]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/AliRICHParam.h
Radiator to Pad goes static.
[u/mrichter/AliRoot.git] / RICH / AliRICHParam.h
index 109eaea7d636a8e91d5b1ed4b90591a5b8bf5ba5..82000e8b7ac122b45a1677be084d07651d7024a2 100644 (file)
 class AliRICHParam :public TObject  
 {
 public:
-                 AliRICHParam();  
-         void    Recalc();//Recalculate dependent parameters after changes 
-  inline void    Segmentation(Int_t Nx, Int_t Ny)   {fNx=Nx;fNy=Ny;Recalc();}
-  inline Int_t   Nx()                          const{return fNx;}
-  inline Int_t   Ny()                          const{return fNy;}   
-  inline void    DeadZone(Float_t a)                {       fDeadZone=a;Recalc();}
-  inline Float_t DeadZone()                    const{return fDeadZone;}
-  inline void    PadSize(Float_t x,Float_t y)       {       fPadX=x;fPadY=y;Recalc();} 
-  inline Float_t PadX()                        const{return fPadX;}
-  inline Float_t PadY()                        const{return fPadY;}
-  inline Float_t PadPlaneWidth()               const{return fPadPlaneWidth;}
-  inline Float_t PadPlaneLength()              const{return fPadPlaneLength;}  
-  inline void    Size(Float_t x,Float_t y,Float_t z){fSizeX=x;fSizeY=y;fSizeZ=z;}
-  inline void    GeantSize(Float_t *pParam)    const{pParam[0]=fSizeX/2;pParam[1]=fSizeY/2;pParam[2]=fSizeZ/2;}  
-  inline Float_t SizeX()                       const{return fSizeX;}
-  inline Float_t SizeY()                       const{return fSizeY;}
-  inline Float_t SizeZ()                       const{return fSizeZ;}   
-  inline void    Offset(Float_t offset)             {       fOffset=offset;}  
-  inline Float_t Offset()                      const{return fOffset;}  
-  inline void    AnglesDeg(Float_t xy,Float_t yz)   {       fAngleXY=xy;fAngleYZ=yz;} 
-  inline Float_t AngleYZ()                     const{return fAngleYZ*d2r;} 
-  inline Float_t AngleXY()                     const{return fAngleXY*d2r;} 
-  inline void    AngleRot(Float_t angle)            {       fAngleRot=angle;}
-  inline Float_t AngleRot()                    const{return fAngleRot*d2r;}                
-  inline void    GapThickness(Float_t a)            {       fGapThickness=a;}    
-  inline Float_t GapThickness()                const{return fGapThickness;}      
-  inline void    ProximityGapThickness(Float_t a)   {       fProximityGapThickness=a;}
-  inline Float_t ProximityGapThickness()       const{return fProximityGapThickness;}    
-  inline void    QuartzLength(Float_t a)            {       fQuartzLength=a;}
-  inline Float_t QuartzLength()                const{return fQuartzLength;}   
-  inline void    QuartzWidth(Float_t a)             {       fQuartzWidth=a;}
-  inline Float_t QuartzWidth()                 const{return fQuartzWidth;}
-  inline void    QuartzThickness(Float_t a)         {       fQuartzThickness=a;}
-  inline Float_t QuartzThickness()             const{return fQuartzThickness;}   
-  inline void    OuterFreonLength(Float_t a)        {       fOuterFreonLength=a;}
-  inline Float_t OuterFreonLength()            const{return fOuterFreonLength;}   
-  inline void    OuterFreonWidth(Float_t a)         {       fOuterFreonWidth=a;}
-  inline Float_t OuterFreonWidth()             const{return fOuterFreonWidth;}   
-  inline void    InnerFreonLength(Float_t a)        {       fInnerFreonLength=a;}
-  inline Float_t InnerFreonLength()            const{return fInnerFreonLength;}   
-  inline void    InnerFreonWidth(Float_t a)         {       fInnerFreonWidth=a;}
-  inline Float_t InnerFreonWidth()             const{return fInnerFreonWidth;}   
-  inline void    FreonThickness(Float_t a)          {       fFreonThickness=a;}
-  inline Float_t FreonThickness()              const{return fFreonThickness;}   
-  inline void    RadiatorToPads(Float_t a)          {       fRadiatorToPads=a;}
-  inline Float_t RadiatorToPads()              const{return fRadiatorToPads;}   
-               
-  inline void    SigmaIntegration(Float_t a)        {       fSigmaIntegration=a;}    
-  inline Float_t SigmaIntegration()            const{return fSigmaIntegration;}    
-  inline void    ChargeSpreadX(Float_t a)           {       fChargeSpreadX=a;}
-  inline Float_t ChargeSpreadX()               const{return fChargeSpreadX;}    
-  inline void    ChargeSpreadY(Float_t a)           {       fChargeSpreadY=a;}
-  inline Float_t ChargeSpreadY()               const{return fChargeSpreadY;}   
-  inline void    ChargeSlope(Float_t a)             {       fChargeSlope=a;}
-  inline Float_t ChargeSlope()                      {return fChargeSlope;}
-  inline void    MaxAdc(Float_t a)                  {       fMaxAdc=a;}
-  inline Float_t MaxAdc()                      const{return fMaxAdc;}
-  inline void    Pitch(Float_t a)                   {       fPitch=a;};
-  inline Float_t Pitch()                       const{return fPitch;}
-  inline void    AlphaFeedback(Float_t a)           {       fAlphaFeedback=a;}
-  inline Float_t AlphaFeedback()               const{return fAlphaFeedback;}
-  inline void    EIonisation(Float_t a)             {       fEIonisation=a;}
-  inline Float_t EIonisation()                 const{return fEIonisation;}                            
-  inline void    SqrtKx3(Float_t a)                 {       fSqrtKx3=a;};
-  inline void    Kx2(Float_t a)                     {       fKx2=a;};
-  inline void    Kx4(Float_t a)                     {       fKx4=a;};
-  inline void    SqrtKy3(Float_t a)                 {       fSqrtKy3=a;};
-  inline void    Ky2(Float_t a)                     {       fKy2=a;};
-  inline void    Ky4(Float_t a)                     {       fKy4=a;};
-  inline void    WireSag(Int_t a)                   {       fWireSag=a;};
-  inline void    Voltage(Int_t a)                   {       fVoltage=a;};       
-protected:
-  Int_t   fNx;                //number of pads along X
-  Int_t   fNy;                //number of pads along Y
-  Float_t fDeadZone;          //spacer between PC planes, cm     
-  Float_t fPadX;              //pad width, cm
-  Float_t fPadY;              //pad lenght, cm
-  Float_t fPadPlaneWidth;     //pad plane width, cm
-  Float_t fPadPlaneLength;    //pad plane length, cm
+           AliRICHParam();  
+  virtual ~AliRICHParam()                    {;}  
+  
+  inline  Int_t Neighbours(Int_t iPadX,Int_t iPadY,Int_t aListX[4],Int_t aListY[4])const;                      //pad->neibours
+  inline  void   SigGenInit(Float_t x,Float_t y);
+  inline  Bool_t SigGenCond(Float_t x,Float_t y);
+  static  Int_t   Local2Pad(Float_t x,Float_t y,Int_t &padx,Int_t &pady);               //(x,y)->(padx,pady), returns sector code 
+  static  Int_t   Local2PadX(Float_t x,Float_t y)    {Int_t padx,pady;Local2Pad(x,y,padx,pady);return padx;}//(x,y)->padx
+  static  Int_t   Local2PadY(Float_t x,Float_t y)    {Int_t padx,pady;Local2Pad(x,y,padx,pady);return pady;}//(x,y)->pady
+  static  void    Pad2Local(Int_t padx,Int_t pady,Float_t &x,Float_t &y);                                         //(padx,pady)->(x,y)
+  static  Int_t   LocalX2Wire(Float_t x)      {return  Int_t((x+PcSizeX()/2)/WirePitch())+1;}         //x->wire number
+  static  Float_t Wire2LocalX(Int_t iWireN)   {return iWireN*WirePitch()-PcSizeX()/2;}                //wire number->x
   
-  Float_t fSizeX;             //chamber length, cm
-  Float_t fSizeY;             //chamber thickness, cm
-  Float_t fSizeZ;             //chamber width, cm
-  Float_t fAngleRot;          //azimuthal rotation angle in X-Y plane, grad  
-  Float_t fAngleYZ;           //angle between RICH chambers in YZ plane, grad
-  Float_t fAngleXY;           //angle between RICH chambers in XY plane, grad
-  Float_t fOffset;            //chambers offset from IP, cm   
-  Float_t fGapThickness;            //gap thickness, cm
-  Float_t fProximityGapThickness;   //proximity gap thickness, cm
-  Float_t fQuartzLength;            //quartz length
-  Float_t fQuartzWidth;             //quartz width
-  Float_t fQuartzThickness;         //quartz thickness
-  Float_t fOuterFreonLength;        //outer freon length
-  Float_t fOuterFreonWidth;         //outer freon width
-  Float_t fInnerFreonLength;        //inner freon length
-  Float_t fInnerFreonWidth;         //inner freon width
-  Float_t fFreonThickness;          //freon thickness
-  Float_t fRadiatorToPads;          //distance from radiator to pads
+  Float_t Gain(Float_t y);                                 //Returns total charge induced by single photon
+  Float_t TotalCharge(Int_t iPID,Float_t eloss,Float_t y); //Returns total charge induced by particle lost eloss GeV
+  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
+  void    FirstPad(Float_t x,Float_t y);
+          
+  static  Float_t AnodeCathodeGap()          {return 0.2;}
+  
+  static  Int_t   NpadsX()                   {return 144;}
+  static  Int_t   NpadsY()                   {return 160;}   
+  static  Int_t   NpadsXsec()                {return NpadsX()/3;}   
+  static  Int_t   NpadsYsec()                {return NpadsY()/2;}   
+  static  Float_t DeadZone()                 {return 2.6;}
+  static  Float_t PadSizeX()                 {return 0.84;}
+  static  Float_t PadSizeY()                 {return 0.8;}
+  static  Float_t SectorSizeX()              {return NpadsX()*PadSizeX()/3;}
+  static  Float_t SectorSizeY()              {return NpadsY()*PadSizeY()/2;}  
+  static  Float_t PcSizeX()                  {return NpadsX()*PadSizeX()+2*DeadZone();}
+  static  Float_t PcSizeY()                  {return NpadsY()*PadSizeY()+DeadZone();}
+  static  Float_t WirePitch()                {return PadSizeX()/2;}
+            
+  void    Size(Float_t x,Float_t y,Float_t z){fSizeX=x;fSizeY=y;fSizeZ=z;}
+  void    GeantSize(Float_t *pArr)      const{pArr[0]=fSizeX/2;pArr[1]=fSizeY/2;pArr[2]=fSizeZ/2;}  
+  Float_t SizeX()                       const{return fSizeX;}
+  Float_t SizeY()                       const{return fSizeY;}
+  Float_t SizeZ()                       const{return fSizeZ;}   
+  void    Offset(Float_t offset)             {       fOffset=offset;}  
+  Float_t Offset()                      const{return fOffset;}  
+  void    Angles(Float_t xy,Float_t yz)      {       fAngleXY=xy;fAngleYZ=yz;} 
+  Float_t AngleYZ()                     const{return fAngleYZ*kD2r;} 
+  Float_t AngleXY()                     const{return fAngleXY*kD2r;} 
+  void    AngleRot(Float_t angle)            {       fAngleRot=angle;}
+  Float_t AngleRot()                    const{return fAngleRot*kD2r;}                
+  static Float_t GapThickness()              {return 8.0;}      
+  void    ProximityGapThickness(Float_t a)   {       fProximityGapThickness=a;}
+  Float_t ProximityGapThickness()       const{return fProximityGapThickness;}    
+  void    QuartzLength(Float_t a)            {       fQuartzLength=a;}
+  Float_t QuartzLength()                const{return fQuartzLength;}   
+  void    QuartzWidth(Float_t a)             {       fQuartzWidth=a;}
+  Float_t QuartzWidth()                 const{return fQuartzWidth;}
+  static Float_t QuartzThickness()           {return 0.5;}   
+  void    OuterFreonLength(Float_t a)        {       fOuterFreonLength=a;}
+  Float_t OuterFreonLength()            const{return fOuterFreonLength;}   
+  void    OuterFreonWidth(Float_t a)         {       fOuterFreonWidth=a;}
+  Float_t OuterFreonWidth()             const{return fOuterFreonWidth;}   
+  void    InnerFreonLength(Float_t a)        {       fInnerFreonLength=a;}
+  Float_t InnerFreonLength()            const{return fInnerFreonLength;}   
+  void    InnerFreonWidth(Float_t a)         {       fInnerFreonWidth=a;}
+  Float_t InnerFreonWidth()             const{return fInnerFreonWidth;}   
+  static  Float_t FreonThickness()           {return 1.5;}   
+  static  Float_t RadiatorToPads()           {return FreonThickness()+QuartzThickness()+GapThickness();}   
+        
+  void    SigmaIntegration(Float_t a)        {       fSigmaIntegration=a;}    
+  Float_t SigmaIntegration()            const{return fSigmaIntegration;}    
+  void    ChargeSpreadX(Float_t a)           {       fChargeSpreadX=a;}
+  Float_t ChargeSpreadX()               const{return fChargeSpreadX;}    
+  void    ChargeSpreadY(Float_t a)           {       fChargeSpreadY=a;}  
+  Float_t ChargeSpreadY()               const{return fChargeSpreadY;}  
+  Float_t AreaX()                       const{return fSigmaIntegration*fChargeSpreadX;} 
+  Float_t AreaY()                       const{return fSigmaIntegration*fChargeSpreadY;} 
+  void    ChargeSlope(Float_t a)             {       fChargeSlope=a;}
+  Float_t ChargeSlope()                      {return fChargeSlope;}
+  void    MaxAdc(Int_t a)                    {       fMaxAdc=a;}
+  Int_t   MaxAdc()                      const{return fMaxAdc;}
+  void    AlphaFeedback(Float_t a)           {       fAlphaFeedback=a;}
+  Float_t AlphaFeedback()               const{return fAlphaFeedback;}
+  void    EIonisation(Float_t a)             {       fEIonisation=a;}
+  Float_t EIonisation()                 const{return fEIonisation;}                            
+  static Float_t SqrtKx3()  {return 0.77459667;}
+  static Float_t Kx2()      {return 0.962;}
+  static Float_t Kx4()      {return 0.379;}
+  static Float_t SqrtKy3()  {return 0.77459667;}
+  static Float_t Ky2()      {return 0.962;}
+  static Float_t Ky4()      {return 0.379;}
 
+  void    WireSag(Int_t a)                   {       fWireSag=a;}
+  void    Voltage(Int_t a)                   {       fVoltage=a;}       
+  Float_t Voltage()                     const{return fVoltage;}       
+protected:
+  static Int_t   Local2Sector(Float_t &x,Float_t &y); //(x,y)->sector
+  static Int_t   Pad2Sector(Int_t &padx,Int_t &pady); //(padx,pady)->sector
+  
+  Int_t   fCurrentPadX,fCurrentPadY;              //???
+  Int_t   fCurrentWire;                           //???
+    
+  Float_t fSizeX;  Float_t fSizeY; Float_t fSizeZ;                                //chamber outer size, cm
+  Float_t fAngleRot;                                                              //azimuthal rotation XY plane, deg  
+  Float_t fAngleYZ;                                                               //angle between chambers YZ plane, deg
+  Float_t fAngleXY;                                                               //angle between chambers XY plane, deg
+  Float_t fOffset;                                                                //chambers offset from IP, cm   
+  Float_t fProximityGapThickness;                                                 //proximity gap thickness, cm
+  Float_t fQuartzLength;     Float_t fQuartzWidth;                                //quartz window size, cm
+  Float_t fOuterFreonLength; Float_t fOuterFreonWidth;                            //freon box outer size, cm
+  Float_t fInnerFreonLength; Float_t fInnerFreonWidth;                            //freon box inner size, cm
+  
   Float_t fChargeSlope;              //Slope of the charge distribution
   Float_t fChargeSpreadX;            //Width of the charge distribution in x
   Float_t fChargeSpreadY;            //Width of the charge distribution in y
   Float_t fSigmaIntegration;         //Number of sigma's used for charge distribution
   Float_t fAlphaFeedback;            //Feedback photons coefficient
   Float_t fEIonisation;              //Mean ionisation energy
-  Float_t fMaxAdc;                   //Maximum ADC channel
-  Float_t fSqrtKx3;                  //Mathieson parameters for x
-  Float_t fKx2;                      //Mathieson parameters for x
-  Float_t fKx4;                      //Mathieson parameters for x
-  Float_t fSqrtKy3;                  //Mathieson parameters for y
-  Float_t fKy2;                      //Mathieson parameters for y 
-  Float_t fKy4;                      //Mathieson parameters for y
-  Float_t fPitch;                    //Anode-cathode pitch
+  Int_t   fMaxAdc;                   //Maximum ADC channel
   Int_t   fWireSag;                  //Flag to turn on/off (0/1) wire sag
   Int_t   fVoltage;                  //Working voltage (2000, 2050, 2100, 2150)
 
-  ClassDef(AliRICHParam,1)    //RICH main parameters
+  ClassDef(AliRICHParam,2)    //RICH main parameters
 };
