Update master to aliroot
[u/mrichter/AliRoot.git] / STEER / 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>
1bb2a43c 16#include <TNamed.h>
6c780877 17#include <TClonesArray.h>
e2afb3b6 18
421ab0fb 19#include "AliLog.h"
a5a091ce 20#include "AliTriggerDetector.h"
94de3818 21
94de3818 22class TBrowser;
23class TArrayI;
2ab0c725 24class TFile;
88cb7938 25class TTree;
26class AliLoader;
2cad796f 27class AliTrackReference;
85a5290f 28class AliDigitizer;
f21fc003 29class AliDigitizationInput;
2257f27e 30class AliVertexer;
6d7874d8 31class AliTracker;
32class AliESD;
33class AliRunLoader;
b99d1564 34class AliRawReader;
8494b010 35
88cb7938 36
e939a978 37class AliModule : public TNamed {
8494b010 38public:
39
40 // Creators - distructors
41 AliModule(const char* name, const char *title);
42 AliModule();
43 virtual ~AliModule();
44
45 // Inline functions
6c780877 46 virtual Int_t GetNdigits() const {return 0;}
47 virtual Int_t GetNhits() const {return 0;}
02ca2762 48 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
94de3818 49 virtual TClonesArray *Digits() const {return 0;}
50 virtual TClonesArray *Hits() const {return 0;}
51 virtual TObjArray *Points() const {return 0;}
52 virtual Int_t GetIshunt() const {return 0;}
7103de83 53 virtual void SetIshunt(Int_t) {}
02ca2762 54 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 55 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 56 virtual Int_t& LoMedium() {return fLoMedium;}
57 virtual Int_t& HiMedium() {return fHiMedium;}
7dd2cbe4 58 virtual Bool_t IsModule() const {return kTRUE;}
59 virtual Bool_t IsDetector() const {return kFALSE;}
8494b010 60
61 // Module composition
aee8290b 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,
88cb7938 66 Float_t &z, Float_t &dens, Float_t &radl,
67 Float_t &absl) const;
aee8290b 68 virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
88cb7938 69 Float_t *z, Float_t dens, Int_t nlmat,
70 Float_t *wmat) const;
aee8290b 71 virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
88cb7938 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;
aee8290b 76 virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
88cb7938 77 Float_t theta2, Float_t phi2, Float_t theta3,
78 Float_t phi3) const;
8494b010 79
80 // Virtual methods
81 virtual void BuildGeometry() {};
82 virtual Int_t IsVersion() const =0;
88cb7938 83
84
8494b010 85 // Other methods
dda5e866 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());}
2ab0c725 90 virtual void Hits2SDigits() {}
f21fc003 91 virtual AliDigitizer* CreateDigitizer(AliDigitizationInput* /*manager*/) const
85a5290f 92 {return NULL;}
a5a091ce 93 virtual AliTriggerDetector* CreateTriggerDetector() const
94 { AliTriggerDetector* det = new AliTriggerDetector(); det->SetName(GetName()); return det;}
2ab0c725 95 virtual void SDigits2Digits() {}
85a5290f 96 virtual void Hits2Digits() {}
fe961a91 97 virtual void Digits2Reco() {}
0421c3d1 98 virtual void Digits2Raw();
b99d1564 99 virtual void Raw2Digits() {}
100 virtual Bool_t Raw2SDigits(AliRawReader*) {return kFALSE;}
2e42b4d4 101 virtual void QADataMaker (const char *) {}
e939a978 102 virtual void Browse(TBrowser *) {} //PH Do we need it?
8494b010 103 virtual void CreateGeometry() {}
104 virtual void CreateMaterials() {}
661663fa 105 virtual void DefineOpticalProperties() {}
4787b401 106 virtual void AddAlignableVolumes() const;
7103de83 107 virtual void PreTrack(){}
108 virtual void PostTrack(){}
109 virtual void FinishEvent() {}
8494b010 110 virtual void FinishRun() {}
24de2263 111 virtual void FinishPrimary() {}
8494b010 112 virtual void Init() {}
113 virtual void LoadPoints(Int_t ) {}
ef7ff1f9 114 virtual void UpdateInternalGeometry() {}
88cb7938 115
116
117
9b62c596 118 virtual void MakeBranch(Option_t * /*opt =" "*/) {}
88cb7938 119 virtual void MakeTree(Option_t *) {}//skowron
120
df75403f 121 virtual AliLoader* MakeLoader(const char* topfoldername);
88cb7938 122 virtual AliLoader* GetLoader() const {return 0x0;} //skowron
123
124
e939a978 125 virtual void Paint(Option_t *) {} //PH Do we need it?
8494b010 126 virtual void ResetDigits() {}
2ab0c725 127 virtual void ResetSDigits() {}
8494b010 128 virtual void ResetHits() {}
8494b010 129 virtual void SetTimeGate(Float_t) {}
94de3818 130 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 131 virtual void StepManager() {}
3f754d83 132 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 133 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 134 virtual void SetBufferSize(Int_t) {}
65fb704d 135 virtual Float_t ZMin() const;
136 virtual Float_t ZMax() const;
2cad796f 137// Track reference related
9ac3aec9 138 virtual AliTrackReference * AddTrackReference(Int_t label, Int_t id = -999);
88cb7938 139 TTree* TreeTR(); //shorcut method for accessing treeTR from folder
6d7874d8 140 void SetRunLoader(AliRunLoader* runLoader)
141 {fRunLoader = runLoader;}
2cad796f 142
421ab0fb 143// Quality Assurance methods
144 virtual void CheckQA() { ; }
f21fc003 145 AliDigitizationInput* GetDigitizationInput() const {return fDigInput;}
146 //
00ee7999 147 static void SetDensityFactor(Float_t density) { fgDensityFactor = density; }
148 static Float_t GetDensityFactor() { return fgDensityFactor; }
149
aee8290b 150protected:
e2afb3b6 151
aee8290b 152 // Data members
153
2ab0c725 154 TArrayI *fIdtmed; //!List of tracking medium numbers
155 TArrayI *fIdmate; //!List of material numbers
156 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
157 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 158
159 Bool_t fActive; //Detector activity flag
3f754d83 160 Bool_t fEnable; //StepManager enabling flag
2cad796f 161 Int_t fMaxIterTrackRef; //!for track refernce iterator routines
162 Int_t fCurrentIterTrackRef; //!for track refernce iterator routines
6d7874d8 163
164 AliRunLoader* fRunLoader; //!local pointer to run loader
f21fc003 165 AliDigitizationInput* fDigInput; //! input for sdigits -> digits
00ee7999 166 static Float_t fgDensityFactor; //! factor that is multiplied to all material densities (ONLY for systematic studies)
e939a978 167 private:
7dd2cbe4 168 AliModule(const AliModule&);
169 AliModule& operator=(const AliModule&);
e939a978 170
f21fc003 171 ClassDef(AliModule, 10) //Base class for ALICE Modules
8494b010 172};
173#endif