This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MUON / AliMUON.h
CommitLineData
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"
9#include "AliDigit.h"
10#include <TVector.h>
11#include <TObjArray.h>
12
13
14static const int NCH=14;
15
16class AliMUONcluster;
17class AliMUONchamber;
18class AliMUONRecCluster;
19//----------------------------------------------
20class AliMUONgeometry
21{
22 public:
23 AliMUONgeometry(){}
24 virtual ~AliMUONgeometry(){}
25 void InitGeo(Float_t z);
26 Float_t fdGas; // half gaz gap
27 Float_t fdAlu; // half Alu width
28 Float_t frMin; // innermost sensitive radius
29 Float_t frMax; // outermost sensitive radius
30 ClassDef(AliMUONgeometry,1)
31};
32//----------------------------------------------
33//
34// Chamber segmentation virtual base class
35//
36class AliMUONsegmentation :
37public TObject {
38
39 public:
40
41 // Set Chamber Segmentation Parameters
42 virtual void SetPADSIZ(Float_t p1, Float_t p2) =0;
43 virtual void SetDAnod(Float_t D) =0;
44 // Transform from pad (wire) to real coordinates and vice versa
45 virtual Float_t GetAnod(Float_t xhit) =0;
46 virtual void GetPadIxy(Float_t x ,Float_t y ,Int_t &ix,Int_t &iy)=0;
47 virtual void GetPadCxy(Int_t ix,Int_t iy,Float_t &x ,Float_t &y )=0;
48 //
49 // Initialisation
50 virtual void Init(AliMUONchamber*) =0;
51 //
52 // Get member data
53 virtual Float_t Dpx() =0;
54 virtual Float_t Dpy() =0;
55 virtual Int_t Npx() =0;
56 virtual Int_t Npy() =0;
57 //
58 // Iterate over pads
59 virtual void FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) =0;
60 virtual void NextPad()=0;
61 virtual Int_t MorePads() =0;
62 // Get next neighbours
63 virtual void Neighbours
64 (Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) =0;
65 // Provisory RecCluster coordinates reconstructor
66 virtual void FitXY(AliMUONRecCluster* Cluster,TClonesArray* MUONdigits) =0;
67 //
68 // Current pad cursor during disintegration
69 virtual Int_t Ix() =0;
70 virtual Int_t Iy() =0;
71 virtual Int_t ISector() =0;
72 //
73 // Signal Generation Condition during Stepping
74 virtual Int_t SigGenCond(Float_t x, Float_t y, Float_t z) = 0;
75 virtual void SigGenInit(Float_t x, Float_t y, Float_t z) = 0;
76 virtual void IntegrationLimits
77 (Float_t& x1, Float_t& x2, Float_t& y1, Float_t& y2) = 0;
78 //
79 // Identification
80 virtual char* YourName() =0;
81 ClassDef(AliMUONsegmentation,1)
82};
83//----------------------------------------------
84//
85// Chamber response virtual base class
86//
87class AliMUONresponse :
88public TObject {
89 public:
90 //
91 // Configuration methods
92 virtual void SetRSIGM(Float_t p1) =0;
93 virtual void SetMUCHSP(Float_t p1) =0;
94 virtual void SetMUSIGM(Float_t p1, Float_t p2) =0;
95 virtual void SetMAXADC(Float_t p1) =0;
96 //
97 // Get member data
98 virtual Float_t Chslope() =0;
99 virtual Float_t ChwX() =0;
100 virtual Float_t ChwY() =0;
101 virtual Float_t Nsigma() =0;
102 virtual Float_t adc_satm() =0;
103 //
104 // Chamber response methods
105 // Pulse height from scored quantity (eloss)
106 virtual Float_t IntPH(Float_t eloss) =0;
107 // Charge disintegration
108 virtual Float_t IntXY(AliMUONsegmentation *) =0;
109 //
110 // Identification
111 virtual char* YourName() =0;
112 ClassDef(AliMUONresponse,1)
113};
114
115//----------------------------------------------
116class AliMUONchamber :
117public TObject,
118public AliMUONgeometry{
119 public:
120 AliMUONchamber();
121 ~AliMUONchamber(){}
122//
123// Set and get GEANT id
124 Int_t GetGid() {return fGid;}
125 void SetGid(Int_t id) {fGid=id;}
126//
127// Initialisation and z-Position
128 void Init();
129 void SetZPOS(Float_t p1) {fzPos=p1;}
130 Float_t ZPosition() {return fzPos;}
131//
132// Configure response model
133 void ResponseModel(AliMUONresponse* thisResponse) {fResponse=thisResponse;}
134//
135// Configure segmentation model
136 void SegmentationModel(Int_t i, AliMUONsegmentation* thisSegmentation) {
137 (*fSegmentation)[i-1] = thisSegmentation;
138 }
139//
140// Get reference to response model
141 AliMUONresponse* &GetResponseModel(){return fResponse;}
142//
143// Get reference to segmentation model
144 AliMUONsegmentation* GetSegmentationModel(Int_t isec) {
145 return (AliMUONsegmentation *) (*fSegmentation)[isec-1];
146 }
147 Int_t Nsec() {return fnsec;}
148 void SetNsec(Int_t nsec) {fnsec=nsec;}
149//
150// Member function forwarding to the segmentation and response models
151//
152// Calculate pulse height from energy loss
153 Float_t IntPH(Float_t eloss) {return fResponse->IntPH(eloss);}
154//
155// Ask segmentation if signal should be generated
156 Int_t SigGenCond(Float_t x, Float_t y, Float_t z)
157 {
158 if (fnsec==1) {
159 return ((AliMUONsegmentation*) (*fSegmentation)[0])
160 ->SigGenCond(x, y, z) ;
161 } else {
162 return (((AliMUONsegmentation*) (*fSegmentation)[0])
163 ->SigGenCond(x, y, z)) ||
164 (((AliMUONsegmentation*) (*fSegmentation)[1])
165 ->SigGenCond(x, y, z)) ;
166 }
167 }
168//
169// Initialisation of segmentation for hit
170 void SigGenInit(Float_t x, Float_t y, Float_t z)
171 {
172
173 if (fnsec==1) {
174 ((AliMUONsegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
175 } else {
176 ((AliMUONsegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
177 ((AliMUONsegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
178 }
179 }
180
181// Configuration forwarding
182//
183 void SetRSIGM(Float_t p1) {fResponse->SetRSIGM(p1);}
184 void SetMUCHSP(Float_t p1) {fResponse->SetMUCHSP(p1);}
185 void SetMUSIGM(Float_t p1, Float_t p2) {fResponse->SetMUSIGM(p1,p2);}
186 void SetMAXADC(Float_t p1) {fResponse->SetMAXADC(p1);}
187
188 void SetPADSIZ(Int_t isec, Float_t p1, Float_t p2) {
189 ((AliMUONsegmentation*) (*fSegmentation)[isec-1])->SetPADSIZ(p1,p2);
190 }
191//
192// Cluster formation method
193 void DisIntegration(Float_t, Float_t, Float_t, Int_t&x, Float_t newclust[6][500]);
194 ClassDef(AliMUONchamber,1)
195
196 private:
197// GEANT volume if for sensitive volume of this chamber
198 Int_t fGid;
199// z-position of this chamber
200 Float_t fzPos;
201// The segmentation models for the cathode planes
202// fnsec=1: one plane segmented, fnsec=2: both planes are segmented.
203 Int_t fnsec;
204 TObjArray *fSegmentation;
205 AliMUONresponse *fResponse;
206
207};
208
209
210
211class AliMUONcluster : public TObject {
212public:
213
214 Int_t fHitNumber; // Hit number
215 Int_t fCathode; // Cathode number
216 Int_t fQ ; // Total charge
217 Int_t fPadX ; // Pad number along X
218 Int_t fPadY ; // Pad number along Y
219 Int_t fQpad ; // Charge per pad
220 Int_t fRSec ; // R -sector of pad
221
222public:
223 AliMUONcluster() {
224 fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0;
225}
226 AliMUONcluster(Int_t *clhits);
227 virtual ~AliMUONcluster() {;}
228
229 ClassDef(AliMUONcluster,1) //Cluster object for set:MUON
230};
231
232
233class AliMUONreccluster : public TObject {
234public:
235
236 Int_t fTracks[3]; //labels of overlapped tracks
237
238 Int_t fQ ; // Q of cluster (in ADC counts)
239 Float_t fX ; // X of cluster
240 Float_t fY ; // Y of cluster
241
242public:
243 AliMUONreccluster() {
244 fTracks[0]=fTracks[1]=fTracks[2]=0;
245 fQ=0; fX=fY=0;
246 }
247 virtual ~AliMUONreccluster() {;}
248
249 ClassDef(AliMUONreccluster,1) //Cluster object for set:MUON
250};
251
252//_____________________________________________________________________________
253
254class AliMUONdigit : public TObject {
255 public:
256 Int_t fPadX; // Pad number along x
257 Int_t fPadY ; // Pad number along y
258 Int_t fSignal; // Signal amplitude
259
260
261 Int_t fTcharges[10]; // charge per track making this digit (up to 10)
262 Int_t fTracks[10]; // tracks making this digit (up to 10)
263
264
265
266 public:
267 AliMUONdigit() {}
268 AliMUONdigit(Int_t *digits);
269 AliMUONdigit(Int_t *tracks, Int_t *charges, Int_t *digits);
270 virtual ~AliMUONdigit() {}
271
272
273 ClassDef(AliMUONdigit,1) //Digits for set:MUON
274};
275//_____________________________________________________________________________
276
277class AliMUONlist : public AliMUONdigit {
278 public:
279
280 Int_t fRpad; // r_pos of pad
281
282 TObjArray *fTrackList;
283
284
285 public:
286 AliMUONlist() {fTrackList=0;}
287 AliMUONlist(Int_t rpad, Int_t *digits);
288 virtual ~AliMUONlist() {}
289
290 TObjArray *TrackList() {return fTrackList;}
291
292 ClassDef(AliMUONlist,1) //Digits for set:MUON
293};
294//___________________________________________
295
296
297//___________________________________________
298
299class AliMUONhit : public AliHit {
300 public:
301 Int_t fChamber; // Chamber number
302 Float_t fParticle; // Geant3 particle type
303 Float_t fTheta ; // Incident theta angle in degrees
304 Float_t fPhi ; // Incident phi angle in degrees
305 Float_t fTlength; // Track length inside the chamber
306 Float_t fEloss; // ionisation energy loss in gas
307 Int_t fPHfirst; // first padhit
308 Int_t fPHlast; // last padhit
309 public:
310 AliMUONhit() {}
311 AliMUONhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
312 virtual ~AliMUONhit() {}
313
314 ClassDef(AliMUONhit,1) //Hits object for set:MUON
315};
316
317class AliMUON : public AliDetector {
318 public:
319 AliMUON();
320 AliMUON(const char *name, const char *title);
321 virtual ~AliMUON();
322 virtual void AddHit(Int_t, Int_t*, Float_t*);
323 virtual void AddCluster(Int_t*);
324 virtual void AddDigits(Int_t, Int_t*, Int_t*, Int_t*);
325 virtual void AddRecCluster(Int_t iCh, Int_t iCat,
326 AliMUONRecCluster* Cluster);
327 virtual void BuildGeometry();
328 virtual void CreateGeometry() {}
329 virtual void CreateMaterials() {}
330 virtual void StepManager();
331 Int_t DistancetoPrimitive(Int_t px, Int_t py);
332 virtual Int_t IsVersion() const =0;
333//
334 TClonesArray *Clusters() {return fClusters;}
335 virtual void MakeBranch(Option_t *opt=" ");
336 void SetTreeAddress();
337 virtual void ResetHits();
338 virtual void ResetDigits();
339 virtual void ResetRecClusters();
340 virtual void ReconstructClusters();
341//
342// Configuration Methods (per station id)
343//
344// Set Chamber Segmentation Parameters
345// id refers to the station and isec to the cathode plane
346 virtual void SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2);
347
348// Set Signal Generation Parameters
349 virtual void SetRSIGM(Int_t id, Float_t p1);
350 virtual void SetMUCHSP(Int_t id, Float_t p1);
351 virtual void SetMUSIGM(Int_t id, Float_t p1, Float_t p2);
352 virtual void SetMAXADC(Int_t id, Float_t p1);
353// Set Segmentation and Response Model
354 virtual void SetSegmentationModel(Int_t id, Int_t isec, AliMUONsegmentation *segmentation);
355 virtual void SetResponseModel(Int_t id, AliMUONresponse *response);
356 virtual void SetNsec(Int_t id, Int_t nsec);
357// Set Stepping Parameters
358 virtual void SetSMAXAR(Float_t p1);
359 virtual void SetSMAXAL(Float_t p1);
360 virtual void SetDMAXAR(Float_t p1);
361 virtual void SetDMAXAL(Float_t p1);
362 virtual void SetMUONACC(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9);
363// Response Simulation
364 virtual void MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id);
365// Return reference to Chamber #id
366 virtual AliMUONchamber& Chamber(Int_t id) {return *((AliMUONchamber *) (*fChambers)[id]);}
367// Retrieve pad hits for a given Hit
368 virtual AliMUONcluster* FirstPad(AliMUONhit *);
369 virtual AliMUONcluster* NextPad();
370// Return pointers to digits
371 TObjArray *Dchambers() {return fDchambers;}
372 Int_t *Ndch() {return fNdch;}
373 virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
374// Return pointers to reconstructed clusters
375 virtual TObjArray *RecClusters(Int_t iCh, Int_t iCat)
376 {return ( (TObjArray*) (*fRecClusters)[iCh+iCat*10]);}
377
378
379 protected:
380 TObjArray *fChambers; // List of Tracking Chambers
381 Int_t fNclusters; // Number of clusters
382 TClonesArray *fClusters; // List of clusters
383 TObjArray *fDchambers; // List of digits
384 TObjArray *fRecClusters; // List of clusters
385 Int_t *fNdch; // Number of digits
386//
387 Bool_t fAccCut; //Transport acceptance cut
388 Float_t fAccMin; //Minimum acceptance cut used during transport
389 Float_t fAccMax; //Minimum acceptance cut used during transport
390//
391
392// Stepping Parameters
393 Float_t fMaxStepGas; // Maximum step size inside the chamber gas
394 Float_t fMaxStepAlu; // Maximum step size inside the chamber aluminum
395 Float_t fMaxDestepGas; // Maximum relative energy loss in gas
396 Float_t fMaxDestepAlu; // Maximum relative energy loss in aluminum
397
398 protected:
399
400 ClassDef(AliMUON,1) //Hits manager for set:MUON
401};
402//___________________________________________
403class AliMUONRecCluster : public TObject {
404public:
405 AliMUONRecCluster() ;
406 AliMUONRecCluster(Int_t FirstDigit,Int_t Ichamber, Int_t Icathod) ;
407 virtual ~AliMUONRecCluster();
408 virtual void AddDigit(Int_t Digit);
409 virtual Int_t FirstDigitIndex();
410 virtual Int_t NextDigitIndex();
411 virtual Int_t InvalidDigitIndex() {return -1;}
412
413 virtual Int_t NDigits();
414 virtual void Finish(); // Nothing yet ...
415 virtual Int_t GetCathod() {return fCathod;}
416 virtual Int_t GetChamber() {return fChamber;}
417
418public:
419 Float_t fX; // reconstructed x
420 Float_t fY; // reconstructed y
421
422protected:
423 TArrayI *fDigits; // List of digits indexes for that cluster
424 Int_t fNdigit; // Number of digits indexes stored;
425 Int_t fCathod; // Number of the cathod to be used;
426 Int_t fChamber; // Number of the chamber to be used;
427 Int_t fCurrentDigit; // Current Digit inside an iteration
428
429 ClassDef(AliMUONRecCluster,1) //Cluster object for set:MUON
430};
431//___________________________________________
432#endif
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447