Fitter in AliHMPIDCluster::Solve(..) method created/deleted once per event to prevent...
authorgvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Sep 2013 13:11:29 +0000 (13:11 +0000)
committergvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Sep 2013 13:11:29 +0000 (13:11 +0000)
HMPID/AliHMPIDCluster.cxx
HMPID/AliHMPIDReconstructor.cxx

index b76ec69..0265c5b 100644 (file)
@@ -285,11 +285,8 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Int_t *pSigmaCut, Bool_t isTr
 //Phase 0. Initialise Fitter  
   Double_t arglist[10];
   Int_t ierflg = 0;
-  TVirtualFitter *fitter = TVirtualFitter::Fitter(this,3*6);                            //initialize Fitter
-
-  delete fitter;                                                                        //temporary solution to avoid the inteference with previous instances
-  fitter = TVirtualFitter::Fitter(this,3*6);                                            //initialize Fitter
-
+  TVirtualFitter* fitter = TVirtualFitter::Fitter(this,3*6);                       //initialize Fitter
+  //
   arglist[0] = -1;
   ierflg = fitter->ExecuteCommand("SET PRI", arglist, 1);                               // no printout
   ierflg = fitter->ExecuteCommand("SET NOW", arglist, 0);                               //no warning messages
@@ -345,15 +342,14 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Int_t *pSigmaCut, Bool_t isTr
    fSt=kNoLoc;
    SetClusterParams(fXX,fYY,fCh);                                                          //need to fill the AliCluster3D part
    new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);                                    //add new unfolded cluster
-   
    return fNlocMax;
  }
 
 // case 2 -> loc max found. Check # of loc maxima 
  if ( fNlocMax >= kMaxLocMax)  { 
- SetClusterParams(fXX,fYY,fCh);                                                           // if # of local maxima exceeds kMaxLocMax...
+   SetClusterParams(fXX,fYY,fCh);                                                           // if # of local maxima exceeds kMaxLocMax...
    fSt = kMax;   new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);                      //...add this raw cluster  
-   } else {                                                                               //or resonable number of local maxima to fit and user requested it
+ } else {                                                                               //or resonable number of local maxima to fit and user requested it
   // Now ready for minimization step
    arglist[0] = 500;                                                                      //number of steps and sigma on pads charges
    arglist[1] = 1.;                                                                       //
index 1cd2236..d01ca39 100644 (file)
@@ -29,7 +29,7 @@
 #include <AliLog.h>                //
 #include "AliHMPIDRawStream.h"     //ConvertDigits()
 #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 
@@ -139,11 +140,13 @@ 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();