Bugfixes and clean-up of alignment object classes. Introduction of so called symbolic...
[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"
a5a091ce 21#include "AliTriggerDetector.h"
94de3818 22
94de3818 23class TClonesArray;
24class TBrowser;
25class TArrayI;
2ab0c725 26class TFile;
88cb7938 27class TTree;
28class AliLoader;
2cad796f 29class AliTrackReference;
85a5290f 30class AliDigitizer;
31class AliRunDigitizer;
2257f27e 32class AliVertexer;
6d7874d8 33class AliTracker;
34class AliESD;
35class AliRunLoader;
b99d1564 36class AliRawReader;
8494b010 37
88cb7938 38
65fb704d 39class AliModule : public TNamed , public TAttLine, public TAttMarker,
40 public AliRndm {
8494b010 41public:
42
43 // Creators - distructors
44 AliModule(const char* name, const char *title);
45 AliModule();
aee8290b 46 AliModule(const AliModule &mod);
8494b010 47 virtual ~AliModule();
48
49 // Inline functions
94de3818 50 virtual int GetNdigits() const {return 0;}
51 virtual int GetNhits() const {return 0;}
02ca2762 52 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
53 virtual TList *Histograms() const {return fHistograms;}
54 virtual TList *Nodes() const {return fNodes;}
94de3818 55 virtual TClonesArray *Digits() const {return 0;}
56 virtual TClonesArray *Hits() const {return 0;}
57 virtual TObjArray *Points() const {return 0;}
58 virtual Int_t GetIshunt() const {return 0;}
7103de83 59 virtual void SetIshunt(Int_t) {}
02ca2762 60 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 61 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 62 virtual Int_t& LoMedium() {return fLoMedium;}
63 virtual Int_t& HiMedium() {return fHiMedium;}
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;}
a5a091ce 97 virtual AliTriggerDetector* CreateTriggerDetector() const
98 { AliTriggerDetector* det = new AliTriggerDetector(); det->SetName(GetName()); return det;}
2ab0c725 99 virtual void SDigits2Digits() {}
85a5290f 100 virtual void Hits2Digits() {}
fe961a91 101 virtual void Digits2Reco() {}
0421c3d1 102 virtual void Digits2Raw();
b99d1564 103 virtual void Raw2Digits() {}
104 virtual Bool_t Raw2SDigits(AliRawReader*) {return kFALSE;}
7103de83 105 virtual void Browse(TBrowser *) {}
8494b010 106 virtual void CreateGeometry() {}
107 virtual void CreateMaterials() {}
b760c02e 108 virtual void AddAlignableVolumes() const {}
8494b010 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 ) {}
ef7ff1f9 118 virtual void UpdateInternalGeometry() {}
88cb7938 119
120
121
9b62c596 122 virtual void MakeBranch(Option_t * /*opt =" "*/) {}
88cb7938 123 virtual void MakeTree(Option_t *) {}//skowron
124
df75403f 125 virtual AliLoader* MakeLoader(const char* topfoldername);
88cb7938 126 virtual AliLoader* GetLoader() const {return 0x0;} //skowron
127
128
8494b010 129 virtual void Paint(Option_t *) {}
130 virtual void ResetDigits() {}
2ab0c725 131 virtual void ResetSDigits() {}
8494b010 132 virtual void ResetHits() {}
133 virtual void ResetPoints() {}
2cad796f 134 virtual void SetTreeAddress();
8494b010 135 virtual void SetTimeGate(Float_t) {}
94de3818 136 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 137 virtual void StepManager() {}
3f754d83 138 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 139 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 140 virtual void SetBufferSize(Int_t) {}
65fb704d 141 virtual Float_t ZMin() const;
142 virtual Float_t ZMax() const;
aee8290b 143 virtual void SetEuclidFile(char *material,char *geometry=0);
88cb7938 144 virtual void ReadEuclid(const char *filnam, char *topvol);
145 virtual void ReadEuclidMedia(const char *filnam);
2cad796f 146// Track reference related
147 TClonesArray *TrackReferences() const {return fTrackReferences;}
148 virtual void RemapTrackHitIDs(Int_t *) {}
149 virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
150 virtual void ResetTrackReferences();
3142ebc3 151 virtual AliTrackReference * AddTrackReference(Int_t label);
2cad796f 152 virtual AliTrackReference * FirstTrackReference(Int_t track);
153 virtual AliTrackReference * NextTrackReference();
88cb7938 154 virtual void MakeBranchTR(Option_t *opt=" ");
155 TTree* TreeTR(); //shorcut method for accessing treeTR from folder
6d7874d8 156
157 void SetRunLoader(AliRunLoader* runLoader)
158 {fRunLoader = runLoader;}
2cad796f 159
160//
e2afb3b6 161 AliModule& operator=(const AliModule &mod)
162 {mod.Copy(*this); return (*this);}
8494b010 163
aee8290b 164protected:
6c4904c2 165 void Copy(TObject &mod) const;
e2afb3b6 166
aee8290b 167 // Data members
168
2ab0c725 169 TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
170 TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
aee8290b 171
2ab0c725 172 TArrayI *fIdtmed; //!List of tracking medium numbers
173 TArrayI *fIdmate; //!List of material numbers
174 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
175 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 176
177 Bool_t fActive; //Detector activity flag
178 TList *fHistograms; //List of histograms
179 TList *fNodes; //List of geometry nodes
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
4951e003 187 ClassDef(AliModule,7) //Base class for ALICE Modules
8494b010 188};
189#endif