]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHParam.h
Protection against empty hit events
[u/mrichter/AliRoot.git] / RICH / AliRICHParam.h
1 #ifndef AliRICHParam_h
2 #define AliRICHParam_h
3
4 #include <TObject.h>
5 #include "AliRICHConst.h"
6
7
8
9 class AliRICHParam :public TObject  
10 {
11 public:
12            AliRICHParam();  
13   virtual ~AliRICHParam()                    {;}  
14   
15   inline  Int_t Neighbours(Int_t iPadX,Int_t iPadY,Int_t aListX[4],Int_t aListY[4])const;                      //pad->neibours
16   inline  void   SigGenInit(Float_t x,Float_t y);
17   inline  Bool_t SigGenCond(Float_t x,Float_t y);
18   static  Int_t   Local2Pad(Float_t x,Float_t y,Int_t &padx,Int_t &pady);               //(x,y)->(padx,pady), returns sector code 
19   static  Int_t   Local2PadX(Float_t x,Float_t y)    {Int_t padx,pady;Local2Pad(x,y,padx,pady);return padx;}//(x,y)->padx
20   static  Int_t   Local2PadY(Float_t x,Float_t y)    {Int_t padx,pady;Local2Pad(x,y,padx,pady);return pady;}//(x,y)->pady
21   static  void    Pad2Local(Int_t padx,Int_t pady,Float_t &x,Float_t &y);                                         //(padx,pady)->(x,y)
22   static  Int_t   LocalX2Wire(Float_t x)      {return  Int_t((x+PcSizeX()/2)/WirePitch())+1;}         //x->wire number
23   static  Float_t Wire2LocalX(Int_t iWireN)   {return iWireN*WirePitch()-PcSizeX()/2;}                //wire number->x
24   
25   Float_t Gain(Float_t y);                                 //Returns total charge induced by single photon
26   Float_t TotalCharge(Int_t iPID,Float_t eloss,Float_t y); //Returns total charge induced by particle lost eloss GeV
27   static  Float_t AssignChargeToPad(Float_t hx,Float_t hy, Int_t px, Int_t py); //Returns charge assigned to given pad for a given hit
28   void    FirstPad(Float_t x,Float_t y);
29           
30   static  Float_t AnodeCathodeGap()          {return 0.2;}
31   
32   static  Int_t   NpadsX()                   {return 144;}
33   static  Int_t   NpadsY()                   {return 160;}   
34   static  Int_t   NpadsXsec()                {return NpadsX()/3;}   
35   static  Int_t   NpadsYsec()                {return NpadsY()/2;}   
36   static  Float_t DeadZone()                 {return 2.6;}
37   static  Float_t PadSizeX()                 {return 0.84;}
38   static  Float_t PadSizeY()                 {return 0.8;}
39   static  Float_t SectorSizeX()              {return NpadsX()*PadSizeX()/3;}
40   static  Float_t SectorSizeY()              {return NpadsY()*PadSizeY()/2;}  
41   static  Float_t PcSizeX()                  {return NpadsX()*PadSizeX()+2*DeadZone();}
42   static  Float_t PcSizeY()                  {return NpadsY()*PadSizeY()+DeadZone();}
43   static  Float_t WirePitch()                {return PadSizeX()/2;}
44             
45   void    Size(Float_t x,Float_t y,Float_t z){fSizeX=x;fSizeY=y;fSizeZ=z;}
46   void    GeantSize(Float_t *pArr)      const{pArr[0]=fSizeX/2;pArr[1]=fSizeY/2;pArr[2]=fSizeZ/2;}  
47   Float_t SizeX()                       const{return fSizeX;}
48   Float_t SizeY()                       const{return fSizeY;}
49   Float_t SizeZ()                       const{return fSizeZ;}   
50   static  Float_t Offset()                   {return 490+1.267;}  
51   static  Float_t AngleYZ()                  {return 19.5*TMath::DegToRad();} 
52   static  Float_t AngleXY()                  {return 20*TMath::DegToRad();} 
53   static  void    AngleRot(Float_t angle)    {       fgAngleRot=angle;}
54   static  Float_t AngleRot()                 {return fgAngleRot*kD2r;}                
55   static  Float_t GapThickness()             {return 8.0;}      
56   void    ProximityGapThickness(Float_t a)   {       fProximityGapThickness=a;}
57   Float_t ProximityGapThickness()       const{return fProximityGapThickness;}    
58   void    QuartzLength(Float_t a)            {       fQuartzLength=a;}
59   Float_t QuartzLength()                const{return fQuartzLength;}   
60   void    QuartzWidth(Float_t a)             {       fQuartzWidth=a;}
61   Float_t QuartzWidth()                 const{return fQuartzWidth;}
62   static Float_t QuartzThickness()           {return 0.5;}   
63   void    OuterFreonLength(Float_t a)        {       fOuterFreonLength=a;}
64   Float_t OuterFreonLength()            const{return fOuterFreonLength;}   
65   void    OuterFreonWidth(Float_t a)         {       fOuterFreonWidth=a;}
66   Float_t OuterFreonWidth()             const{return fOuterFreonWidth;}   
67   void    InnerFreonLength(Float_t a)        {       fInnerFreonLength=a;}
68   Float_t InnerFreonLength()            const{return fInnerFreonLength;}   
69   void    InnerFreonWidth(Float_t a)         {       fInnerFreonWidth=a;}
70   Float_t InnerFreonWidth()             const{return fInnerFreonWidth;}   
71   static  Float_t FreonThickness()           {return 1.5;}   
72   static  Float_t RadiatorToPads()           {return FreonThickness()+QuartzThickness()+GapThickness();}   
73         
74   void    SigmaIntegration(Float_t a)        {       fSigmaIntegration=a;}    
75   Float_t SigmaIntegration()            const{return fSigmaIntegration;}    
76   void    ChargeSpreadX(Float_t a)           {       fChargeSpreadX=a;}
77   Float_t ChargeSpreadX()               const{return fChargeSpreadX;}    
78   void    ChargeSpreadY(Float_t a)           {       fChargeSpreadY=a;}  
79   Float_t ChargeSpreadY()               const{return fChargeSpreadY;}  
80   Float_t AreaX()                       const{return fSigmaIntegration*fChargeSpreadX;} 
81   Float_t AreaY()                       const{return fSigmaIntegration*fChargeSpreadY;} 
82   void    ChargeSlope(Float_t a)             {       fChargeSlope=a;}
83   Float_t ChargeSlope()                      {return fChargeSlope;}
84   void    MaxAdc(Int_t a)                    {       fMaxAdc=a;}
85   Int_t   MaxAdc()                      const{return fMaxAdc;}
86   void    AlphaFeedback(Float_t a)           {       fAlphaFeedback=a;}
87   Float_t AlphaFeedback()               const{return fAlphaFeedback;}
88   void    EIonisation(Float_t a)             {       fEIonisation=a;}
89   Float_t EIonisation()                 const{return fEIonisation;}                            
90   static Float_t SqrtKx3()  {return 0.77459667;}
91   static Float_t Kx2()      {return 0.962;}
92   static Float_t Kx4()      {return 0.379;}
93   static Float_t SqrtKy3()  {return 0.77459667;}
94   static Float_t Ky2()      {return 0.962;}
95   static Float_t Ky4()      {return 0.379;}
96
97   void    WireSag(Int_t a)                   {       fWireSag=a;}
98   void    Voltage(Int_t a)                   {       fVoltage=a;}       
99   Float_t Voltage()                     const{return fVoltage;}       
100 protected:
101   static Int_t   Local2Sector(Float_t &x,Float_t &y); //(x,y)->sector
102   static Int_t   Pad2Sector(Int_t &padx,Int_t &pady); //(padx,pady)->sector
103   
104   Int_t   fCurrentPadX,fCurrentPadY;              //???
105   Int_t   fCurrentWire;                           //???
106     
107   Float_t fSizeX;  Float_t fSizeY; Float_t fSizeZ;                                //chamber outer size, cm
108   static  Float_t fgAngleRot;                                                     //azimuthal rotation XY plane, deg  
109   Float_t fProximityGapThickness;                                                 //proximity gap thickness, cm
110   Float_t fQuartzLength;     Float_t fQuartzWidth;                                //quartz window size, cm
111   Float_t fOuterFreonLength; Float_t fOuterFreonWidth;                            //freon box outer size, cm
112   Float_t fInnerFreonLength; Float_t fInnerFreonWidth;                            //freon box inner size, cm
113   
114   Float_t fChargeSlope;              //Slope of the charge distribution
115   Float_t fChargeSpreadX;            //Width of the charge distribution in x
116   Float_t fChargeSpreadY;            //Width of the charge distribution in y
117   Float_t fSigmaIntegration;         //Number of sigma's used for charge distribution
118   Float_t fAlphaFeedback;            //Feedback photons coefficient
119   Float_t fEIonisation;              //Mean ionisation energy
120   Int_t   fMaxAdc;                   //Maximum ADC channel
121   Int_t   fWireSag;                  //Flag to turn on/off (0/1) wire sag
122   Int_t   fVoltage;                  //Working voltage (2000, 2050, 2100, 2150)
123
124   ClassDef(AliRICHParam,2)    //RICH main parameters
125 };
126 //__________________________________________________________________________________________________
127 void AliRICHParam::SigGenInit(Float_t x,Float_t y)
128 {//Initialises pad and wire position during stepping
129   Local2Pad(x,y,fCurrentPadX,fCurrentPadY);
130   fCurrentWire= (x>0) ? Int_t(x/WirePitch())+1 : Int_t(x/WirePitch())-1 ;
131 }
132 //__________________________________________________________________________________________________
133 Bool_t AliRICHParam::SigGenCond(Float_t x,Float_t y)
134 {//Signal will be generated if particle crosses pad boundary or boundary between two wires.
135   Int_t curPadX,curPadY;
136   Local2Pad(x,y,curPadX,curPadY);
137   Int_t currentWire=(x>0) ? Int_t(x/WirePitch())+1 : Int_t(x/WirePitch())-1;
138   if((curPadX != fCurrentPadX) || (curPadY != fCurrentPadY) || (currentWire!=fCurrentWire)) 
139     return kTRUE;
140   else
141     return kFALSE;
142 }//Bool_t AliRICHParam::SigGenCond(Float_t x,Float_t y)
143 //__________________________________________________________________________________________________
144 Int_t AliRICHParam::Neighbours(Int_t iPadX,Int_t iPadY,Int_t listX[4],Int_t listY[4])const
145 {
146   listX[0]=iPadX;   listY[0]=iPadY-1;       
147   listX[1]=iPadX+1; listY[1]=iPadY;       
148   listX[2]=iPadX;   listY[2]=iPadY+1;       
149   listX[3]=iPadX-1; listY[3]=iPadY;       
150   return 4;
151 }
152 //__________________________________________________________________________________________________
153 #endif //AliRICHParam_h