LCOV - code coverage report
Current view: top level - HMPID/HMPIDbase - AliHMPIDParam.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 120 179 67.0 %
Date: 2016-06-14 17:26:59 Functions: 16 20 80.0 %

          Line data    Source code
       1             : //  **************************************************************************
       2             : //  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             : //  *                                                                        *
       4             : //  * Author: The ALICE Off-line Project.                                    *
       5             : //  * Contributors are mentioned in the code where appropriate.              *
       6             : //  *                                                                        *
       7             : //  * Permission to use, copy, modify and distribute this software and its   *
       8             : //  * documentation strictly for non-commercial purposes is hereby granted   *
       9             : //  * without fee, provided that the above copyright notice appears in all   *
      10             : //  * copies and that both the copyright notice and this permission notice   *
      11             : //  * appear in the supporting documentation. The authors make no claims     *
      12             : //  * about the suitability of this software for any purpose. It is          *
      13             : //  * provided "as is" without express or implied warranty.                  *
      14             : //  **************************************************************************
      15             : #include "AliHMPIDParam.h"  //class header
      16             : #include "AliHMPIDDigit.h"  //ctor
      17             : #include "AliLog.h"         //general
      18             : #include <AliRunLoader.h>   //Stack()
      19             : #include <AliStack.h>       //Stack()
      20             : #include "AliCDBManager.h"  //ctor
      21             : #include "AliCDBEntry.h"    //ctor
      22             : #include <TLatex.h>         //TestTrans()  
      23             : #include <TView.h>          //TestTrans()
      24             : #include <TPolyMarker3D.h>  //TestTrans()
      25             : #include <TRotation.h>
      26             : #include <TParticle.h>      //Stack()    
      27             : #include <TGeoPhysicalNode.h> //ctor
      28             : #include <TGeoBBox.h>
      29             : #include <TF1.h>                 //ctor
      30             : 
      31          16 : ClassImp(AliHMPIDParam)
      32             : 
      33             : 
      34             : // Mathieson constant definition
      35             : const Double_t AliHMPIDParam::fgkD     = 0.222500;  // ANODE-CATHODE distance 0.445/2
      36             : //                                                                                          K3 = 0.66 along the wires (anode-cathode/wire pitch=0.5625)
      37          16 : const Double_t AliHMPIDParam::fgkSqrtK3x = TMath::Sqrt(0.66);
      38          16 : const Double_t AliHMPIDParam::fgkK2x     = TMath::PiOver2()*(1 - 0.5*fgkSqrtK3x);
      39          16 : const Double_t AliHMPIDParam::fgkK1x     = 0.25*fgkK2x*fgkSqrtK3x/TMath::ATan(fgkSqrtK3x);
      40          16 : const Double_t AliHMPIDParam::fgkK4x     = fgkK1x/(fgkK2x*fgkSqrtK3x);
      41             : //                                                                                          K3 = 0.87 along the wires (anode-cathode/wire pitch=0.5625)
      42          16 : const Double_t AliHMPIDParam::fgkSqrtK3y = TMath::Sqrt(0.87);
      43          16 : const Double_t AliHMPIDParam::fgkK2y     = TMath::PiOver2()*(1 - 0.5*fgkSqrtK3y);
      44          16 : const Double_t AliHMPIDParam::fgkK1y     = 0.25*fgkK2y*fgkSqrtK3y/TMath::ATan(fgkSqrtK3y);
      45          16 : const Double_t AliHMPIDParam::fgkK4y     = fgkK1y/(fgkK2y*fgkSqrtK3y);
      46             : //
      47             :   
      48             : 
      49             : Float_t AliHMPIDParam::fgkMinPcX[]={0.,0.,0.,0.,0.,0.};
      50             : Float_t AliHMPIDParam::fgkMaxPcX[]={0.,0.,0.,0.,0.,0.};
      51             : Float_t AliHMPIDParam::fgkMinPcY[]={0.,0.,0.,0.,0.,0.};
      52             : Float_t AliHMPIDParam::fgkMaxPcY[]={0.,0.,0.,0.,0.,0.};
      53             : 
      54             : Bool_t AliHMPIDParam::fgMapPad[160][144][7];
      55             : 
      56             : Float_t AliHMPIDParam::fgCellX=0.;
      57             : Float_t AliHMPIDParam::fgCellY=0.;
      58             : 
      59             : Float_t AliHMPIDParam::fgPcX=0;
      60             : Float_t AliHMPIDParam::fgPcY=0;
      61             : 
      62             : Float_t AliHMPIDParam::fgAllX=0;
      63             : Float_t AliHMPIDParam::fgAllY=0;
      64             : 
      65             : Bool_t AliHMPIDParam::fgInstanceType=kTRUE;  
      66             : 
      67             : AliHMPIDParam* AliHMPIDParam::fgInstance=0x0;        //singleton pointer               
      68             : 
      69             : Int_t AliHMPIDParam::fgNSigmas  = 4;
      70             : Int_t AliHMPIDParam::fgThreshold= 4;
      71             : 
      72             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      73             : AliHMPIDParam::AliHMPIDParam(Bool_t noGeo):
      74           3 :   TNamed("HmpidParam","default version"),
      75           3 :   fX(0), fY(0), fRefIdx(1.28947),fPhotEMean(6.675),fTemp(25)                          //just set a refractive index for C6F14 at ephot=6.675 eV @ T=25 C
      76           9 : {
      77             : // Here all the intitializition is taken place when AliHMPIDParam::Instance() is invoked for the first time.
      78             : // In particular, matrices to be used for LORS<->MARS trasnformations are initialized from TGeo structure.    
      79             : // Note that TGeoManager should be already initialized from geometry.root file  
      80             : 
      81           3 :   AliCDBManager *pCDB = AliCDBManager::Instance();
      82           3 :   if(!pCDB) {
      83           0 :      AliWarning("No Nmean C6F14 from OCDB. Default is taken from ctor.");
      84             :   } else {
      85           9 :     AliCDBEntry *pNmeanEnt =pCDB->Get("HMPID/Calib/Nmean"); //contains TObjArray of 42 TF1 + 1 EPhotMean
      86           3 :     if(!pNmeanEnt) {
      87           0 :       AliWarning("No Nmean C6F14 from OCDB. Default is taken from ctor.");
      88             :     } else {
      89           3 :       TObjArray *pNmean = (TObjArray*)pNmeanEnt->GetObject();
      90           6 :       if(pNmean->GetEntries()==43) {                                               //for backward compatibility
      91           3 :         Double_t tmin,tmax;
      92           6 :         ((TF1*)pNmean->At(42))->GetRange(tmin,tmax);
      93           9 :         fPhotEMean = ((TF1*)pNmean->At(42))->Eval(tmin);                          //photon eMean from OCDB
      94           9 :         AliInfo(Form("EPhotMean = %f eV successfully loaded from OCDB",fPhotEMean));
      95           3 :       } else {
      96           0 :         AliWarning("For backward compatibility EPhotMean is taken from ctor.");
      97             :       }
      98             :     }
      99             :   }
     100             : 
     101           6 :   fRefIdx = MeanIdxRad(); //initialization of the running ref. index of freon
     102             :   
     103             :   Float_t dead=2.6;// cm of the dead zones between PCs-> See 2CRC2099P1
     104             : 
     105             : 
     106           3 :   if(noGeo==kTRUE) fgInstanceType=kFALSE;                                                   //instance from ideal geometry, no actual geom is present
     107             :     
     108           3 :   if(noGeo==kFALSE && !gGeoManager)  
     109             :   {
     110           0 :     TGeoManager::Import("geometry.root");
     111           0 :     if(!gGeoManager) AliFatal("!!!!!!No geometry loaded!!!!!!!");
     112             :   }
     113             :   
     114           3 :   fgCellX=0.8;fgCellY=0.84;
     115             :   
     116           3 :   if(!noGeo==kTRUE){
     117           3 :     TGeoVolume *pCellVol = gGeoManager->GetVolume("Hcel");
     118           3 :     if(pCellVol) {
     119           0 :       TGeoBBox *bcell = (TGeoBBox *)pCellVol->GetShape();
     120           0 :       fgCellX=2.*bcell->GetDX(); fgCellY = 2.*bcell->GetDY();  // overwrite the values with the read ones
     121           0 :     }
     122           3 :   }    
     123           3 :   fgPcX=80.*fgCellX; fgPcY = 48.*fgCellY;
     124           3 :   fgAllX=2.*fgPcX+dead;
     125           3 :   fgAllY=3.*fgPcY+2.*dead;
     126             : 
     127           3 :   fgkMinPcX[1]=fgPcX+dead; fgkMinPcX[3]=fgkMinPcX[1];  fgkMinPcX[5]=fgkMinPcX[3];
     128           3 :   fgkMaxPcX[0]=fgPcX; fgkMaxPcX[2]=fgkMaxPcX[0];  fgkMaxPcX[4]=fgkMaxPcX[2];
     129           3 :   fgkMaxPcX[1]=fgAllX; fgkMaxPcX[3]=fgkMaxPcX[1];  fgkMaxPcX[5]=fgkMaxPcX[3];
     130             : 
     131           3 :   fgkMinPcY[2]=fgPcY+dead; fgkMinPcY[3]=fgkMinPcY[2];  
     132           3 :   fgkMinPcY[4]=2.*fgPcY+2.*dead; fgkMinPcY[5]=fgkMinPcY[4];
     133           3 :   fgkMaxPcY[0]=fgPcY; fgkMaxPcY[1]=fgkMaxPcY[0];  
     134           3 :   fgkMaxPcY[2]=2.*fgPcY+dead; fgkMaxPcY[3]=fgkMaxPcY[2]; 
     135           3 :   fgkMaxPcY[4]=fgAllY; fgkMaxPcY[5]=fgkMaxPcY[4];   
     136             :     
     137           3 :   fX=0.5*SizeAllX();
     138           3 :   fY=0.5*SizeAllY();
     139             :   
     140             :       
     141          48 :   for(Int_t ich=kMinCh;ich<=kMaxCh;ich++) {
     142        6762 :     for(Int_t padx=0;padx<160;padx++) {
     143      974400 :        for(Int_t pady=0;pady<144;pady++) {
     144      483840 :          fgMapPad[padx][pady][ich] = kTRUE;             //init all the pads are active at the beginning....
     145             :        }
     146             :      }
     147             :    }
     148             :      
     149             : 
     150          48 :   for(Int_t i=kMinCh;i<=kMaxCh;i++)
     151          42 :     if(gGeoManager && gGeoManager->IsClosed()) {
     152          42 :       TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("/HMPID/Chamber%i",i));
     153          21 :       if (!pne) {
     154           0 :         AliErrorClass(Form("The symbolic volume %s does not correspond to any physical entry!",Form("HMPID_%i",i)));
     155           0 :         fM[i]=new TGeoHMatrix;
     156           0 :         IdealPosition(i,fM[i]);
     157             :       } else {
     158          21 :         TGeoPhysicalNode *pnode = pne->GetPhysicalNode();
     159         105 :         if(pnode) fM[i]=new TGeoHMatrix(*(pnode->GetMatrix()));
     160             :         else {
     161           0 :           fM[i]=new TGeoHMatrix;
     162           0 :           IdealPosition(i,fM[i]);
     163             :         }
     164             :       }
     165          21 :     } else{
     166           0 :       fM[i]=new TGeoHMatrix;
     167           0 :       IdealPosition(i,fM[i]);
     168             :     } 
     169           3 :   fgInstance=this; 
     170           6 : }//ctor
     171             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     172             : void AliHMPIDParam::Print(Option_t* opt) const
     173             : {
     174             : // print some usefull (hopefully) info on some internal guts of HMPID parametrisation 
     175             :   
     176           0 :   for(Int_t i=0;i<7;i++) fM[i]->Print(opt);
     177           0 : }//Print()
     178             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     179             : void AliHMPIDParam::IdealPosition(Int_t iCh, TGeoHMatrix *pMatrix)
     180             : {
     181             : // Construct ideal position matrix for a given chamber
     182             : // Arguments: iCh- chamber ID; pMatrix- pointer to precreated unity matrix where to store the results
     183             : //   Returns: none
     184             :   const Double_t kAngHor=19.5;        //  horizontal angle between chambers  19.5 grad
     185             :   const Double_t kAngVer=20;          //  vertical angle between chambers    20   grad     
     186             :   const Double_t kAngCom=30;          //  common HMPID rotation with respect to x axis  30   grad     
     187             :   const Double_t kTrans[3]={490,0,0}; //  center of the chamber is on window-gap surface
     188           0 :   pMatrix->RotateY(90);               //  rotate around y since initial position is in XY plane -> now in YZ plane
     189           0 :   pMatrix->SetTranslation(kTrans);    //  now plane in YZ is shifted along x 
     190           0 :   switch(iCh){
     191           0 :     case 0:                pMatrix->RotateY(kAngHor);  pMatrix->RotateZ(-kAngVer);  break; //right and down 
     192           0 :     case 1:                                            pMatrix->RotateZ(-kAngVer);  break; //down              
     193           0 :     case 2:                pMatrix->RotateY(kAngHor);                               break; //right 
     194             :     case 3:                                                                         break; //no rotation
     195           0 :     case 4:                pMatrix->RotateY(-kAngHor);                              break; //left   
     196           0 :     case 5:                                            pMatrix->RotateZ(kAngVer);   break; //up
     197           0 :     case 6:                pMatrix->RotateY(-kAngHor); pMatrix->RotateZ(kAngVer);   break; //left and up 
     198             :   }
     199           0 :   pMatrix->RotateZ(kAngCom);     //apply common rotation  in XY plane    
     200             :    
     201           0 : }
     202             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     203             : Int_t AliHMPIDParam::Stack(Int_t evt,Int_t tid)
     204             : {
     205             : // Prints some useful info from stack
     206             : // Arguments: evt - event number. if not -1 print info only for that event
     207             : //            tid - track id. if not -1 then print it and all it's mothers if any   
     208             : //   Returns: mother tid of the given tid if any
     209           0 :   AliRunLoader *pAL=AliRunLoader::Open(); 
     210           0 :   if(pAL->LoadHeader()) return -1;
     211           0 :   if(pAL->LoadKinematics()) return -1;
     212             :   
     213             :   Int_t mtid=-1;
     214           0 :   Int_t iNevt=pAL->GetNumberOfEvents();
     215             :   
     216           0 :   for(Int_t iEvt=0;iEvt<iNevt;iEvt++){//events loop
     217           0 :     if(evt!=-1 && evt!=iEvt) continue; //in case one needs to print the requested event, ignore all others
     218           0 :     pAL->GetEvent(iEvt);    
     219           0 :     AliStack *pStack=pAL->Stack();  
     220           0 :     if(tid==-1){                        //print all tids for this event
     221           0 :       for(Int_t i=0;i<pStack->GetNtrack();i++) pStack->Particle(i)->Print();
     222           0 :           Printf("totally %i tracks including %i primaries for event %i out of %i event(s)",
     223           0 :           pStack->GetNtrack(),pStack->GetNprimary(),iEvt,iNevt);
     224           0 :     }else{                              //print only this tid and it;s mothers
     225           0 :       if(tid<0 || tid>pStack->GetNtrack()) {Printf("Wrong tid, valid tid range for event %i is 0-%i",iEvt,pStack->GetNtrack());break;}
     226           0 :       TParticle *pTrack=pStack->Particle(tid); mtid=pTrack->GetFirstMother();
     227           0 :       TString str=pTrack->GetName();
     228           0 :       while((tid=pTrack->GetFirstMother()) >= 0){
     229           0 :         pTrack=pStack->Particle(tid);
     230           0 :         str+=" from ";str+=pTrack->GetName();
     231             :       } 
     232           0 :     }//if(tid==-1)      
     233           0 :   }//events loop
     234           0 :   pAL->UnloadHeader();  pAL->UnloadKinematics();
     235             :   return mtid;
     236           0 : }
     237             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     238             : Int_t AliHMPIDParam::StackCount(Int_t pid,Int_t evt)
     239             : {
     240             : // Counts total number of particles of given sort (including secondary) for a given event
     241           0 :   AliRunLoader *pAL=AliRunLoader::Open(); 
     242           0 :   pAL->GetEvent(evt);    
     243           0 :   if(pAL->LoadHeader()) return 0;
     244           0 :   if(pAL->LoadKinematics()) return 0;
     245           0 :   AliStack *pStack=pAL->Stack();
     246             :   
     247             :   Int_t iCnt=0;
     248           0 :   for(Int_t i=0;i<pStack->GetNtrack();i++) if(pStack->Particle(i)->GetPdgCode()==pid) iCnt++;
     249             :   
     250           0 :   pAL->UnloadHeader();  pAL->UnloadKinematics();
     251             :   return iCnt;
     252           0 : }
     253             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     254             : Double_t AliHMPIDParam::Sigma2(Double_t trkTheta,Double_t trkPhi,Double_t ckovTh, Double_t ckovPh)
     255             : {
     256             : // Analithical calculation of total error (as a sum of localization, geometrical and chromatic errors) on Cerenkov angle for a given Cerenkov photon 
     257             : // created by a given MIP. Fromulae according to CERN-EP-2000-058 
     258             : // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
     259             : //            dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]        
     260             : //            MIP beta
     261             : //   Returns: absolute error on Cerenkov angle, [radians]    
     262             :   
     263       11032 :   TVector3 v(-999,-999,-999);
     264        5516 :   Double_t trkBeta = 1./(TMath::Cos(ckovTh)*GetRefIdx());
     265             :   
     266        6963 :   if(trkBeta > 1) trkBeta = 1;                 //protection against bad measured thetaCer  
     267        5516 :   if(trkBeta < 0) trkBeta = 0.0001;            //
     268             : 
     269       11032 :   v.SetX(SigLoc (trkTheta,trkPhi,ckovTh,ckovPh,trkBeta));
     270       11032 :   v.SetY(SigGeom(trkTheta,trkPhi,ckovTh,ckovPh,trkBeta));
     271       11032 :   v.SetZ(SigCrom(trkTheta,trkPhi,ckovTh,ckovPh,trkBeta));
     272             : 
     273        5516 :   return v.Mag2();
     274        5516 : }
     275             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     276             : Double_t AliHMPIDParam::SigLoc(Double_t trkTheta,Double_t trkPhi,Double_t thetaC, Double_t phiC,Double_t betaM)
     277             : {
     278             : // Analitical calculation of localization error (due to finite segmentation of PC) on Cerenkov angle for a given Cerenkov photon 
     279             : // created by a given MIP. Fromulae according to CERN-EP-2000-058 
     280             : // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
     281             : //            dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]        
     282             : //            MIP beta
     283             : //   Returns: absolute error on Cerenkov angle, [radians]    
     284             :   
     285       11032 :   Double_t phiDelta = phiC - trkPhi;
     286             : 
     287        5516 :   Double_t sint     = TMath::Sin(trkTheta);
     288        5516 :   Double_t cost     = TMath::Cos(trkTheta);
     289        5516 :   Double_t sinf     = TMath::Sin(trkPhi);
     290        5516 :   Double_t cosf     = TMath::Cos(trkPhi);
     291        5516 :   Double_t sinfd    = TMath::Sin(phiDelta);
     292        5516 :   Double_t cosfd    = TMath::Cos(phiDelta);
     293        5516 :   Double_t tantheta = TMath::Tan(thetaC);
     294             :   
     295        5516 :   Double_t alpha =cost-tantheta*cosfd*sint;                                                 // formula (11)
     296        5516 :   Double_t k = 1.-GetRefIdx()*GetRefIdx()+alpha*alpha/(betaM*betaM);        // formula (after 8 in the text)
     297        6221 :   if (k<0) return 1e10;
     298        4811 :   Double_t mu =sint*sinf+tantheta*(cost*cosfd*sinf+sinfd*cosf);                             // formula (10)
     299        4811 :   Double_t e  =sint*cosf+tantheta*(cost*cosfd*cosf-sinfd*sinf);                             // formula (9)
     300             : 
     301        4811 :   Double_t kk = betaM*TMath::Sqrt(k)/(GapThick()*alpha);                            // formula (6) and (7)
     302        4811 :   Double_t dtdxc = kk*(k*(cosfd*cosf-cost*sinfd*sinf)-(alpha*mu/(betaM*betaM))*sint*sinfd); // formula (6)           
     303        4811 :   Double_t dtdyc = kk*(k*(cosfd*sinf+cost*sinfd*cosf)+(alpha* e/(betaM*betaM))*sint*sinfd); // formula (7)            pag.4
     304             : 
     305             :   Double_t errX = 0.2,errY=0.25;                                                            //end of page 7
     306        4811 :   return  TMath::Sqrt(errX*errX*dtdxc*dtdxc + errY*errY*dtdyc*dtdyc);
     307        5516 : }
     308             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     309             : Double_t AliHMPIDParam::SigCrom(Double_t trkTheta,Double_t trkPhi,Double_t thetaC, Double_t phiC,Double_t betaM)
     310             : {
     311             : // Analitical calculation of chromatic error (due to lack of knowledge of Cerenkov photon energy) on Cerenkov angle for a given Cerenkov photon 
     312             : // created by a given MIP. Fromulae according to CERN-EP-2000-058 
     313             : // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
     314             : //            dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]        
     315             : //            MIP beta
     316             : //   Returns: absolute error on Cerenkov angle, [radians]    
     317             :   
     318       11032 :   Double_t phiDelta = phiC - trkPhi;
     319             : 
     320        5516 :   Double_t sint     = TMath::Sin(trkTheta);
     321        5516 :   Double_t cost     = TMath::Cos(trkTheta);
     322        5516 :   Double_t cosfd    = TMath::Cos(phiDelta);
     323        5516 :   Double_t tantheta = TMath::Tan(thetaC);
     324             :   
     325        5516 :   Double_t alpha =cost-tantheta*cosfd*sint;                                                 // formula (11)
     326        5516 :   Double_t dtdn = cost*GetRefIdx()*betaM*betaM/(alpha*tantheta);                    // formula (12)
     327             :             
     328             : //  Double_t f = 0.00928*(7.75-5.635)/TMath::Sqrt(12.);
     329        5516 :   Double_t f = 0.0172*(7.75-5.635)/TMath::Sqrt(24.);
     330             : 
     331        5516 :   return f*dtdn;
     332             : }//SigCrom()
     333             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     334             : Double_t AliHMPIDParam::SigGeom(Double_t trkTheta,Double_t trkPhi,Double_t thetaC, Double_t phiC,Double_t betaM)
     335             : {
     336             : // Analitical calculation of geometric error (due to lack of knowledge of creation point in radiator) on Cerenkov angle for a given Cerenkov photon 
     337             : // created by a given MIP. Formulae according to CERN-EP-2000-058 
     338             : // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
     339             : //            dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]        
     340             : //            MIP beta
     341             : //   Returns: absolute error on Cerenkov angle, [radians]    
     342             : 
     343       11032 :   Double_t phiDelta = phiC - trkPhi;
     344             : 
     345        5516 :   Double_t sint     = TMath::Sin(trkTheta);
     346        5516 :   Double_t cost     = TMath::Cos(trkTheta);
     347        5516 :   Double_t sinf     = TMath::Sin(trkPhi);
     348        5516 :   Double_t cosfd    = TMath::Cos(phiDelta);
     349        5516 :   Double_t costheta = TMath::Cos(thetaC);
     350        5516 :   Double_t tantheta = TMath::Tan(thetaC);
     351             :   
     352        5516 :   Double_t alpha =cost-tantheta*cosfd*sint;                                                  // formula (11)
     353             :   
     354        5516 :   Double_t k = 1.-GetRefIdx()*GetRefIdx()+alpha*alpha/(betaM*betaM);         // formula (after 8 in the text)
     355        6221 :   if (k<0) return 1e10;
     356             : 
     357        4811 :   Double_t eTr = 0.5*RadThick()*betaM*TMath::Sqrt(k)/(GapThick()*alpha);     // formula (14)
     358        4811 :   Double_t lambda = (1.-sint*sinf)*(1.+sint*sinf);                                                  // formula (15)
     359             : 
     360        4811 :   Double_t c1 = 1./(1.+ eTr*k/(alpha*alpha*costheta*costheta));                              // formula (13.a)
     361        4811 :   Double_t c2 = betaM*TMath::Power(k,1.5)*tantheta*lambda/(GapThick()*alpha*alpha);  // formula (13.b)
     362        4811 :   Double_t c3 = (1.+eTr*k*betaM*betaM)/((1+eTr)*alpha*alpha);                                // formula (13.c)
     363        4811 :   Double_t c4 = TMath::Sqrt(k)*tantheta*(1-lambda)/(GapThick()*betaM);               // formula (13.d)
     364        4811 :   Double_t dtdT = c1 * (c2+c3*c4);
     365        4811 :   Double_t trErr = RadThick()/(TMath::Sqrt(12.)*cost);
     366             : 
     367        4811 :   return trErr*dtdT;
     368        5516 : }//SigGeom()
     369             : //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     370             : Double_t AliHMPIDParam::SigmaCorrFact  (Int_t iPart, Double_t occupancy) 
     371             : {
     372             :   Double_t corr = 1.0;
     373             :                                                                                                              
     374         108 :   switch(iPart) {
     375           8 :     case 0: corr = 0.115*occupancy + 1.166; break; 
     376           8 :     case 1: corr = 0.115*occupancy + 1.166; break;
     377           8 :     case 2: corr = 0.115*occupancy + 1.166; break;
     378           8 :     case 3: corr = 0.065*occupancy + 1.137; break;
     379           4 :     case 4: corr = 0.048*occupancy + 1.202; break;
     380             :   }
     381             :                                                                                                                            
     382          36 :  return corr; 
     383             : }
     384             : 

Generated by: LCOV version 1.11