AliRoot Core  ee782a0 (ee782a0)
AliMC.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 // This class is extracted from the AliRun class
19 // and contains all the MC-related functionality
20 // The number of dependencies has to be reduced...
21 // Author: F.Carminati
22 // Federico.Carminati@cern.ch
23 
24 #include <string.h>
25 
26 #include <RVersion.h>
27 #include <TArrayI.h>
28 #include <TClonesArray.h>
29 #include <TFile.h>
30 #include <TGeoGlobalMagField.h>
31 #include <TGeoManager.h>
32 #include <TParticle.h>
33 #include <TROOT.h>
34 #include <TStopwatch.h>
35 #include <TSystem.h>
36 #include <TVirtualMC.h>
37 #include <TMCVerbose.h>
38 #include <TTree.h>
39 
40 #include "AliCDBEntry.h"
41 #include "AliCDBManager.h"
42 #include "AliCDBStorage.h"
43 #include "AliDetector.h"
44 #include "AliFileUtilities.h"
45 #include "AliGenerator.h"
46 #include "AliGeomManager.h"
47 #include "AliHeader.h"
48 #include "AliHit.h"
49 #include "AliLego.h"
50 #include "AliLog.h"
51 #include "AliMC.h"
52 #include "AliMagF.h"
53 #include "AliRun.h"
54 #include "AliSimulation.h"
55 #include "AliStack.h"
56 #include "AliTrackReference.h"
57 #include "AliTransportMonitor.h"
58 #include <iostream>
59 
60 using std::endl;
61 using std::cout;
62 ClassImp(AliMC)
63 
64 //_______________________________________________________________________
66  fMC(0),
67  fGenerator(0),
68  fSaveRndmStatus(kFALSE),
69  fSaveRndmEventStatus(kFALSE),
70  fReadRndmStatus(kFALSE),
71  fUseMonitoring(kFALSE),
72  fRndmFileName("random.root"),
73  fEventEnergy(0),
74  fSummEnergy(0),
75  fSum2Energy(0),
76  fTrRmax(1.e10),
77  fTrZmax(1.e10),
78  fPuRmax(-1.),
79  fPuZmax(-1.),
80  fRDecayMax(1.e10),
81  fRDecayMin(-1.),
82  fDecayPdg(0),
83  fImedia(0),
84  fTransParName("\0"),
85  fMonitor(0),
86  fHitLists(0),
87  fTmpTreeTR(0),
88  fTmpFileTR(0),
89  fTrackReferences(),
90  fTmpTrackReferences()
91 
92 {
93  //default constructor
94  DecayLimits();
95 }
96 
97 //_______________________________________________________________________
98 AliMC::AliMC(const char *name, const char *title) :
99  TVirtualMCApplication(name, title),
100  fMC(0),
101  fGenerator(0),
102  fSaveRndmStatus(kFALSE),
103  fSaveRndmEventStatus(kFALSE),
104  fReadRndmStatus(kFALSE),
105  fUseMonitoring(kFALSE),
106  fRndmFileName("random.root"),
107  fEventEnergy(0),
108  fSummEnergy(0),
109  fSum2Energy(0),
110  fTrRmax(1.e10),
111  fTrZmax(1.e10),
112  fPuRmax(-1.),
113  fPuZmax(-1.),
114  fRDecayMax(1.e10),
115  fRDecayMin(-1.),
116  fDecayPdg(0),
117  fImedia(new TArrayI(1000)),
118  fTransParName("\0"),
119  fMonitor(0),
120  fHitLists(new TList()),
121  fTmpTreeTR(0),
122  fTmpFileTR(0),
123  fTrackReferences(AliTrackReference::Class(), 100),
124  fTmpTrackReferences(AliTrackReference::Class(), 100)
125 {
126  //constructor
127  // Set transport parameters
128  SetTransPar();
129  DecayLimits();
130  // Prepare the tracking medium lists
131  for(Int_t i=0;i<1000;i++) (*fImedia)[i]=-99;
132 }
133 
134 //_______________________________________________________________________
136 {
137  //destructor
138  delete fGenerator;
139  delete fImedia;
140  delete fHitLists;
141  delete fMonitor;
142  // Delete track references
143 }
144 
145 
147 {
148  // cache the pointer to the VMC instance
149  // this is done in order to avoid penalties coming from the thread_local storage nature of TVirtualMC::GetMC()
150 
151  // This instance is available only in functions called during event processing
152  // The global instance, gMC == TVirtualMC::GetMC() should be used in functions called in initialization
153  // (for geometry construction etc.)
154 
155  fMC = TVirtualMC::GetMC();
156  TIter next(gAlice->Modules());
157  AliModule *detector;
158  AliInfo("CacheVMCInstance");
159  while((detector = static_cast<AliModule*>(next()))) {
160  detector->CacheVMCInstance(fMC);
161  }
162 }
163 
164 //_______________________________________________________________________
166 {
167  //
168  // Either load geometry from file or create it through usual
169  // loop on detectors. In the first case the method
170  // AliModule::CreateMaterials() only builds fIdtmed and is postponed
171  // at InitGeometry().
172  //
173 
174  if(AliSimulation::Instance()->IsGeometryFromFile()){ //load geometry either from CDB or from file
175  if(IsGeometryFromCDB()){
176  AliInfo("Loading geometry from CDB default storage");
177  AliCDBPath path("GRP","Geometry","Data");
179  if(!entry) AliFatal("Unable to load geometry from CDB!");
180  entry->SetOwner(0);
181  gGeoManager = (TGeoManager*) entry->GetObject();
182  if (!gGeoManager) AliFatal("TGeoManager object not found in the specified CDB entry!");
183  }else{
184  // Load geometry
185  const char *geomfilename = AliSimulation::Instance()->GetGeometryFile();
186  if(gSystem->ExpandPathName(geomfilename)){
187  AliInfo(Form("Loading geometry from file:\n %40s",geomfilename));
188  TGeoManager::Import(geomfilename);
189  }else{
190  AliInfo(Form("Geometry file %40s not found!\n",geomfilename));
191  return;
192  }
193  }
194  TVirtualMC::GetMC()->SetRootGeometry();
195  }else{
196  // Create modules, materials, geometry
197  if (!gGeoManager) new TGeoManager("ALICE", "ALICE geometry");
198  TStopwatch stw;
199  TIter next(gAlice->Modules());
200  AliModule *detector;
201  AliDebug(1, "Geometry creation:");
202  while((detector = dynamic_cast<AliModule*>(next()))) {
203  stw.Start();
204  // Initialise detector materials and geometry
205  detector->CreateMaterials();
206  detector->CreateGeometry();
207  AliInfo(Form("%10s R:%.2fs C:%.2fs",
208  detector->GetName(),stw.RealTime(),stw.CpuTime()));
209  }
210  }
211 
212 }
213 
214 //_______________________________________________________________________
216 {
217  // Call misalignment code if AliSimulation object was defined.
218 
219  if(!AliSimulation::Instance()->IsGeometryFromFile()){
220  //Set alignable volumes for the whole geometry
222  }
223  // Misalign geometry via AliSimulation instance
224  if (!AliSimulation::Instance()) return kFALSE;
227  AliFatal("Current loaded geometry differs in the definition of symbolic names!");
228 
230 }
231 
232 //_______________________________________________________________________
234 {
235  //
236  // Loop all detector modules and call DefineOpticalProperties() method
237  //
238 
239  TIter next(gAlice->Modules());
240  AliModule *detector;
241  AliInfo("Optical properties definition");
242  while((detector = dynamic_cast<AliModule*>(next()))) {
243  // Initialise detector geometry
244  if(AliSimulation::Instance()->IsGeometryFromFile()) detector->CreateMaterials();
245  // Initialise detector optical properties
246  detector->DefineOpticalProperties();
247  }
248 }
249 
250 #include <TPDGCode.h>
251 //_______________________________________________________________________
253 {
254  //
255  // Add particles (not present in Geant3 or Geant4)
256  //
257 
258  cout << "########## AliMC::AddParticles" << endl;
259 
260  //Hypertriton
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);
262  //Anti-Hypertriton
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);
264 
265  //Hyper hydrogen 4
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);
267  //Anti-Hyper hydrogen 4
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);
269 
270  //Hyper helium 4
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);
272  //Anti-Hyper helium 4
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);
274 
275  //Hyper helium 5
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);
277  //Anti-Hyper helium 5
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);
279 
280  //Double Hyper hydrogen 4
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);
282  //Double Anti-Hyper hydrogen 4
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);
284 
285  //Lambda-Neutron
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);
287 
288  //Anti-Lambda-Neutron
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);
290 
291  //H-Dibaryon
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);
293 
294  //Anti-H-Dibaryon
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);
296 
297  //Xi-Proton
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);
299 
300  //Anti-Xi-Proton
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);
302 
303  //Lambda-Neutron-Neutron
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);
305 
306  //Anti-Lambda-Neutron-Neutron
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);
308 
309  //Omega-Proton
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);
311 
312  //Anti-Omega-Proton
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);
314 
315  //Omega-Neutron
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);
317 
318  //Anti-Omega-Neutron
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);
320 
321  //Omega-Omega
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);
323 
324  //Anti-Omega-Omega
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);
326 
327  //Lambda(1405)-Proton
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);
329 
330  //Anti-Lambda(1405)-Proton
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);
332 
333  //Lambda(1405)-Lambda(1405)
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);
335 
336  //Anti-Lambda(1405)-Lambda(1405)
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);
338 
339 
340  //Resonances not in Generators
341  // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV)
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);
343 
344  // f2(1270) (PDG: width = 185 MeV)
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);
346 
347  // Xi_0(1820)
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);
350 
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; // Lambda
354  xi_0_1820_mode[0][1] = 310; // K0s
355  TVirtualMC::GetMC()->SetDecayMode(123324,xi_0_1820_ratio,xi_0_1820_mode);
356  xi_0_1820_mode[0][0] = -3122; // Lambda-bar
357  TVirtualMC::GetMC()->SetDecayMode(-123324,xi_0_1820_ratio,xi_0_1820_mode);
358 
359  // Xi-+(1820)
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);
362 
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; // Lambda
366  xi_charged_1820_mode[0][1] = -321; // K-
367  TVirtualMC::GetMC()->SetDecayMode(123314,xi_charged_1820_ratio,xi_charged_1820_mode);
368  xi_charged_1820_mode[0][0] = -3122; // Lambda-bar
369  xi_charged_1820_mode[0][1] = 321; // K+
370  TVirtualMC::GetMC()->SetDecayMode(-123314,xi_charged_1820_ratio,xi_charged_1820_mode);
371 
372  // Ps - hidden strange (s-sbar) pentaquarks
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);
377 
378  Int_t psmode[6][3] = {0};
379  Float_t psratio[6] = {0.f};
380  psratio[0] = 100.;
381 
382  psmode[0][0] = 333; // phi
383  psmode[0][1] = 2212; // proton
384  TVirtualMC::GetMC()->SetDecayMode(9322134,psratio,psmode);
385  TVirtualMC::GetMC()->SetDecayMode(9322136,psratio,psmode);
386 
387  psmode[0][1] = -2212; // anti-proton
388  TVirtualMC::GetMC()->SetDecayMode(-9322134,psratio,psmode);
389  TVirtualMC::GetMC()->SetDecayMode(-9322136,psratio,psmode);
390 
391  // d*(2380) - dibaryon resonance
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);
394 
395  Int_t dstmode[6][3] = {0};
396  Float_t dstratio[6] = {0.f};
397  dstratio[0] = 100; // For now we implement only the mode of interest
398  // d* -> d pi+ pi-
399  dstmode[0][0] = 1000010020; // deuteron
400  dstmode[0][1] = -211; // negative pion
401  dstmode[0][2] = 211; // positive pion
402  TVirtualMC::GetMC()->SetDecayMode(900010020,dstratio,dstmode);
403 
404  dstmode[0][0] = -1000010020; // anti-deuteron
405  TVirtualMC::GetMC()->SetDecayMode(-900010020,dstratio,dstmode);
406 
407 
408  // Heavy vector mesons
409  // D*+
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);
411  // D*-
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);
413  // D*0
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);
415  // D*0bar
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);
417  // D*_s+
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);
419  // D*_s-
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);
421  // B*0
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);
423  // B*0bar
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);
425  // B*+
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);
427  // B*-
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);
429  // B*_s0
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);
431  // B*_s0bar
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);
433  // B*_c+
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);
435  // B*_c-
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);
437 
438  // Define the 2- and 3-body phase space decay for the Hyper-Triton
439  Int_t mode[6][3];
440  Float_t bratio[6];
441 
442  for (Int_t kz = 0; kz < 6; kz++) {
443  bratio[kz] = 0.;
444  mode[kz][0] = 0;
445  mode[kz][1] = 0;
446  mode[kz][2] = 0;
447  }
448  bratio[0] = 50.;
449  mode[0][0] = 1000020030; // Helium3
450  mode[0][1] = -211; // negative pion
451 
452  bratio[1] = 50.;
453  mode[1][0] = 1000010020; // deuteron
454  mode[1][1] = 2212; // proton
455  mode[1][2] = -211; // negative pion
456 
457  TVirtualMC::GetMC()->SetDecayMode(1010010030,bratio,mode);
458 
459 
460 
461  // Define the 2- and 3-body phase space decay for the Anti-Hyper-Triton
462  Int_t amode[6][3];
463  Float_t abratio[6];
464 
465  for (Int_t kz = 0; kz < 6; kz++) {
466  abratio[kz] = 0.;
467  amode[kz][0] = 0;
468  amode[kz][1] = 0;
469  amode[kz][2] = 0;
470  }
471  abratio[0] = 50.;
472  amode[0][0] = -1000020030; // anti- Helium3
473  amode[0][1] = 211; // positive pion
474  abratio[1] = 50.;
475  amode[1][0] = -1000010020; // anti-deuteron
476  amode[1][1] = -2212; // anti-proton
477  amode[1][2] = 211; // positive pion
478 
479  TVirtualMC::GetMC()->SetDecayMode(-1010010030,abratio,amode);
480 
482 
483  // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
484 
485  Int_t mode3[6][3];
486  Float_t bratio3[6];
487 
488  for (Int_t kz = 0; kz < 6; kz++) {
489  bratio3[kz] = 0.;
490  mode3[kz][0] = 0;
491  mode3[kz][1] = 0;
492  mode3[kz][2] = 0;
493  }
494  bratio3[0] = 50.;
495  mode3[0][0] = 1000020040; // Helium4
496  mode3[0][1] = -211; // negative pion
497 
498  bratio3[1] = 50.;
499  mode3[1][0] = 1000010030; // tritium
500  mode3[1][1] = 2212; // proton
501  mode3[1][2] = -211; // negative pion
502 
503  TVirtualMC::GetMC()->SetDecayMode(1010010040,bratio3,mode3);
504 
505 
506  // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
507  Int_t amode3[6][3];
508  Float_t abratio3[6];
509 
510  for (Int_t kz = 0; kz < 6; kz++) {
511  abratio3[kz] = 0.;
512  amode3[kz][0] = 0;
513  amode3[kz][1] = 0;
514  amode3[kz][2] = 0;
515  }
516  abratio3[0] = 50.;
517  amode3[0][0] = -1000020040; // anti- Helium4
518  amode3[0][1] = 211; // positive pion
519  abratio3[1] = 50.;
520  amode3[1][0] = -1000010030; // anti-tritium
521  amode3[1][1] = -2212; // anti-proton
522  amode3[1][2] = 211; // positive pion
523 
524  TVirtualMC::GetMC()->SetDecayMode(-1010010040,abratio3,amode3);
525 
526 
527  // Define the 3-body phase space decay for the Hyper Helium 4
528  Int_t mode4[6][3];
529  Float_t bratio4[6];
530 
531  for (Int_t kz = 0; kz < 6; kz++) {
532  bratio4[kz] = 0.;
533  mode4[kz][0] = 0;
534  mode4[kz][1] = 0;
535  mode4[kz][2] = 0;
536  }
537  bratio4[0] = 100.;
538  mode4[0][0] = 1000020030; // Helium3
539  mode4[0][1] = -211; // negative pion
540  mode4[0][2] = 2212; // proton
541 
542  TVirtualMC::GetMC()->SetDecayMode(1010020040,bratio4,mode4);
543 
544 
545  // Define the 2-body phase space decay for the Anti-Hyper Helium 4
546  Int_t amode4[6][3];
547  Float_t abratio4[6];
548 
549  for (Int_t kz = 0; kz < 6; kz++) {
550  abratio4[kz] = 0.;
551  amode4[kz][0] = 0;
552  amode4[kz][1] = 0;
553  amode4[kz][2] = 0;
554  }
555  abratio4[0] = 100.;
556  amode4[0][0] = -1000020030; // anti-Helium 3
557  amode4[0][1] = 211; // positive pion
558  amode4[0][2] = -2212; // anti proton
559 
560  TVirtualMC::GetMC()->SetDecayMode(-1010020040,abratio4,amode4);
561 
562  // Define the 3-body phase space decay for the Hyper Helium 5
563  Int_t mode41[6][3];
564  Float_t bratio41[6];
565 
566  for (Int_t kz = 0; kz < 6; kz++) {
567  bratio41[kz] = 0.;
568  mode41[kz][0] = 0;
569  mode41[kz][1] = 0;
570  mode41[kz][2] = 0;
571  }
572  bratio41[0] = 50.;
573  mode41[0][0] = 1000020040; // Helium4
574  mode41[0][1] = -211; // negative pion
575  mode41[0][2] = 2212; // proton
576  bratio41[1] = 50.;
577  mode41[1][0] = 1000020030; // Helium3
578  mode41[1][1] = -211; // negative pion
579  mode41[1][2] = 1000010020; // Deuteron
580 
581  TVirtualMC::GetMC()->SetDecayMode(1010020050,bratio41,mode41);
582 
583 
584  // Define the 2-body phase space decay for the Anti-Hyper Helium 5
585  Int_t amode41[6][3];
586  Float_t abratio41[6];
587 
588  for (Int_t kz = 0; kz < 6; kz++) {
589  abratio41[kz] = 0.;
590  amode41[kz][0] = 0;
591  amode41[kz][1] = 0;
592  amode41[kz][2] = 0;
593  }
594  abratio41[0] = 50.;
595  amode41[0][0] = -1000020040; // anti-Helium 4
596  amode41[0][1] = 211; // positive pion
597  amode41[0][2] = -2212; // anti proton
598  abratio41[1] = 50.;
599  amode41[1][0] = -1000020030; // anti-Helium 3
600  amode41[1][1] = 211; // positive pion
601  amode41[1][2] = -1000010020; // anti deuteron
602 
603  TVirtualMC::GetMC()->SetDecayMode(-1010020050,abratio41,amode41);
604 
605  // Define the 3-body phase space decay for the Double Hyper Hydrogen 4
606  Int_t mode42[6][3];
607  Float_t bratio42[6];
608 
609  for (Int_t kz = 0; kz < 6; kz++) {
610  bratio42[kz] = 0.;
611  mode42[kz][0] = 0;
612  mode42[kz][1] = 0;
613  mode42[kz][2] = 0;
614  }
615  bratio42[0] = 100.;
616  mode42[0][0] = 1010020040; // Hyper-Helium4
617  mode42[0][1] = -211; // negative pion
618 
619  TVirtualMC::GetMC()->SetDecayMode(1020010040,bratio42,mode42);
620 
621 
622  // Define the 2-body phase space decay for the Anti Double Hyper Hydrogen 4
623  Int_t amode42[6][3];
624  Float_t abratio42[6];
625 
626  for (Int_t kz = 0; kz < 6; kz++) {
627  abratio42[kz] = 0.;
628  amode42[kz][0] = 0;
629  amode42[kz][1] = 0;
630  amode42[kz][2] = 0;
631  }
632  abratio42[0] = 100.;
633  amode42[0][0] = -1010020040; // anti-Hyper-Helium 4
634  amode42[0][1] = 211; // positive pion
635 
636  TVirtualMC::GetMC()->SetDecayMode(-1020010040,abratio42,amode42);
637 
638  // Define the 2-body phase space decay for the Lambda-neutron boundstate
639  Int_t mode1[6][3];
640  Float_t bratio1[6];
641 
642  for (Int_t kz = 0; kz < 6; kz++) {
643  bratio1[kz] = 0.;
644  mode1[kz][0] = 0;
645  mode1[kz][1] = 0;
646  mode1[kz][2] = 0;
647  }
648  bratio1[0] = 100.;
649  mode1[0][0] = 1000010020; // deuteron
650  mode1[0][1] = -211; // negative pion
651 
652  TVirtualMC::GetMC()->SetDecayMode(1010000020,bratio1,mode1);
653 
654 
655  // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate
656  Int_t amode1[6][3];
657  Float_t abratio1[6];
658 
659  for (Int_t kz = 0; kz < 6; kz++) {
660  abratio1[kz] = 0.;
661  amode1[kz][0] = 0;
662  amode1[kz][1] = 0;
663  amode1[kz][2] = 0;
664  }
665  abratio1[0] = 100.;
666  amode1[0][0] = -1000010020; // anti-deuteron
667  amode1[0][1] = 211; // positive pion
668 
669  TVirtualMC::GetMC()->SetDecayMode(-1010000020,abratio1,amode1);
670 
671  // Define the 2-body phase space decay for the H-Dibaryon
672  Int_t mode2[6][3];
673  Float_t bratio2[6];
674 
675  for (Int_t kz = 0; kz < 6; kz++) {
676  bratio2[kz] = 0.;
677  mode2[kz][0] = 0;
678  mode2[kz][1] = 0;
679  mode2[kz][2] = 0;
680  }
681  bratio2[0] = 100.;
682  mode2[0][0] = 3122; // Lambda
683  mode2[0][1] = 2212; // proton
684  mode2[0][2] = -211; // negative pion
685 
686  TVirtualMC::GetMC()->SetDecayMode(1020000020,bratio2,mode2);
687 
688  // Define the 2-body phase space decay for the Anti-H-Dibaryon
689  Int_t amode2[6][3];
690  Float_t abratio2[6];
691 
692  for (Int_t kz = 0; kz < 6; kz++) {
693  abratio2[kz] = 0.;
694  amode2[kz][0] = 0;
695  amode2[kz][1] = 0;
696  amode2[kz][2] = 0;
697  }
698  abratio2[0] = 100.;
699  amode2[0][0] = -3122; // anti-deuteron
700  amode2[0][1] = -2212; // anti-proton
701  amode2[0][2] = 211; // positive pion
702 
703  TVirtualMC::GetMC()->SetDecayMode(-1020000020,abratio2,amode2);
704 
705  // Define the 2-body phase space decay for the Xi0P
706  Int_t mode5[6][3];
707  Float_t bratio5[6];
708 
709  for (Int_t kz = 0; kz < 6; kz++) {
710  bratio5[kz] = 0.;
711  mode5[kz][0] = 0;
712  mode5[kz][1] = 0;
713  mode5[kz][2] = 0;
714  }
715  bratio5[0] = 100.;
716  mode5[0][0] = 3122; // Lambda
717  mode5[0][1] = 2212; // proton
718 
719  TVirtualMC::GetMC()->SetDecayMode(1020010020,bratio5,mode5);
720 
721  // Define the 2-body phase space decay for the Anti-Xi0P
722  Int_t amode5[6][3];
723  Float_t abratio5[6];
724 
725  for (Int_t kz = 0; kz < 6; kz++) {
726  abratio5[kz] = 0.;
727  amode5[kz][0] = 0;
728  amode5[kz][1] = 0;
729  amode5[kz][2] = 0;
730  }
731  abratio5[0] = 100.;
732  amode5[0][0] = -3122; // anti-Lambda
733  amode5[0][1] = -2212; // anti-proton
734 
735  TVirtualMC::GetMC()->SetDecayMode(-1020010020,abratio5,amode5);
736 
737  // Define the 2-body phase space decay for the Lambda-Neutron-Neutron
738  Int_t mode6[6][3];
739  Float_t bratio6[6];
740 
741  for (Int_t kz = 0; kz < 6; kz++) {
742  bratio6[kz] = 0.;
743  mode6[kz][0] = 0;
744  mode6[kz][1] = 0;
745  mode6[kz][2] = 0;
746  }
747  bratio6[0] = 100.;
748  mode6[0][0] = 1000010030; // triton
749  mode6[0][1] = -211; // pion
750 
751  TVirtualMC::GetMC()->SetDecayMode(1010000030,bratio6,mode6);
752 
753  // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron
754  Int_t amode6[6][3];
755  Float_t abratio6[6];
756 
757  for (Int_t kz = 0; kz < 6; kz++) {
758  abratio6[kz] = 0.;
759  amode6[kz][0] = 0;
760  amode6[kz][1] = 0;
761  amode6[kz][2] = 0;
762  }
763  abratio6[0] = 100.;
764  amode6[0][0] = -1000010030; // anti-triton
765  amode6[0][1] = 211; // pion
766 
767  TVirtualMC::GetMC()->SetDecayMode(-1010000030,abratio6,amode6);
768 
769 
770  // Define the 3-body phase space decay for the Omega-Proton
771  Int_t mode7[6][3];
772  Float_t bratio7[6];
773 
774  for (Int_t kz = 0; kz < 6; kz++) {
775  bratio7[kz] = 0.;
776  mode7[kz][0] = 0;
777  mode7[kz][1] = 0;
778  mode7[kz][2] = 0;
779  }
780  bratio7[0] = 100.;
781  mode7[0][0] = 3122; // Lambda
782  mode7[0][1] = -321; // negative Kaon
783  mode7[0][2] = 2212; // proton
784 
785  TVirtualMC::GetMC()->SetDecayMode(1030000020,bratio7,mode7);
786 
787  // Define the 3-body phase space decay for the Anti-Omega-Proton
788  Int_t amode7[6][3];
789  Float_t abratio7[6];
790 
791  for (Int_t kz = 0; kz < 6; kz++) {
792  abratio7[kz] = 0.;
793  amode7[kz][0] = 0;
794  amode7[kz][1] = 0;
795  amode7[kz][2] = 0;
796  }
797  abratio7[0] = 100.;
798  amode7[0][0] = -3122; // anti-Lambda
799  amode7[0][1] = 321; // positive kaon
800  amode7[0][2] = -2212; // anti-proton
801 
802  TVirtualMC::GetMC()->SetDecayMode(-1030000020,abratio7,amode7);
803 
804  // Define the 2-body phase space decay for the Omega-Neutron
805  Int_t mode8[6][3];
806  Float_t bratio8[6];
807 
808  for (Int_t kz = 0; kz < 6; kz++) {
809  bratio8[kz] = 0.;
810  mode8[kz][0] = 0;
811  mode8[kz][1] = 0;
812  mode8[kz][2] = 0;
813  }
814  bratio8[0] = 100.;
815  mode8[0][0] = 3122; // Lambda
816  mode8[0][1] = 3312; // negative Xi
817 
818  TVirtualMC::GetMC()->SetDecayMode(1030010020,bratio8,mode8);
819 
820  // Define the 2-body phase space decay for the Anti-Omega-Neutron
821  Int_t amode8[6][3];
822  Float_t abratio8[6];
823 
824  for (Int_t kz = 0; kz < 6; kz++) {
825  abratio8[kz] = 0.;
826  amode8[kz][0] = 0;
827  amode8[kz][1] = 0;
828  amode8[kz][2] = 0;
829  }
830  abratio8[0] = 100.;
831  amode8[0][0] = -3122; // anti-Lambda
832  amode8[0][1] = -3312; // positive Xi
833 
834  TVirtualMC::GetMC()->SetDecayMode(-1030010020,abratio8,amode8);
835 
836  // Define the 3-body phase space decay for the Omega-Omega
837  Int_t mode9[6][3];
838  Float_t bratio9[6];
839 
840  for (Int_t kz = 0; kz < 6; kz++) {
841  bratio9[kz] = 0.;
842  mode9[kz][0] = 0;
843  mode9[kz][1] = 0;
844  mode9[kz][2] = 0;
845  }
846  bratio9[0] = 100.;
847  mode9[0][0] = 3334; // negative Omega
848  mode9[0][1] = 3312; // negative Xi
849 
850  TVirtualMC::GetMC()->SetDecayMode(1060020020,bratio9,mode9);
851 
852  // Define the 3-body phase space decay for the Anti-Omega-Omega
853  Int_t amode9[6][3];
854  Float_t abratio9[6];
855 
856  for (Int_t kz = 0; kz < 6; kz++) {
857  abratio9[kz] = 0.;
858  amode9[kz][0] = 0;
859  amode9[kz][1] = 0;
860  amode9[kz][2] = 0;
861  }
862  abratio9[0] = 100.;
863  amode9[0][0] = -3334; // positive Omega
864  amode9[0][1] = -3312; // positive Xi
865 
866  TVirtualMC::GetMC()->SetDecayMode(-1060020020,abratio9,amode9);
867 
868  // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton
869  Int_t mode10[6][3];
870  Float_t bratio10[6];
871 
872  for (Int_t kz = 0; kz < 6; kz++) {
873  bratio10[kz] = 0.;
874  mode10[kz][0] = 0;
875  mode10[kz][1] = 0;
876  mode10[kz][2] = 0;
877  }
878  bratio10[0] = 50.;
879  mode10[0][0] = 3122; // Lambda
880  mode10[0][1] = 2212; // proton
881  bratio10[1] = 50.;
882  mode10[1][0] = 2212; // proton
883  mode10[1][1] = -321; // negative kaon
884  mode10[1][2] = 2212; // proton
885 
886  TVirtualMC::GetMC()->SetDecayMode(1010010021,bratio10,mode10);
887 
888  // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton
889  Int_t amode10[6][3];
890  Float_t abratio10[6];
891 
892  for (Int_t kz = 0; kz < 6; kz++) {
893  abratio10[kz] = 0.;
894  amode10[kz][0] = 0;
895  amode10[kz][1] = 0;
896  amode10[kz][2] = 0;
897  }
898  abratio10[0] = 50.;
899  amode10[0][0] = -3122; // anti-Lambda
900  amode10[0][1] = -2212; // anti-proton
901  abratio10[1] = 50.;
902  amode10[1][0] = -2212; // anti-proton
903  amode10[1][1] = 321; // positive kaon
904  amode10[1][2] = -2212; // anti-proton
905 
906  TVirtualMC::GetMC()->SetDecayMode(-1010010021,abratio10,amode10);
907 
908  // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405)
909  Int_t mode11[6][3];
910  Float_t bratio11[6];
911 
912  for (Int_t kz = 0; kz < 6; kz++) {
913  bratio11[kz] = 0.;
914  mode11[kz][0] = 0;
915  mode11[kz][1] = 0;
916  mode11[kz][2] = 0;
917  }
918  bratio11[0] = 50.;
919  mode11[0][0] = 3122; // Lambda
920  mode11[0][1] = 3122; // Lambda
921  bratio11[1] = 50.;
922  mode11[1][0] = 3122; // Lambda
923  mode11[1][1] = 2212; // proton
924  mode11[1][2] = -211; // negative pion
925 
926  TVirtualMC::GetMC()->SetDecayMode(1020000021,bratio11,mode11);
927 
928  // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405)
929  Int_t amode11[6][3];
930  Float_t abratio11[6];
931 
932  for (Int_t kz = 0; kz < 6; kz++) {
933  abratio11[kz] = 0.;
934  amode11[kz][0] = 0;
935  amode11[kz][1] = 0;
936  amode11[kz][2] = 0;
937  }
938  abratio11[0] = 50.;
939  amode11[0][0] = -3122; // anti-Lambda
940  amode11[0][1] = -3122; // anti-Lambda
941  abratio11[1] = 50.;
942  amode11[1][0] = -3122; // anti-Lambda
943  amode11[1][1] = -2212; // anti-proton
944  amode11[1][2] = 211; // positive pion
945 
946  TVirtualMC::GetMC()->SetDecayMode(-1020000021,abratio11,amode11);
947 
948 
950 
951  // Define the 2-body phase space decay for the f0(980)
952 // Int_t mode[6][3];
953 // Float_t bratio[6];
954 
955  for (Int_t kz = 0; kz < 6; kz++) {
956  bratio[kz] = 0.;
957  mode[kz][0] = 0;
958  mode[kz][1] = 0;
959  mode[kz][2] = 0;
960  }
961  bratio[0] = 100.;
962  mode[0][0] = 211; // pion
963  mode[0][1] = -211; // pion
964 
965  TVirtualMC::GetMC()->SetDecayMode(9010221,bratio,mode);
966 
967  // Define the 2-body phase space decay for the f2(1270)
968 // Int_t mode[6][3];
969 // Float_t bratio[6];
970 
971  for (Int_t kz = 0; kz < 6; kz++) {
972  bratio[kz] = 0.;
973  mode[kz][0] = 0;
974  mode[kz][1] = 0;
975  mode[kz][2] = 0;
976  }
977  bratio[0] = 100.;
978  mode[0][0] = 211; // pion
979  mode[0][1] = -211; // pion
980 
981  TVirtualMC::GetMC()->SetDecayMode(225,bratio,mode);
982 
983  // Lambda1520/Lambda1520bar
984 
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);
987 
988  // Lambda1520 decay modes
989 
990  // L(1520) -> p K-
991  bratio[0] = 0.223547;
992  mode[0][0] = 2212;
993  mode[0][1] = -321;
994 
995  // L(1520) -> n K0
996  bratio[1] = 0.223547;
997  mode[1][0] = 2112;
998  mode[1][1] = -311;
999 
1000  // L(1520) -> Sigma+ pi-
1001  bratio[2] = 0.139096;
1002  mode[2][0] = 3222;
1003  mode[2][1] = -211;
1004 
1005  // L(1520) -> Sigma0 pi0
1006  bratio[3] = 0.139096;
1007  mode[3][0] = 3212;
1008  mode[3][1] = 111;
1009 
1010  // L(1520) -> Sigma- pi+
1011  bratio[4] = 0.139096;
1012  mode[4][0] = 3112;
1013  mode[4][1] = 211;
1014 
1015  // The other decay modes are neglected
1016  bratio[5] = 0.;
1017  mode[5][0] = 0;
1018  mode[5][1] = 0;
1019 
1020  TVirtualMC::GetMC()->SetDecayMode(3124,bratio,mode);
1021 
1022  // Lambda1520bar decay modes
1023 
1024  // L(1520)bar -> p- K+
1025  bratio[0] = 0.223547;
1026  mode[0][0] = -2212;
1027  mode[0][1] = 321;
1028 
1029  // L(1520)bar -> nbar K0bar
1030  bratio[1] = 0.223547;
1031  mode[1][0] = -2112;
1032  mode[1][1] = 311;
1033 
1034  // L(1520)bar -> Sigmabar- pi+
1035  bratio[2] = 0.139096;
1036  mode[2][0] = -3222;
1037  mode[2][1] = 211;
1038 
1039  // L(1520)bar -> Sigma0bar pi0
1040  bratio[3] = 0.139096;
1041  mode[3][0] = -3212;
1042  mode[3][1] = 111;
1043 
1044  // L(1520)bar -> Sigmabar+ pi-
1045  bratio[4] = 0.139096;
1046  mode[4][0] = -3112;
1047  mode[4][1] = -211;
1048 
1049  // The other decay modes are neglected
1050  bratio[5] = 0.;
1051  mode[5][0] = 0;
1052  mode[5][1] = 0;
1053 
1054  TVirtualMC::GetMC()->SetDecayMode(-3124,bratio,mode);
1055 
1056  // --------------------------------------------------------------------
1057 }
1058 
1059 //_______________________________________________________________________
1061 {
1062  //
1063  // Initialize detectors
1064  //
1065 
1066  AliInfo("Initialisation:");
1067  TStopwatch stw;
1068  TIter next(gAlice->Modules());
1069  AliModule *detector;
1070  while((detector = dynamic_cast<AliModule*>(next()))) {
1071  stw.Start();
1072  detector->Init();
1073  AliInfo(Form("%10s R:%.2fs C:%.2fs",
1074  detector->GetName(),stw.RealTime(),stw.CpuTime()));
1075  }
1076 }
1077 
1078 //_______________________________________________________________________
1080 {
1081  // Set the loading of geometry from cdb instead of creating it
1082  // A default CDB storage needs to be set before this method is called
1083  if(AliCDBManager::Instance()->IsDefaultStorageSet() &&
1084  AliCDBManager::Instance()->GetRun() >= 0)
1086  else
1087  AliError("Loading of geometry from CDB ignored. First set a default CDB storage!");
1088 }
1089 
1090 //_______________________________________________________________________
1092 {
1093  return (strcmp(AliSimulation::Instance()->GetGeometryFile(),"*OCDB*")==0);
1094 }
1095 
1096 //_______________________________________________________________________
1098 {
1099  //
1100  // Add alignable volumes (TGeoPNEntries) looping on all
1101  // active modules
1102  //
1103 
1104  AliInfo(Form("Setting entries for all alignable volumes of active detectors"));
1105  AliModule *detector;
1106  TIter next(gAlice->Modules());
1107  while((detector = dynamic_cast<AliModule*>(next()))) {
1108  detector->AddAlignableVolumes();
1109  }
1110 }
1111 
1112 //_______________________________________________________________________
1114 {
1115  //
1116  // Generate primary particles and fill them in the stack.
1117  //
1118 
1119  Generator()->Generate();
1120 }
1121 
1122 //_______________________________________________________________________
1124 {
1125  //
1126  // Load the event generator
1127  //
1128  if(!fGenerator) fGenerator = generator;
1129 }
1130 
1131 //_______________________________________________________________________
1133 {
1134  //
1135  // Load the event generator
1136  //
1137  if(fGenerator) {
1138  if(generator) {
1139  AliWarning(Form("Replacing generator %s with %s",
1140  fGenerator->GetName(),generator->GetName()));
1141  }
1142  else {
1143  AliWarning(Form("Replacing generator %s with NULL",
1144  fGenerator->GetName()));
1145  }
1146  }
1147  fGenerator = generator;
1148 }
1149 
1150 //_______________________________________________________________________
1152 {
1153  // Clean generator information
1154  AliDebug(1, "fGenerator->FinishRun()");
1155  fGenerator->FinishRun();
1156 
1157  // Monitoring information
1158  if (fMonitor) {
1159  fMonitor->Print();
1160  fMonitor->Export("timing.root");
1161  }
1162 
1163  //Output energy summary tables
1164  AliDebug(1, "EnergySummary()");
1165  ToAliDebug(1, EnergySummary());
1166 }
1167 
1168 //_______________________________________________________________________
1170 {
1171  //
1172  // Called at the beginning of each primary track
1173  //
1174 
1175  // Reset Hits info
1176  ResetHits();
1178 }
1179 
1180 //_______________________________________________________________________
1182 {
1183  // Actions before the track's transport
1184 
1185  //verbose.PreTrack();
1186 
1187  TObjArray &dets = *gAlice->Modules();
1188  AliModule *module;
1189 
1190  for (Int_t i = 0; i <= gAlice->GetNdets(); i++)
1191  if ((module = static_cast<AliModule *>(dets.UncheckedAt(i))))
1192  module->PreTrack();
1193 }
1194 
1195 //_______________________________________________________________________
1197 {
1198  //
1199  // Called at every step during transport
1200  //
1201  //verbose.Stepping();
1202 
1203  Int_t id = DetFromMate(fMC->CurrentMedium());
1204  if (id < 0) return;
1205 
1206 
1207  if ( fMC->IsNewTrack() &&
1208  fMC->TrackTime() == 0. &&
1209  fRDecayMin >= 0. &&
1210  fRDecayMax > fRDecayMin &&
1211  fMC->TrackPid() == fDecayPdg )
1212  {
1214  }
1215 
1216  // --- If monitoring timing was requested, monitor the step
1217  if (fUseMonitoring) {
1218  if (!fMonitor) {
1219  fMonitor = new AliTransportMonitor(fMC->NofVolumes()+1);
1220  fMonitor->Start();
1221  }
1222  if (fMC->IsNewTrack() || fMC->TrackTime() == 0. || fMC->TrackStep()<1.1E-10) {
1223  fMonitor->DummyStep();
1224  } else {
1225  // Normal stepping
1226  Int_t copy;
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);
1232  fMonitor->StepInfo(volId, pdg, pxpypz.E(), xyz.X(), xyz.Y(), xyz.Z());
1233  }
1234  }
1235  //
1236  // --- If lego option, do it and leave
1237  if (AliSimulation::Instance()->Lego())
1239  else {
1240  Int_t copy;
1241  //Update energy deposition tables
1242  AddEnergyDeposit(fMC->CurrentVolID(copy),fMC->Edep());
1243  //
1244  // write tracke reference for track which is dissapearing - MI
1245 
1246  if (fMC->IsTrackDisappeared() && !(fMC->IsTrackAlive())) {
1247  if (fMC->Etot() > 0.05) AddTrackReference(GetCurrentTrackNumber(),
1249 
1250 
1251  }
1252 
1253  //Call the appropriate stepping routine;
1254  AliModule *det = static_cast<AliModule*>(gAlice->Modules()->UncheckedAt(id));
1255  if(det && det->StepManagerIsEnabled()) {
1256  det->StepManager();
1257  }
1258  }
1259 }
1260 
1261 //_______________________________________________________________________
1263 {
1264  //e
1265  // Print summary of deposited energy
1266  //
1267 
1268  Int_t ndep=0;
1269  Float_t edtot=0;
1270  Float_t ed, ed2;
1271  Int_t kn, i, left, j, id;
1272  const Float_t kzero=0;
1273  Int_t ievent=AliRunLoader::Instance()->GetHeader()->GetEvent()+1;
1274  //
1275  // Energy loss information
1276  if(ievent) {
1277  printf("***************** Energy Loss Information per event (GEV) *****************\n");
1278  for(kn=1;kn<fEventEnergy.GetSize();kn++) {
1279  ed=fSummEnergy[kn];
1280  if(ed>0) {
1281  fEventEnergy[ndep]=kn;
1282  if(ievent>1) {
1283  ed=ed/ievent;
1284  ed2=fSum2Energy[kn];
1285  ed2=ed2/ievent;
1286  ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,kzero))/ed;
1287  } else
1288  ed2=99;
1289  fSummEnergy[ndep]=ed;
1290  fSum2Energy[ndep]=TMath::Min(static_cast<Float_t>(99.),TMath::Max(ed2,kzero));
1291  edtot+=ed;
1292  ndep++;
1293  }
1294  }
1295  for(kn=0;kn<(ndep-1)/3+1;kn++) {
1296  left=ndep-kn*3;
1297  for(i=0;i<(3<left?3:left);i++) {
1298  j=kn*3+i;
1299  id=Int_t (fEventEnergy[j]+0.1);
1300  printf(" %s %10.3f +- %10.3f%%;",TVirtualMC::GetMC()->VolName(id),fSummEnergy[j],fSum2Energy[j]);
1301  }
1302  printf("\n");
1303  }
1304  //
1305  // Relative energy loss in different detectors
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++) {
1309  left=ndep-kn*5;
1310  for(i=0;i<(5<left?5:left);i++) {
1311  j=kn*5+i;
1312  id=Int_t (fEventEnergy[j]+0.1);
1313  printf(" %s %10.3f%%;",TVirtualMC::GetMC()->VolName(id),100*fSummEnergy[j]/edtot);
1314  }
1315  printf("\n");
1316  }
1317  for(kn=0;kn<75;kn++) printf("*");
1318  printf("\n");
1319  }
1320  //
1321  // Reset the TArray's
1322  // fEventEnergy.Set(0);
1323  // fSummEnergy.Set(0);
1324  // fSum2Energy.Set(0);
1325 }
1326 #include <TFile.h>
1327 //_____________________________________________________________________________
1329 {
1330  //
1331  // Clean-up previous event
1332  // Energy scores
1333  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1334  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1335  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1336  AliDebug(1, " BEGINNING EVENT ");
1337  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1338  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1339  AliDebug(1, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
1340 
1341  AliRunLoader *runloader=AliRunLoader::Instance();
1342 
1343  /*******************************/
1344  /* Clean after eventual */
1345  /* previous event */
1346  /*******************************/
1347 
1348 
1349  //Set the next event in Run Loader -> Cleans trees (TreeK and all trees in detectors),
1351  runloader->SetEventNumber(gAlice->GetEventNrInRun());// sets new files, cleans the previous event stuff, if necessary, etc.,
1352  AliDebug(1, Form("EventNr is %d",gAlice->GetEventNrInRun()));
1353 
1354  fEventEnergy.Reset();
1355  // Clean detector information
1356 
1357  if (runloader->Stack())
1358  runloader->Stack()->Reset();//clean stack -> tree is unloaded
1359  else
1360  runloader->MakeStack();//or make a new one
1361 
1362  // Random engine status
1363  //
1364 
1366  TString fileName="random";
1367  if ( fSaveRndmEventStatus ) {
1368  fileName += "Evt";
1369  fileName += gAlice->GetEventNrInRun();
1370  }
1371  fileName += ".root";
1372 
1373  // write ROOT random engine status
1374  cout << "Saving random engine status in " << fileName.Data() << endl;
1375  TFile f(fileName.Data(),"RECREATE");
1376  gRandom->Write(fileName.Data());
1377  }
1378 
1379  if ( fReadRndmStatus ) {
1380  //read ROOT random engine status
1381  cout << "Reading random engine status from " << fRndmFileName.Data() << endl;
1382  TFile f(fRndmFileName.Data());
1383  gRandom->Read(fRndmFileName.Data());
1384  }
1385 
1386  if(AliSimulation::Instance()->Lego() == 0x0)
1387  {
1388  AliDebug(1, "fRunLoader->MakeTree(K)");
1389  runloader->MakeTree("K");
1390  }
1391 
1392  AliDebug(1, "TVirtualMC::GetMC()->SetStack(fRunLoader->Stack())");
1393  TVirtualMC::GetMC()->SetStack(runloader->Stack());//Was in InitMC - but was moved here
1394  //because we don't have guarantee that
1395  //stack pointer is not going to change from event to event
1396  //since it bellobgs to header and is obtained via RunLoader
1397  //
1398  // Reset all Detectors & kinematics & make/reset trees
1399  //
1400 
1401  runloader->GetHeader()->Reset(AliCDBManager::Instance()->GetRun(),gAlice->GetEvNumber(),
1402  gAlice->GetEventNrInRun());
1403 // fRunLoader->WriteKinematics("OVERWRITE"); is there any reason to rewrite here since MakeTree does so
1404 
1405  if(AliSimulation::Instance()->Lego())
1406  {
1408  return;
1409  }
1410 
1411 
1412  AliDebug(1, "ResetHits()");
1413  ResetHits();
1414 
1415  AliDebug(1, "fRunLoader->MakeTree(H)");
1416  runloader->MakeTree("H");
1417 
1418 
1419 
1421  //create new branches and SetAdresses
1422  TIter next(gAlice->Modules());
1423  AliModule *detector;
1424  while((detector = (AliModule*)next()))
1425  {
1426  AliDebug(2, Form("%s->MakeBranch(H)",detector->GetName()));
1427  detector->MakeBranch("H");
1428  }
1429 }
1430 
1431 //_______________________________________________________________________
1433 {
1434  //
1435  // Reset all Detectors hits
1436  //
1437  TIter next(gAlice->Modules());
1438  AliModule *detector;
1439  while((detector = dynamic_cast<AliModule*>(next()))) {
1440  detector->ResetHits();
1441  }
1442 }
1443 
1444 //_______________________________________________________________________
1446 {
1447  //
1448  // Reset all Detectors digits
1449  //
1450  TIter next(gAlice->Modules());
1451  AliModule *detector;
1452  while((detector = dynamic_cast<AliModule*>(next()))) {
1453  detector->ResetDigits();
1454  }
1455 }
1456 
1457 //_______________________________________________________________________
1459 {
1460  //
1461  // Reset all Detectors digits
1462  //
1463  TIter next(gAlice->Modules());
1464  AliModule *detector;
1465  while((detector = dynamic_cast<AliModule*>(next()))) {
1466  detector->ResetSDigits();
1467  }
1468 }
1469 
1470 //_______________________________________________________________________
1472 {
1473  // Posts tracks for each module
1474 
1475  TObjArray &dets = *gAlice->Modules();
1476  AliModule *module;
1477 
1478  for(Int_t i=0; i<=gAlice->GetNdets(); i++)
1479  if((module = static_cast<AliModule*>(dets.UncheckedAt(i))))
1480  module->PostTrack();
1481 }
1482 
1483 //_______________________________________________________________________
1485 {
1486  //
1487  // Called at the end of each primary track
1488  //
1489 
1490  AliRunLoader *runloader=AliRunLoader::Instance();
1491  // static Int_t count=0;
1492  // const Int_t times=10;
1493  // This primary is finished, purify stack
1494 #if ROOT_VERSION_CODE > 262152
1495  if (!(TVirtualMC::GetMC()->SecondariesAreOrdered())) {
1496  if (runloader->Stack()->ReorderKine()) RemapHits();
1497  }
1498 #endif
1499  if (runloader->Stack()->PurifyKine(fPuRmax, fPuZmax)) RemapHits();
1500 
1501  TIter next(gAlice->Modules());
1502  AliModule *detector;
1503  while((detector = dynamic_cast<AliModule*>(next()))) {
1504  detector->FinishPrimary();
1505  AliLoader* loader = detector->GetLoader();
1506  if(loader)
1507  {
1508  TTree* treeH = loader->TreeH();
1509  if (treeH) treeH->Fill(); //can be Lego run and treeH can not exist
1510  }
1511  }
1512 
1513  // Write out track references if any
1514  if (fTmpTreeTR) fTmpTreeTR->Fill();
1515 }
1516 
1518 {
1519 //
1520 // Remaps the track labels of the hits
1521  AliRunLoader *runloader=AliRunLoader::Instance();
1522  AliStack* stack = runloader->Stack();
1523  TList* hitLists = GetHitLists();
1524  TIter next(hitLists);
1525  TCollection *hitList;
1526 
1527  while((hitList = dynamic_cast<TCollection*>(next()))) {
1528  TIter nexthit(hitList);
1529  AliHit *hit;
1530  while((hit = dynamic_cast<AliHit*>(nexthit()))) {
1531  hit->SetTrack(stack->TrackLabel(hit->GetTrack()));
1532  }
1533  }
1534 
1535  //
1536  // This for detectors which have a special mapping mechanism
1537  // for hits, such as TPC and TRD
1538  //
1539 
1540 
1541  TObjArray* modules = gAlice->Modules();
1542  TIter nextmod(modules);
1543  AliModule *module;
1544  while((module = (AliModule*) nextmod())) {
1545  AliDetector* det = dynamic_cast<AliDetector*> (module);
1546  if (det) det->RemapTrackHitIDs(stack->TrackLabelMap());
1547  }
1548  //
1550 }
1551 
1552 //_______________________________________________________________________
1554 {
1555  //
1556  // Called at the end of the event.
1557  //
1558 
1560 
1561  TIter next(gAlice->Modules());
1562  AliModule *detector;
1563  while((detector = dynamic_cast<AliModule*>(next()))) {
1564  detector->FinishEvent();
1565  }
1566 
1567  //Update the energy deposit tables
1568  Int_t i;
1569  for(i=0;i<fEventEnergy.GetSize();i++)
1570  {
1571  fSummEnergy[i]+=fEventEnergy[i];
1573  }
1574 
1575  AliRunLoader *runloader=AliRunLoader::Instance();
1576 
1577  AliHeader* header = runloader->GetHeader();
1578  AliStack* stack = runloader->Stack();
1579  if ( (header == 0x0) || (stack == 0x0) )
1580  {//check if we got header and stack. If not cry and exit aliroot
1581  AliFatal("Can not get the stack or header from LOADER");
1582  return;//never reached
1583  }
1584  // Update Header information
1585  header->SetNprimary(stack->GetNprimary());
1586  header->SetNtrack(stack->GetNtrack());
1587  header->SetTimeStamp(AliSimulation::Instance()->GenerateTimeStamp());
1589  // Write out the kinematics
1590  if (!AliSimulation::Instance()->Lego()) stack->FinishEvent();
1591 
1592  // Synchronize the TreeTR with TreeK
1594 
1595  // Write out the event Header information
1596  TTree* treeE = runloader->TreeE();
1597  if (treeE)
1598  {
1599  header->SetStack(stack);
1600  treeE->Fill();
1601  }
1602  else
1603  {
1604  AliError("Can not get TreeE from RL");
1605  }
1606 
1607  if(AliSimulation::Instance()->Lego() == 0x0)
1608  {
1609  runloader->WriteKinematics("OVERWRITE");
1610  runloader->WriteTrackRefs("OVERWRITE");
1611  runloader->WriteHits("OVERWRITE");
1612  }
1613 
1614  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1615  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1616  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1617  AliDebug(1, " FINISHING EVENT ");
1618  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1619  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1620  AliDebug(1, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
1621 }
1622 
1623 //_______________________________________________________________________
1625 {
1626  // MC initialization
1627 
1628 
1629  //=================Create Materials and geometry
1630  TVirtualMC::GetMC()->Init();
1631  // Set alignable volumes for the whole geometry (with old root)
1632 #if ROOT_VERSION_CODE < 331527
1634 #endif
1635  //Read the cuts for all materials
1636  ReadTransPar();
1637  //Build the special IMEDIA table
1638  MediaTable();
1639 
1640  //Compute cross-sections
1641  TVirtualMC::GetMC()->BuildPhysics();
1642 
1643  //Initialise geometry deposition table
1644  fEventEnergy.Set(TVirtualMC::GetMC()->NofVolumes()+1);
1645  fSummEnergy.Set(TVirtualMC::GetMC()->NofVolumes()+1);
1646  fSum2Energy.Set(TVirtualMC::GetMC()->NofVolumes()+1);
1647 
1648  // Register MC in configuration
1649  AliConfig::Instance()->Add(TVirtualMC::GetMC());
1650 
1651  // cache the VMC pointer/instance
1652  CacheVMCInstance();
1653 }
1654 
1655 //_______________________________________________________________________
1657 {
1658  //
1659  // Built media table to get from the media number to
1660  // the detector id
1661  //
1662 
1663  Int_t kz, nz, idt, lz, i, k, ind;
1664  // Int_t ibeg;
1665  TObjArray &dets = *gAlice->Detectors();
1666  AliModule *det;
1667  Int_t ndets=gAlice->GetNdets();
1668  //
1669  // For all detectors
1670  for (kz=0;kz<ndets;kz++) {
1671  // If detector is defined
1672  if((det=dynamic_cast<AliModule*>(dets[kz]))) {
1673  TArrayI &idtmed = *(det->GetIdtmed());
1674  for(nz=0;nz<100;nz++) {
1675 
1676  // Find max and min material number
1677  if((idt=idtmed[nz])) {
1678  det->LoMedium() = det->LoMedium() < idt ? det->LoMedium() : idt;
1679  det->HiMedium() = det->HiMedium() > idt ? det->HiMedium() : idt;
1680  }
1681  }
1682  if(det->LoMedium() > det->HiMedium()) {
1683  det->LoMedium() = 0;
1684  det->HiMedium() = 0;
1685  } else {
1686  if(det->HiMedium() > fImedia->GetSize()) {
1687  AliError(Form("Increase fImedia from %d to %d",
1688  fImedia->GetSize(),det->HiMedium()));
1689  return;
1690  }
1691  // Tag all materials in rage as belonging to detector kz
1692  for(lz=det->LoMedium(); lz<= det->HiMedium(); lz++) {
1693  (*fImedia)[lz]=kz;
1694  }
1695  }
1696  }
1697  }
1698  //
1699  // Print summary table
1700  AliInfo("Tracking media ranges:");
1701  ToAliInfo(
1702  for(i=0;i<(ndets-1)/6+1;i++) {
1703  for(k=0;k< (6<ndets-i*6?6:ndets-i*6);k++) {
1704  ind=i*6+k;
1705  det=dynamic_cast<AliModule*>(dets[ind]);
1706  if(det)
1707  printf(" %6s: %3d -> %3d;",det->GetName(),det->LoMedium(),
1708  det->HiMedium());
1709  else
1710  printf(" %6s: %3d -> %3d;","NULL",0,0);
1711  }
1712  printf("\n");
1713  }
1714  );
1715 }
1716 
1717 //_______________________________________________________________________
1719 {
1720  //
1721  // Read filename to set the transport parameters
1722  //
1723 
1724 
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"};
1732  char line[256];
1733  char detName[7];
1734  char* filtmp;
1735  Float_t cut[kncuts];
1736  Int_t flag[knflags];
1737  Int_t i, itmed, iret, jret, ktmed, kz;
1738  FILE *lun;
1739  //
1740  // See whether the file is there
1741  filtmp=gSystem->ExpandPathName(fTransParName.Data());
1742  lun=fopen(filtmp,"r");
1743  delete [] filtmp;
1744  if(!lun) {
1745  AliWarning(Form("File %s does not exist!",fTransParName.Data()));
1746  return;
1747  }
1748  //
1749  while(1) {
1750  // Initialise cuts and flags
1751  for(i=0;i<kncuts;i++) cut[i]=-99;
1752  for(i=0;i<knflags;i++) flag[i]=-99;
1753  itmed=0;
1754  memset(line,0,256);
1755  // Read up to the end of line excluded
1756  iret=fscanf(lun,"%255[^\n]",line);
1757  if(iret<0) {
1758  //End of file
1759  fclose(lun);
1760  return;
1761  }
1762  // Read the end of line
1763  jret = fscanf(lun,"%*c");
1764  if(!iret) continue;
1765  if(line[0]=='*') continue;
1766  // Read the numbers
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]);
1771  if(!iret) continue;
1772  if(iret<0) {
1773  //reading error
1774  AliWarning(Form("Error reading file %s",fTransParName.Data()));
1775  continue;
1776  }
1777  // Check that the module exist
1778  AliModule *mod = gAlice->GetModule(detName);
1779  if(mod) {
1780  // Get the array of media numbers
1781  TArrayI &idtmed = *mod->GetIdtmed();
1782  // Check that the tracking medium code is valid
1783  if(0<=itmed && itmed < 100) {
1784  ktmed=idtmed[itmed];
1785  if(!ktmed) {
1786  AliWarning(Form("Invalid tracking medium code %d for %s",itmed,mod->GetName()));
1787  continue;
1788  }
1789  // Set energy thresholds
1790  for(kz=0;kz<kncuts;kz++) {
1791  if(cut[kz]>=0) {
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]);
1795  }
1796  }
1797  // Set transport mechanisms
1798  for(kz=0;kz<knflags;kz++) {
1799  if(flag[kz]>=0) {
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]));
1803  }
1804  }
1805  } else {
1806  AliWarning(Form("Invalid medium code %d",itmed));
1807  continue;
1808  }
1809  } else {
1810  AliDebug(1, Form("%s not present",detName));
1811  continue;
1812  }
1813  }
1814 }
1815 
1816 //_______________________________________________________________________
1817 void AliMC::SetTransPar(const char *filename)
1818 {
1819  //
1820  // Sets the file name for transport parameters
1821  //
1822  fTransParName = filename;
1823 }
1824 
1825 //_______________________________________________________________________
1826 void AliMC::AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
1827 {
1828  //
1829  // Add a hit to detector id
1830  //
1831  TObjArray &dets = *gAlice->Modules();
1832  if(dets[id]) static_cast<AliModule*>(dets[id])->AddHit(track,vol,hits);
1833 }
1834 
1835 //_______________________________________________________________________
1836 void AliMC::AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
1837 {
1838  //
1839  // Add digit to detector id
1840  //
1841  TObjArray &dets = *gAlice->Modules();
1842  if(dets[id]) static_cast<AliModule*>(dets[id])->AddDigit(tracks,digits);
1843 }
1844 
1845 //_______________________________________________________________________
1847  //
1848  // Returns current track
1849  //
1851 }
1852 
1853 //_______________________________________________________________________
1854 void AliMC::DumpPart (Int_t i) const
1855 {
1856  //
1857  // Dumps particle i in the stack
1858  //
1859  AliRunLoader * runloader = AliRunLoader::Instance();
1860  if (runloader->Stack())
1861  runloader->Stack()->DumpPart(i);
1862 }
1863 
1864 //_______________________________________________________________________
1865 void AliMC::DumpPStack () const
1866 {
1867  //
1868  // Dumps the particle stack
1869  //
1870  AliRunLoader * runloader = AliRunLoader::Instance();
1871  if (runloader->Stack())
1872  runloader->Stack()->DumpPStack();
1873 }
1874 
1875 //_______________________________________________________________________
1876 Int_t AliMC::GetNtrack() const {
1877  //
1878  // Returns number of tracks in stack
1879  //
1880  Int_t ntracks = -1;
1881  AliRunLoader * runloader = AliRunLoader::Instance();
1882  if (runloader->Stack())
1883  ntracks = runloader->Stack()->GetNtrack();
1884  return ntracks;
1885 }
1886 
1887 //_______________________________________________________________________
1888 Int_t AliMC::GetPrimary(Int_t track) const
1889 {
1890  //
1891  // return number of primary that has generated track
1892  //
1893  Int_t nprimary = -999;
1894  AliRunLoader * runloader = AliRunLoader::Instance();
1895  if (runloader->Stack())
1896  nprimary = runloader->Stack()->GetPrimary(track);
1897  return nprimary;
1898 }
1899 
1900 //_______________________________________________________________________
1901 TParticle* AliMC::Particle(Int_t i) const
1902 {
1903  // Returns the i-th particle from the stack taking into account
1904  // the remaping done by PurifyKine
1905  AliRunLoader * runloader = AliRunLoader::Instance();
1906  if (runloader)
1907  if (runloader->Stack())
1908  return runloader->Stack()->Particle(i);
1909  return 0x0;
1910 }
1911 
1912 //_______________________________________________________________________
1913 const TObjArray* AliMC::Particles() const {
1914  //
1915  // Returns pointer to Particles array
1916  //
1917  AliRunLoader * runloader = AliRunLoader::Instance();
1918  if (runloader)
1919  if (runloader->Stack())
1920  return runloader->Stack()->Particles();
1921  return 0x0;
1922 }
1923 
1924 //_______________________________________________________________________
1925 void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg, const Float_t *pmom,
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
1928 {
1929 // Delegate to stack
1930 //
1931  AliRunLoader * runloader = AliRunLoader::Instance();
1932  if (runloader)
1933  if (runloader->Stack())
1934  runloader->Stack()->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
1935  mech, ntr, weight, is);
1936 }
1937 
1938 //_______________________________________________________________________
1939 void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg,
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
1944 {
1945  // Delegate to stack
1946  //
1947  AliRunLoader * runloader = AliRunLoader::Instance();
1948  if (runloader)
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);
1952 }
1953 
1954 //_______________________________________________________________________
1955 void AliMC::SetHighWaterMark(Int_t nt) const
1956 {
1957  //
1958  // Set high water mark for last track in event
1959  AliRunLoader * runloader = AliRunLoader::Instance();
1960  if (runloader)
1961  if (runloader->Stack())
1962  runloader->Stack()->SetHighWaterMark(nt);
1963 }
1964 
1965 //_______________________________________________________________________
1966 void AliMC::KeepTrack(Int_t track) const
1967 {
1968  //
1969  // Delegate to stack
1970  //
1971  AliRunLoader * runloader = AliRunLoader::Instance();
1972  if (runloader)
1973  if (runloader->Stack())
1974  runloader->Stack()->KeepTrack(track);
1975 }
1976 
1977 //_______________________________________________________________________
1978 void AliMC::FlagTrack(Int_t track) const
1979 {
1980  // Delegate to stack
1981  //
1982  AliRunLoader * runloader = AliRunLoader::Instance();
1983  if (runloader)
1984  if (runloader->Stack())
1985  runloader->Stack()->FlagTrack(track);
1986 }
1987 
1988 //_______________________________________________________________________
1990 {
1991  //
1992  // Set current track number
1993  //
1994  AliRunLoader * runloader = AliRunLoader::Instance();
1995  if (runloader)
1996  if (runloader->Stack())
1997  runloader->Stack()->SetCurrentTrack(track);
1998 }
1999 
2000 //_______________________________________________________________________
2002 {
2003  //
2004  // add a trackrefernce to the list
2005  Int_t primary = GetPrimary(label);
2006  Particle(primary)->SetBit(kKeepBit);
2007 
2008  Int_t nref = fTmpTrackReferences.GetEntriesFast();
2009  return new(fTmpTrackReferences[nref]) AliTrackReference(label, id);
2010 }
2011 
2012 
2013 
2014 //_______________________________________________________________________
2016 {
2017  //
2018  // Reset all references
2019  //
2020  fTmpTrackReferences.Clear();
2021 }
2022 
2023 //_______________________________________________________________________
2024 void AliMC::RemapTrackReferencesIDs(const Int_t *map)
2025 {
2026  //
2027  // Remapping track reference
2028  // Called at finish primary
2029  //
2030 
2031  Int_t nEntries = fTmpTrackReferences.GetEntries();
2032  for (Int_t i=0; i < nEntries; i++){
2033  AliTrackReference * ref = dynamic_cast<AliTrackReference*>(fTmpTrackReferences.UncheckedAt(i));
2034  if (ref) {
2035  Int_t newID = map[ref->GetTrack()];
2036  if (newID>=0) ref->SetTrack(newID);
2037  else {
2038  ref->SetBit(kNotDeleted,kFALSE);
2039  fTmpTrackReferences.RemoveAt(i);
2040  }
2041  } // if ref
2042  }
2043  fTmpTrackReferences.Compress();
2044 }
2045 
2046 //_______________________________________________________________________
2048 {
2049  //
2050  // Fix the particle decay time according to rmin and rmax for decays
2051  //
2052 
2053  TLorentzVector p;
2054  TVirtualMC::GetMC()->TrackMomentum(p);
2055  Double_t tmin, tmax;
2056  Double_t b;
2057 
2058  // Transverse velocity
2059  Double_t vt = p.Pt() / p.E();
2060 
2061  if ((b = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField()) > 0.) { // [kG]
2062 
2063  // Radius of helix
2064 
2065  Double_t rho = p.Pt() / 0.0003 / b; // [cm]
2066 
2067  // Revolution frequency
2068 
2069  Double_t omega = vt / rho;
2070 
2071  // Maximum and minimum decay time
2072  //
2073  // Check for curlers first
2074  const Double_t kOvRhoSqr2 = 1./(rho*TMath::Sqrt(2.));
2075  if (fRDecayMax * kOvRhoSqr2 > 1.) return;
2076 
2077  //
2078 
2079  tmax = TMath::ACos((1.-fRDecayMax*kOvRhoSqr2)*(1.+fRDecayMax*kOvRhoSqr2)) / omega; // [ct]
2080  tmin = TMath::ACos((1.-fRDecayMin*kOvRhoSqr2)*(1.+fRDecayMin*kOvRhoSqr2)) / omega; // [ct]
2081  } else {
2082  tmax = fRDecayMax / vt; // [ct]
2083  tmin = fRDecayMin / vt; // [ct]
2084  }
2085 
2086  //
2087  // Dial t using the two limits
2088  Double_t t = tmin + (tmax - tmin) * gRandom->Rndm(); // [ct]
2089  //
2090  //
2091  // Force decay time in transport code
2092  //
2093  TVirtualMC::GetMC()->ForceDecayTime(t / 2.99792458e10);
2094 }
2095 
2097 {
2098  // Make the temporary track reference tree
2099  fTmpFileTR = new TFile("TrackRefsTmp.root", "recreate");
2100  fTmpTreeTR = new TTree("TreeTR", "Track References");
2101  TClonesArray* pRef = &fTmpTrackReferences;
2102  fTmpTreeTR->Branch("TrackReferences", &pRef, 4000);
2103 }
2104 
2105 //_______________________________________________________________________
2107 {
2108 //
2109 // Reorder and expand the temporary track reference tree in order to match the kinematics tree
2110 //
2111 
2113 //
2114 // TreeTR
2115  AliDebug(1, "fRunLoader->MakeTrackRefsContainer()");
2116  rl->MakeTrackRefsContainer();
2117  TTree * treeTR = rl->TreeTR();
2118  // make branch for central track references
2119  TClonesArray* pRef = &fTrackReferences;
2120  treeTR->Branch("TrackReferences", &pRef);
2121 
2122  AliStack* stack = rl->Stack();
2123  Int_t np = stack->GetNprimary();
2124  Int_t nt = fTmpTreeTR->GetEntries();
2125  //
2126  // Loop over tracks and find the secondaries with the help of the kine tree
2127  Int_t ifills = 0;
2128  Int_t it = 0;
2129  for (Int_t ip = np - 1; ip > -1; ip--) {
2130  TParticle *part = stack->Particle(ip);
2131  //printf("Particle %5d %5d %5d %5d %5d \n", ip, part->GetPdgCode(), part->GetFirstMother(), part->GetFirstDaughter(), part->GetLastDaughter());
2132 
2133  // Skip primaries that have not been transported
2134  Int_t dau1 = part->GetFirstDaughter();
2135  Int_t dau2 = -1;
2136  if (!part->TestBit(kTransportBit)) continue;
2137  //
2138  fTmpTreeTR->GetEntry(it++);
2139  Int_t nh = fTmpTrackReferences.GetEntries();
2140  // Determine range of secondaries produced by this primary
2141  if (dau1 > -1) {
2142  Int_t inext = ip - 1;
2143  while (dau2 < 0) {
2144  if (inext >= 0) {
2145  part = stack->Particle(inext);
2146  dau2 = part->GetFirstDaughter();
2147  if (!(part->TestBit(kTransportBit)) || dau2 == -1 || dau2 < np) {
2148 // if (dau2 == -1 || dau2 < np) {
2149  dau2 = -1;
2150  } else {
2151  dau2--;
2152  }
2153  } else {
2154  dau2 = stack->GetNtrack() - 1;
2155  }
2156  inext--;
2157  } // find upper bound
2158  } // dau2 < 0
2159 // printf("Check (1) %5d %5d %5d %5d %5d \n", ip, np, it, dau1, dau2);
2160  //
2161  // Loop over reference hits and find secondary label
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();
2166  // Skip primaries
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));
2170  if (label == id) {
2171  // secondary found
2172  Int_t nref = fTrackReferences.GetEntriesFast();
2173  new(fTrackReferences[nref]) AliTrackReference(*tr);
2174  }
2175  } // hits
2176  treeTR->Fill();
2177  fTrackReferences.Clear();
2178  ifills++;
2179  } // daughters
2180  } // tracks
2181  //
2182  // Now loop again and write the primaries
2183  it = nt - 1;
2184  for (Int_t ip = 0; ip < np; ip++) {
2185  TParticle* part = stack->Particle(ip);
2186 // if ((part->GetFirstDaughter() == -1 && part->GetStatusCode() <= 1) || part->GetFirstDaughter() >= np)
2187  if (part->TestBit(kTransportBit))
2188  {
2189  // Skip particles that have not been transported
2190  fTmpTreeTR->GetEntry(it--);
2191  Int_t nh = fTmpTrackReferences.GetEntries();
2192  //
2193  // Loop over reference hits and find primary labels
2194  for (Int_t ih = 0; ih < nh; ih++) {
2196  Int_t label = tr->Label();
2197  if (label == ip) {
2198  Int_t nref = fTrackReferences.GetEntriesFast();
2199  new(fTrackReferences[nref]) AliTrackReference(*tr);
2200  }
2201  }
2202  }
2203  treeTR->Fill();
2204  fTrackReferences.Clear();
2205  ifills++;
2206  } // tracks
2207  // Check
2208  if (ifills != stack->GetNtrack())
2209  AliWarning(Form("Number of entries in TreeTR (%5d) unequal to TreeK (%5d) \n", ifills, stack->GetNtrack()));
2210 //
2211 // Clean-up
2212  delete fTmpTreeTR;
2213  fTmpFileTR->Close();
2214  delete fTmpFileTR;
2215  fTmpTrackReferences.Clear();
2216  AliFileUtilities::RemoveLocalFile("TrackRefsTmp.root");
2217 }
2218 
TList * GetHitLists() const
Definition: AliMC.h:87
#define ToAliInfo(whatever)
Definition: AliLog.h:515
TBrowser b
Definition: RunAnaESD.C:12
virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
Definition: AliMC.cxx:1826
static AliRunLoader * Instance()
Definition: AliRunLoader.h:176
void SetHighWaterMark(Int_t hgwmk)
Definition: AliStack.cxx:677
void MakeTmpTrackRefsTree()
Definition: AliMC.cxx:2096
virtual void PostTrack()
Definition: AliModule.h:108
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void FinishEvent()
Definition: AliMC.cxx:1553
const TString & GetPath() const
Definition: AliCDBPath.h:38
virtual ~AliMC()
Definition: AliMC.cxx:135
void MakeTrackRefsContainer()
const Int_t nt
Definition: pdfIO.C:2
virtual Int_t GetPrimary(Int_t track) const
Definition: AliMC.cxx:1888
TArrayF fSummEnergy
Energy deposit for current event.
Definition: AliMC.h:142
void SetSgPerBgEmbedded(int i)
Definition: AliHeader.h:68
Bool_t IsGeometryFromCDB() const
Definition: AliMC.cxx:1091
virtual void FinishPrimary()
Definition: AliModule.h:111
virtual Int_t GetCurrentTrackNumber() const
Definition: AliStack.h:143
Bool_t MisalignGeometry(AliRunLoader *runLoader=NULL)
Definition: AliHit.h:14
AliMC()
Definition: AliMC.cxx:65
virtual void Init()
Definition: AliModule.h:112
#define TObjArray
virtual void ResetTrackReferences()
Definition: AliMC.cxx:2015
virtual void PreTrack()
Definition: AliMC.cxx:1181
void CacheVMCInstance()
Definition: AliMC.cxx:146
Float_t fPuZmax
Definition: AliMC.h:147
const char * path
virtual void DumpPStack() const
Definition: AliMC.cxx:1865
Float_t fRDecayMax
Definition: AliMC.h:148
Int_t GetTrack() const
Definition: AliHit.h:19
virtual void FinishEvent()
Definition: AliLego.cxx:267
virtual void FinishRun()
TTree * fTmpTreeTR
Lists of hits to be remapped by PurifyKine.
Definition: AliMC.h:156
virtual void FinishEvent()
Definition: AliModule.h:109
Int_t GetNdets() const
Definition: AliRun.h:41
TString fTransParName
Array of correspondence between media and detectors.
Definition: AliMC.h:152
virtual void FlagTrack(Int_t track) const
Definition: AliMC.cxx:1978
Float_t p[]
Definition: kNNTest.C:133
Int_t fDecayPdg
Definition: AliMC.h:150
virtual void BeginPrimary()
Definition: AliMC.cxx:1169
Bool_t fReadRndmStatus
Options to save random engine status for each event.
Definition: AliMC.h:138
Int_t WriteKinematics(Option_t *opt="")
void SetGeometryFromCDB()
Definition: AliMC.cxx:1079
AliTPCfastTrack * track
Int_t GetEventNrInRun() const
Definition: AliRun.h:40
void DumpPStack()
Definition: AliStack.cxx:815
virtual void PreTrack()
Definition: AliModule.h:107
Int_t WriteTrackRefs(Option_t *opt="")
virtual void ResetDigits()
Definition: AliMC.cxx:1445
TString fRndmFileName
Activate monitoring.
Definition: AliMC.h:140
virtual void PostTrack()
Definition: AliMC.cxx:1471
TVectorD vz
Definition: driftITSTPC.C:87
void ReorderAndExpandTreeTR()
Definition: AliMC.cxx:2106
void AddEnergyDeposit(Int_t id, Float_t edep)
Definition: AliMC.h:67
Int_t GetEvNumber() const
Definition: AliRun.cxx:379
TVirtualMC * fMC
Definition: AliMC.h:134
virtual void SetCurrentTrack(Int_t track) const
Definition: AliMC.cxx:1989
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
Int_t * TrackLabelMap()
Definition: AliStack.h:88
#define AliWarning(message)
Definition: AliLog.h:541
virtual void FinishPrimary()
Definition: AliMC.cxx:1484
virtual void SetTimeStamp(time_t timeStamp)
Definition: AliHeader.h:62
AliCDBEntry * Get(const AliCDBId &query, Bool_t forceCaching=kFALSE)
#define ToAliDebug(level, whatever)
Definition: AliLog.h:379
Int_t SetEventNumber(Int_t evno)
virtual void EnergySummary()
Definition: AliMC.cxx:1262
virtual void GeneratePrimaries()
Definition: AliMC.cxx:1113
bool RemoveLocalFile(const char *filename)
virtual void SetStack(AliStack *stack)
Definition: AliHeader.cxx:187
Bool_t ReorderKine()
Definition: AliStack.cxx:399
virtual Int_t GetTrack() const
void Add(TDatabasePDG *pdg)
Definition: AliConfig.cxx:180
Int_t GetNprimary() const
Definition: AliStack.h:137
virtual const Char_t * GetGeometryFile() const
AliTransportMonitor * fMonitor
Definition: AliMC.h:153
TObject * GetObject()
Definition: AliCDBEntry.h:56
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()
Definition: AliModule.h:127
virtual Int_t DetFromMate(Int_t i) const
Definition: AliMC.h:55
virtual Int_t GetNtrack() const
Definition: AliStack.h:134
virtual void KeepTrack(Int_t itra) const
Definition: AliMC.cxx:1966
virtual void InitGeometry()
Definition: AliMC.cxx:1060
void MakeTree(Option_t *option)
TArrayF fSum2Energy
Energy per event in each volume.
Definition: AliMC.h:143
virtual void SetNprimary(Int_t nprimary)
Definition: AliHeader.h:37
const TObjArray * Particles() const
Definition: AliMC.cxx:1913
AliModule * GetModule(const char *name) const
Definition: AliRun.cxx:191
AliLego * Lego() const
AliHeader * GetHeader() const
#define AliInfo(message)
Definition: AliLog.h:484
virtual void Init()
Definition: AliMC.cxx:1624
virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
Definition: AliMC.cxx:1836
virtual void BeginEvent()
Definition: AliLego.cxx:245
TGeoManager * gGeoManager
TClonesArray fTrackReferences
Temporary track reference file.
Definition: AliMC.h:158
static AliSimulation * Instance()
Definition: AliSimulation.h:38
virtual void RemapTrackReferencesIDs(const Int_t *map)
Definition: AliMC.cxx:2024
virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts")
Definition: AliMC.cxx:1817
virtual AliGenerator * Generator() const
Definition: AliMC.h:58
virtual void SetCurrentTrack(Int_t track)
Definition: AliStack.cxx:871
static void SetGeometry(TGeoManager *const geom)
virtual void ConstructOpGeometry()
Definition: AliMC.cxx:233
void polar()
Definition: polar.C:2
virtual Int_t & HiMedium()
Definition: AliModule.h:57
Int_t GetPrimary(Int_t id, Bool_t useInEmbedding=kFALSE)
Definition: AliStack.cxx:789
void SetTrack(Int_t track)
Definition: AliHit.h:20
AliRun * gAlice
Definition: AliRun.cxx:62
virtual void Reset(Int_t run, Int_t event)
Definition: AliHeader.cxx:130
const TObjArray * Particles() const
Definition: AliStack.h:146
Int_t GetCurrentTrackNumber() const
Definition: AliMC.cxx:1846
virtual TArrayI * GetIdtmed() const
Definition: AliModule.h:47
virtual void ResetHits()
Definition: AliModule.h:128
TArrayI * fImedia
Definition: AliMC.h:151
virtual Int_t Label() const
void KeepTrack(Int_t itrack)
Definition: AliStack.cxx:628
void RemapHits()
Definition: AliMC.cxx:1517
Definition: AliCDBEntry.h:18
void Export(const char *fname)
#define AliFatal(message)
Definition: AliLog.h:640
TTree * TreeTR() const
AliTrackReference * AddTrackReference(Int_t label, Int_t id=-999)
Definition: AliMC.cxx:2001
Float_t fPuRmax
Definition: AliMC.h:146
TTree * TreeE() const
TF1 * f
Definition: interpolTest.C:21
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
Definition: AliMC.cxx:1925
virtual Bool_t MisalignGeometry()
Definition: AliMC.cxx:215
Int_t TrackLabel(Int_t label) const
Definition: AliStack.h:87
virtual void SetHighWaterMark(Int_t nt) const
Definition: AliMC.cxx:1955
Definition: AliMC.h:30
virtual void MediaTable()
Definition: AliMC.cxx:1656
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)
Definition: AliStack.cxx:139
virtual void Generate()=0
virtual void ResetSDigits()
Definition: AliMC.cxx:1458
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
Definition: AliStack.cxx:690
#define AliDebug(logLevel, message)
Definition: AliLog.h:300
virtual void RemapTrackHitIDs(Int_t *)
Definition: AliDetector.h:63
Int_t GetSgPerBgEmbedded() const
Definition: AliRun.h:68
virtual void ConstructGeometry()
Definition: AliMC.cxx:165
virtual void Stepping()
Definition: AliMC.cxx:1196
TTree * TreeH() const
Definition: AliLoader.h:83
virtual void SetNtrack(Int_t ntrack)
Definition: AliHeader.h:44
void Reset(Int_t size=0)
Definition: AliStack.cxx:654
virtual void SetGenerator(AliGenerator *generator)
Definition: AliMC.cxx:1123
static Bool_t CheckSymNamesLUT(const char *detsToBeChecked)
TClonesArray fTmpTrackReferences
List of track references - for one primary track only.
Definition: AliMC.h:159
virtual void FinishRun()
Definition: AliMC.cxx:1151
void SetEventNrInRun(Int_t event)
Definition: AliRun.h:39
virtual void AddAlignableVolumes() const
Definition: AliModule.cxx:362
virtual void AddParticles()
Definition: AliMC.cxx:252
void FinishEvent()
Definition: AliStack.cxx:556
virtual void BeginEvent()
Definition: AliMC.cxx:1328
virtual void FixParticleDecaytime()
Definition: AliMC.cxx:2047
Int_t WriteHits(Option_t *opt="")
TFile * fTmpFileTR
Temporary track reference tree.
Definition: AliMC.h:157
Float_t fRDecayMin
Definition: AliMC.h:149
virtual Int_t & LoMedium()
Definition: AliModule.h:56
TList * fHitLists
Transport monitoring tool.
Definition: AliMC.h:154
Int_t GetNtrack() const
Definition: AliMC.cxx:1876
void SetOwner(Bool_t owner)
Definition: AliCDBEntry.h:64
#define AliError(message)
Definition: AliLog.h:591
virtual void DumpPart(Int_t i) const
Definition: AliMC.cxx:1854
virtual void ResetHits()
Definition: AliMC.cxx:1432
Bool_t PurifyKine(Float_t rmax=-1., Float_t zmax=-1.)
Definition: AliStack.cxx:305
virtual void SetGeometryFile(const Char_t *filename)
Bool_t fUseMonitoring
Options to read random engine status.
Definition: AliMC.h:139
TCut cut
Definition: MakeGlobalFit.C:75
Bool_t fSaveRndmStatus
Definition: AliMC.h:136
Bool_t fSaveRndmEventStatus
Options to save random engine status.
Definition: AliMC.h:137
void FlagTrack(Int_t track)
Definition: AliStack.cxx:604
AliGenerator * fGenerator
cached MC instance (to avoid calls to thread_local gMC=TVirtualMC::GetMC())
Definition: AliMC.h:135
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
virtual void ResetDigits()
Definition: AliModule.h:126
virtual void SetTrack(Int_t track)
virtual void ReadTransPar()
Definition: AliMC.cxx:1718
void DumpPart(Int_t i) const
Definition: AliStack.cxx:806
virtual void StepManager()
Definition: AliModule.h:131
virtual void StepManager()
Definition: AliLego.cxx:311
virtual void DecayLimits(Float_t rmin=-1., Float_t rmax=-1., Int_t pdg=0)
Definition: AliMC.h:74
virtual Bool_t StepManagerIsEnabled() const
Definition: AliModule.h:133
static AliConfig * Instance()
Definition: AliConfig.cxx:87
TObjArray * Modules() const
Definition: AliRun.h:36
virtual Int_t GetEvent() const
Definition: AliHeader.h:48
TArrayF fEventEnergy
The file name of random engine status to be read in.
Definition: AliMC.h:141
TParticle * Particle(Int_t i) const
Definition: AliMC.cxx:1901
AliStack * Stack() const
Definition: AliRunLoader.h:95
virtual void ResetGenerator(AliGenerator *generator)
Definition: AliMC.cxx:1132
virtual void SetAllAlignableVolumes()
Definition: AliMC.cxx:1097
TObjArray * Detectors() const
Definition: AliRun.h:35