28 #include <TClonesArray.h> 30 #include <TGeoGlobalMagField.h> 31 #include <TGeoManager.h> 32 #include <TParticle.h> 34 #include <TStopwatch.h> 36 #include <TVirtualMC.h> 37 #include <TMCVerbose.h> 68 fSaveRndmStatus(kFALSE),
69 fSaveRndmEventStatus(kFALSE),
70 fReadRndmStatus(kFALSE),
71 fUseMonitoring(kFALSE),
72 fRndmFileName("random.root"),
99 TVirtualMCApplication(name, title),
102 fSaveRndmStatus(kFALSE),
103 fSaveRndmEventStatus(kFALSE),
104 fReadRndmStatus(kFALSE),
105 fUseMonitoring(kFALSE),
106 fRndmFileName(
"random.root"),
117 fImedia(new TArrayI(1000)),
120 fHitLists(new TList()),
131 for(Int_t i=0;i<1000;i++) (*
fImedia)[i]=-99;
155 fMC = TVirtualMC::GetMC();
159 while((detector = static_cast<AliModule*>(next()))) {
160 detector->CacheVMCInstance(
fMC);
176 AliInfo(
"Loading geometry from CDB default storage");
179 if(!entry)
AliFatal(
"Unable to load geometry from CDB!");
186 if(gSystem->ExpandPathName(geomfilename)){
187 AliInfo(Form(
"Loading geometry from file:\n %40s",geomfilename));
188 TGeoManager::Import(geomfilename);
190 AliInfo(Form(
"Geometry file %40s not found!\n",geomfilename));
194 TVirtualMC::GetMC()->SetRootGeometry();
197 if (!
gGeoManager)
new TGeoManager(
"ALICE",
"ALICE geometry");
202 while((detector = dynamic_cast<AliModule*>(next()))) {
205 detector->CreateMaterials();
206 detector->CreateGeometry();
207 AliInfo(Form(
"%10s R:%.2fs C:%.2fs",
208 detector->GetName(),stw.RealTime(),stw.CpuTime()));
227 AliFatal(
"Current loaded geometry differs in the definition of symbolic names!");
241 AliInfo(
"Optical properties definition");
242 while((detector = dynamic_cast<AliModule*>(next()))) {
246 detector->DefineOpticalProperties();
250 #include <TPDGCode.h> 258 cout <<
"########## AliMC::AddParticles" << endl;
261 TVirtualMC::GetMC()->DefineParticle(1010010030,
"HyperTriton", kPTHadron, 2.99131 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE);
263 TVirtualMC::GetMC()->DefineParticle(-1010010030,
"AntiHyperTriton", kPTHadron, 2.99131 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE);
266 TVirtualMC::GetMC()->DefineParticle(1010010040,
"Hyperhydrog4", kPTHadron, 3.931 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
268 TVirtualMC::GetMC()->DefineParticle(-1010010040,
"AntiHyperhydrog4", kPTHadron, 3.931 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
271 TVirtualMC::GetMC()->DefineParticle(1010020040,
"Hyperhelium4", kPTHadron, 3.929 , 2.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
273 TVirtualMC::GetMC()->DefineParticle(-1010020040,
"AntiHyperhelium4", kPTHadron, 3.929 , 2.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
276 TVirtualMC::GetMC()->DefineParticle(1010020050,
"Hyperhelium5", kPTHadron, 4.841 , 2.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE);
278 TVirtualMC::GetMC()->DefineParticle(-1010020050,
"AntiHyperhelium5", kPTHadron, 4.841 , 2.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE);
281 TVirtualMC::GetMC()->DefineParticle(1020010040,
"DoubleHyperhydrogen4", kPTHadron, 4.106 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
283 TVirtualMC::GetMC()->DefineParticle(-1020010040,
"DoubleAntiHyperhydrogen4", kPTHadron, 4.106 , 1.0, 2.632e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE);
286 TVirtualMC::GetMC()->DefineParticle(1010000020,
"LambdaNeutron", kPTNeutron, 2.054 , 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
289 TVirtualMC::GetMC()->DefineParticle(-1010000020,
"AntiLambdaNeutron", kPTNeutron, 2.054 , 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
292 TVirtualMC::GetMC()->DefineParticle(1020000020,
"Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
295 TVirtualMC::GetMC()->DefineParticle(-1020000020,
"AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
298 TVirtualMC::GetMC()->DefineParticle(1020010020,
"Xi0Proton", kPTHadron, 2.248 , 1.0, 1.333e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
301 TVirtualMC::GetMC()->DefineParticle(-1020010020,
"AntiXi0Proton", kPTHadron, 2.248 , 1.0, 1.333e-10,
"Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
304 TVirtualMC::GetMC()->DefineParticle(1010000030,
"LambdaNeutronNeutron", kPTNeutron, 2.99 , 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE);
307 TVirtualMC::GetMC()->DefineParticle(-1010000030,
"AntiLambdaNeutronNeutron", kPTNeutron, 2.99 , 0.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE);
310 TVirtualMC::GetMC()->DefineParticle(1030000020,
"OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10,
"Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE);
313 TVirtualMC::GetMC()->DefineParticle(-1030000020,
"AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10,
"Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE);
316 TVirtualMC::GetMC()->DefineParticle(1030010020,
"OmegaNeutron", kPTHadron, 2.472, 1.0, 2.190e-22,
"Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE);
319 TVirtualMC::GetMC()->DefineParticle(-1030010020,
"AntiOmegaNeutron", kPTHadron, 2.472, 1.0, 2.190e-22,
"Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE);
322 TVirtualMC::GetMC()->DefineParticle(1060020020,
"OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
325 TVirtualMC::GetMC()->DefineParticle(-1060020020,
"AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
328 TVirtualMC::GetMC()->DefineParticle(1010010021,
"Lambda1405Proton", kPTHadron, 2.295, 1.0, 1.316e-23,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
331 TVirtualMC::GetMC()->DefineParticle(-1010010021,
"AntiLambda1405Proton", kPTHadron, 2.295, 1.0, 1.316e-23,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
334 TVirtualMC::GetMC()->DefineParticle(1020000021,
"Lambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
337 TVirtualMC::GetMC()->DefineParticle(-1020000021,
"AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23,
"Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
342 TVirtualMC::GetMC()->DefineParticle(9010221,
"f0_980", kPTNeutron, 0.98 , 0.0, 9.403e-24,
"Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE);
345 TVirtualMC::GetMC()->DefineParticle(225,
"f2_1270", kPTNeutron, 1.275 , 0.0, 3.558e-24,
"Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE);
348 TVirtualMC::GetMC()->DefineParticle( 123324,
"Xi_0_1820", kPTNeutron,1.8234,0.0,2.742550e-23,
"Hadron",0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE);
349 TVirtualMC::GetMC()->DefineParticle(-123324,
"Xi_0_Bar_1820",kPTNeutron,1.8234,0.0,2.742550e-23,
"Hadron",0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE);
351 int xi_0_1820_mode[6][3] = {{0}};
352 float xi_0_1820_ratio[6] = {100.f,0.f,0.f,0.f,0.f,0.f};
353 xi_0_1820_mode[0][0] = 3122;
354 xi_0_1820_mode[0][1] = 310;
355 TVirtualMC::GetMC()->SetDecayMode(123324,xi_0_1820_ratio,xi_0_1820_mode);
356 xi_0_1820_mode[0][0] = -3122;
357 TVirtualMC::GetMC()->SetDecayMode(-123324,xi_0_1820_ratio,xi_0_1820_mode);
360 TVirtualMC::GetMC()->DefineParticle(123314,
"Xi_Minus_1820",kPTHadron,1.8234,-1.0,2.742550e-23,
"Hadron",0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE);
361 TVirtualMC::GetMC()->DefineParticle(-123314,
"Xi_Plus_1820",kPTHadron,1.8234, 1.0,2.742550e-23,
"Hadron",0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE);
363 int xi_charged_1820_mode[6][3] = {{0}};
364 float xi_charged_1820_ratio[6] = {100.f,0.f,0.f,0.f,0.f,0.f};
365 xi_charged_1820_mode[0][0] = 3122;
366 xi_charged_1820_mode[0][1] = -321;
367 TVirtualMC::GetMC()->SetDecayMode(123314,xi_charged_1820_ratio,xi_charged_1820_mode);
368 xi_charged_1820_mode[0][0] = -3122;
369 xi_charged_1820_mode[0][1] = 321;
370 TVirtualMC::GetMC()->SetDecayMode(-123314,xi_charged_1820_ratio,xi_charged_1820_mode);
373 TVirtualMC::GetMC()->DefineParticle( 9322134,
"Ps_2100", kPTHadron, 2.1 , 1.0, 1.6455e-23,
"Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE);
374 TVirtualMC::GetMC()->DefineParticle(-9322134,
"AntiPs_2100", kPTHadron, 2.1 , -1.0, 1.6455e-23,
"Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE);
375 TVirtualMC::GetMC()->DefineParticle( 9322136,
"Ps_2500", kPTHadron, 2.5 , 1.0, 1.6455e-23,
"Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE);
376 TVirtualMC::GetMC()->DefineParticle(-9322136,
"AntiPs_2500", kPTHadron, 2.5 , -1.0, 1.6455e-23,
"Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE);
378 Int_t psmode[6][3] = {0};
379 Float_t psratio[6] = {0.f};
384 TVirtualMC::GetMC()->SetDecayMode(9322134,psratio,psmode);
385 TVirtualMC::GetMC()->SetDecayMode(9322136,psratio,psmode);
387 psmode[0][1] = -2212;
388 TVirtualMC::GetMC()->SetDecayMode(-9322134,psratio,psmode);
389 TVirtualMC::GetMC()->SetDecayMode(-9322136,psratio,psmode);
392 TVirtualMC::GetMC()->DefineParticle( 900010020,
"d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23,
"Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE);
393 TVirtualMC::GetMC()->DefineParticle( -900010020,
"d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23,
"Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE);
395 Int_t dstmode[6][3] = {0};
396 Float_t dstratio[6] = {0.f};
399 dstmode[0][0] = 1000010020;
400 dstmode[0][1] = -211;
402 TVirtualMC::GetMC()->SetDecayMode(900010020,dstratio,dstmode);
404 dstmode[0][0] = -1000010020;
405 TVirtualMC::GetMC()->SetDecayMode(-900010020,dstratio,dstmode);
410 TVirtualMC::GetMC()->DefineParticle(413,
"D*+", kPTHadron, 2.0103, 1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
412 TVirtualMC::GetMC()->DefineParticle(-413,
"D*-", kPTHadron, 2.0103, -1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
414 TVirtualMC::GetMC()->DefineParticle(423,
"D*0", kPTHadron, 2.0007, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
416 TVirtualMC::GetMC()->DefineParticle(-423,
"D*0bar", kPTHadron, 2.0007, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
418 TVirtualMC::GetMC()->DefineParticle(433,
"D*_s+", kPTHadron, 2.1123, 1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
420 TVirtualMC::GetMC()->DefineParticle(-433,
"D*_s-", kPTHadron, 2.1123, -1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
422 TVirtualMC::GetMC()->DefineParticle(513,
"B*0", kPTHadron, 5.3251, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
424 TVirtualMC::GetMC()->DefineParticle(-513,
"B*0bar", kPTHadron, 5.3251, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
426 TVirtualMC::GetMC()->DefineParticle(523,
"B*+", kPTHadron, 5.3251, 1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
428 TVirtualMC::GetMC()->DefineParticle(-523,
"B*-", kPTHadron, 5.3251, -1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
430 TVirtualMC::GetMC()->DefineParticle(533,
"B*_s0", kPTHadron, 5.4128, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
432 TVirtualMC::GetMC()->DefineParticle(-533,
"B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
434 TVirtualMC::GetMC()->DefineParticle(543,
"B*_c+", kPTHadron, 6.6020, 1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
436 TVirtualMC::GetMC()->DefineParticle(-543,
"B*_c-", kPTHadron, 6.6020, -1.0, 0.0,
"Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
442 for (Int_t kz = 0; kz < 6; kz++) {
449 mode[0][0] = 1000020030;
453 mode[1][0] = 1000010020;
457 TVirtualMC::GetMC()->SetDecayMode(1010010030,bratio,mode);
465 for (Int_t kz = 0; kz < 6; kz++) {
472 amode[0][0] = -1000020030;
475 amode[1][0] = -1000010020;
479 TVirtualMC::GetMC()->SetDecayMode(-1010010030,abratio,amode);
488 for (Int_t kz = 0; kz < 6; kz++) {
495 mode3[0][0] = 1000020040;
499 mode3[1][0] = 1000010030;
503 TVirtualMC::GetMC()->SetDecayMode(1010010040,bratio3,mode3);
510 for (Int_t kz = 0; kz < 6; kz++) {
517 amode3[0][0] = -1000020040;
520 amode3[1][0] = -1000010030;
521 amode3[1][1] = -2212;
524 TVirtualMC::GetMC()->SetDecayMode(-1010010040,abratio3,amode3);
531 for (Int_t kz = 0; kz < 6; kz++) {
538 mode4[0][0] = 1000020030;
542 TVirtualMC::GetMC()->SetDecayMode(1010020040,bratio4,mode4);
549 for (Int_t kz = 0; kz < 6; kz++) {
556 amode4[0][0] = -1000020030;
558 amode4[0][2] = -2212;
560 TVirtualMC::GetMC()->SetDecayMode(-1010020040,abratio4,amode4);
566 for (Int_t kz = 0; kz < 6; kz++) {
573 mode41[0][0] = 1000020040;
577 mode41[1][0] = 1000020030;
579 mode41[1][2] = 1000010020;
581 TVirtualMC::GetMC()->SetDecayMode(1010020050,bratio41,mode41);
586 Float_t abratio41[6];
588 for (Int_t kz = 0; kz < 6; kz++) {
595 amode41[0][0] = -1000020040;
597 amode41[0][2] = -2212;
599 amode41[1][0] = -1000020030;
601 amode41[1][2] = -1000010020;
603 TVirtualMC::GetMC()->SetDecayMode(-1010020050,abratio41,amode41);
609 for (Int_t kz = 0; kz < 6; kz++) {
616 mode42[0][0] = 1010020040;
619 TVirtualMC::GetMC()->SetDecayMode(1020010040,bratio42,mode42);
624 Float_t abratio42[6];
626 for (Int_t kz = 0; kz < 6; kz++) {
633 amode42[0][0] = -1010020040;
636 TVirtualMC::GetMC()->SetDecayMode(-1020010040,abratio42,amode42);
642 for (Int_t kz = 0; kz < 6; kz++) {
649 mode1[0][0] = 1000010020;
652 TVirtualMC::GetMC()->SetDecayMode(1010000020,bratio1,mode1);
659 for (Int_t kz = 0; kz < 6; kz++) {
666 amode1[0][0] = -1000010020;
669 TVirtualMC::GetMC()->SetDecayMode(-1010000020,abratio1,amode1);
675 for (Int_t kz = 0; kz < 6; kz++) {
686 TVirtualMC::GetMC()->SetDecayMode(1020000020,bratio2,mode2);
692 for (Int_t kz = 0; kz < 6; kz++) {
699 amode2[0][0] = -3122;
700 amode2[0][1] = -2212;
703 TVirtualMC::GetMC()->SetDecayMode(-1020000020,abratio2,amode2);
709 for (Int_t kz = 0; kz < 6; kz++) {
719 TVirtualMC::GetMC()->SetDecayMode(1020010020,bratio5,mode5);
725 for (Int_t kz = 0; kz < 6; kz++) {
732 amode5[0][0] = -3122;
733 amode5[0][1] = -2212;
735 TVirtualMC::GetMC()->SetDecayMode(-1020010020,abratio5,amode5);
741 for (Int_t kz = 0; kz < 6; kz++) {
748 mode6[0][0] = 1000010030;
751 TVirtualMC::GetMC()->SetDecayMode(1010000030,bratio6,mode6);
757 for (Int_t kz = 0; kz < 6; kz++) {
764 amode6[0][0] = -1000010030;
767 TVirtualMC::GetMC()->SetDecayMode(-1010000030,abratio6,amode6);
774 for (Int_t kz = 0; kz < 6; kz++) {
785 TVirtualMC::GetMC()->SetDecayMode(1030000020,bratio7,mode7);
791 for (Int_t kz = 0; kz < 6; kz++) {
798 amode7[0][0] = -3122;
800 amode7[0][2] = -2212;
802 TVirtualMC::GetMC()->SetDecayMode(-1030000020,abratio7,amode7);
808 for (Int_t kz = 0; kz < 6; kz++) {
818 TVirtualMC::GetMC()->SetDecayMode(1030010020,bratio8,mode8);
824 for (Int_t kz = 0; kz < 6; kz++) {
831 amode8[0][0] = -3122;
832 amode8[0][1] = -3312;
834 TVirtualMC::GetMC()->SetDecayMode(-1030010020,abratio8,amode8);
840 for (Int_t kz = 0; kz < 6; kz++) {
850 TVirtualMC::GetMC()->SetDecayMode(1060020020,bratio9,mode9);
856 for (Int_t kz = 0; kz < 6; kz++) {
863 amode9[0][0] = -3334;
864 amode9[0][1] = -3312;
866 TVirtualMC::GetMC()->SetDecayMode(-1060020020,abratio9,amode9);
872 for (Int_t kz = 0; kz < 6; kz++) {
886 TVirtualMC::GetMC()->SetDecayMode(1010010021,bratio10,mode10);
890 Float_t abratio10[6];
892 for (Int_t kz = 0; kz < 6; kz++) {
899 amode10[0][0] = -3122;
900 amode10[0][1] = -2212;
902 amode10[1][0] = -2212;
904 amode10[1][2] = -2212;
906 TVirtualMC::GetMC()->SetDecayMode(-1010010021,abratio10,amode10);
912 for (Int_t kz = 0; kz < 6; kz++) {
926 TVirtualMC::GetMC()->SetDecayMode(1020000021,bratio11,mode11);
930 Float_t abratio11[6];
932 for (Int_t kz = 0; kz < 6; kz++) {
939 amode11[0][0] = -3122;
940 amode11[0][1] = -3122;
942 amode11[1][0] = -3122;
943 amode11[1][1] = -2212;
946 TVirtualMC::GetMC()->SetDecayMode(-1020000021,abratio11,amode11);
955 for (Int_t kz = 0; kz < 6; kz++) {
965 TVirtualMC::GetMC()->SetDecayMode(9010221,bratio,mode);
971 for (Int_t kz = 0; kz < 6; kz++) {
981 TVirtualMC::GetMC()->SetDecayMode(225,bratio,mode);
985 TVirtualMC::GetMC()->DefineParticle(3124,
"Lambda1520", kPTNeutron, 1.5195 , 0.0, 4.22e-23,
"Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE);
986 TVirtualMC::GetMC()->DefineParticle(-3124,
"Lambda1520bar", kPTNeutron, 1.5195 , 0.0, 4.22e-23,
"Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE);
991 bratio[0] = 0.223547;
996 bratio[1] = 0.223547;
1001 bratio[2] = 0.139096;
1006 bratio[3] = 0.139096;
1011 bratio[4] = 0.139096;
1020 TVirtualMC::GetMC()->SetDecayMode(3124,bratio,mode);
1025 bratio[0] = 0.223547;
1030 bratio[1] = 0.223547;
1035 bratio[2] = 0.139096;
1040 bratio[3] = 0.139096;
1045 bratio[4] = 0.139096;
1054 TVirtualMC::GetMC()->SetDecayMode(-3124,bratio,mode);
1070 while((detector = dynamic_cast<AliModule*>(next()))) {
1073 AliInfo(Form(
"%10s R:%.2fs C:%.2fs",
1074 detector->GetName(),stw.RealTime(),stw.CpuTime()));
1087 AliError(
"Loading of geometry from CDB ignored. First set a default CDB storage!");
1104 AliInfo(Form(
"Setting entries for all alignable volumes of active detectors"));
1107 while((detector = dynamic_cast<AliModule*>(next()))) {
1139 AliWarning(Form(
"Replacing generator %s with %s",
1140 fGenerator->GetName(),generator->GetName()));
1143 AliWarning(Form(
"Replacing generator %s with NULL",
1154 AliDebug(1,
"fGenerator->FinishRun()");
1191 if ((module = static_cast<AliModule *>(dets.UncheckedAt(i))))
1207 if (
fMC->IsNewTrack() &&
1208 fMC->TrackTime() == 0. &&
1222 if (
fMC->IsNewTrack() ||
fMC->TrackTime() == 0. ||
fMC->TrackStep()<1.1E-10) {
1227 Int_t volId =
fMC->CurrentVolID(copy);
1228 Int_t pdg =
fMC->TrackPid();
1229 TLorentzVector xyz, pxpypz;
1230 fMC->TrackPosition(xyz);
1231 fMC->TrackMomentum(pxpypz);
1246 if (
fMC->IsTrackDisappeared() && !(
fMC->IsTrackAlive())) {
1271 Int_t kn, i, left, j, id;
1272 const Float_t kzero=0;
1277 printf(
"***************** Energy Loss Information per event (GEV) *****************\n");
1286 ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,kzero))/ed;
1290 fSum2Energy[ndep]=TMath::Min(static_cast<Float_t>(99.),TMath::Max(ed2,kzero));
1295 for(kn=0;kn<(ndep-1)/3+1;kn++) {
1297 for(i=0;i<(3<left?3:left);i++) {
1306 printf(
"******************** Relative Energy Loss per event ********************\n");
1307 printf(
"Total energy loss per event %10.3f GeV\n",edtot);
1308 for(kn=0;kn<(ndep-1)/5+1;kn++) {
1310 for(i=0;i<(5<left?5:left);i++) {
1313 printf(
" %s %10.3f%%;",TVirtualMC::GetMC()->VolName(
id),100*
fSummEnergy[j]/edtot);
1317 for(kn=0;kn<75;kn++)
printf(
"*");
1333 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1334 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1335 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1337 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1338 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1339 AliDebug(1,
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1357 if (runloader->
Stack())
1371 fileName +=
".root";
1374 cout <<
"Saving random engine status in " << fileName.Data() << endl;
1375 TFile
f(fileName.Data(),
"RECREATE");
1376 gRandom->Write(fileName.Data());
1381 cout <<
"Reading random engine status from " <<
fRndmFileName.Data() << endl;
1388 AliDebug(1,
"fRunLoader->MakeTree(K)");
1392 AliDebug(1,
"TVirtualMC::GetMC()->SetStack(fRunLoader->Stack())");
1393 TVirtualMC::GetMC()->SetStack(runloader->
Stack());
1415 AliDebug(1,
"fRunLoader->MakeTree(H)");
1426 AliDebug(2, Form(
"%s->MakeBranch(H)",detector->GetName()));
1427 detector->MakeBranch(
"H");
1439 while((detector = dynamic_cast<AliModule*>(next()))) {
1452 while((detector = dynamic_cast<AliModule*>(next()))) {
1465 while((detector = dynamic_cast<AliModule*>(next()))) {
1479 if((module = static_cast<AliModule*>(dets.UncheckedAt(i))))
1494 #if ROOT_VERSION_CODE > 262152 1495 if (!(TVirtualMC::GetMC()->SecondariesAreOrdered())) {
1503 while((detector = dynamic_cast<AliModule*>(next()))) {
1505 AliLoader* loader = detector->GetLoader();
1508 TTree* treeH = loader->
TreeH();
1509 if (treeH) treeH->Fill();
1524 TIter next(hitLists);
1525 TCollection *hitList;
1527 while((hitList = dynamic_cast<TCollection*>(next()))) {
1528 TIter nexthit(hitList);
1530 while((hit = dynamic_cast<AliHit*>(nexthit()))) {
1542 TIter nextmod(modules);
1544 while((module = (
AliModule*) nextmod())) {
1563 while((detector = dynamic_cast<AliModule*>(next()))) {
1579 if ( (header == 0x0) || (stack == 0x0) )
1581 AliFatal(
"Can not get the stack or header from LOADER");
1596 TTree* treeE = runloader->
TreeE();
1604 AliError(
"Can not get TreeE from RL");
1614 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1615 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1616 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1618 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1619 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1620 AliDebug(1,
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1630 TVirtualMC::GetMC()->Init();
1632 #if ROOT_VERSION_CODE < 331527 1641 TVirtualMC::GetMC()->BuildPhysics();
1645 fSummEnergy.Set(TVirtualMC::GetMC()->NofVolumes()+1);
1646 fSum2Energy.Set(TVirtualMC::GetMC()->NofVolumes()+1);
1663 Int_t kz, nz, idt, lz, i, k, ind;
1670 for (kz=0;kz<ndets;kz++) {
1672 if((det=dynamic_cast<AliModule*>(dets[kz]))) {
1674 for(nz=0;nz<100;nz++) {
1677 if((idt=idtmed[nz])) {
1687 AliError(Form(
"Increase fImedia from %d to %d",
1700 AliInfo(
"Tracking media ranges:");
1702 for(i=0;i<(ndets-1)/6+1;i++) {
1703 for(k=0;k< (6<ndets-i*6?6:ndets-i*6);k++) {
1705 det=
dynamic_cast<AliModule*
>(dets[ind]);
1710 printf(
" %6s: %3d -> %3d;",
"NULL",0,0);
1725 const Int_t kncuts=10;
1726 const Int_t knflags=12;
1727 const Int_t knpars=kncuts+knflags;
1728 const char kpars[knpars][7] = {
"CUTGAM" ,
"CUTELE",
"CUTNEU",
"CUTHAD",
"CUTMUO",
1729 "BCUTE",
"BCUTM",
"DCUTE",
"DCUTM",
"PPCUTM",
"ANNI",
1730 "BREM",
"COMP",
"DCAY",
"DRAY",
"HADR",
"LOSS",
1731 "MULS",
"PAIR",
"PHOT",
"RAYL",
"STRA"};
1735 Float_t
cut[kncuts];
1736 Int_t flag[knflags];
1737 Int_t i, itmed, iret, jret, ktmed, kz;
1742 lun=fopen(filtmp,
"r");
1751 for(i=0;i<kncuts;i++) cut[i]=-99;
1752 for(i=0;i<knflags;i++) flag[i]=-99;
1756 iret=fscanf(lun,
"%255[^\n]",line);
1763 jret = fscanf(lun,
"%*c");
1765 if(line[0]==
'*')
continue;
1767 iret=sscanf(line,
"%6s %d %f %f %f %f %f %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %d %d",
1768 detName,&itmed,&cut[0],&cut[1],&cut[2],&cut[3],&cut[4],&cut[5],&cut[6],&cut[7],&cut[8],
1769 &cut[9],&flag[0],&flag[1],&flag[2],&flag[3],&flag[4],&flag[5],&flag[6],&flag[7],
1770 &flag[8],&flag[9],&flag[10],&flag[11]);
1783 if(0<=itmed && itmed < 100) {
1784 ktmed=idtmed[itmed];
1786 AliWarning(Form(
"Invalid tracking medium code %d for %s",itmed,mod->GetName()));
1790 for(kz=0;kz<kncuts;kz++) {
1792 AliDebug(2, Form(
"%-6s set to %10.3E for tracking medium code %4d for %s",
1793 kpars[kz],cut[kz],itmed,mod->GetName()));
1794 TVirtualMC::GetMC()->Gstpar(ktmed,kpars[kz],cut[kz]);
1798 for(kz=0;kz<knflags;kz++) {
1800 AliDebug(2, Form(
"%-6s set to %10d for tracking medium code %4d for %s",
1801 kpars[kncuts+kz],flag[kz],itmed,mod->GetName()));
1802 TVirtualMC::GetMC()->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz]));
1806 AliWarning(Form(
"Invalid medium code %d",itmed));
1810 AliDebug(1, Form(
"%s not present",detName));
1832 if(dets[
id])
static_cast<AliModule*
>(dets[id])->
AddHit(track,vol,hits);
1860 if (runloader->
Stack())
1871 if (runloader->
Stack())
1882 if (runloader->
Stack())
1893 Int_t nprimary = -999;
1895 if (runloader->
Stack())
1907 if (runloader->
Stack())
1919 if (runloader->
Stack())
1926 const Float_t *vpos,
const Float_t *
polar, Float_t tof,
1927 TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
const 1933 if (runloader->
Stack())
1934 runloader->
Stack()->
PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
1935 mech, ntr, weight, is);
1940 Double_t px, Double_t py, Double_t pz, Double_t e,
1941 Double_t vx, Double_t vy, Double_t
vz, Double_t tof,
1942 Double_t polx, Double_t poly, Double_t polz,
1943 TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
const 1949 if (runloader->
Stack())
1950 runloader->
Stack()->
PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
1951 polx, poly, polz, mech, ntr, weight, is);
1961 if (runloader->
Stack())
1973 if (runloader->
Stack())
1984 if (runloader->
Stack())
1996 if (runloader->
Stack())
2032 for (Int_t i=0; i < nEntries; i++){
2035 Int_t newID = map[ref->
GetTrack()];
2036 if (newID>=0) ref->
SetTrack(newID);
2038 ref->SetBit(kNotDeleted,kFALSE);
2054 TVirtualMC::GetMC()->TrackMomentum(p);
2055 Double_t tmin, tmax;
2059 Double_t vt = p.Pt() / p.E();
2061 if ((b = ((
AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField()) > 0.) {
2065 Double_t rho = p.Pt() / 0.0003 /
b;
2069 Double_t omega = vt / rho;
2074 const Double_t kOvRhoSqr2 = 1./(rho*TMath::Sqrt(2.));
2088 Double_t t = tmin + (tmax - tmin) * gRandom->Rndm();
2093 TVirtualMC::GetMC()->ForceDecayTime(t / 2.99792458e10);
2099 fTmpFileTR =
new TFile(
"TrackRefsTmp.root",
"recreate");
2100 fTmpTreeTR =
new TTree(
"TreeTR",
"Track References");
2102 fTmpTreeTR->Branch(
"TrackReferences", &pRef, 4000);
2115 AliDebug(1,
"fRunLoader->MakeTrackRefsContainer()");
2117 TTree * treeTR = rl->
TreeTR();
2120 treeTR->Branch(
"TrackReferences", &pRef);
2129 for (Int_t ip = np - 1; ip > -1; ip--) {
2130 TParticle *part = stack->
Particle(ip);
2134 Int_t dau1 = part->GetFirstDaughter();
2142 Int_t inext = ip - 1;
2146 dau2 = part->GetFirstDaughter();
2147 if (!(part->TestBit(
kTransportBit)) || dau2 == -1 || dau2 < np) {
2162 for (Int_t
id = dau1; (id <= dau2) && (dau1 > -1);
id++) {
2163 for (Int_t ih = 0; ih < nh; ih++) {
2165 Int_t label = tr->
Label();
2167 if (label == ip)
continue;
2168 if (label > dau2 || label < dau1)
2169 AliWarning(Form(
"Track Reference Label out of range !: %5d %5d %5d \n", label, dau1, dau2));
2184 for (Int_t ip = 0; ip < np; ip++) {
2185 TParticle* part = stack->
Particle(ip);
2194 for (Int_t ih = 0; ih < nh; ih++) {
2196 Int_t label = tr->
Label();
2209 AliWarning(Form(
"Number of entries in TreeTR (%5d) unequal to TreeK (%5d) \n", ifills, stack->
GetNtrack()));
TList * GetHitLists() const
#define ToAliInfo(whatever)
virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
static AliRunLoader * Instance()
void SetHighWaterMark(Int_t hgwmk)
void MakeTmpTrackRefsTree()
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void FinishEvent()
const TString & GetPath() const
void MakeTrackRefsContainer()
virtual Int_t GetPrimary(Int_t track) const
TArrayF fSummEnergy
Energy deposit for current event.
Bool_t IsGeometryFromCDB() const
virtual void FinishPrimary()
virtual Int_t GetCurrentTrackNumber() const
Bool_t MisalignGeometry(AliRunLoader *runLoader=NULL)
virtual void ResetTrackReferences()
virtual void DumpPStack() const
virtual void FinishEvent()
TTree * fTmpTreeTR
Lists of hits to be remapped by PurifyKine.
virtual void FinishEvent()
TString fTransParName
Array of correspondence between media and detectors.
virtual void FlagTrack(Int_t track) const
virtual void BeginPrimary()
Bool_t fReadRndmStatus
Options to save random engine status for each event.
Int_t WriteKinematics(Option_t *opt="")
void SetGeometryFromCDB()
Int_t GetEventNrInRun() const
Int_t WriteTrackRefs(Option_t *opt="")
virtual void ResetDigits()
TString fRndmFileName
Activate monitoring.
void ReorderAndExpandTreeTR()
void AddEnergyDeposit(Int_t id, Float_t edep)
Int_t GetEvNumber() const
virtual void SetCurrentTrack(Int_t track) const
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
#define AliWarning(message)
virtual void FinishPrimary()
AliCDBEntry * Get(const AliCDBId &query, Bool_t forceCaching=kFALSE)
#define ToAliDebug(level, whatever)
Int_t SetEventNumber(Int_t evno)
virtual void EnergySummary()
virtual void GeneratePrimaries()
bool RemoveLocalFile(const char *filename)
virtual Int_t GetTrack() const
void Add(TDatabasePDG *pdg)
Int_t GetNprimary() const
virtual const Char_t * GetGeometryFile() const
AliTransportMonitor * fMonitor
void StepInfo(Int_t volId, Int_t pdg, Double_t energy, Double_t x, Double_t y, Double_t z)
void Print(Option_t *volName="") const
virtual void ResetSDigits()
virtual Int_t DetFromMate(Int_t i) const
virtual Int_t GetNtrack() const
virtual void KeepTrack(Int_t itra) const
virtual void InitGeometry()
void MakeTree(Option_t *option)
TArrayF fSum2Energy
Energy per event in each volume.
const TObjArray * Particles() const
AliModule * GetModule(const char *name) const
AliHeader * GetHeader() const
virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
virtual void BeginEvent()
TGeoManager * gGeoManager
TClonesArray fTrackReferences
Temporary track reference file.
static AliSimulation * Instance()
virtual void RemapTrackReferencesIDs(const Int_t *map)
virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts")
virtual AliGenerator * Generator() const
virtual void SetCurrentTrack(Int_t track)
static void SetGeometry(TGeoManager *const geom)
virtual void ConstructOpGeometry()
virtual Int_t & HiMedium()
Int_t GetPrimary(Int_t id, Bool_t useInEmbedding=kFALSE)
void SetTrack(Int_t track)
const TObjArray * Particles() const
Int_t GetCurrentTrackNumber() const
virtual TArrayI * GetIdtmed() const
virtual Int_t Label() const
void KeepTrack(Int_t itrack)
void Export(const char *fname)
#define AliFatal(message)
AliTrackReference * AddTrackReference(Int_t label, Int_t id=-999)
virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, const Float_t *pmom, const Float_t *vpos, const Float_t *polar, Float_t tof, TMCProcess mech, Int_t &ntr, Float_t weight=1, Int_t is=0) const
virtual Bool_t MisalignGeometry()
Int_t TrackLabel(Int_t label) const
virtual void SetHighWaterMark(Int_t nt) const
virtual void MediaTable()
virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, const Float_t *pmom, const Float_t *vpos, const Float_t *polar, Float_t tof, TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
virtual void Generate()=0
virtual void ResetSDigits()
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
#define AliDebug(logLevel, message)
virtual void RemapTrackHitIDs(Int_t *)
Int_t GetSgPerBgEmbedded() const
virtual void ConstructGeometry()
virtual void SetGenerator(AliGenerator *generator)
static Bool_t CheckSymNamesLUT(const char *detsToBeChecked)
TClonesArray fTmpTrackReferences
List of track references - for one primary track only.
void SetEventNrInRun(Int_t event)
virtual void AddAlignableVolumes() const
virtual void AddParticles()
virtual void BeginEvent()
virtual void FixParticleDecaytime()
Int_t WriteHits(Option_t *opt="")
TFile * fTmpFileTR
Temporary track reference tree.
virtual Int_t & LoMedium()
TList * fHitLists
Transport monitoring tool.
void SetOwner(Bool_t owner)
#define AliError(message)
virtual void DumpPart(Int_t i) const
Bool_t PurifyKine(Float_t rmax=-1., Float_t zmax=-1.)
virtual void SetGeometryFile(const Char_t *filename)
Bool_t fUseMonitoring
Options to read random engine status.
Bool_t fSaveRndmEventStatus
Options to save random engine status.
void FlagTrack(Int_t track)
AliGenerator * fGenerator
cached MC instance (to avoid calls to thread_local gMC=TVirtualMC::GetMC())
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
virtual void ResetDigits()
virtual void SetTrack(Int_t track)
virtual void ReadTransPar()
void DumpPart(Int_t i) const
virtual void StepManager()
virtual void StepManager()
virtual void DecayLimits(Float_t rmin=-1., Float_t rmax=-1., Int_t pdg=0)
virtual Bool_t StepManagerIsEnabled() const
static AliConfig * Instance()
TObjArray * Modules() const
TArrayF fEventEnergy
The file name of random engine status to be read in.
TParticle * Particle(Int_t i) const
virtual void ResetGenerator(AliGenerator *generator)
virtual void SetAllAlignableVolumes()
TObjArray * Detectors() const