-
+//__________________________________________________________________________________________________
+void AliRICHParam::SigGenInit(Float_t x,Float_t y)
+{//Initialises pad and wire position during stepping
+  Local2Pad(x,y,fCurrentPadX,fCurrentPadY);
+  fCurrentWire= (x>0) ? Int_t(x/WirePitch())+1 : Int_t(x/WirePitch())-1 ;
+}
+//__________________________________________________________________________________________________
+Bool_t AliRICHParam::SigGenCond(Float_t x,Float_t y)
+{//Signal will be generated if particle crosses pad boundary or boundary between two wires.
+  Int_t curPadX,curPadY;
+  Local2Pad(x,y,curPadX,curPadY);
+  Int_t currentWire=(x>0) ? Int_t(x/WirePitch())+1 : Int_t(x/WirePitch())-1;
+  if((curPadX != fCurrentPadX) || (curPadY != fCurrentPadY) || (currentWire!=fCurrentWire)) 
+    return kTRUE;
+  else
+    return kFALSE;
+}//Bool_t AliRICHParam::SigGenCond(Float_t x,Float_t y)
+//__________________________________________________________________________________________________
+Int_t AliRICHParam::Neighbours(Int_t iPadX,Int_t iPadY,Int_t listX[4],Int_t listY[4])const
+{
+  listX[0]=iPadX;   listY[0]=iPadY-1;       
+  listX[1]=iPadX+1; listY[1]=iPadY;       
+  listX[2]=iPadX;   listY[2]=iPadY+1;       
+  listX[3]=iPadX-1; listY[3]=iPadY;       
+  return 4;
+}
+//__________________________________________________________________________________________________
 #endif //AliRICHParam_h