AliRoot Core  3dc7879 (3dc7879)
AliModule.h
Go to the documentation of this file.
1 #ifndef ALIMODULE_H
2 #define ALIMODULE_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 
8 //
9 // This is the basic class for any
10 // ALICE detector module, whether it is
11 // sensitive or not. Detector classes depend
12 // on this.
13 //
14 
15 #include <TNamed.h>
16 #include <TClonesArray.h>
17 
18 #include "AliTriggerDetector.h"
19 
20 class TBrowser;
21 class TArrayI;
22 class TFile;
23 class TTree;
24 class TVirtualMC;
25 class AliLoader;
26 class AliTrackReference;
27 class AliDigitizer;
29 class AliVertexer;
30 class AliTracker;
31 class AliESD;
32 class AliRunLoader;
33 class AliRawReader;
34 
35 
36 class AliModule : public TNamed {
37 public:
38 
39  // Creators - distructors
40  AliModule(const char* name, const char *title);
41  AliModule();
42  virtual ~AliModule();
43 
44  // Inline functions
45  virtual Int_t GetNdigits() const {return 0;}
46  virtual Int_t GetNhits() const {return 0;}
47  virtual TArrayI *GetIdtmed() const {return fIdtmed;}
48  virtual TClonesArray *Digits() const {return 0;}
49  virtual TClonesArray *Hits() const {return 0;}
50  virtual TObjArray *Points() const {return 0;}
51  virtual Int_t GetIshunt() const {return 0;}
52  virtual void SetIshunt(Int_t) {}
53  virtual Bool_t IsActive() const {return fActive;}
54  virtual void SetActive(Bool_t v=kTRUE) {fActive = v;}
55  virtual Bool_t IsFolder() const {return kTRUE;}
56  virtual Int_t& LoMedium() {return fLoMedium;}
57  virtual Int_t& HiMedium() {return fHiMedium;}
58  virtual Bool_t IsModule() const {return kTRUE;}
59  virtual Bool_t IsDetector() const {return kFALSE;}
60 
61  // Module composition
62  virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
63  Float_t z, Float_t dens, Float_t radl,
64  Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
65  virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a,
66  Float_t &z, Float_t &dens, Float_t &radl,
67  Float_t &absl) const;
68  virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
69  Float_t *z, Float_t dens, Int_t nlmat,
70  Float_t *wmat) const;
71  virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
72  Int_t isvol, Int_t ifield, Float_t fieldm,
73  Float_t tmaxfd, Float_t stemax, Float_t deemax,
74  Float_t epsil, Float_t stmin, Float_t *ubuf=0,
75  Int_t nbuf=0) const;
76  void AliMatrix(Int_t &nmat, Double_t theta1, Double_t phi1,
77  Double_t theta2, Double_t phi2, Double_t theta3,
78  Double_t phi3) const;
79 
80  // Virtual methods
81  virtual void BuildGeometry() {};
82  virtual Int_t IsVersion() const =0;
83 
84 
85  // Other methods
86  virtual void AddDigit(Int_t*, Int_t*){
87  Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
88  virtual void AddHit(Int_t, Int_t*, Float_t *) {
89  Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
90  virtual void Hits2SDigits() {}
91  virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* /*manager*/) const
92  {return NULL;}
94  { AliTriggerDetector* det = new AliTriggerDetector(); det->SetName(GetName()); return det;}
95  virtual void SDigits2Digits() {}
96  virtual void Hits2Digits() {}
97  virtual void Digits2Reco() {}
98  virtual void Digits2Raw();
99  virtual void Raw2Digits() {}
100  virtual Bool_t Raw2SDigits(AliRawReader*) {return kFALSE;}
101  virtual void QADataMaker (const char *) {}
102  virtual void Browse(TBrowser *) {} //PH Do we need it?
103  virtual void CreateGeometry() {}
104  virtual void CreateMaterials() {}
105  virtual void DefineOpticalProperties() {}
106  virtual void AddAlignableVolumes() const;
107  virtual void PreTrack(){}
108  virtual void PostTrack(){}
109  virtual void FinishEvent() {}
110  virtual void FinishRun() {}
111  virtual void FinishPrimary() {}
112  virtual void Init() {}
113  virtual void LoadPoints(Int_t ) {}
114  virtual void UpdateInternalGeometry() {}
115 
116 
117 
118  virtual void MakeBranch(Option_t * /*opt =" "*/) {}
119  virtual void MakeTree(Option_t *) {}//skowron
120 
121  virtual AliLoader* MakeLoader(const char* topfoldername);
122  virtual AliLoader* GetLoader() const {return 0x0;} //skowron
123 
124 
125  virtual void Paint(Option_t *) {} //PH Do we need it?
126  virtual void ResetDigits() {}
127  virtual void ResetSDigits() {}
128  virtual void ResetHits() {}
129  virtual void SetTimeGate(Float_t) {}
130  virtual Float_t GetTimeGate() const {return 1.e10;}
131  virtual void StepManager() {}
132  virtual void DisableStepManager() {fEnable = kFALSE;}
133  virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
134  virtual void SetBufferSize(Int_t) {}
135  virtual Float_t ZMin() const;
136  virtual Float_t ZMax() const;
137 // Track reference related
138  virtual AliTrackReference * AddTrackReference(Int_t label, Int_t id = -999);
139  TTree* TreeTR(); //shorcut method for accessing treeTR from folder
140  void SetRunLoader(AliRunLoader* runLoader)
141  {fRunLoader = runLoader;}
142 
143 // Quality Assurance methods
144  virtual void CheckQA() { ; }
146  //
147  static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
148  static Float_t GetDensityFactor() { return fgDensityFactor; }
149 
150  void CacheVMCInstance(TVirtualMC *mc) { fMC = mc; }
151 
152 protected:
153 
154  // Data members
155  TVirtualMC *fMC;
156 
157  TArrayI *fIdtmed;
158  TArrayI *fIdmate;
159  Int_t fLoMedium;
160  Int_t fHiMedium;
161 
162  Bool_t fActive; //Detector activity flag
163  Bool_t fEnable; //StepManager enabling flag
166 
169  static Float_t fgDensityFactor;
170  private:
171  AliModule(const AliModule&);
172  AliModule& operator=(const AliModule&);
173 
174  ClassDef(AliModule, 10) //Base class for ALICE Modules
175 };
176 #endif
virtual void PostTrack()
Definition: AliModule.h:108
virtual Int_t GetIshunt() const
Definition: AliModule.h:51
virtual Int_t GetNdigits() const
Definition: AliModule.h:45
void AliMatrix(Int_t &nmat, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3) const
Definition: AliModule.cxx:331
virtual void UpdateInternalGeometry()
Definition: AliModule.h:114
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=0, Int_t nbuf=0) const
Definition: AliModule.cxx:278
virtual void FinishRun()
Definition: AliModule.h:110
virtual void FinishPrimary()
Definition: AliModule.h:111
Int_t fLoMedium
List of material numbers.
Definition: AliModule.h:159
virtual void Init()
Definition: AliModule.h:112
#define TObjArray
virtual void CheckQA()
Definition: AliModule.h:144
virtual void AliMixture(Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat) const
Definition: AliModule.cxx:228
virtual void Digits2Reco()
Definition: AliModule.h:97
virtual void DefineOpticalProperties()
Definition: AliModule.h:105
virtual void Paint(Option_t *)
Definition: AliModule.h:125
virtual void QADataMaker(const char *)
Definition: AliModule.h:101
virtual ~AliModule()
Definition: AliModule.cxx:130
Int_t fHiMedium
Minimum tracking medium ID for this Module.
Definition: AliModule.h:160
TVirtualMC * fMC
Definition: AliModule.h:155
virtual AliLoader * MakeLoader(const char *topfoldername)
Definition: AliModule.cxx:371
virtual void FinishEvent()
Definition: AliModule.h:109
void CacheVMCInstance(TVirtualMC *mc)
Definition: AliModule.h:150
virtual void CreateGeometry()
Definition: AliModule.h:103
AliDigitizationInput * GetDigitizationInput() const
Definition: AliModule.h:145
virtual void AddHit(Int_t, Int_t *, Float_t *)
Definition: AliModule.h:88
virtual void BuildGeometry()
Definition: AliModule.h:81
AliRunLoader * fRunLoader
for track refernce iterator routines
Definition: AliModule.h:167
virtual void PreTrack()
Definition: AliModule.h:107
virtual void SetIshunt(Int_t)
Definition: AliModule.h:52
static Float_t fgDensityFactor
input for sdigits -> digits
Definition: AliModule.h:169
virtual void Raw2Digits()
Definition: AliModule.h:99
virtual Bool_t IsDetector() const
Definition: AliModule.h:59
AliDigitizationInput * fDigInput
local pointer to run loader
Definition: AliModule.h:168
virtual void AliGetMaterial(Int_t imat, char *name, Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const
Definition: AliModule.cxx:194
virtual void CreateMaterials()
Definition: AliModule.h:104
virtual void SetTimeGate(Float_t)
Definition: AliModule.h:129
Bool_t fEnable
Definition: AliModule.h:163
virtual void ResetSDigits()
Definition: AliModule.h:127
virtual void SetBufferSize(Int_t)
Definition: AliModule.h:134
virtual Bool_t IsModule() const
Definition: AliModule.h:58
virtual void AliMaterial(Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const
Definition: AliModule.cxx:149
void SetRunLoader(AliRunLoader *runLoader)
Definition: AliModule.h:140
static void SetDensityFactor(Float_t density)
Definition: AliModule.h:147
virtual void MakeBranch(Option_t *)
Definition: AliModule.h:118
virtual TObjArray * Points() const
Definition: AliModule.h:50
virtual void Digits2Raw()
Definition: AliModule.cxx:402
virtual Float_t ZMin() const
Definition: AliModule.cxx:350
virtual void Hits2SDigits()
Definition: AliModule.h:90
virtual Int_t & HiMedium()
Definition: AliModule.h:57
virtual TClonesArray * Digits() const
Definition: AliModule.h:48
virtual Int_t GetNhits() const
Definition: AliModule.h:46
virtual void Browse(TBrowser *)
Definition: AliModule.h:102
virtual TArrayI * GetIdtmed() const
Definition: AliModule.h:47
virtual void ResetHits()
Definition: AliModule.h:128
virtual TClonesArray * Hits() const
Definition: AliModule.h:49
virtual void MakeTree(Option_t *)
Definition: AliModule.h:119
Bool_t fActive
Maximum tracking medium ID for this Module.
Definition: AliModule.h:162
virtual Float_t ZMax() const
Definition: AliModule.cxx:356
static Float_t GetDensityFactor()
Definition: AliModule.h:148
TArrayI * fIdtmed
cached MC instance (to avoid calls to thread_local gMC=TVirtualMC::GetMC())
Definition: AliModule.h:157
virtual AliTrackReference * AddTrackReference(Int_t label, Int_t id=-999)
Definition: AliModule.cxx:378
Int_t fCurrentIterTrackRef
for track refernce iterator routines
Definition: AliModule.h:165
virtual void LoadPoints(Int_t)
Definition: AliModule.h:113
virtual void DisableStepManager()
Definition: AliModule.h:132
TArrayI * fIdmate
List of tracking medium numbers.
Definition: AliModule.h:158
virtual AliLoader * GetLoader() const
Definition: AliModule.h:122
Int_t fMaxIterTrackRef
Definition: AliModule.h:164
virtual void AddDigit(Int_t *, Int_t *)
Definition: AliModule.h:86
virtual void AddAlignableVolumes() const
Definition: AliModule.cxx:362
virtual Float_t GetTimeGate() const
Definition: AliModule.h:130
virtual Int_t IsVersion() const =0
virtual AliDigitizer * CreateDigitizer(AliDigitizationInput *) const
Definition: AliModule.h:91
virtual Int_t & LoMedium()
Definition: AliModule.h:56
virtual Bool_t Raw2SDigits(AliRawReader *)
Definition: AliModule.h:100
virtual void SDigits2Digits()
Definition: AliModule.h:95
virtual Bool_t IsFolder() const
Definition: AliModule.h:55
virtual void ResetDigits()
Definition: AliModule.h:126
virtual void Hits2Digits()
Definition: AliModule.h:96
virtual Bool_t IsActive() const
Definition: AliModule.h:53
virtual AliTriggerDetector * CreateTriggerDetector() const
Definition: AliModule.h:93
virtual void StepManager()
Definition: AliModule.h:131
AliModule & operator=(const AliModule &)
Definition: AliESD.h:40
virtual Bool_t StepManagerIsEnabled() const
Definition: AliModule.h:133
virtual void SetActive(Bool_t v=kTRUE)
Definition: AliModule.h:54
TTree * TreeTR()
Definition: AliModule.cxx:385