Remove warnings on SunOS
[u/mrichter/AliRoot.git] / RICH / AliRICH.h
CommitLineData
fe4da5cc 1#ifndef RICH_H
2#define RICH_H
3////////////////////////////////////////////////
4// Manager and hits classes for set:RICH //
5////////////////////////////////////////////////
fe4da5cc 6#include "AliDetector.h"
7#include "AliHit.h"
ddae0931 8#include "AliRICHConst.h"
9#include "AliDigit.h"
10#include <TVector.h>
11#include <TObjArray.h>
12#include <TFile.h>
13#include <TTree.h>
14#include <TRotMatrix.h>
fe4da5cc 15
ddae0931 16static const int NCH=7;
17typedef enum {mip, cerenkov} Response_t;
fe4da5cc 18
ddae0931 19class AliRICHcluster;
20class AliRICHchamber;
21class AliRICHRecCluster;
22class AliRICHCerenkov;
fe4da5cc 23
ddae0931 24//----------------------------------------------
25//----------------------------------------------
26//
27// Chamber segmentation virtual base class
28//
29class AliRICHsegmentation :
30public TObject {
31
32 public:
33
34 // Set Chamber Segmentation Parameters
35 virtual void SetPADSIZ(Float_t p1, Float_t p2) =0;
36 virtual void SetDAnod(Float_t D) =0;
37 // Transform from pad (wire) to real coordinates and vice versa
38 virtual Float_t GetAnod(Float_t xhit) =0;
39 virtual void GetPadIxy(Float_t x ,Float_t y ,Int_t &ix,Int_t &iy)=0;
40 virtual void GetPadCxy(Int_t ix,Int_t iy,Float_t &x ,Float_t &y )=0;
41 //
42 // Initialisation
43 virtual void Init(AliRICHchamber*) =0;
44 //
45 // Get member data
46 virtual Float_t Dpx() =0;
47 virtual Float_t Dpy() =0;
48 virtual Int_t Npx() =0;
49 virtual Int_t Npy() =0;
50 //
51 // Iterate over pads
52 virtual void FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) =0;
53 virtual void NextPad()=0;
54 virtual Int_t MorePads() =0;
55 // Get next neighbours
56 virtual void Neighbours
57 (Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]) =0;
58 // Provisory RecCluster coordinates reconstructor
59 virtual void FitXY(AliRICHRecCluster* Cluster,TClonesArray* RICHdigits) =0;
60 //
61 // Current pad cursor during disintegration
62 virtual Int_t Ix() =0;
63 virtual Int_t Iy() =0;
64 virtual Int_t ISector() =0;
65 //
66 // Signal Generation Condition during Stepping
67 virtual Int_t SigGenCond(Float_t x, Float_t y, Float_t z) = 0;
68 virtual void SigGenInit(Float_t x, Float_t y, Float_t z) = 0;
69 virtual void IntegrationLimits
70 (Float_t& x1, Float_t& x2, Float_t& y1, Float_t& y2) = 0;
71 //
72 // Identification
73 virtual char* YourName() =0;
74 ClassDef(AliRICHsegmentation,1)
75 };
76//----------------------------------------------
77//
78// Chamber response virtual base class
79//
80class AliRICHresponse :
81public TObject {
82 public:
83 //
84 // Configuration methods
85 virtual void SetRSIGM(Float_t p1) =0;
86 virtual void SetMUCHSP(Float_t p1) =0;
87 virtual void SetMUSIGM(Float_t p1, Float_t p2) =0;
88 virtual void SetMAXADC(Float_t p1) =0;
89 //
90 // Get member data
91 virtual Float_t Chslope() =0;
92 virtual Float_t ChwX() =0;
93 virtual Float_t ChwY() =0;
94 virtual Float_t Nsigma() =0;
95 virtual Float_t adc_satm() =0;
96 //
97 // Chamber response methods
98 // Pulse height from scored quantity (eloss)
f91473f6 99 virtual Float_t IntPH(Float_t eloss=0) =0;
100 // virtual Float_t IntPH() =0;
ddae0931 101 virtual Int_t FeedBackPhotons(Float_t *source, Float_t qtot) =0;
102 // Charge disintegration
103 virtual Float_t IntXY(AliRICHsegmentation *) =0;
104 //
105 // Identification
106 virtual char* YourName() =0;
107 // Mathieson parameters
108 virtual void SetSqrtKx3(Float_t p1) =0;
109 virtual void SetKx2(Float_t p1) =0;
110 virtual void SetKx4(Float_t p1) =0;
111 virtual void SetSqrtKy3(Float_t p1) =0;
112 virtual void SetKy2(Float_t p1) =0;
113 virtual void SetKy4(Float_t p1) =0;
114 virtual void SetPitch(Float_t p1) =0;
115 ClassDef(AliRICHresponse,1)
116 };
117
118//----------------------------------------------
119class AliRICHchamber :
120public TObject
121{
122
123 public:
124
125//Rotation matrices for each chamber
126
127 TRotMatrix *fChamberMatrix;
128 Float_t fChamberTrans[3];
129
130 public:
131 AliRICHchamber();
132 ~AliRICHchamber(){}
133//
134// Set and get GEANT id
135 Int_t GetGid() {return fGid;}
136 void SetGid(Int_t id) {fGid=id;}
137//
138// Initialisation and z-Position
139 void Init();
140 void SetZPOS(Float_t p1) {fzPos=p1;}
141 Float_t ZPosition() {return fzPos;}
142//
143
144// Set inner radius of sensitive volume
145 void SetRInner(Float_t rmin) {frMin=rmin;}
146// Set outer radius of sensitive volum
147 void SetROuter(Float_t rmax) {frMax=rmax;}
148
149// Return inner radius of sensitive volume
150 Float_t RInner() {return frMin;}
151// Return outer radius of sensitive volum
152 Float_t ROuter() {return frMax;}
153
154//Transformation from Global to local coordinates, chamber-dependant
155 void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);
156
157//Setting chamber specific rotation matrices
158
159 void SetChamberTransform(Float_t Trans1,Float_t Trans2,Float_t Trans3,TRotMatrix *Matrix)
160
161 {
162 fChamberMatrix=Matrix;
163 fChamberTrans[0]=Trans1;
164 fChamberTrans[1]=Trans2;
165 fChamberTrans[2]=Trans3;
166 }
167
168// Configure response model
169 void ResponseModel(Response_t res, AliRICHresponse* thisResponse);
170
171 //
172// Configure segmentation model
173 void SegmentationModel(Int_t i, AliRICHsegmentation* thisSegmentation) {
174 (*fSegmentation)[i-1] = thisSegmentation;
175 }
176//
177// Get reference to response model
178 AliRICHresponse* GetResponseModel(Response_t res);
179//
180// Get reference to segmentation model
181 AliRICHsegmentation* GetSegmentationModel(Int_t isec) {
182 return (AliRICHsegmentation *) (*fSegmentation)[isec-1];
183 }
184 Int_t Nsec() {return fnsec;}
185 void SetNsec(Int_t nsec) {fnsec=nsec;}
186//
187// Member function forwarding to the segmentation and response models
188//
189// Calculate pulse height from energy loss
190 Float_t IntPH(Float_t eloss) {return ((AliRICHresponse*) (*fResponse)[0])->IntPH(eloss);}
191 Float_t IntPH() {return ((AliRICHresponse*) (*fResponse)[1])->IntPH(); }
192//
193// Ask segmentation if signal should be generated
194 Int_t SigGenCond(Float_t x, Float_t y, Float_t z)
195 {
196 if (fnsec==1) {
197 return ((AliRICHsegmentation*) (*fSegmentation)[0])
198 ->SigGenCond(x, y, z) ;
199 } else {
200 return (((AliRICHsegmentation*) (*fSegmentation)[0])
201 ->SigGenCond(x, y, z)) ||
202 (((AliRICHsegmentation*) (*fSegmentation)[1])
203 ->SigGenCond(x, y, z)) ;
204 }
205 }
206//
207// Initialisation of segmentation for hit
208 void SigGenInit(Float_t x, Float_t y, Float_t z)
209 {
210
211 if (fnsec==1) {
212 ((AliRICHsegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
213 } else {
214 ((AliRICHsegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
215 ((AliRICHsegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
216 }
217 }
218
219// Configuration forwarding
220//
221 void SetRSIGM(Float_t p)
222 {
223 ((AliRICHresponse*) (*fResponse)[0])->SetRSIGM(p);
224 ((AliRICHresponse*) (*fResponse)[1])->SetRSIGM(p);
225 }
226 void SetMUCHSP(Float_t p)
227 {
228 ((AliRICHresponse*) (*fResponse)[0])->SetMUCHSP(p);
229 ((AliRICHresponse*) (*fResponse)[1])->SetMUCHSP(p);
230 }
231 void SetMUSIGM(Float_t p1, Float_t p2)
232 {
233 ((AliRICHresponse*) (*fResponse)[0])->SetMUSIGM(p1,p2);
234 ((AliRICHresponse*) (*fResponse)[1])->SetMUSIGM(p1,p2);
235 }
236 void SetMAXADC(Float_t p)
237 {
238 ((AliRICHresponse*) (*fResponse)[0])->SetMAXADC(p);
239 ((AliRICHresponse*) (*fResponse)[1])->SetMAXADC(p);
240 }
241 void SetSqrtKx3(Float_t p)
242 {
243 ((AliRICHresponse*) (*fResponse)[0])->SetSqrtKx3(p);
244 ((AliRICHresponse*) (*fResponse)[1])->SetSqrtKx3(p);
245 }
246 void SetKx2(Float_t p)
247 {
248 ((AliRICHresponse*) (*fResponse)[0])->SetKx2(p);
249 ((AliRICHresponse*) (*fResponse)[1])->SetKx2(p);
250 }
251 void SetKx4(Float_t p)
252 {
253 ((AliRICHresponse*) (*fResponse)[0])->SetKx4(p);
254 ((AliRICHresponse*) (*fResponse)[1])->SetKx4(p);
255 }
256 void SetSqrtKy3(Float_t p)
257 {
258 ((AliRICHresponse*) (*fResponse)[0])->SetSqrtKy3(p);
259 ((AliRICHresponse*) (*fResponse)[1])->SetSqrtKy3(p);
260 }
261 void SetKy2(Float_t p)
262 {
263 ((AliRICHresponse*) (*fResponse)[0])->SetKy2(p);
264 ((AliRICHresponse*) (*fResponse)[1])->SetKy2(p);
265 }
266 void SetKy4(Float_t p)
267 {
268 ((AliRICHresponse*) (*fResponse)[0])->SetKy4(p);
269 ((AliRICHresponse*) (*fResponse)[1])->SetKy4(p);
270 }
271
272 void SetPitch(Float_t p)
273 {
274 ((AliRICHresponse*) (*fResponse)[0])->SetPitch(p);
275 ((AliRICHresponse*) (*fResponse)[1])->SetPitch(p);
276 }
277
278 void SetPADSIZ(Int_t isec, Float_t p1, Float_t p2) {
279 ((AliRICHsegmentation*) (*fSegmentation)[isec-1])->SetPADSIZ(p1,p2);
280 }
281//
282// Cluster formation method
283 void DisIntegration(Float_t, Float_t, Float_t, Int_t&x, Float_t newclust[6][500], Response_t res);
284 ClassDef(AliRICHchamber,1)
285
286 private:
287
288// Maximum and Minimum Chamber size
289 Float_t frMin;
290 Float_t frMax;
291// GEANT volume if for sensitive volume of this chamber
292 Int_t fGid;
293// z-position of this chamber
294 Float_t fzPos;
295// The segmentation models for the cathode planes
296// fnsec=1: one plane segmented, fnsec=2: both planes are segmented.
297 Int_t fnsec;
298 TObjArray *fSegmentation;
299 TObjArray *fResponse;
300
fe4da5cc 301};
302
fe4da5cc 303
ddae0931 304
305class AliRICHcluster : public TObject {
fe4da5cc 306public:
ddae0931 307
308 Int_t fHitNumber; // Hit number
309 Int_t fCathode; // Cathode number
310 Int_t fQ ; // Total charge
311 Int_t fPadX ; // Pad number along X
312 Int_t fPadY ; // Pad number along Y
313 Int_t fQpad ; // Charge per pad
314 Int_t fRSec ; // R -sector of pad
315
fe4da5cc 316public:
ddae0931 317 AliRICHcluster() {
318 fHitNumber=fQ=fPadX=fPadY=fQpad=fRSec=0;
319 }
320 AliRICHcluster(Int_t *clhits);
321 virtual ~AliRICHcluster() {;}
322
323 ClassDef(AliRICHcluster,1) //Cluster object for set:RICH
324 };
325
326
327 class AliRICHreccluster : public TObject {
fe4da5cc 328public:
ddae0931 329
330 Int_t fTracks[3]; //labels of overlapped tracks
331
332 Int_t fQ ; // Q of cluster (in ADC counts)
333 Float_t fX ; // X of cluster
334 Float_t fY ; // Y of cluster
335
336 public:
337 AliRICHreccluster() {
338 fTracks[0]=fTracks[1]=fTracks[2]=0;
339 fQ=0; fX=fY=0;
340 }
341 virtual ~AliRICHreccluster() {;}
342
343 ClassDef(AliRICHreccluster,1) //Cluster object for set:RICH
344 };
345
346//_____________________________________________________________________________
fe4da5cc 347
ddae0931 348class AliRICHdigit : public TObject {
349 public:
350 Int_t fPadX; // Pad number along x
351 Int_t fPadY ; // Pad number along y
352 Int_t fSignal; // Signal amplitude
353
354
355 Int_t fTcharges[10]; // charge per track making this digit (up to 10)
356 Int_t fTracks[10]; // tracks making this digit (up to 10)
357
358
359
360 public:
361 AliRICHdigit() {}
362 AliRICHdigit(Int_t *digits);
363 AliRICHdigit(Int_t *tracks, Int_t *charges, Int_t *digits);
364 virtual ~AliRICHdigit() {}
365
366
367 ClassDef(AliRICHdigit,1) //Digits for set:RICH
368 };
fe4da5cc 369//_____________________________________________________________________________
fe4da5cc 370
ddae0931 371class AliRICHlist : public AliRICHdigit {
372 public:
373
374 Int_t fRpad; // r_pos of pad
375 Int_t fChamber; // chamber number of pad
376 TObjArray *fTrackList;
377
378
379 public:
380 AliRICHlist() {fTrackList=0;}
381 AliRICHlist(Int_t ich, Int_t *digits);
382 virtual ~AliRICHlist() {}
383
384 TObjArray *TrackList() {return fTrackList;}
385
386 ClassDef(AliRICHlist,1) //Digits for set:RICH
387 };
388//___________________________________________
389
390
391//___________________________________________
392
393class AliRICHhit : public AliHit {
394 public:
395 Int_t fChamber; // Chamber number
396 Float_t fParticle; // Geant3 particle type
397 Float_t fTheta ; // Incident theta angle in degrees
398 Float_t fPhi ; // Incident phi angle in degrees
399 Float_t fTlength; // Track length inside the chamber
400 Float_t fEloss; // ionisation energy loss in gas
401 Int_t fPHfirst; // first padhit
402 Int_t fPHlast; // last padhit
403 public:
404 AliRICHhit() {}
405 AliRICHhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
406 virtual ~AliRICHhit() {}
407
408 ClassDef(AliRICHhit,1) //Hits object for set:RICH
409 };
410
411//------------------------------------------------
412// Cerenkov photon object
413//------------------------------------------------
fe4da5cc 414
ddae0931 415class AliRICHCerenkov: public AliHit {
416 public:
417 Int_t fChamber; // Chamber number
418 Float_t fTheta ; // Incident theta angle in degrees
419 Float_t fPhi ; // Incident phi angle in degrees
420 Float_t fTlength; // Track length inside the chamber
421 Int_t fPHfirst; // first padhit
422 Int_t fPHlast; // last padhit
423 public:
424 AliRICHCerenkov() {}
425 AliRICHCerenkov(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *Cerenkovs);
426 virtual ~AliRICHCerenkov() {}
427
428 ClassDef(AliRICHCerenkov,1) //Cerenkovs object for set:RICH
429 };
430
431//--------------------------------------------------
432
433class AliRICH : public AliDetector {
434 public:
435 AliRICH();
436 AliRICH(const char *name, const char *title);
437 virtual ~AliRICH();
438 virtual void AddHit(Int_t, Int_t*, Float_t*);
439 virtual void AddCerenkov(Int_t, Int_t*, Float_t*);
440 virtual void AddCluster(Int_t*);
441 virtual void AddDigits(Int_t, Int_t*, Int_t*, Int_t*);
442 virtual void AddRecCluster(Int_t iCh, Int_t iCat,
443 AliRICHRecCluster* Cluster);
444 virtual void BuildGeometry();
445 virtual void CreateGeometry() {}
446 virtual void CreateMaterials() {}
447 virtual void StepManager();
448 Int_t DistancetoPrimitive(Int_t px, Int_t py);
449 virtual Int_t IsVersion() const =0;
450//
451 TClonesArray *Clusters() {return fClusters;}
452 TClonesArray *Cerenkovs() {return fCerenkovs;}
453 virtual void MakeBranch(Option_t *opt=" ");
454 void SetTreeAddress();
455 virtual void ResetHits();
456 virtual void ResetDigits();
457 virtual void ResetRecClusters();
458 virtual void ReconstructClusters();
459 virtual void Digitise(Int_t,Option_t *opt=" ",Text_t *name=" ");
460//
461// Configuration Methods (per station id)
462//
463// Set Chamber Segmentation Parameters
464// id refers to the station and isec to the cathode plane
465 virtual void SetPADSIZ(Int_t id, Int_t isec, Float_t p1, Float_t p2);
466
467// Set Signal Generation Parameters
468 virtual void SetRSIGM(Int_t id, Float_t p1);
469 virtual void SetMUCHSP(Int_t id, Float_t p1);
470 virtual void SetMUSIGM(Int_t id, Float_t p1, Float_t p2);
471 virtual void SetMAXADC(Int_t id, Float_t p1);
472// Set Segmentation and Response Model
473 virtual void SetSegmentationModel(Int_t id, Int_t isec, AliRICHsegmentation *segmentation);
474 virtual void SetResponseModel(Int_t id, Response_t res, AliRICHresponse *response);
475 virtual void SetNsec(Int_t id, Int_t nsec);
476// Set Stepping Parameters
477 virtual void SetSMAXAR(Float_t p1);
478 virtual void SetSMAXAL(Float_t p1);
479 virtual void SetDMAXAR(Float_t p1);
480 virtual void SetDMAXAL(Float_t p1);
481 virtual void SetRICHACC(Bool_t acc=0, Float_t angmin=2, Float_t angmax=9);
482// Response Simulation
483 virtual void MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id,Response_t res);
484// Return reference to Chamber #id
485 virtual AliRICHchamber& Chamber(Int_t id) {return *((AliRICHchamber *) (*fChambers)[id]);}
486// Retrieve pad hits for a given Hit
487 virtual AliRICHcluster* FirstPad(AliRICHhit *, TClonesArray *);
488 virtual AliRICHcluster* NextPad(TClonesArray *);
489// Return pointers to digits
490 TObjArray *Dchambers() {return fDchambers;}
491 Int_t *Ndch() {return fNdch;}
492 virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
493// Return pointers to reconstructed clusters
494 virtual TObjArray *RecClusters(Int_t iCh, Int_t iCat)
495 {return ( (TObjArray*) (*fRecClusters)[iCh+iCat*10]);}
496
497
498 protected:
499 TObjArray *fChambers; // List of Tracking Chambers
500 Int_t fNclusters; // Number of clusters
501 Int_t fNcerenkovs; // Number of cerenkovs
502 TClonesArray *fClusters; // List of clusters
503 TObjArray *fDchambers; // List of digits
504 TObjArray *fRecClusters; // List of clusters
505 TClonesArray *fCerenkovs; // List of cerenkovs
506 Int_t *fNdch; // Number of digits
507 Text_t *fFileName; // Filename for event mixing
508
509
510 TObjArray *fRawClusters; // List of raw clusters
511 Int_t *fNrawch; // Number of raw clusters
512 TObjArray *fCathCorrel; // List of correlated clusters
513 Int_t *fNcorch; // Number of correl clusters
514 TTree *fTreeC; // Cathode correl index tree
515
516//
517 Bool_t fAccCut; //Transport acceptance cut
518 Float_t fAccMin; //Minimum acceptance cut used during transport
519 Float_t fAccMax; //Minimum acceptance cut used during transport
520//
521
522// Stepping Parameters
523 Float_t fMaxStepGas; // Maximum step size inside the chamber gas
524 Float_t fMaxStepAlu; // Maximum step size inside the chamber aluminum
525 Float_t fMaxDestepGas; // Maximum relative energy loss in gas
526 Float_t fMaxDestepAlu; // Maximum relative energy loss in aluminum
527
528 protected:
529
530 ClassDef(AliRICH,1) //Hits manager for set:RICH
531 };
532//___________________________________________
533class AliRICHRecCluster : public TObject {
534 public:
535 AliRICHRecCluster() ;
536 AliRICHRecCluster(Int_t FirstDigit,Int_t Ichamber, Int_t Icathod) ;
537 virtual ~AliRICHRecCluster();
538 virtual void AddDigit(Int_t Digit);
539 virtual Int_t FirstDigitIndex();
540 virtual Int_t NextDigitIndex();
541 virtual Int_t InvalidDigitIndex() {return -1;}
542
543 virtual Int_t NDigits();
544 virtual void Finish(); // Nothing yet ...
545 virtual Int_t GetCathod() {return fCathod;}
546 virtual Int_t GetChamber() {return fChamber;}
547
548 public:
549 Float_t fX; // reconstructed x
550 Float_t fY; // reconstructed y
551
552 protected:
553 TArrayI *fDigits; // List of digits indexes for that cluster
554 Int_t fNdigit; // Number of digits indexes stored;
555 Int_t fCathod; // Number of the cathod to be used;
556 Int_t fChamber; // Number of the chamber to be used;
557 Int_t fCurrentDigit; // Current Digit inside an iteration
558
559 ClassDef(AliRICHRecCluster,1) //Cluster object for set:RICH
560 };
561//___________________________________________
fe4da5cc 562#endif
563
564
565
ddae0931 566
567
568
569
570
571
572
573
574
575
576
577