pi0 Re/Mi histograms added, pi0 parameterization set to PHOS13bcdef
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDReconstructor.cxx
index e91ffe0..d01ca39 100644 (file)
@@ -28,8 +28,8 @@
 #include <AliRawReader.h>          //Reconstruct() for raw digits
 #include <AliLog.h>                //
 #include "AliHMPIDRawStream.h"     //ConvertDigits()
-#include "AliHMPIDRecoParamV1.h"   //ctor
-
+#include "AliHMPIDRecoParamV1.h"     //ctor
+#include <TVirtualFitter.h> 
 ClassImp(AliHMPIDReconstructor)
 
 Int_t AliHMPIDReconstructor::fgStreamLevel = 0;        // stream (debug) level
@@ -68,6 +68,7 @@ void AliHMPIDReconstructor::Dig2Clu(TObjArray *pDigAll,TObjArray *pCluAll,Int_t
 //            pCluAll     - list of clusters for all chambers
 //            isTryUnfold - flag to choose between CoG and Mathieson fitting  
 //  Returns: none    
+
   TMatrixF padMap(AliHMPIDParam::kMinPx,AliHMPIDParam::kMaxPcx,AliHMPIDParam::kMinPy,AliHMPIDParam::kMaxPcy);  //pads map for single chamber 0..159 x 0..143 
   
   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){                  //chambers loop 
@@ -124,7 +125,7 @@ void AliHMPIDReconstructor::Reconstruct(TTree *pDigTree,TTree *pCluTree)const
     pDigTree->SetBranchAddress(Form("HMPID%d",iCh),&((*fDig)[iCh]));
   }   
   
-  Int_t *pUserCut = new Int_t[7];
+  Int_t pUserCut[7];
   
    if(AliHMPIDReconstructor::GetRecoParam()) {
     for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
@@ -139,16 +140,19 @@ void AliHMPIDReconstructor::Reconstruct(TTree *pDigTree,TTree *pCluTree)const
       AliDebug(1,Form("Cannot get AliHMPIDRecoParamV1!"));
       }
     }  
-  
+  TVirtualFitter* fitter = TVirtualFitter::GetFitter();
+  delete fitter;
+  fitter = TVirtualFitter::Fitter(0,3*6); // create a new fitter to avoid interferrence with others
   pDigTree->GetEntry(0);
   Dig2Clu(fDig,fClu,pUserCut);     //cluster finder 
   pCluTree->Fill();                //fill tree for current event
-  
+  delete fitter;
   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
     fDig->At(iCh)->Clear();
     fClu->At(iCh)->Clear();
   }
   
+  
   AliDebug(1,"Stop.");      
 }//Reconstruct(for simulated digits)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -167,7 +171,7 @@ void AliHMPIDReconstructor::ConvertDigits(AliRawReader *pRR,TTree *pDigTree)cons
     pDigTree->Branch(Form("HMPID%d",iCh),&((*fDig)[iCh]));
   }
     
-  Int_t *pUserCut = new Int_t[7];
+  Int_t pUserCut[7];
   
    if(AliHMPIDReconstructor::GetRecoParam()) {
     for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
@@ -199,20 +203,7 @@ void AliHMPIDReconstructor::ConvertDigits(AliRawReader *pRR,TTree *pDigTree)cons
   
   for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++)fDig->At(iCh)->Clear();
   
+  
   AliDebug(1,"Stop.");
 }//Reconstruct digits from raw digits
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDReconstructor::FillESD(TTree */*digitsTree*/, TTree */*clustersTree*/, AliESDEvent *pESD) const
-{
-// Fill ESD with all the infos from HMPID
-// Probability vector from AliHMPIDPid
-//...
-  AliHMPIDPid pID;
-  Double_t prob[AliPID::kSPECIES];
-  
-  for(Int_t iTrk=0;iTrk<pESD->GetNumberOfTracks();iTrk++){//ESD tracks loop
-    AliESDtrack *pTrk = pESD->GetTrack(iTrk);// get next reconstructed track
-    pID.FindPid(pTrk,AliPID::kSPECIES,prob);
-    pTrk->SetHMPIDpid(prob);
-  }//ESD tracks loop
-}//FillESD()