3bd79107 |
1 | #ifndef ALIITS_H |
2 | #define ALIITS_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 | |
58005f18 |
8 | //////////////////////////////////////////////////////////////////////// |
3bd79107 |
9 | // Manager class for set: ITS // |
58005f18 |
10 | //////////////////////////////////////////////////////////////////////// |
fe4da5cc |
11 | |
143d1056 |
12 | #include <TObjArray.h> // used in inline function GetModule. |
cd77595e |
13 | #include <TBranch.h> // used in inline function SetHitsAddressBranch |
3bd79107 |
14 | |
9ad8b5dd |
15 | #include "AliRun.h" |
fe4da5cc |
16 | #include "AliDetector.h" |
de82972f |
17 | |
d5da1ecf |
18 | class TString; |
19 | class TTree; |
55b5a0b3 |
20 | class TFile; |
fe4da5cc |
21 | |
e8189707 |
22 | class AliITSDetType; |
3bd79107 |
23 | class AliITSsimulation; |
24 | class AliITSClusterFinder; |
de82972f |
25 | class AliITSsegmentation; |
26 | class AliITSresponse; |
27 | class AliITShit; |
28 | class AliITSgeom; |
2aea926d |
29 | class AliITSpListItem; |
de82972f |
30 | class AliITSdigit; |
31 | class AliITSRecPoint; |
32 | class AliITSRawCluster; |
33 | class AliITSmodule; |
27a043b1 |
34 | |
a8a6107b |
35 | const Int_t kNTYPES=3; |
de82972f |
36 | |
3bd79107 |
37 | class AliITS : public AliDetector { |
58005f18 |
38 | |
2aea926d |
39 | public: |
40 | //================= Standard Classes =============================== |
41 | AliITS(); // Default creator. |
42 | AliITS(const char *name, const char *title); // standard Creator |
43 | virtual ~AliITS(); // destructor |
44 | AliITS(AliITS &source); // copy constructor. Not to be used! |
45 | AliITS& operator=(AliITS &source); // = operator. Not to be used! |
46 | virtual Int_t IsVersion() const {return 1;} |
47 | virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); |
48 | |
49 | //===================== Simulation Geometry ======================== |
e8189707 |
50 | // get geometry version - detailed (major) or coarse (minor) |
2aea926d |
51 | virtual Int_t GetMajorVersion(){return -1;} |
52 | virtual Int_t GetMinorVersion(){return -1;} |
53 | virtual void GetGeometryVersion(Int_t &a,Int_t &b) |
54 | {a = GetMajorVersion();b=GetMinorVersion();return;} |
55 | virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;} |
56 | //-------------------- Geometry Transformations -------------------- |
57 | // ITS geometry functions |
58 | AliITSgeom *GetITSgeom() const {return fITSgeom;} |
f91c3e58 |
59 | // Sets ITS geometry ! be very careful using this function. |
60 | void SetITSgeom(AliITSgeom *geom) {fITSgeom = geom;} |
2aea926d |
61 | // return pointer to the array of modules |
62 | TObjArray *GetModules() const {return fITSmodules;} |
63 | // return pointer to a particular module |
64 | AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *) |
65 | (fITSmodules->At(index));} |
3bd79107 |
66 | |
2aea926d |
67 | //================ Nessesary general Classes ======================= |
68 | virtual void Init(); |
69 | virtual void SetDefaults(); |
70 | virtual void SetDefaultSimulation(); |
71 | virtual void SetDefaultClusterFinders(); |
72 | virtual void MakeBranch(Option_t *opt=" ", const char *file=0); |
73 | virtual void SetTreeAddress(); |
cd77595e |
74 | // For a give branch from the treeH sets the TClonesArray address. |
9ad8b5dd |
75 | virtual void SetHitsAddressBranch(TBranch *b){b->SetAddress(&fHits);} |
2aea926d |
76 | // Return pointer to DetType #id |
77 | AliITSDetType *DetType(Int_t id); |
78 | //Int_t NDetTypes() {return fNDetTypes;} |
79 | //---------- Configuration Methods (per detector type) ------------- |
7d8046e8 |
80 | // Determines which ITS subdetectors will be processed. Effects |
81 | // digitization, and Reconstruction only. |
82 | void SetDetectors(Option_t *opt="All"){fOpt = opt;} |
83 | // Returns the list of ITS subdetectors that will be processed. |
84 | Option_t* GetDetectors(){return fOpt;} |
3bd79107 |
85 | // Set response |
2aea926d |
86 | virtual void SetResponseModel(Int_t id, AliITSresponse *response); |
3bd79107 |
87 | // Set segmentation |
2aea926d |
88 | virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg); |
3bd79107 |
89 | // Set simulation - temporary |
2aea926d |
90 | virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim); |
3bd79107 |
91 | // Set reconstruction |
2aea926d |
92 | virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec); |
3bd79107 |
93 | // Set class names for digit and rec point |
2aea926d |
94 | virtual void SetClasses(Int_t id, const char *digit, const char *cluster); |
95 | |
96 | //=================== Hits ========================================= |
97 | virtual void StepManager() {} // See Step Manager for specific geometry. |
98 | virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits); |
99 | //------------ sort hits by module for Digitisation ---------------- |
100 | virtual void InitModules(Int_t size,Int_t &nmodules); |
101 | virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules, |
102 | Option_t *opt,Text_t *filename); |
103 | virtual void ClearModules(); |
104 | |
105 | //===================== Digitisation =============================== |
106 | void MakeBranchS(const char *file); |
107 | void SetTreeAddressS(TTree *treeS); |
f91c3e58 |
108 | TClonesArray * GetSDigits() { return fSDigits; } |
9ad8b5dd |
109 | void MakeBranchInTreeD(TTree *treeD,const char *file=0); |
110 | void MakeBranchD(const char *file){ |
111 | MakeBranchInTreeD(gAlice->TreeD(),file);} |
2aea926d |
112 | void SetTreeAddressD(TTree *treeD); |
113 | void Hits2SDigits(); // Turn hits into SDigits |
114 | void Hits2PreDigits(); // Turn hits into SDigits |
115 | void SDigits2Digits(); // Turn SDigits to Digits |
116 | void Hits2Digits(); // Turn hits straight into Digits. |
117 | //------------------ Internal functions ---------------------------- |
118 | // Standard Hits To SDigits function |
119 | void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size, |
120 | Option_t *add, Option_t *det, Text_t *filename); |
121 | // Standard Hits To SDigits function |
122 | void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size, |
123 | Option_t *add, Option_t *det, Text_t *filename); |
124 | // Standard Hits To Digits function |
125 | void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, |
126 | Option_t *add, Option_t *det, Text_t *filename); |
127 | void ResetSDigits(); // Resets the Summable digits. |
128 | void ResetDigits(); // depending on how the |
129 | void ResetDigits(Int_t branch); // tree will be filled only |
130 | void AddSumDigit(AliITSpListItem &sdig); |
131 | void AddRealDigit(Int_t branch, Int_t *digits); |
132 | void AddSimDigit(Int_t branch, AliITSdigit *d); |
133 | void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits, |
134 | Int_t* tracks,Int_t *hits,Float_t* trkcharges); |
135 | // Return pointers to digits |
136 | TObjArray *Dtype() {return fDtype;} |
137 | Int_t *Ndtype() {return fNdtype;} |
138 | TClonesArray *DigitsAddress(Int_t id) |
139 | {return ((TClonesArray *) (*fDtype)[id]);} |
3bd79107 |
140 | |
2aea926d |
141 | //===================== Raw Data IO ================================ |
142 | // Write digits into raw data format |
143 | virtual void Digits2RawData() {} |
144 | // Decode raw data and store digits |
145 | virtual void RawData2Digits() {} |
58005f18 |
146 | |
2aea926d |
147 | //==================== Clusterization ============================== |
148 | // create separate tree for clusters - declustering refining |
149 | void MakeTreeC(Option_t *option="C"); |
150 | void GetTreeC(Int_t event); |
151 | void AddCluster(Int_t branch, AliITSRawCluster *c); |
152 | void ResetClusters(); // one of the methods in |
153 | void ResetClusters(Int_t branch); // the pair will be kept |
154 | // Return pointer to the tree of clusters |
155 | TTree *TreeC() {return fTreeC;} |
3bd79107 |
156 | // Return pointers to clusters |
2aea926d |
157 | TObjArray *Ctype() {return fCtype;} |
158 | Int_t *Nctype() {return fNctype;} |
159 | TClonesArray *ClustersAddress(Int_t id) |
3bd79107 |
160 | {return ((TClonesArray *) (*fCtype)[id]);} |
161 | |
2aea926d |
162 | //=================== Reconstruction =============================== |
163 | void MakeBranchR(const char *file); |
164 | void SetTreeAddressR(TTree *treeR); |
165 | void AddRecPoint(const AliITSRecPoint &p); |
166 | void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size, |
167 | Option_t *add, Option_t *det, Text_t *filename); |
168 | void Digits2Reco(); |
169 | void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det); |
170 | void ResetRecPoints(); |
3bd79107 |
171 | // Return pointer to rec points |
172 | TClonesArray *RecPoints() {return fRecPoints;} |
3bd79107 |
173 | |
2aea926d |
174 | protected: |
175 | //================== Data Members ================================== |
176 | AliITSgeom *fITSgeom; // Pointer to ITS geometry |
177 | Bool_t fEuclidOut; // Flag to write geometry in euclid format |
178 | TObjArray *fITSmodules; //! Pointer to ITS modules |
7d8046e8 |
179 | Option_t *fOpt; //! Detector option ="All" unless changed. |
3bd79107 |
180 | |
2aea926d |
181 | Int_t fIdN; // the number of layers |
182 | Int_t *fIdSens; //[fIdN] layer identifier |
183 | TString *fIdName; //[fIdN] layer identifier |
3bd79107 |
184 | |
2aea926d |
185 | Int_t fNDetTypes; // Number of detector types |
186 | TObjArray *fDetTypes; // List of detector types |
e8189707 |
187 | |
f91c3e58 |
188 | TClonesArray *fSDigits; // List of Summable digits. |
2aea926d |
189 | Int_t fNSDigits; // Number of Summable Digits. |
55b5a0b3 |
190 | |
2aea926d |
191 | TObjArray *fDtype; // List of digits |
192 | Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det. |
3bd79107 |
193 | |
2aea926d |
194 | TObjArray *fCtype; // List of clusters |
195 | Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det. |
196 | TTree *fTreeC; // Tree for raw clusters |
3bd79107 |
197 | |
2aea926d |
198 | TClonesArray *fRecPoints; // List of reconstructed points |
199 | Int_t fNRecPoints; // Number of rec points |
3bd79107 |
200 | |
201 | ClassDef(AliITS,1) // Base class for ITS |
fe4da5cc |
202 | }; |
3bd79107 |
203 | |
fe4da5cc |
204 | #endif |