LCOV - code coverage report
Current view: top level - HMPID/HMPIDbase - AliHMPIDParam.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 83 148 56.1 %
Date: 2016-06-14 17:26:59 Functions: 60 95 63.2 %

          Line data    Source code
       1             : #ifndef AliHMPIDParam_h
       2             : #define AliHMPIDParam_h
       3             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : /* $Id$ */
       7             : 
       8             : #include "stdio.h"
       9             : #include <TMath.h>
      10             : #include <TNamed.h>        //base class
      11             : #include <TGeoManager.h>   //Instance()
      12             : #include <TGeoMatrix.h>   //Instance()
      13             : #include <TVector3.h>      //Lors2Mars() Mars2Lors()
      14             :  
      15             : // Class providing all the needed parametrised information
      16             : // to construct the geometry, to define segmentation and to provide response model
      17             : // In future will also provide all the staff needed for alignment and calibration
      18             : 
      19             : class AliHMPIDParam :public TNamed  
      20             : {
      21             : public:
      22             : //ctor&dtor    
      23           0 :   virtual        ~AliHMPIDParam() {if (fgInstance){for(Int_t i=0;i<7;i++){delete fM[i];fM[i] = 0x0;};fgInstance=0;}}
      24             :   
      25             :   void     Print(Option_t *opt="") const;                                         //print current parametrization
      26             :          
      27             :   static inline AliHMPIDParam* Instance();                                //pointer to AliHMPIDParam singleton
      28             :   static inline AliHMPIDParam* InstanceNoGeo();                           //pointer to AliHMPIDParam singleton without geometry.root for MOOD, displays, ...
      29             : //geo info
      30             :   enum EChamberData{kMinCh=0,kMaxCh=6,kMinPc=0,kMaxPc=5};      //Segmenation
      31             :   enum EPadxData{kPadPcX=80,kMinPx=0,kMaxPx=79,kMaxPcx=159};   //Segmentation structure along x
      32             :   enum EPadyData{kPadPcY=48,kMinPy=0,kMaxPy=47,kMaxPcy=143};   //Segmentation structure along y 
      33             :   //The electronics takes the 32bit int as: first 9 bits for the pedestal and the second 9 bits for threshold - values below should be within range
      34             :   enum EPedestalData{kPadMeanZeroCharge=400,kPadSigmaZeroCharge=20,kPadMeanMasked=401,kPadSigmaMasked=20};         //One can go up to 5 sigma cut, overflow is protected in AliHMPIDCalib
      35             :   
      36             :       
      37           0 :   static Float_t r2d         (                               )     {return 57.2957795;                               }
      38     2173114 :   static Float_t SizePadX    (                               )     {return fgCellX;                                  }  //pad size x, [cm]  
      39     2173306 :   static Float_t SizePadY    (                               )     {return fgCellY;                                  }  //pad size y, [cm]  
      40             : 
      41           0 :   static Float_t SizePcX    (                                )     {return fgPcX;                                    }  // PC size x
      42          40 :   static Float_t SizePcY    (                                )     {return fgPcY;                                    }  // PC size y
      43         440 :   static Float_t MaxPcX      (Int_t iPc                      )     {return fgkMaxPcX[iPc];                           }  // PC limits
      44         440 :   static Float_t MaxPcY      (Int_t iPc                      )     {return fgkMaxPcY[iPc];                           }  // PC limits
      45         440 :   static Float_t MinPcX      (Int_t iPc                      )     {return fgkMinPcX[iPc];                           }  // PC limits
      46         440 :   static Float_t MinPcY      (Int_t iPc                      )     {return fgkMinPcY[iPc];                           }  // PC limits
      47     1293602 :   static Int_t   Nsig        (                               )     {return fgNSigmas;                                 }  //Getter n. sigmas for noise
      48        1764 :   static Float_t SizeAllX    (                               )     {return fgAllX;                                   }  //all PCs size x, [cm]        
      49        1764 :   static Float_t SizeAllY    (                               )     {return fgAllY;                                   }  //all PCs size y, [cm]    
      50             : 
      51     1086326 :   static Float_t LorsX       (Int_t pc,Int_t padx             )    {return (padx    +0.5)*SizePadX()+fgkMinPcX[pc];  }  //center of the pad x, [cm]
      52     1086528 :   static Float_t LorsY       (Int_t pc,Int_t pady            )     {return (pady    +0.5)*SizePadY()+fgkMinPcY[pc];  }  //center of the pad y, [cm]
      53             : 
      54           0 :   Float_t ChPhiMin    (Int_t ch                       ) {return Lors2Mars(ch,LorsX(ch,kMinPx)-fX,LorsY(ch,kMinPy)-fY).Phi()*r2d();}      //PhiMin (degree) of the camber ch
      55           0 :   Float_t ChThMin     (Int_t ch                       ) {return Lors2Mars(ch,LorsX(ch,kMinPx)-fX,LorsY(ch,kMinPy)-fY).Theta()*r2d();}    //ThMin  (degree) of the camber ch
      56           0 :   Float_t ChPhiMax    (Int_t ch                       ) {return Lors2Mars(ch,LorsX(ch,kMaxPcx)-fX,LorsY(ch,kMaxPcy)-fY).Phi()*r2d();}    //PhiMax (degree) of the camber ch
      57           0 :   Float_t ChThMax     (Int_t ch                       ) {return Lors2Mars(ch,LorsX(ch,kMaxPcx)-fX,LorsY(ch,kMaxPcy)-fY).Theta()*r2d();}  //ThMax  (degree) of the camber ch
      58             : 
      59             :   inline static void   Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py);                                     //(x,y)->(pc,px,py) 
      60             : 
      61       13494 :   static Int_t   Abs         (Int_t ch,Int_t pc,Int_t x,Int_t y)   {return ch*100000000+pc*1000000+x*1000+y;         }  //(ch,pc,padx,pady)-> abs pad
      62         112 :   static Int_t   DDL2C       (Int_t ddl                      )     {return ddl/2;                                    }  //ddl -> chamber
      63       10232 :   static Int_t   A2C         (Int_t pad                      )     {return pad/100000000;                            }  //abs pad -> chamber
      64     2236570 :   static Int_t   A2P         (Int_t pad                      )     {return pad%100000000/1000000;                    }  //abs pad -> pc 
      65     1132564 :   static Int_t   A2X         (Int_t pad                      )     {return pad%1000000/1000;                         }  //abs pad -> pad X 
      66     1132462 :   static Int_t   A2Y         (Int_t pad                      )     {return pad%1000;                                 }  //abs pad -> pad Y 
      67             : 
      68     1293602 :   static Bool_t  IsOverTh    (Float_t q                      )     {return q >= fgThreshold;                         }  //is digit over threshold?
      69             :   
      70        1758 :   Bool_t  GetInstType        (                               )const{return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
      71             :   
      72             :   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                           //is the point in dead area?
      73             :   inline static Bool_t IsDeadPad(Int_t padx,Int_t pady,Int_t ch);                                                       //is a dead pad?
      74             :   
      75             :   inline void SetChStatus(Int_t ch,Bool_t status=kTRUE);
      76             :   inline void SetSectStatus(Int_t ch,Int_t sect,Bool_t status); 
      77             :   inline void SetPcStatus(Int_t ch,Int_t pc,Bool_t status); 
      78             :   inline void PrintChStatus(Int_t ch);
      79             :   inline void SetGeomAccept();
      80             :   
      81             :   inline static Int_t  InHVSector(           Float_t y     );                                                           //find HV sector
      82         128 :   static Int_t     Radiator(          Float_t y               )       {if (InHVSector(y)<0) return -1; return InHVSector(y)/2;}
      83          32 :   static Double_t  HinRad(Float_t y)         {if (Radiator(y)<0) return -1;return y-Radiator(y)*fgkMinPcY[Radiator(y)];}                                   // height in the radiator to estimate temperature from gradient
      84       39020 :   static Bool_t    IsInside    (Float_t x,Float_t y,Float_t d=0)     {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
      85             : 
      86             :   //For optical properties
      87           0 :   static Double_t   EPhotMin()                       {return 5.5;}           //
      88           0 :   static Double_t   EPhotMax()                       {return 8.5;}           //Photon energy range,[eV]
      89         182 :   static Double_t NIdxRad(Double_t eV,Double_t temp) {return TMath::Sqrt(1+0.554*(1239.84/eV)*(1239.84/eV)/((1239.84/eV)*(1239.84/eV)-5769))-0.0005*(temp-20);}
      90           0 :   static Double_t NIdxWin(Double_t eV)               {return TMath::Sqrt(1+46.411/(10.666*10.666-eV*eV)+228.71/(18.125*18.125-eV*eV));}  
      91           0 :   static Double_t NMgF2Idx(Double_t eV)              {return 1.7744 - 2.866e-3*(1239.842609/eV) + 5.5564e-6*(1239.842609/eV)*(1239.842609/eV);}          // MgF2 idx of trasparency system
      92           0 :   static Double_t NIdxGap(Double_t eV)               {return 1+0.12489e-6/(2.62e-4 - eV*eV/1239.84/1239.84);}
      93           0 :   static Double_t LAbsRad(Double_t eV)               {return (eV<7.8)*(GausPar(eV,3.20491e16,-0.00917890,0.742402)+GausPar(eV,3035.37,4.81171,0.626309))+(eV>=7.8)*0.0001;}
      94           0 :   static Double_t LAbsWin(Double_t eV)               {return (eV<8.2)*(818.8638-301.0436*eV+36.89642*eV*eV-1.507555*eV*eV*eV)+(eV>=8.2)*0.0001;}//fit from DiMauro data 28.10.03
      95           0 :   static Double_t LAbsGap(Double_t eV)               {return (eV<7.75)*6512.399+(eV>=7.75)*3.90743e-2/(-1.655279e-1+6.307392e-2*eV-8.011441e-3*eV*eV+3.392126e-4*eV*eV*eV);}
      96           0 :   static Double_t QEffCSI(Double_t eV)               {return (eV>6.07267)*0.344811*(1-exp(-1.29730*(eV-6.07267)));}//fit from DiMauro data 28.10.03
      97           0 :   static Double_t GausPar(Double_t x,Double_t a1,Double_t a2,Double_t a3) {return a1*TMath::Exp(-0.5*((x-a2)/a3)*((x-a2)/a3));}
      98             :   inline static Double_t FindTemp(Double_t tLow,Double_t tUp,Double_t y);    //find the temperature of the C6F14 in a given point with coord. y (in x is uniform)
      99             :   
     100             :   
     101          16 :   Double_t   GetEPhotMean            ()const {return fPhotEMean;} 
     102       97608 :   Double_t   GetRefIdx               ()const {return fRefIdx;}                       //running refractive index
     103             :   
     104         166 :   Double_t   MeanIdxRad              ()const {return NIdxRad(fPhotEMean,fTemp);}
     105           0 :   Double_t   MeanIdxWin              ()const {return NIdxWin(fPhotEMean);}
     106             :   //
     107        1024 :   Float_t    DistCut                 ()const {return 1.0;}       //<--TEMPORAR--> to be removed in future. Cut for MIP-TRACK residual 
     108         304 :   Float_t    QCut                    ()const {return 100;}       //<--TEMPORAR--> to be removed in future. Separation PHOTON-MIP charge 
     109          16 :   Float_t    MultCut                 ()const {return 30;}       //<--TEMPORAR--> to be removed in future. Multiplicity cut to activate WEIGHT procedure 
     110             : 
     111       34342 :   Double_t   RadThick                ()const {return 1.5;}       //<--TEMPORAR--> to be removed in future. Radiator thickness
     112       59388 :   Double_t   WinThick                ()const {return 0.5;}       //<--TEMPORAR--> to be removed in future. Window thickness
     113       53300 :   Double_t   GapThick                ()const {return 8.0;}       //<--TEMPORAR--> to be removed in future. Proximity gap thickness
     114       29336 :   Double_t   WinIdx                  ()const {return 1.5787;}    //<--TEMPORAR--> to be removed in future. Mean refractive index of WIN material (SiO2) 
     115       14954 :   Double_t   GapIdx                  ()const {return 1.0005;}    //<--TEMPORAR--> to be removed in future. Mean refractive index of GAP material (CH4)
     116             : 
     117             :   static        Int_t      Stack(Int_t evt=-1,Int_t tid=-1);              //Print stack info for event and tid
     118             :   static        Int_t      StackCount(Int_t pid,Int_t evt);               //Counts stack particles of given sort in given event  
     119             :   static        void       IdealPosition(Int_t iCh,TGeoHMatrix *m);       //ideal position of given chamber 
     120             :   //trasformation methodes
     121        9035 :   void     Lors2Mars   (Int_t c,Float_t x,Float_t y,Double_t *m,Int_t pl=kPc)const{Double_t z=0; switch(pl){case kPc:z=8.0;break; case kAnod:z=7.806;break; case kRad:z=-1.25; break;}   Double_t l[3]={x-fX,y-fY,z};  fM[c]->LocalToMaster(l,m); }    
     122          30 :   TVector3 Lors2Mars   (Int_t c,Float_t x,Float_t y,            Int_t pl=kPc)const{Double_t m[3];Lors2Mars(c,x,y,m,pl); return TVector3(m);    }//MRS->LRS  
     123        2644 :   void     Mars2Lors   (Int_t c,Double_t *m,Float_t &x ,Float_t &y          )const{Double_t l[3];fM[c]->MasterToLocal(m,l);x=l[0]+fX;y=l[1]+fY;}//MRS->LRS
     124        1024 :   void     Mars2LorsVec(Int_t c,Double_t *m,Float_t &th,Float_t &ph         )const{Double_t l[3]; fM[c]->MasterToLocalVect(m,l); 
     125         512 :                                                                                    Float_t pt=TMath::Sqrt(l[0]*l[0]+l[1]*l[1]); 
     126         512 :                                                                                            th=TMath::ATan(pt/l[2]); 
     127         512 :                                                                                            ph=TMath::ATan2(l[1],l[0]);}    
     128           0 :   void     Lors2MarsVec(Int_t c,Double_t *m,Double_t *l                     )const{fM[c]->LocalToMasterVect(m,l);                              }//LRS->MRS 
     129           0 :   TVector3 Norm        (Int_t c                                             )const{Double_t n[3]; Norm(c,n); return TVector3(n);               }//norm 
     130        3584 :   void     Norm        (Int_t c,Double_t *n                                 )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n);        }//norm
     131        3584 :   void     Point       (Int_t c,Double_t *p,Int_t plane                     )const{Lors2Mars(c,0,0,p,plane);}         //point of given chamber plane
     132             : 
     133           0 :   void     SetTemp        (Double_t temp                                       ) {fTemp = temp;}                      //set actual temperature of the C6F14
     134           0 :   void     SetEPhotMean   (Double_t ePhotMean                                  ) {fPhotEMean = ePhotMean;}            //set mean photon energy
     135             :   
     136         104 :   void     SetRefIdx      (Double_t refRadIdx                                  ) {fRefIdx = refRadIdx;}               //set running refractive index
     137             :   
     138           0 :   void     SetNSigmas     (Int_t sigmas                                        ) {fgNSigmas   = sigmas;}                 //set sigma cut  
     139     1293602 :   void     SetThreshold   (Int_t thres                                         ) {fgThreshold = thres;}                 //set sigma cut        
     140           0 :   void     SetInstanceType(Bool_t inst                                         ) {fgInstanceType = inst;}             //kTRUE if from geomatry kFALSE if from ideal geometry
     141             :   //For PID
     142             :   Double_t SigLoc         (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to cathode segmetation
     143             :   Double_t SigGeom        (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknown photon origin
     144             :   Double_t SigCrom        (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknonw photon energy
     145             :   Double_t Sigma2         (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh              );//photon candidate sigma^2
     146             :   
     147             :   static Double_t SigmaCorrFact(Int_t iPart, Double_t occupancy                                         );//correction factor for theoretical resolution
     148             : 
     149             :   //Mathieson Getters
     150             :   
     151     2167352 :   static Double_t PitchAnodeCathode()  {return fgkD;}
     152     1105400 :   static Double_t SqrtK3x() {return fgkSqrtK3x;}
     153     1083676 :   static Double_t K2x    () {return fgkK2x;}
     154       21724 :   static Double_t K1x    () {return fgkK1x;}
     155      530976 :   static Double_t K4x    () {return fgkK4x;}
     156     1105400 :   static Double_t SqrtK3y() {return fgkSqrtK3y;}
     157     1083676 :   static Double_t K2y    () {return fgkK2y;}
     158       21724 :   static Double_t K1y    () {return fgkK1y;}
     159      530976 :   static Double_t K4y    () {return fgkK4y;}
     160             :   //
     161             :   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
     162             :   enum ETrackingFlags {kMipDistCut=-9,kMipQdcCut=-5,kNoPhotAccept=-11};     //flags for Reconstruction
     163             : 
     164             : protected:
     165             :   static /*const*/ Float_t fgkMinPcX[6];                                                           //limits PC
     166             :   static /*const*/ Float_t fgkMinPcY[6];                                                           //limits PC
     167             :   static /*const*/ Float_t fgkMaxPcX[6];                                                           //limits PC
     168             :   static /*const*/ Float_t fgkMaxPcY[6]; 
     169             :   
     170             :   static Bool_t fgMapPad[160][144][7];                                                                   //map of pads to evaluate if they are active or dead (160,144) pads for 7 chambers
     171             :   
     172             : // Mathieson constants
     173             : // For HMPID --> x direction means parallel      to the wires: K3 = 0.66  (NIM A270 (1988) 602-603) fig.1  
     174             : // For HMPID --> y direction means perpendicular to the wires: K3 = 0.90  (NIM A270 (1988) 602-603) fig.2  
     175             : //
     176             : 
     177             :   static const Double_t fgkD;  // ANODE-CATHODE distance 0.445/2
     178             :   
     179             :   static const Double_t fgkSqrtK3x,fgkK2x,fgkK1x,fgkK4x;
     180             :   static const Double_t fgkSqrtK3y,fgkK2y,fgkK1y,fgkK4y;
     181             : //
     182             :     
     183             :   static Int_t    fgNSigmas;                                                                        //sigma Cut
     184             :   static Int_t    fgThreshold;                                                                        //sigma Cut
     185             :   static Bool_t   fgInstanceType;                                                                  //kTRUE if from geomatry kFALSE if from ideal geometry
     186             : 
     187             :   static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;                                   //definition of HMPID geometric parameters 
     188             :          AliHMPIDParam(Bool_t noGeo);             //default ctor is protected to enforce it to be singleton
     189             : 
     190             :   static AliHMPIDParam *fgInstance;   //static pointer  to instance of AliHMPIDParam singleton
     191             : 
     192             :   TGeoHMatrix *fM[7];                 //pointers to matrices defining HMPID chambers rotations-translations
     193             :   Float_t fX;                         //x shift of LORS with respect to rotated MARS 
     194             :   Float_t fY;                         //y shift of LORS with respect to rotated MARS
     195             :   Double_t fRefIdx;                   //running refractive index of C6F14
     196             :   Double_t fPhotEMean;                //mean energy of photon
     197             :   Double_t fTemp;                     //actual temparature of C6F14  
     198             : private:
     199             :   AliHMPIDParam(const AliHMPIDParam& r);              //dummy copy constructor
     200             :   AliHMPIDParam &operator=(const AliHMPIDParam& r);   //dummy assignment operator
     201             :       
     202          22 :   ClassDef(AliHMPIDParam,1)           //HMPID main parameters class
     203             : };
     204             : 
     205             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     206             : AliHMPIDParam* AliHMPIDParam::Instance()
     207             : {
     208             : // Return pointer to the AliHMPIDParam singleton. 
     209             : // Arguments: none
     210             : //   Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry       
     211     1300002 :   if(!fgInstance) new AliHMPIDParam(kFALSE);                                //default setting for reconstruction, if no geometry.root -> AliFatal
     212      649851 :   return fgInstance;  
     213           0 : }//Instance()    
     214             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     215             : AliHMPIDParam* AliHMPIDParam::InstanceNoGeo()
     216             : {
     217             : // Return pointer to the AliHMPIDParam singleton without the geometry.root. 
     218             : // Arguments: none
     219             : //   Returns: pointer to the instance of AliHMPIDParam or 0 if no geometry       
     220         528 :   if(!fgInstance) new AliHMPIDParam(kTRUE);                               //to avoid AliFatal, for MOOD and displays, use ideal geometry parameters
     221         264 :   return fgInstance;  
     222           0 : }//Instance()    
     223             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     224             : Bool_t AliHMPIDParam::IsInDead(Float_t x,Float_t y)
     225             : {
     226             : // Check is the current point is outside of sensitive area or in dead zones
     227             : // Arguments: x,y -position
     228             : //   Returns: 1 if not in sensitive zone           
     229       55888 :   for(Int_t iPc=0;iPc<6;iPc++)
     230       75788 :     if(x>=fgkMinPcX[iPc] && x<=fgkMaxPcX[iPc] && y>=fgkMinPcY[iPc] && y<=fgkMaxPcY [iPc]) return kFALSE; //in current pc
     231             :   
     232         145 :   return kTRUE;
     233        5585 : }
     234             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     235             : Bool_t AliHMPIDParam::IsDeadPad(Int_t padx,Int_t pady,Int_t ch)
     236             : {
     237             : // Check is the current pad is active or not
     238             : // Arguments: padx,pady pad integer coord
     239             : //   Returns: kTRUE if dead, kFALSE if active
     240             : 
     241           0 :     if(fgMapPad[padx-1][pady-1][ch]) return kFALSE; //current pad active
     242             :   
     243           0 :   return kTRUE;
     244           0 : }
     245             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     246             : void AliHMPIDParam::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
     247             : {
     248             : // Check the pad of given position
     249             : // Arguments: x,y- position [cm] in LORS; pc,px,py- pad where to store the result
     250             : //   Returns: none
     251        2232 :   pc=px=py=-1;
     252        3204 :   if     (x>fgkMinPcX[0] && x<fgkMaxPcX[0]) {pc=0; px=Int_t( x               / SizePadX());}//PC 0 or 2 or 4
     253         432 :   else if(x>fgkMinPcX[1] && x<fgkMaxPcX[1]) {pc=1; px=Int_t((x-fgkMinPcX[1]) / SizePadX());}//PC 1 or 3 or 5
     254             :   else return;
     255        2335 :   if     (y>fgkMinPcY[0] && y<fgkMaxPcY[0]) {      py=Int_t( y               / SizePadY());}//PC 0 or 1
     256        2525 :   else if(y>fgkMinPcY[2] && y<fgkMaxPcY[2]) {pc+=2;py=Int_t((y-fgkMinPcY[2]) / SizePadY());}//PC 2 or 3
     257        1472 :   else if(y>fgkMinPcY[4] && y<fgkMaxPcY[4]) {pc+=4;py=Int_t((y-fgkMinPcY[4]) / SizePadY());}//PC 4 or 5
     258             :   else return;
     259        1116 : }
     260             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     261             : Int_t AliHMPIDParam::InHVSector(Float_t y)
     262             : {
     263             : //Calculate the HV sector corresponding to the cluster position
     264             : //Arguments: y
     265             : //Returns the HV sector in the single module
     266             :  
     267             :    Int_t hvsec = -1;
     268         670 :    Int_t pc,px,py;
     269         335 :    Lors2Pad(1.,y,pc,px,py);
     270         340 :    if(py==-1) return hvsec;
     271             :    
     272         330 :    hvsec = (py+(pc/2)*(kMaxPy+1))/((kMaxPy+1)/2);
     273             :    
     274         330 :    return hvsec;
     275         335 : }
     276             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     277             : Double_t AliHMPIDParam::FindTemp(Double_t tLow,Double_t tHigh,Double_t y)
     278             : {
     279             : //  Model for gradient in temperature
     280          16 :   Double_t yRad = HinRad(y);     //height in a given radiator
     281           8 :   if(tHigh<tLow) tHigh = tLow;   //if Tout < Tin consider just Tin as reference...
     282           8 :   if(yRad<0        ) yRad = 0;         //protection against fake y values
     283          12 :   if(yRad>SizePcY()) yRad = SizePcY(); //protection against fake y values
     284             :   
     285           8 :   Double_t gradT = (tHigh-tLow)/SizePcY();  // linear gradient
     286           8 :   return gradT*yRad+tLow;
     287             : }
     288             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     289             : void AliHMPIDParam::SetChStatus(Int_t ch,Bool_t status)
     290             : {
     291             : //Set a chamber on or off depending on the status
     292             : //Arguments: ch=chamber,status=kTRUE = active, kFALSE=off
     293             : //Returns: none
     294           0 :   for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
     295           0 :      for(Int_t pady=0;pady<kMaxPcy+1;pady++) {
     296           0 :        fgMapPad[padx][pady][ch] = status;
     297             :      }
     298             :    }
     299           0 : }
     300             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     301             : void AliHMPIDParam::SetSectStatus(Int_t ch,Int_t sect,Bool_t status)
     302             : {
     303             : //Set a given sector sect for a chamber ch on or off depending on the status
     304             : //Sector=0,5 (6 sectors)
     305             : //Arguments: ch=chamber,sect=sector,status: kTRUE = active, kFALSE=off
     306             : //Returns: none
     307             :   
     308             :   Int_t npadsect = (kMaxPcy+1)/6;
     309           0 :   Int_t padSectMin = npadsect*sect;
     310           0 :   Int_t padSectMax = padSectMin+npadsect;
     311             :   
     312           0 :   for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
     313           0 :      for(Int_t pady=padSectMin;pady<padSectMax;pady++) {
     314           0 :        fgMapPad[padx][pady][ch] = status;
     315             :      }
     316             :    }
     317           0 : }
     318             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     319             : void AliHMPIDParam::SetPcStatus(Int_t ch,Int_t pc,Bool_t status)
     320             : {
     321             : //Set a given PC pc for a chamber ch on or off depending on the status
     322             : //Arguments: ch=chamber,pc=PC,status: kTRUE = active, kFALSE=off
     323             : //Returns: none
     324             :   
     325           0 :   Int_t deltaX = pc%2;
     326           0 :   Int_t deltaY = pc/2;
     327           0 :   Int_t padPcXMin = deltaX*kPadPcX;
     328           0 :   Int_t padPcXMax = padPcXMin+kPadPcX;
     329           0 :   Int_t padPcYMin = deltaY*kPadPcY;
     330           0 :   Int_t padPcYMax = padPcYMin+kPadPcY;
     331             :   
     332           0 :   for(Int_t padx=padPcXMin;padx<padPcXMax;padx++) {
     333           0 :      for(Int_t pady=padPcYMin;pady<padPcYMax;pady++) {
     334           0 :        fgMapPad[padx][pady][ch] = status;
     335             :      }
     336             :    }
     337           0 : }
     338             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     339             : void AliHMPIDParam::PrintChStatus(Int_t ch)
     340             : {
     341             : //Print the map status of a chamber on or off depending on the status
     342             : //Arguments: ch=chamber
     343             : //Returns: none
     344           0 :   Printf(" ");
     345           0 :   Printf(" --------- C H A M B E R  %d   ---------------",ch);
     346           0 :   for(Int_t pady=kMaxPcy;pady>=0;pady--) {
     347           0 :      for(Int_t padx=0;padx<kMaxPcx+1;padx++) {
     348           0 :        if(padx==80) printf(" ");
     349           0 :        printf("%d",fgMapPad[padx][pady][ch]);
     350             :      }
     351           0 :      printf(" %d \n",pady+1);
     352           0 :      if(pady%48==0) printf("\n");
     353             :    }
     354           0 :    printf("\n");
     355           0 : }
     356             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     357             : void AliHMPIDParam::SetGeomAccept()
     358             : {
     359             : //Set the real acceptance of the modules, due to ineficciency or hardware problems (up tp 1/6/2010)
     360             : //Arguments: none
     361             : //Returns: none
     362           0 :   SetSectStatus(0,3,kFALSE);
     363           0 :   SetSectStatus(4,0,kFALSE);
     364           0 :   SetSectStatus(5,1,kFALSE);
     365           0 :   SetSectStatus(6,2,kFALSE);
     366           0 :   SetSectStatus(6,3,kFALSE);
     367           0 : }
     368             : #endif

Generated by: LCOV version 1.11