bug fix in Event Cuts and update of Add task macro
authormchojnac <Marek.Chojnacki@cern.ch>
Fri, 10 Oct 2014 09:34:42 +0000 (11:34 +0200)
committermchojnac <Marek.Chojnacki@cern.ch>
Fri, 10 Oct 2014 09:35:38 +0000 (11:35 +0200)
PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraBoth.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraBothEventCuts.cxx

index 511866b..ea6295d 100644 (file)
@@ -80,7 +80,7 @@ AliAnalysisTaskSpectraBoth* AddTaskSpectraBoth(Bool_t mc=kFALSE,
   if(mc==1)evcuts->SetIsMC(kTRUE);
   evcuts->PrintCuts();
   
-  AliAnalysisTaskSpectraBoth *task = new AliAnalysisTaskSpectraBoth(Form("TaskBothSpectraCent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",  
+  AliAnalysisTaskSpectraBoth *task = new AliAnalysisTaskSpectraBoth(Form("TaskBothSpectraCent%.3fto%.3f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",  
                                                                       CentCutMin,
                                                                       CentCutMax,
                                                                       QvecCutMin,
@@ -99,9 +99,9 @@ AliAnalysisTaskSpectraBoth* AddTaskSpectraBoth(Bool_t mc=kFALSE,
   TString outputFileName = AliAnalysisManager::GetCommonFileName();
   
   TString typeofdata=mc?"MC":"Data";
-  outputFileName += Form(":OutputBothSpectraTask_%s_Cent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType(),opt.Data());
+  outputFileName += Form(":OutputBothSpectraTask_%s_Cent%.3fto%.3f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType(),opt.Data());
   
-  TString tmpstring= Form("OutputBothSpectraTask_%s_Cent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType(),opt.Data());
+  TString tmpstring= Form("OutputBothSpectraTask_%s_Cent%.3fto%.3f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType(),opt.Data());
   
   cout<<"outputFileName:  "<<outputFileName<<endl;
   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();      
index d68e958..46641e9 100644 (file)
@@ -246,7 +246,6 @@ Bool_t AliSpectraBothEventCuts::IsSelected(AliVEvent * aod,AliSpectraBothTrackCu
                fHistoVtxAftSelwithoutZvertexCutusingMCz->Fill(mcZ);    
        if (vertex->GetZ() > fVertexCutMin && vertex->GetZ() < fVertexCutMax)
        {
-               fHistoCuts->Fill(kAcceptedEvents);
                fIsSelected=kTRUE;
                fHistoVtxAftSel->Fill(vertex->GetZ());
        }
@@ -259,6 +258,8 @@ Bool_t AliSpectraBothEventCuts::IsSelected(AliVEvent * aod,AliSpectraBothTrackCu
   {
        if( CheckCentralityCut() && CheckMultiplicityCut() && CheckQVectorCut())
                fIsSelected=kTRUE;
+       else
+               fIsSelected=kFALSE;     
   }    
 
 
@@ -283,7 +284,10 @@ Bool_t AliSpectraBothEventCuts::IsSelected(AliVEvent * aod,AliSpectraBothTrackCu
        }
   }
   if(fIsSelected)
-       fHistoNChAftSel->Fill(Nch);
+  {    
+       fHistoNChAftSel->Fill(Nch);
+       fHistoCuts->Fill(kAcceptedEvents);
+  }    
   return fIsSelected;
 }
 
@@ -348,7 +352,7 @@ Bool_t AliSpectraBothEventCuts::CheckCentralityCut()
                cent=ApplyCentralityPatchAOD049();
   }    
   fHistoCentrality->Fill(0.5,cent);    
-  if ( (cent <= fCentralityCutMax)  &&  (cent >= fCentralityCutMin) )  
+  if ( (cent < fCentralityCutMax)  &&  (cent >= fCentralityCutMin) )  
   {
         fHistoCentrality->Fill(1.5,cent);      
        return kTRUE;