Backward compatibility with old qthre in OCDB:
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 07:32:44 +0000 (07:32 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 07:32:44 +0000 (07:32 +0000)
previous: 7 qthre (one for each chamber)
now      : 7*6 qthre (one for each sector)

HMPID/AliHMPIDTracker.cxx

index 0907bfd..bd49913 100644 (file)
@@ -106,8 +106,13 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
     }
     pTrk->SetHMPIDtrk(xRa,yRa,theta,phi);                                                        //store initial infos
     Double_t nmean=((TF1*)pNmean->At(3*cham))->Eval(pEsd->GetTimeStamp());                       //C6F14 Nmean for this chamber
-    Int_t hvsec = AliHMPIDParam::InHVSector(xPc,yPc);
-    Double_t qthre=((TF1*)pQthre->At(6*cham+hvsec))->Eval(pEsd->GetTimeStamp());
+    Double_t qthre = 0; 
+    if(pQthre->GetEntriesFast()==AliHMPIDParam::kMaxCh+1)                                        // just for backward compatibility
+      qthre=((TF1*)pQthre->At(cham))->Eval(pEsd->GetTimeStamp());                                //
+    else {                                                                                       // in the past just 1 qthre
+      Int_t hvsec = AliHMPIDParam::InHVSector(xPc,yPc);                                          //  per chamber
+      qthre=((TF1*)pQthre->At(6*cham+hvsec))->Eval(pEsd->GetTimeStamp());                        //
+    }                                                                                            //
     recon.SetImpPC(xPc,yPc);                                                                     //store track impact to PC
     recon.CkovAngle(pTrk,(TClonesArray *)pClus->At(cham),nmean,qthre);                           //search for Cerenkov angle of this track
 //    Printf("AliHMPIDTracker::Recon: nmean %f, qthre %f",nmean,qthre);
@@ -122,7 +127,9 @@ Int_t AliHMPIDTracker::ReconHiddenTrk(Int_t iCh,Int_t iHVsec,AliESDtrack *pTrk,T
 //   Returns: error code, 0 if no errors
   AliHMPIDReconHTA reconHTA;                                                                          //instance of reconstruction class, nothing important in ctor
   Double_t nmean=((TF1*)pNmean->At(3*iCh))->Eval(0);                                            //C6F14 Nmean for this chamber
-  Double_t qthre=((TF1*)pQthre->At(iCh+iHVsec))->Eval(0);                                             //C6F14 Nmean for this chamber
+  Double_t qthre = 0;
+  if(pQthre->GetEntriesFast()==7) qthre=((TF1*)pQthre->At(iCh))->Eval(0);                                             //C6F14 Nmean for this chamber
+  else  qthre=((TF1*)pQthre->At(6*iCh+iHVsec))->Eval(0); 
   if(pCluLst->GetEntriesFast()<4) return 1;                                                     //min 4 clusters (3 + 1 mip) to find a ring! 
   if(reconHTA.CkovHiddenTrk(pTrk,pCluLst,nmean,qthre)) return 0;                                   //search for track parameters and Cerenkov angle of this track
   else return 1;                                                                                // error code: 0=no error,1=fit not performed;