fix for PIDCombined
authorlmilano <lmilano@cern.ch>
Tue, 15 Jul 2014 10:41:13 +0000 (12:41 +0200)
committerlmilano <lmilano@cern.ch>
Tue, 15 Jul 2014 10:41:13 +0000 (12:41 +0200)
PWG/Tools/AliHelperPID.cxx
PWG/Tools/AliHelperPID.h

index 1f195b0..3409cce 100644 (file)
@@ -142,11 +142,6 @@ AliHelperPID::AliHelperPID() : TNamed("HelperPID", "PID object"),fisMC(0), fPIDT
     fHistoPID->GetYaxis()->SetTitle(Form("%s signal",kDetectorName[idet]));
     fOutputList->Add(fHistoPID);
   }
-
-  // ------- setup PIDCombined
-  fPIDCombined=new AliPIDCombined;
-  fPIDCombined->SetDefaultTPCPriors();
-  fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);  
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
@@ -181,7 +176,12 @@ Int_t AliHelperPID::GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos){
   if(fPIDType==kBayes){//use bayesianPID
     
     if(!fPIDCombined) {
-      //AliFatal("PIDCombined object has to be set in the steering macro");
+      // ------- setup PIDCombined
+      fPIDCombined=new AliPIDCombined;
+      fPIDCombined->SetDefaultTPCPriors();
+      fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);  
+    }
+    if(!fPIDCombined) {
       AliFatal("PIDCombined object not found");
     }
     
index 5d1bb63..fdc32bd 100644 (file)
@@ -85,7 +85,7 @@ class AliHelperPID : public TNamed
   void SetfPtTOFPID(Double_t pttof){fPtTOFPID=pttof;}
   //set PID Combined
   //void SetPIDCombined(AliPIDCombined *obj){fPIDCombined=obj;}
-  void SetPIDCombined(AliPIDCombined *obj){Printf("void SetPIDCombined(AliPIDCombined *obj) not implemented");}  //FIXME Left for backward-compatibility, not the PIDCombined onject is created in the constructor as done in /ANALYSIS/AliAnalysisTaskPIDCombined.cxx (Jul 15th 2014)
+  void SetPIDCombined(AliPIDCombined *obj){Printf("void AliHelperPID::SetPIDCombined(AliPIDCombined *obj) not implemented");}  //FIXME Left for backward compatibility, not the PIDCombined onject is created in the constructor as done in /ANALYSIS/AliAnalysisTaskPIDCombined.cxx (Jul 15th 2014)
   AliPIDCombined *GetPIDCombined(){return fPIDCombined;}
   //set cut on beyesian probability
   void SetBayesCut(Double_t cut){fBayesCut=cut;}
@@ -121,8 +121,8 @@ class AliHelperPID : public TNamed
   PIDType_t fPIDType; // PID type
   Double_t fNSigmaPID; // number of sigma for PID cut
   Double_t fBayesCut; // Cut on Bayesian probability
-  AliPIDResponse   *fPIDResponse;     // ! PID response object
-  AliPIDCombined   *fPIDCombined;     // ! PIDCombined
+  AliPIDResponse   *fPIDResponse;     //! PID response object
+  AliPIDCombined   *fPIDCombined;     //! PIDCombined
   TList     *fOutputList;  // List Histo's
   Double_t fnsigmas[kNSpecies][kNSigmaPIDType+1]; //nsigma values
   Bool_t fHasDoubleCounting[kNSpecies];//array with compatible identities