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