Reverting...
[u/mrichter/AliRoot.git] / STEER / AliModule.h
CommitLineData
aee8290b 1#ifndef ALIMODULE_H
2#define ALIMODULE_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
1bb2a43c 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//
e2afb3b6 14
1bb2a43c 15#include <Riostream.h>
16#include <TAttLine.h>
17#include <TAttMarker.h>
18#include <TNamed.h>
e2afb3b6 19
65fb704d 20#include "AliRndm.h"
94de3818 21
94de3818 22class TClonesArray;
23class TBrowser;
24class TArrayI;
2ab0c725 25class TFile;
88cb7938 26class TTree;
27class AliLoader;
2cad796f 28class AliTrackReference;
85a5290f 29class AliDigitizer;
30class AliRunDigitizer;
2257f27e 31class AliVertexer;
6d7874d8 32class AliTracker;
33class AliESD;
34class AliRunLoader;
8494b010 35
88cb7938 36
65fb704d 37class AliModule : public TNamed , public TAttLine, public TAttMarker,
38 public AliRndm {
8494b010 39public:
40
41 // Creators - distructors
42 AliModule(const char* name, const char *title);
43 AliModule();
aee8290b 44 AliModule(const AliModule &mod);
8494b010 45 virtual ~AliModule();
46
47 // Inline functions
94de3818 48 virtual int GetNdigits() const {return 0;}
49 virtual int GetNhits() const {return 0;}
02ca2762 50 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
51 virtual TList *Histograms() const {return fHistograms;}
52 virtual TList *Nodes() const {return fNodes;}
94de3818 53 virtual TClonesArray *Digits() const {return 0;}
54 virtual TClonesArray *Hits() const {return 0;}
55 virtual TObjArray *Points() const {return 0;}
56 virtual Int_t GetIshunt() const {return 0;}
7103de83 57 virtual void SetIshunt(Int_t) {}
02ca2762 58 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 59 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 60 virtual Int_t& LoMedium() {return fLoMedium;}
61 virtual Int_t& HiMedium() {return fHiMedium;}
65fb704d 62 virtual Int_t GetDebug() const {return fDebug;}
63 virtual void SetDebug(Int_t deb=0) {fDebug=deb;}
8494b010 64
65 // Module composition
aee8290b 66 virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
67 Float_t z, Float_t dens, Float_t radl,
68 Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
69 virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a,
88cb7938 70 Float_t &z, Float_t &dens, Float_t &radl,
71 Float_t &absl) const;
aee8290b 72 virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
88cb7938 73 Float_t *z, Float_t dens, Int_t nlmat,
74 Float_t *wmat) const;
aee8290b 75 virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
88cb7938 76 Int_t isvol, Int_t ifield, Float_t fieldm,
77 Float_t tmaxfd, Float_t stemax, Float_t deemax,
78 Float_t epsil, Float_t stmin, Float_t *ubuf=0,
79 Int_t nbuf=0) const;
aee8290b 80 virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
88cb7938 81 Float_t theta2, Float_t phi2, Float_t theta3,
82 Float_t phi3) const;
8494b010 83
84 // Virtual methods
85 virtual void BuildGeometry() {};
86 virtual Int_t IsVersion() const =0;
88cb7938 87
88
8494b010 89 // Other methods
dda5e866 90 virtual void AddDigit(Int_t*, Int_t*){
91 Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
92 virtual void AddHit(Int_t, Int_t*, Float_t *) {
93 Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
2ab0c725 94 virtual void Hits2SDigits() {}
c92eb8ad 95 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* /*manager*/) const
85a5290f 96 {return NULL;}
2ab0c725 97 virtual void SDigits2Digits() {}
85a5290f 98 virtual void Hits2Digits() {}
fe961a91 99 virtual void Digits2Reco() {}
596a855f 100 virtual void Reconstruct() const {}
2257f27e 101 virtual AliVertexer* CreateVertexer() const {return NULL;}
596a855f 102 virtual AliTracker* CreateTracker() const {return NULL;}
103 virtual void FillESD(AliESD* /*esd*/) const {}
0421c3d1 104 virtual void Digits2Raw();
2ab0c725 105 virtual void Raw2Digits() {}
7103de83 106 virtual void Browse(TBrowser *) {}
8494b010 107 virtual void CreateGeometry() {}
108 virtual void CreateMaterials() {}
109 virtual void Disable();
8494b010 110 virtual void Enable();
7103de83 111 virtual void PreTrack(){}
112 virtual void PostTrack(){}
113 virtual void FinishEvent() {}
8494b010 114 virtual void FinishRun() {}
24de2263 115 virtual void FinishPrimary() {}
8494b010 116 virtual void Init() {}
117 virtual void LoadPoints(Int_t ) {}
88cb7938 118
119
120
9b62c596 121 virtual void MakeBranch(Option_t * /*opt =" "*/) {}
88cb7938 122 virtual void MakeTree(Option_t *) {}//skowron
123
df75403f 124 virtual AliLoader* MakeLoader(const char* topfoldername);
88cb7938 125 virtual AliLoader* GetLoader() const {return 0x0;} //skowron
126
127
8494b010 128 virtual void Paint(Option_t *) {}
129 virtual void ResetDigits() {}
2ab0c725 130 virtual void ResetSDigits() {}
8494b010 131 virtual void ResetHits() {}
132 virtual void ResetPoints() {}
2cad796f 133 virtual void SetTreeAddress();
8494b010 134 virtual void SetTimeGate(Float_t) {}
94de3818 135 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 136 virtual void StepManager() {}
3f754d83 137 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 138 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 139 virtual void SetBufferSize(Int_t) {}
65fb704d 140 virtual Float_t ZMin() const;
141 virtual Float_t ZMax() const;
aee8290b 142 virtual void SetEuclidFile(char *material,char *geometry=0);
88cb7938 143 virtual void ReadEuclid(const char *filnam, char *topvol);
144 virtual void ReadEuclidMedia(const char *filnam);
2cad796f 145// Track reference related
146 TClonesArray *TrackReferences() const {return fTrackReferences;}
147 virtual void RemapTrackHitIDs(Int_t *) {}
148 virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
149 virtual void ResetTrackReferences();
88cb7938 150 virtual void AddTrackReference(Int_t label);
2cad796f 151 virtual AliTrackReference * FirstTrackReference(Int_t track);
152 virtual AliTrackReference * NextTrackReference();
88cb7938 153 virtual void MakeBranchTR(Option_t *opt=" ");
154 TTree* TreeTR(); //shorcut method for accessing treeTR from folder
6d7874d8 155
156 void SetRunLoader(AliRunLoader* runLoader)
157 {fRunLoader = runLoader;}
2cad796f 158
159//
e2afb3b6 160 AliModule& operator=(const AliModule &mod)
161 {mod.Copy(*this); return (*this);}
8494b010 162
aee8290b 163protected:
6c4904c2 164 void Copy(TObject &mod) const;
e2afb3b6 165
aee8290b 166 // Data members
167
2ab0c725 168 TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
169 TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
aee8290b 170
2ab0c725 171 TArrayI *fIdtmed; //!List of tracking medium numbers
172 TArrayI *fIdmate; //!List of material numbers
173 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
174 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 175
176 Bool_t fActive; //Detector activity flag
177 TList *fHistograms; //List of histograms
178 TList *fNodes; //List of geometry nodes
65fb704d 179 Int_t fDebug; //Debug flag
3f754d83 180 Bool_t fEnable; //StepManager enabling flag
2388c363 181 TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
2cad796f 182 Int_t fMaxIterTrackRef; //!for track refernce iterator routines
183 Int_t fCurrentIterTrackRef; //!for track refernce iterator routines
6d7874d8 184
185 AliRunLoader* fRunLoader; //!local pointer to run loader
186
187 ClassDef(AliModule,6) //Base class for ALICE Modules
8494b010 188};
189#endif