]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDReconstructor.cxx
Mip-track matching improved. Now Last point of HMPID stored and track re-fitted.
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDReconstructor.cxx
index 8f1c993c073a7fdd7546b285e022af0132266b29..5d50600f2d4d63dbf5df8b0f0426e2de0b6dc675 100644 (file)
@@ -26,6 +26,7 @@
 #include <AliCDBManager.h>         //ctor
 #include <AliESDEvent.h>           //FillEsd()
 #include <AliRawReader.h>          //Reconstruct() for raw digits
+#include <AliLog.h>                //
 #include "AliHMPIDRawStream.h"     //ConvertDigits()
 #include "AliHMPIDRecoParam.h"     //ctor
 ClassImp(AliHMPIDReconstructor)
@@ -49,38 +50,19 @@ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fD
     fClu->AddAt(pClus,i);
   }
 
-   if(fgkRecoParam!=0x0 && fgkRecoParam->GetUserCutMode()==kFALSE)
-  {
-      for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
+   if(fgkRecoParam!=0x0 && fgkRecoParam->GetUserCutMode()==kTRUE) {
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
       fUserCut[iCh] = fgkRecoParam->GetUserCut(iCh);
       AliDebug(1,Form("UserCut successfully loaded (from RecoParam) for chamber %i -> %i ",iCh,fUserCut[iCh]));
-   }
+    }
   }  
   else {
-  AliCDBEntry *pUserCutEnt =AliCDBManager::Instance()->Get("HMPID/Calib/UserCut");    //contains TObjArray of 14 TObject with n. of sigmas to cut charge 
-  if(pUserCutEnt) {
-    TObjArray *pUserCut = (TObjArray*)pUserCutEnt->GetObject(); 
-    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){                  //chambers loop 
-      fUserCut[iCh] = pUserCut->At(iCh)->GetUniqueID();
-      AliDebug(1,Form("UserCut successfully loaded (from OCDB) for chamber %i -> %i ",iCh,fUserCut[iCh]));
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
+      fUserCut[iCh] = 3;                                                                             // minimal requirement for sigma cut
+      AliDebug(1,Form("UserCut loaded from defaults for chamber %i -> %i ",iCh,fUserCut[iCh]));
     }
-   }
-  }
-
-  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 7 TF1
-  if(!pQthreEnt) AliFatal("No Qthre available");
-  TObjArray *pQthre = (TObjArray*)pQthreEnt->GetObject();
-  for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
-    for(Int_t isec=0;isec<=5;isec++) {
-     TF1 *pfQthre = (TF1*)pQthre->At(6*iCh+isec); 
-     Double_t tMin,tMax;
-     pfQthre->GetRange(tMin,tMax);
-     Double_t qthre=pfQthre->Eval(tMin);
-     AliDebug(1,Form("Qthre successfully loaded for chamber %i  sector %i -> %f ",iCh,isec,qthre));
-    }
-  }
+  } 
 
-     
   AliCDBEntry *pDaqSigEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig");  //contains TObjArray of TObjArray 14 TMatrixF sigmas values for pads 
   if(!pDaqSigEnt) AliFatal("No pedestals from DAQ!");
   fDaqSig = (TObjArray*)pDaqSigEnt->GetObject();
@@ -89,7 +71,7 @@ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fD
   }
 }//AliHMPIDReconstructor
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDReconstructor::Dig2Clu(TObjArray *pDigAll,TObjArray *pCluAll,Bool_t isTryUnfold)
+void AliHMPIDReconstructor::Dig2Clu(TObjArray *pDigAll,TObjArray *pCluAll,Int_t *pUserCut,Bool_t isTryUnfold)
 {
 // Finds all clusters for a given digits list provided not empty. Currently digits list is a list of all digits for a single chamber.
 // Puts all found clusters in separate lists, one per clusters. 
@@ -116,8 +98,7 @@ void AliHMPIDReconstructor::Dig2Clu(TObjArray *pDigAll,TObjArray *pCluAll,Bool_t
       AliHMPIDDigit *pDig=(AliHMPIDDigit*)pDigCur->At(iDig);                              //take current digit
       if(!(pDig=UseDig(pDig->PadChX(),pDig->PadChY(),pDigCur,&padMap))) continue;         //this digit is already taken in FormClu(), go after next digit
       FormClu(&clu,pDig,pDigCur,&padMap);                                                 //form cluster starting from this digit by recursion
-      
-      clu.Solve(pCluCur,isTryUnfold);                                                     //solve this cluster and add all unfolded clusters to provided list  
+      clu.Solve(pCluCur,pUserCut,isTryUnfold);                                 //solve this cluster and add all unfolded clusters to provided list  
       clu.Reset();                                                                        //empty current cluster
     }//digits loop for current chamber
   }//chambers loop
@@ -154,7 +135,7 @@ void AliHMPIDReconstructor::Reconstruct(TTree *pDigTree,TTree *pCluTree)const
     pDigTree->SetBranchAddress(Form("HMPID%d",iCh),&((*fDig)[iCh]));
   }   
   pDigTree->GetEntry(0);
-  Dig2Clu(fDig,fClu);              //cluster finder 
+  Dig2Clu(fDig,fClu,fUserCut);     //cluster finder 
   pCluTree->Fill();                //fill tree for current event
   
   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){