The present commit corresponds to an important change in the way the
[u/mrichter/AliRoot.git] / 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;
5d12ce38 27
28class AliMC : public TVirtualMCApplication {
29public:
30 AliMC();
31 AliMC(const char *name, const char *title);
5d12ce38 32 virtual ~AliMC();
33
5d12ce38 34//
35// MC Application
36//
37 virtual void ConstructGeometry();
39b3f8ba 38 virtual Bool_t MisalignGeometry();
661663fa 39 virtual void ConstructOpGeometry();
5d12ce38 40 virtual void InitGeometry();
4787b401 41 virtual void SetAllAlignableVolumes();
5d12ce38 42 virtual void GeneratePrimaries();
43 virtual void BeginEvent();
44 virtual void BeginPrimary();
45 virtual void PreTrack();
46 virtual void Stepping();
47 virtual void PostTrack();
48 virtual void FinishPrimary();
49 virtual void FinishEvent();
50 virtual Double_t TrackingZmax() const {return fTrZmax;}
51 virtual Double_t TrackingRmax() const {return fTrRmax;}
5d12ce38 52 virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
53//
54
55 virtual AliGenerator* Generator() const {return fGenerator;}
56 virtual void SetGenerator(AliGenerator *generator);
57 virtual void ResetGenerator(AliGenerator *generator);
58
59//
60 virtual void ReadTransPar();
61 virtual void MediaTable();
62 virtual void EnergySummary();
63 virtual void FinishRun();
64 void AddEnergyDeposit(Int_t id, Float_t edep)
65 {fEventEnergy[id]+=edep;}
66 virtual void ResetHits();
3e2e3ece 67 virtual void ResetDigits();
68 virtual void ResetSDigits();
5d12ce38 69 virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10)
0561efeb 70 {fTrRmax=rmax; fTrZmax=zmax;}
71 virtual void DecayLimits( Float_t rmin = -1., Float_t rmax = -1., Int_t pdg = 0)
72 {fRDecayMin = rmin; fRDecayMax = rmax; fDecayPdg = pdg;}
73
5d12ce38 74 virtual void Init();
75 virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
5d12ce38 76 //PH
77 virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
78 virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
4fc0efd3 79 virtual void AddHitList(TCollection *hitList) {if (hitList) fHitLists->Add(hitList);}
5d12ce38 80 Int_t GetCurrentTrackNumber() const;
81 virtual void DumpPart (Int_t i) const;
82 virtual void DumpPStack () const;
83 TList* GetHitLists() const {return fHitLists ;}
84 Int_t GetNtrack() const;
85 virtual Int_t GetPrimary(Int_t track) const;
c50a3f13 86 const TObjArray* Particles() const;
5d12ce38 87 TParticle *Particle(Int_t i) const;
88 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
3e2e3ece 89 const Float_t *pmom, const Float_t *vpos, const Float_t *polar,
5d12ce38 90 Float_t tof, TMCProcess mech, Int_t &ntr,
2057aecb 91 Float_t weight = 1, Int_t is = 0) const;
5d12ce38 92 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
93 Double_t px, Double_t py, Double_t pz, Double_t e,
94 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
95 Double_t polx, Double_t poly, Double_t polz,
96 TMCProcess mech, Int_t &ntr, Float_t weight=1,
2057aecb 97 Int_t is = 0) const;
98 virtual void SetHighWaterMark(Int_t nt) const;
5d12ce38 99
2057aecb 100 virtual void KeepTrack(Int_t itra) const;
101 virtual void FlagTrack(Int_t track) const;
102 virtual void SetCurrentTrack(Int_t track) const;
9ac3aec9 103// Track reference related
104 AliTrackReference* AddTrackReference(Int_t label, Int_t id = -999);
fd650020 105 // const TClonesArray* TrackReferences() const {return &fTrackReferences;}
9ac3aec9 106 virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
107 virtual void ResetTrackReferences();
108 virtual void FixParticleDecaytime();
3cac0921 109 private:
7dd2cbe4 110 AliMC(const AliMC&); // Not implemented
111 AliMC& operator= (const AliMC&); // Not implemented
3cac0921 112 void MakeTmpTrackRefsTree();
113 void ReorderAndExpandTreeTR();
114 private:
942a9039 115 void RemapHits();
5d12ce38 116 AliGenerator *fGenerator; // Generator used in the MC
117 TArrayF fEventEnergy; //! Energy deposit for current event
118 TArrayF fSummEnergy; //! Energy per event in each volume
119 TArrayF fSum2Energy; //! Energy squared per event in each volume
120 Float_t fTrRmax; // Maximum radius for tracking
121 Float_t fTrZmax; // Maximu z for tracking
0561efeb 122 Float_t fRDecayMax; // Maximum radius for decay
123 Float_t fRDecayMin; // Minimum radius for decay
124 Int_t fDecayPdg; // PDG code of particle with forced decay length
5d12ce38 125 TArrayI *fImedia; //! Array of correspondence between media and detectors
126 TString fTransParName; // Name of the transport parameters file
5d12ce38 127 TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
3cac0921 128 //Temporary Track Reference tree related
129 TTree *fTmpTreeTR; //! Temporary track reference tree
130 TFile *fTmpFileTR; //! Temporary track reference file
fd650020 131 TClonesArray fTrackReferences; //! List of track references - for one primary track only
132 TClonesArray fTmpTrackReferences; //! Temporary list of track references - for one primary track only
133 ClassDef(AliMC, 4)
5d12ce38 134};
135
136
137#endif