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