Adding detector ID to the track references
[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;
8494b010 36
88cb7938 37
65fb704d 38class AliModule : public TNamed , public TAttLine, public TAttMarker,
39 public AliRndm {
8494b010 40public:
41
42 // Creators - distructors
43 AliModule(const char* name, const char *title);
44 AliModule();
aee8290b 45 AliModule(const AliModule &mod);
8494b010 46 virtual ~AliModule();
47
48 // Inline functions
94de3818 49 virtual int GetNdigits() const {return 0;}
50 virtual int GetNhits() const {return 0;}
02ca2762 51 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
52 virtual TList *Histograms() const {return fHistograms;}
53 virtual TList *Nodes() const {return fNodes;}
94de3818 54 virtual TClonesArray *Digits() const {return 0;}
55 virtual TClonesArray *Hits() const {return 0;}
56 virtual TObjArray *Points() const {return 0;}
57 virtual Int_t GetIshunt() const {return 0;}
7103de83 58 virtual void SetIshunt(Int_t) {}
02ca2762 59 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 60 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 61 virtual Int_t& LoMedium() {return fLoMedium;}
62 virtual Int_t& HiMedium() {return fHiMedium;}
8494b010 63
64 // Module composition
aee8290b 65 virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
66 Float_t z, Float_t dens, Float_t radl,
67 Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
68 virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a,
88cb7938 69 Float_t &z, Float_t &dens, Float_t &radl,
70 Float_t &absl) const;
aee8290b 71 virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
88cb7938 72 Float_t *z, Float_t dens, Int_t nlmat,
73 Float_t *wmat) const;
aee8290b 74 virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
88cb7938 75 Int_t isvol, Int_t ifield, Float_t fieldm,
76 Float_t tmaxfd, Float_t stemax, Float_t deemax,
77 Float_t epsil, Float_t stmin, Float_t *ubuf=0,
78 Int_t nbuf=0) const;
aee8290b 79 virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
88cb7938 80 Float_t theta2, Float_t phi2, Float_t theta3,
81 Float_t phi3) const;
8494b010 82
83 // Virtual methods
84 virtual void BuildGeometry() {};
85 virtual Int_t IsVersion() const =0;
88cb7938 86
87
8494b010 88 // Other methods
dda5e866 89 virtual void AddDigit(Int_t*, Int_t*){
90 Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
91 virtual void AddHit(Int_t, Int_t*, Float_t *) {
92 Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
2ab0c725 93 virtual void Hits2SDigits() {}
c92eb8ad 94 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* /*manager*/) const
85a5290f 95 {return NULL;}
a5a091ce 96 virtual AliTriggerDetector* CreateTriggerDetector() const
97 { AliTriggerDetector* det = new AliTriggerDetector(); det->SetName(GetName()); return det;}
2ab0c725 98 virtual void SDigits2Digits() {}
85a5290f 99 virtual void Hits2Digits() {}
fe961a91 100 virtual void Digits2Reco() {}
0421c3d1 101 virtual void Digits2Raw();
2ab0c725 102 virtual void Raw2Digits() {}
7103de83 103 virtual void Browse(TBrowser *) {}
8494b010 104 virtual void CreateGeometry() {}
105 virtual void CreateMaterials() {}
106 virtual void Disable();
8494b010 107 virtual void Enable();
7103de83 108 virtual void PreTrack(){}
109 virtual void PostTrack(){}
110 virtual void FinishEvent() {}
8494b010 111 virtual void FinishRun() {}
24de2263 112 virtual void FinishPrimary() {}
8494b010 113 virtual void Init() {}
114 virtual void LoadPoints(Int_t ) {}
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
8494b010 125 virtual void Paint(Option_t *) {}
126 virtual void ResetDigits() {}
2ab0c725 127 virtual void ResetSDigits() {}
8494b010 128 virtual void ResetHits() {}
129 virtual void ResetPoints() {}
2cad796f 130 virtual void SetTreeAddress();
8494b010 131 virtual void SetTimeGate(Float_t) {}
94de3818 132 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 133 virtual void StepManager() {}
3f754d83 134 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 135 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 136 virtual void SetBufferSize(Int_t) {}
65fb704d 137 virtual Float_t ZMin() const;
138 virtual Float_t ZMax() const;
aee8290b 139 virtual void SetEuclidFile(char *material,char *geometry=0);
88cb7938 140 virtual void ReadEuclid(const char *filnam, char *topvol);
141 virtual void ReadEuclidMedia(const char *filnam);
2cad796f 142// Track reference related
143 TClonesArray *TrackReferences() const {return fTrackReferences;}
144 virtual void RemapTrackHitIDs(Int_t *) {}
145 virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
146 virtual void ResetTrackReferences();
3142ebc3 147 virtual AliTrackReference * AddTrackReference(Int_t label);
2cad796f 148 virtual AliTrackReference * FirstTrackReference(Int_t track);
149 virtual AliTrackReference * NextTrackReference();
88cb7938 150 virtual void MakeBranchTR(Option_t *opt=" ");
151 TTree* TreeTR(); //shorcut method for accessing treeTR from folder
6d7874d8 152
153 void SetRunLoader(AliRunLoader* runLoader)
154 {fRunLoader = runLoader;}
2cad796f 155
156//
e2afb3b6 157 AliModule& operator=(const AliModule &mod)
158 {mod.Copy(*this); return (*this);}
8494b010 159
aee8290b 160protected:
6c4904c2 161 void Copy(TObject &mod) const;
e2afb3b6 162
aee8290b 163 // Data members
164
2ab0c725 165 TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
166 TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
aee8290b 167
2ab0c725 168 TArrayI *fIdtmed; //!List of tracking medium numbers
169 TArrayI *fIdmate; //!List of material numbers
170 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
171 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 172
173 Bool_t fActive; //Detector activity flag
174 TList *fHistograms; //List of histograms
175 TList *fNodes; //List of geometry nodes
3f754d83 176 Bool_t fEnable; //StepManager enabling flag
2388c363 177 TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
2cad796f 178 Int_t fMaxIterTrackRef; //!for track refernce iterator routines
179 Int_t fCurrentIterTrackRef; //!for track refernce iterator routines
6d7874d8 180
181 AliRunLoader* fRunLoader; //!local pointer to run loader
182
4951e003 183 ClassDef(AliModule,7) //Base class for ALICE Modules
8494b010 184};
185#endif