prevent running if CDB snapshot setting failed
[u/mrichter/AliRoot.git] / STEER / STEER / AliMC.h
CommitLineData
5d12ce38 1#ifndef ALIMC_H
2#define ALIMC_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
2057aecb 8//
9// This is the ALICE implementation of TVirtualMCApplication
10// for simulation with different implementations
11// of the Virtual MonteCarlo
12//
13
5d12ce38 14#include <TArrayF.h>
15#include <TArrayI.h>
fd650020 16#include <TClonesArray.h>
3e2e3ece 17#include <TList.h>
024a7e64 18#include <TMCProcess.h>
5d12ce38 19#include <TVirtualMCApplication.h>
20
d6276823 21class TParticle;
3cac0921 22class TFile;
23class TTree;
24
5d12ce38 25class AliGenerator;
9ac3aec9 26class AliTrackReference;
a5fe2c41 27class AliTransportMonitor;
5d12ce38 28
29class AliMC : public TVirtualMCApplication {
30public:
31 AliMC();
32 AliMC(const char *name, const char *title);
5d12ce38 33 virtual ~AliMC();
34
5d12ce38 35//
36// MC Application
37//
38 virtual void ConstructGeometry();
39b3f8ba 39 virtual Bool_t MisalignGeometry();
661663fa 40 virtual void ConstructOpGeometry();
88f91d87 41 virtual void AddParticles();
5d12ce38 42 virtual void InitGeometry();
4787b401 43 virtual void SetAllAlignableVolumes();
5d12ce38 44 virtual void GeneratePrimaries();
45 virtual void BeginEvent();
46 virtual void BeginPrimary();
47 virtual void PreTrack();
48 virtual void Stepping();
49 virtual void PostTrack();
50 virtual void FinishPrimary();
51 virtual void FinishEvent();
52 virtual Double_t TrackingZmax() const {return fTrZmax;}
53 virtual Double_t TrackingRmax() const {return fTrRmax;}
5d12ce38 54 virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
55//
56
57 virtual AliGenerator* Generator() const {return fGenerator;}
58 virtual void SetGenerator(AliGenerator *generator);
59 virtual void ResetGenerator(AliGenerator *generator);
60
61//
62 virtual void ReadTransPar();
63 virtual void MediaTable();
64 virtual void EnergySummary();
65 virtual void FinishRun();
66 void AddEnergyDeposit(Int_t id, Float_t edep)
67 {fEventEnergy[id]+=edep;}
68 virtual void ResetHits();
3e2e3ece 69 virtual void ResetDigits();
70 virtual void ResetSDigits();
5d12ce38 71 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10)
0561efeb 72 {fTrRmax=rmax; fTrZmax=zmax;}
73 virtual void DecayLimits( Float_t rmin = -1., Float_t rmax = -1., Int_t pdg = 0)
74 {fRDecayMin = rmin; fRDecayMax = rmax; fDecayPdg = pdg;}
75
5d12ce38 76 virtual void Init();
77 virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
5d12ce38 78 //PH
79 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
80 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
4fc0efd3 81 virtual void AddHitList(TCollection *hitList) {if (hitList) fHitLists->Add(hitList);}
5d12ce38 82 Int_t GetCurrentTrackNumber() const;
83 virtual void DumpPart (Int_t i) const;
84 virtual void DumpPStack () const;
85 TList* GetHitLists() const {return fHitLists ;}
86 Int_t GetNtrack() const;
87 virtual Int_t GetPrimary(Int_t track) const;
c50a3f13 88 const TObjArray* Particles() const;
5d12ce38 89 TParticle *Particle(Int_t i) const;
90 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
3e2e3ece 91 const Float_t *pmom, const Float_t *vpos, const Float_t *polar,
5d12ce38 92 Float_t tof, TMCProcess mech, Int_t &ntr,
2057aecb 93 Float_t weight = 1, Int_t is = 0) const;
5d12ce38 94 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
95 Double_t px, Double_t py, Double_t pz, Double_t e,
96 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
97 Double_t polx, Double_t poly, Double_t polz,
98 TMCProcess mech, Int_t &ntr, Float_t weight=1,
2057aecb 99 Int_t is = 0) const;
100 virtual void SetHighWaterMark(Int_t nt) const;
5d12ce38 101
2057aecb 102 virtual void KeepTrack(Int_t itra) const;
103 virtual void FlagTrack(Int_t track) const;
104 virtual void SetCurrentTrack(Int_t track) const;
9ac3aec9 105// Track reference related
106 AliTrackReference* AddTrackReference(Int_t label, Int_t id = -999);
fd650020 107 // const TClonesArray* TrackReferences() const {return &fTrackReferences;}
6da30991 108 virtual void RemapTrackReferencesIDs(const Int_t *map); //remaping track references MI
9ac3aec9 109 virtual void ResetTrackReferences();
110 virtual void FixParticleDecaytime();
d97f1dbe 111// Geometry related
112 void SetGeometryFromCDB();
113 Bool_t IsGeometryFromCDB() const;
a5fe2c41 114// Monitor transport
115 void SetUseMonitoring(Bool_t flag=kTRUE) { fUseMonitoring = flag; }
116 AliTransportMonitor *GetTransportMonitor() const { return fMonitor; }
9d188d33 117// Random number generator status
118 void SetSaveRndmStatus(Bool_t value) { fSaveRndmStatus = value; }
119 void SetSaveRndmStatusPerEvent(Bool_t value) { fSaveRndmEventStatus = value; }
120 void SetReadRndmStatus(Bool_t value) { fReadRndmStatus = value; };
121 void SetRndmFileName(const TString& fileName) { fRndmFileName = fileName; };
d97f1dbe 122
3cac0921 123 private:
7dd2cbe4 124 AliMC(const AliMC&); // Not implemented
125 AliMC& operator= (const AliMC&); // Not implemented
3cac0921 126 void MakeTmpTrackRefsTree();
127 void ReorderAndExpandTreeTR();
128 private:
942a9039 129 void RemapHits();
5d12ce38 130 AliGenerator *fGenerator; // Generator used in the MC
9d188d33 131 Bool_t fSaveRndmStatus; //! Options to save random engine status
132 Bool_t fSaveRndmEventStatus; //! Options to save random engine status for each event
133 Bool_t fReadRndmStatus; //! Options to read random engine status
a5fe2c41 134 Bool_t fUseMonitoring; //! Activate monitoring
9d188d33 135 TString fRndmFileName; //! The file name of random engine status to be read in
5d12ce38 136 TArrayF fEventEnergy; //! Energy deposit for current event
137 TArrayF fSummEnergy; //! Energy per event in each volume
138 TArrayF fSum2Energy; //! Energy squared per event in each volume
139 Float_t fTrRmax; // Maximum radius for tracking
140 Float_t fTrZmax; // Maximu z for tracking
0561efeb 141 Float_t fRDecayMax; // Maximum radius for decay
142 Float_t fRDecayMin; // Minimum radius for decay
143 Int_t fDecayPdg; // PDG code of particle with forced decay length
5d12ce38 144 TArrayI *fImedia; //! Array of correspondence between media and detectors
145 TString fTransParName; // Name of the transport parameters file
a5fe2c41 146 AliTransportMonitor *fMonitor; //! Transport monitoring tool
5d12ce38 147 TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
3cac0921 148 //Temporary Track Reference tree related
149 TTree *fTmpTreeTR; //! Temporary track reference tree
150 TFile *fTmpFileTR; //! Temporary track reference file
fd650020 151 TClonesArray fTrackReferences; //! List of track references - for one primary track only
152 TClonesArray fTmpTrackReferences; //! Temporary list of track references - for one primary track only
153 ClassDef(AliMC, 4)
5d12ce38 154};
155
156
157#endif