]>
Commit | Line | Data |
---|---|---|
fe4da5cc | 1 | #ifndef MUON_H |
2 | #define MUON_H | |
3 | //////////////////////////////////////////////// | |
4 | // Manager and hits classes for set:MUON // | |
5 | //////////////////////////////////////////////// | |
6 | #include "AliDetector.h" | |
7 | #include "AliHit.h" | |
8 | #include "AliMUONConst.h" | |
a897a37a | 9 | #include "AliDigit.h" |
10 | #include "AliMUONchamber.h" | |
11 | #include "AliMUONSegRes.h" | |
fe4da5cc | 12 | #include <TVector.h> |
13 | #include <TObjArray.h> | |
a897a37a | 14 | #include <TArrayF.h> |
15 | #include <TFile.h> | |
16 | #include <TTree.h> | |
17 | typedef enum {simple, medium, big} Cluster_t; | |
fe4da5cc | 18 | |
19 | static const int NCH=14; | |
20 | ||
21 | class AliMUONcluster; | |
fe4da5cc | 22 | class AliMUONRecCluster; |
a897a37a | 23 | class AliMUONRawCluster; |
24 | class AliMUONClusterFinder; | |
25 | class AliMUONcorrelation; | |
fe4da5cc | 26 | |
fe4da5cc | 27 | |
28 | //---------------------------------------------- | |
fe4da5cc | 29 | |
30 | ||
31 | class AliMUONcluster : public TObject { | |
32 | public: | |
33 | ||
34 | Int_t fHitNumber; // Hit number | |
35 | Int_t fCathode; // Cathode number | |
36 | Int_t fQ ; // Total charge | |
37 | Int_t fPadX ; // Pad number along X | |
38 | Int_t fPadY ; // Pad number along Y | |
39 | Int_t fQpad ; // Charge per pad | |
40 | Int_t fRSec ; // R -sector of pad | |
41 | ||
42 | public: | |
43 | AliMUONcluster() { | |
44 | fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0; | |
45 | } | |
46 | AliMUONcluster(Int_t *clhits); | |
47 | virtual ~AliMUONcluster() {;} | |
48 | ||
49 | ClassDef(AliMUONcluster,1) //Cluster object for set:MUON | |
50 | }; | |
51 | ||
52 | ||
53 | class AliMUONreccluster : public TObject { | |
54 | public: | |
55 | ||
56 | Int_t fTracks[3]; //labels of overlapped tracks | |
57 | ||
58 | Int_t fQ ; // Q of cluster (in ADC counts) | |
59 | Float_t fX ; // X of cluster | |
60 | Float_t fY ; // Y of cluster | |
a897a37a | 61 | |
fe4da5cc | 62 | public: |
63 | AliMUONreccluster() { | |
64 | fTracks[0]=fTracks[1]=fTracks[2]=0; | |
a897a37a | 65 | fQ=0; fX=fY=0; |
fe4da5cc | 66 | } |
67 | virtual ~AliMUONreccluster() {;} | |
68 | ||
69 | ClassDef(AliMUONreccluster,1) //Cluster object for set:MUON | |
70 | }; | |
71 | ||
72 | //_____________________________________________________________________________ | |
73 | ||
74 | class AliMUONdigit : public TObject { | |
75 | public: | |
76 | Int_t fPadX; // Pad number along x | |
77 | Int_t fPadY ; // Pad number along y | |
78 | Int_t fSignal; // Signal amplitude | |
a897a37a | 79 | Int_t fTcharges[10]; // charge per track making this digit (up to 10) |
80 | Int_t fTracks[10]; // primary tracks making this digit (up to 10) | |
81 | Int_t fPhysics; // physics contribution to signal | |
82 | Int_t fHit; // hit number - temporary solution | |
fe4da5cc | 83 | |
84 | ||
85 | ||
86 | public: | |
87 | AliMUONdigit() {} | |
88 | AliMUONdigit(Int_t *digits); | |
89 | AliMUONdigit(Int_t *tracks, Int_t *charges, Int_t *digits); | |
a897a37a | 90 | virtual ~AliMUONdigit(); |
91 | ||
fe4da5cc | 92 | ClassDef(AliMUONdigit,1) //Digits for set:MUON |
93 | }; | |
94 | //_____________________________________________________________________________ | |
95 | ||
96 | class AliMUONlist : public AliMUONdigit { | |
97 | public: | |
a897a37a | 98 | Int_t fChamber; // chamber number of pad |
fe4da5cc | 99 | TObjArray *fTrackList; |
fe4da5cc | 100 | public: |
101 | AliMUONlist() {fTrackList=0;} | |
102 | AliMUONlist(Int_t rpad, Int_t *digits); | |
a897a37a | 103 | virtual ~AliMUONlist() {delete fTrackList;} |
fe4da5cc | 104 | TObjArray *TrackList() {return fTrackList;} |
fe4da5cc | 105 | ClassDef(AliMUONlist,1) //Digits for set:MUON |
106 | }; | |
107 | //___________________________________________ | |
108 | ||
109 | ||
110 | //___________________________________________ | |
111 | ||
112 | class AliMUONhit : public AliHit { | |
113 | public: | |
114 | Int_t fChamber; // Chamber number | |
a897a37a | 115 | Float_t fParticle; // Geant3 particle type |
fe4da5cc | 116 | Float_t fTheta ; // Incident theta angle in degrees |
117 | Float_t fPhi ; // Incident phi angle in degrees | |
118 | Float_t fTlength; // Track length inside the chamber | |
119 | Float_t fEloss; // ionisation energy loss in gas | |
120 | Int_t fPHfirst; // first padhit | |
121 | Int_t fPHlast; // last padhit | |
a897a37a | 122 | |
123 | // modifs perso | |
124 | Float_t fPTot; // hit momentum P | |
125 | Float_t fCxHit; // Px/P | |
126 | Float_t fCyHit; // Py/P | |
127 | Float_t fCzHit; // Pz/P | |
128 | ||
fe4da5cc | 129 | public: |
130 | AliMUONhit() {} | |
131 | AliMUONhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits); | |
132 | virtual ~AliMUONhit() {} | |
133 | ||
134 | ClassDef(AliMUONhit,1) //Hits object for set:MUON | |
135 | }; | |
136 | ||
137 | class AliMUON : public AliDetector { | |
138 | public: | |
139 | AliMUON(); | |
140 | AliMUON(const char *name, const char *title); | |
141 | virtual ~AliMUON(); | |
142 | virtual void AddHit(Int_t, Int_t*, Float_t*); | |
143 | virtual void AddCluster(Int_t*); | |
144 | virtual void AddDigits(Int_t, Int_t*, Int_t*, Int_t*); | |
a897a37a | 145 | virtual void AddRawCluster(Int_t, const AliMUONRawCluster&); |
fe4da5cc | 146 | virtual void AddRecCluster(Int_t iCh, Int_t iCat, |
147 | AliMUONRecCluster* Cluster); | |
a897a37a | 148 | virtual void AddCathCorrel(Int_t, Int_t*, Float_t*, Float_t*); |
fe4da5cc | 149 | virtual void BuildGeometry(); |
150 | virtual void CreateGeometry() {} | |
151 | virtual void CreateMaterials() {} | |
152 | virtual void StepManager(); | |
153 | Int_t DistancetoPrimitive(Int_t px, Int_t py); | |
154 | virtual Int_t IsVersion() const =0; | |
155 | // | |
156 | TClonesArray *Clusters() {return fClusters;} | |
a897a37a | 157 | virtual void MakeTreeC(Option_t *option="C"); |
158 | void GetTreeC(Int_t); | |
fe4da5cc | 159 | virtual void MakeBranch(Option_t *opt=" "); |
160 | void SetTreeAddress(); | |
161 | virtual void ResetHits(); | |
162 | virtual void ResetDigits(); | |
a897a37a | 163 | virtual void ResetRawClusters(); |
fe4da5cc | 164 | virtual void ResetRecClusters(); |
a897a37a | 165 | virtual void ResetCorrelation(); |
166 | virtual void FindClusters(Int_t,Int_t); | |
167 | virtual void Digitise(Int_t,Int_t,Option_t *opt=" ",Option_t *opt=" ",Text_t *name=" "); | |
168 | virtual void CathodeCorrelation(Int_t); | |
169 | virtual void SortTracks(Int_t *,Int_t *,Int_t); | |
170 | // | |
171 | // modifs perso | |
172 | ||
173 | void Init(Double_t &, Double_t &, Double_t &); | |
174 | void Reconst(Int_t &,Int_t &,Int_t,Int_t &,Int_t&,Int_t&, Option_t *option,Text_t *filename); | |
175 | void FinishEvent(); | |
176 | void Close(); | |
177 | void SetCutPxz(Double_t p) {fSPxzCut=p;} | |
178 | void SetSigmaCut(Double_t p) {fSSigmaCut=p;} | |
179 | void SetXPrec(Double_t p) {fSXPrec=p;} | |
180 | void SetYPrec(Double_t p) {fSYPrec=p;} | |
181 | Double_t GetCutPxz() {return fSPxzCut;} | |
182 | Double_t GetSigmaCut() {return fSSigmaCut;} | |
183 | Double_t GetXPrec() {return fSXPrec;} | |
184 | Double_t GetYPrec() {return fSYPrec;} | |
185 | // fin modifs perso | |
186 | ||
fe4da5cc | 187 | // Configuration Methods (per station id) |
188 | // | |
189 | // Set Chamber Segmentation Parameters | |
190 | // id refers to the station and isec to the cathode plane | |
191 | virtual void SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2); | |
192 | ||
193 | // Set Signal Generation Parameters | |
a897a37a | 194 | virtual void SetSigmaIntegration(Int_t id, Float_t p1); |
195 | virtual void SetChargeSlope(Int_t id, Float_t p1); | |
196 | virtual void SetChargeSpread(Int_t id, Float_t p1, Float_t p2); | |
197 | virtual void SetMaxAdc(Int_t id, Float_t p1); | |
fe4da5cc | 198 | // Set Segmentation and Response Model |
199 | virtual void SetSegmentationModel(Int_t id, Int_t isec, AliMUONsegmentation *segmentation); | |
200 | virtual void SetResponseModel(Int_t id, AliMUONresponse *response); | |
201 | virtual void SetNsec(Int_t id, Int_t nsec); | |
a897a37a | 202 | // Set Reconstruction Model |
203 | virtual void SetReconstructionModel(Int_t id, AliMUONClusterFinder *reconstruction); | |
fe4da5cc | 204 | // Set Stepping Parameters |
a897a37a | 205 | virtual void SetMaxStepGas(Float_t p1); |
206 | virtual void SetMaxStepAlu(Float_t p1); | |
207 | virtual void SetMaxDestepGas(Float_t p1); | |
208 | virtual void SetMaxDestepAlu(Float_t p1); | |
209 | virtual void SetMuonAcc(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9); | |
fe4da5cc | 210 | // Response Simulation |
211 | virtual void MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id); | |
212 | // Return reference to Chamber #id | |
213 | virtual AliMUONchamber& Chamber(Int_t id) {return *((AliMUONchamber *) (*fChambers)[id]);} | |
214 | // Retrieve pad hits for a given Hit | |
a897a37a | 215 | virtual AliMUONcluster* FirstPad(AliMUONhit *, TClonesArray *); |
216 | virtual AliMUONcluster* NextPad(TClonesArray *); | |
fe4da5cc | 217 | // Return pointers to digits |
218 | TObjArray *Dchambers() {return fDchambers;} | |
219 | Int_t *Ndch() {return fNdch;} | |
220 | virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);} | |
221 | // Return pointers to reconstructed clusters | |
a897a37a | 222 | // virtual TObjArray *RecClusters(Int_t iCh, Int_t iCat) |
223 | // {return ( (TObjArray*) (*fRecClusters)[iCh+iCat*10]);} | |
fe4da5cc | 224 | |
a897a37a | 225 | TObjArray *RawClusters() {return fRawClusters;} |
226 | Int_t *Nrawch() {return fNrawch;} | |
227 | virtual TClonesArray *RawClustAddress(Int_t id) {return ((TClonesArray *) (*fRawClusters)[id]);} | |
228 | ||
229 | // modifs perso | |
230 | AliMUONRawCluster *RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster); | |
231 | ||
232 | ||
233 | // Return pointers to list of correlated clusters | |
234 | TObjArray *CathCorrel() {return fCathCorrel;} | |
235 | Int_t *Ncorch() {return fNcorch;} | |
236 | virtual TClonesArray *CathCorrelAddress(Int_t id) | |
237 | {return ((TClonesArray *) (*fCathCorrel)[id]);} | |
238 | ||
239 | // modifs perso | |
240 | // virtual TClonesArray *CathCorrelAddress2(Int_t id) | |
241 | // {return ((TClonesArray *) (*fCathCorrel2)[id]);} | |
242 | ||
243 | // Return pointer to TreeC | |
244 | TTree *TreeC() {return fTreeC;} | |
fe4da5cc | 245 | protected: |
246 | TObjArray *fChambers; // List of Tracking Chambers | |
247 | Int_t fNclusters; // Number of clusters | |
248 | TClonesArray *fClusters; // List of clusters | |
249 | TObjArray *fDchambers; // List of digits | |
fe4da5cc | 250 | Int_t *fNdch; // Number of digits |
a897a37a | 251 | |
252 | // TObjArray *fRecClusters; // List of clusters | |
253 | ||
254 | TObjArray *fRawClusters; // List of raw clusters | |
255 | Int_t *fNrawch; // Number of raw clusters | |
256 | TObjArray *fCathCorrel; // List of correlated clusters | |
257 | Int_t *fNcorch; // Number of correl clusters | |
258 | TTree *fTreeC; // Cathode correl index tree | |
259 | ||
fe4da5cc | 260 | // |
261 | Bool_t fAccCut; //Transport acceptance cut | |
262 | Float_t fAccMin; //Minimum acceptance cut used during transport | |
263 | Float_t fAccMax; //Minimum acceptance cut used during transport | |
264 | // | |
265 | ||
266 | // Stepping Parameters | |
267 | Float_t fMaxStepGas; // Maximum step size inside the chamber gas | |
268 | Float_t fMaxStepAlu; // Maximum step size inside the chamber aluminum | |
269 | Float_t fMaxDestepGas; // Maximum relative energy loss in gas | |
270 | Float_t fMaxDestepAlu; // Maximum relative energy loss in aluminum | |
a897a37a | 271 | // |
272 | // modifs perso | |
273 | // Parameters for reconstruction program | |
274 | Double_t fSPxzCut; // Pxz cut (GeV/c) to begin the track finding | |
275 | Double_t fSSigmaCut; // Number of sig. delimiting the searching areas | |
276 | Double_t fSXPrec; // Chamber precision in X (cm) | |
277 | Double_t fSYPrec; // Chamber precision in Y (cm) | |
278 | ||
279 | Text_t *fFileName; | |
fe4da5cc | 280 | |
281 | protected: | |
282 | ||
283 | ClassDef(AliMUON,1) //Hits manager for set:MUON | |
284 | }; | |
285 | //___________________________________________ | |
286 | class AliMUONRecCluster : public TObject { | |
287 | public: | |
288 | AliMUONRecCluster() ; | |
289 | AliMUONRecCluster(Int_t FirstDigit,Int_t Ichamber, Int_t Icathod) ; | |
290 | virtual ~AliMUONRecCluster(); | |
291 | virtual void AddDigit(Int_t Digit); | |
292 | virtual Int_t FirstDigitIndex(); | |
293 | virtual Int_t NextDigitIndex(); | |
294 | virtual Int_t InvalidDigitIndex() {return -1;} | |
295 | ||
296 | virtual Int_t NDigits(); | |
297 | virtual void Finish(); // Nothing yet ... | |
298 | virtual Int_t GetCathod() {return fCathod;} | |
299 | virtual Int_t GetChamber() {return fChamber;} | |
300 | ||
301 | public: | |
302 | Float_t fX; // reconstructed x | |
303 | Float_t fY; // reconstructed y | |
304 | ||
305 | protected: | |
306 | TArrayI *fDigits; // List of digits indexes for that cluster | |
307 | Int_t fNdigit; // Number of digits indexes stored; | |
308 | Int_t fCathod; // Number of the cathod to be used; | |
309 | Int_t fChamber; // Number of the chamber to be used; | |
310 | Int_t fCurrentDigit; // Current Digit inside an iteration | |
311 | ||
312 | ClassDef(AliMUONRecCluster,1) //Cluster object for set:MUON | |
313 | }; | |
314 | //___________________________________________ | |
a897a37a | 315 | |
316 | class AliMUONRawCluster : public TObject { | |
317 | public: | |
318 | ||
319 | Int_t fTracks[3]; //labels of overlapped tracks | |
320 | Int_t fQ ; // Q of cluster (in ADC counts) | |
321 | Float_t fX ; // X of cluster | |
322 | Float_t fY ; // Y of cluster | |
323 | Int_t fPeakSignal; | |
324 | Int_t fIndexMap[50]; //indeces of digits | |
325 | Int_t fOffsetMap[50]; //Emmanuel special | |
326 | Float_t fContMap[50]; //Contribution from digit | |
327 | Int_t fPhysicsMap[50]; | |
328 | Int_t fMultiplicity; //cluster multiplicity | |
329 | Int_t fNcluster[2]; | |
330 | Int_t fClusterType; | |
331 | public: | |
332 | AliMUONRawCluster() { | |
333 | fTracks[0]=fTracks[1]=fTracks[2]=-1; | |
334 | fQ=0; fX=fY=0; fMultiplicity=0; | |
335 | for (int k=0;k<50;k++) { | |
336 | fIndexMap[k]=-1; | |
337 | fOffsetMap[k]=0; | |
338 | fContMap[k]=0; | |
339 | fPhysicsMap[k]=-1; | |
340 | } | |
341 | fNcluster[0]=fNcluster[1]=-1; | |
342 | } | |
343 | virtual ~AliMUONRawCluster() {} | |
344 | ||
345 | Float_t GetRadius() {return TMath::Sqrt(fX*fX+fY*fY);} | |
346 | ||
347 | Bool_t IsSortable() const {return true;} | |
348 | Int_t Compare(TObject *obj); | |
349 | Int_t PhysicsContribution(); | |
350 | static Int_t BinarySearch(Float_t r, TArrayF, Int_t from, Int_t upto); | |
351 | static void SortMin(Int_t *,Float_t *,Float_t *,Float_t *,Float_t *,Int_t); | |
352 | ||
353 | ClassDef(AliMUONRawCluster,1) //Cluster object for set:MUON | |
354 | }; | |
355 | ||
356 | //___________________________________________ | |
357 | class AliMUONcorrelation : public TObject { | |
358 | public: | |
359 | ||
360 | // correlation starts from the 1-st cathode | |
361 | // last number in arrays corresponds to cluster on 1-st cathode | |
362 | ||
363 | Int_t fCorrelIndex[4]; // entry number in TreeR for the associated | |
364 | // cluster candidates on the 2-nd cathode | |
365 | Float_t fX[4] ; // X of clusters on the 2-nd cathode | |
366 | Float_t fY[4] ; // Y of clusters | |
367 | ||
368 | public: | |
369 | AliMUONcorrelation() { | |
370 | fCorrelIndex[0]=fCorrelIndex[1]=fCorrelIndex[2]=fCorrelIndex[3]=0; | |
371 | fX[0]=fX[1]=fX[2]=fX[3]=0; fY[0]=fY[1]=fY[2]=fY[3]=0; | |
372 | } | |
373 | AliMUONcorrelation(Int_t *idx, Float_t *x, Float_t *y); | |
374 | virtual ~AliMUONcorrelation() {} | |
375 | ClassDef(AliMUONcorrelation,1) //Cathode correlation object for set:MUON | |
376 | }; | |
377 | ||
fe4da5cc | 378 | #endif |
379 | ||
380 | ||
381 | ||
382 | ||
383 | ||
384 | ||
385 | ||
386 | ||
387 | ||
388 | ||
389 | ||
390 | ||
391 | ||
392 | ||
393 |