added switch for generation of THnSparses (background)
authordmuhlhei <d.muehlheim@cern.ch>
Wed, 14 Jan 2015 17:14:25 +0000 (18:14 +0100)
committerdmuhlhei <d.muehlheim@cern.ch>
Thu, 15 Jan 2015 12:16:27 +0000 (13:16 +0100)
PWGGA/GammaConv/AliAnalysisTaskGammaCalo.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaCalo.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.h
PWGGA/GammaConv/AliCaloPhotonCuts.cxx
PWGGA/GammaConv/AliCaloPhotonCuts.h
PWGGA/GammaConv/macros/AddTask_GammaCalo_PbPb.C
PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvCalo_PbPb.C
PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C

index 28f59d1..c8a33ad 100644 (file)
@@ -222,7 +222,8 @@ AliAnalysisTaskGammaCalo::AliAnalysisTaskGammaCalo(): AliAnalysisTaskSE(),
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
        fIsOverlappingWithOtherHeader(kFALSE),
-       fIsMC(kFALSE)
+    fIsMC(kFALSE),
+    fDoTHnSparse(kTRUE)
 {
   
 }
@@ -392,7 +393,8 @@ AliAnalysisTaskGammaCalo::AliAnalysisTaskGammaCalo(const char *name):
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
        fIsOverlappingWithOtherHeader(kFALSE),
-       fIsMC(kFALSE)
+    fIsMC(kFALSE),
+    fDoTHnSparse(kTRUE)
 {
   // Define output slots here
   DefineOutput(1, TList::Class());
@@ -417,9 +419,11 @@ void AliAnalysisTaskGammaCalo::InitBack(){
        Double_t xMin[nDim] = {0,0, 0,0};
        Double_t xMax[nDim] = {0.8,25,7,6};
        
-       fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
-       fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
-       
+    if(fDoTHnSparse){
+        fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
+        fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
+    }
+
        fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts];
 
        
@@ -447,22 +451,24 @@ void AliAnalysisTaskGammaCalo::InitBack(){
                                centMax = ((centMax*5)+45);
                        }
                        
-                       fBackList[iCut] = new TList();
-                       fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
-                       fBackList[iCut]->SetOwner(kTRUE);
-                       fCutFolder[iCut]->Add(fBackList[iCut]);
-                       
-                       fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-                       fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
-                       
-                       fMotherList[iCut] = new TList();
-                       fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
-                       fMotherList[iCut]->SetOwner(kTRUE);
-                       fCutFolder[iCut]->Add(fMotherList[iCut]);
-                       
-                       fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-                       fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
-                       
+            if(fDoTHnSparse){
+                fBackList[iCut] = new TList();
+                fBackList[iCut]->SetName(Form("%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
+                fBackList[iCut]->SetOwner(kTRUE);
+                fCutFolder[iCut]->Add(fBackList[iCut]);
+
+                fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+                fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
+
+                fMotherList[iCut] = new TList();
+                fMotherList[iCut]->SetName(Form("%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                fMotherList[iCut]->SetOwner(kTRUE);
+                fCutFolder[iCut]->Add(fMotherList[iCut]);
+
+                fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+                fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
+            }
+
                        if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
@@ -491,8 +497,10 @@ void AliAnalysisTaskGammaCalo::UserCreateOutputObjects(){
   
        fCutFolder = new TList*[fnCuts];
        fESDList = new TList*[fnCuts];
-       fBackList = new TList*[fnCuts];
-       fMotherList = new TList*[fnCuts];
+    if(fDoTHnSparse){
+        fBackList = new TList*[fnCuts];
+        fMotherList = new TList*[fnCuts];
+    }
        fHistoNEvents = new TH1I*[fnCuts];
        fHistoNGoodESDTracks = new TH1I*[fnCuts];
        fHistoNGammaCandidates = new TH1I*[fnCuts];
@@ -1855,7 +1863,7 @@ void AliAnalysisTaskGammaCalo::CalculatePi0Candidates(){
                                                        fHistoMotherEtaPtOpenAngle[fiCut]->Fill(pi0cand->Pt(),pi0cand->GetOpeningAngle());
                                                }
                                        }
-                                       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
+                    if(fDoTHnSparse && ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
                                                Int_t zbin = 0;
                                                Int_t mbin = 0;
                                                
@@ -2443,8 +2451,10 @@ void AliAnalysisTaskGammaCalo::CalculateBackground(){
                                        if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
                                                ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
-                                               Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
-                                               fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                        if(fDoTHnSparse){
+                            Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
+                            fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                        }
                                        }
                                        delete backgroundCandidate;
                                        backgroundCandidate = 0x0;
@@ -2465,8 +2475,10 @@ void AliAnalysisTaskGammaCalo::CalculateBackground(){
                                
                                                if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                        fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
-                                                       Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
-                                                       fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                            if(fDoTHnSparse){
+                                Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
+                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                            }
                                                }
                                                delete backgroundCandidate;
                                                backgroundCandidate = 0x0;
index 55b2d0f..bdaffd5 100644 (file)
@@ -50,6 +50,7 @@ class AliAnalysisTaskGammaCalo : public AliAnalysisTaskSE {
                void SetDoMesonAnalysis(Bool_t flag){fDoMesonAnalysis = flag;}
                void SetDoMesonQA(Int_t flag){fDoMesonQA = flag;}
                void SetDoClusterQA(Int_t flag){fDoClusterQA = flag;}
+               void SetDoTHnSparse(Bool_t flag){fDoTHnSparse = flag;}
                
            // Setting the cut lists for the conversion photons
                void SetEventCutList(Int_t nCuts, TList *CutArray){
@@ -257,6 +258,7 @@ class AliAnalysisTaskGammaCalo : public AliAnalysisTaskSE {
                Bool_t                                                          fIsFromMBHeader;                                        // flag for MC headers
                Bool_t                                                          fIsOverlappingWithOtherHeader;          // flag for particles in MC overlapping between headers
                Bool_t                                                          fIsMC;                                                          // flag for MC information
+               Bool_t                              fDoTHnSparse;                       // flag for using THnSparses for background estimation
 
 
        private:
index cc105f9..861dbef 100644 (file)
@@ -256,7 +256,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(): AliAnalysisTaskSE(
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
        fIsOverlappingWithOtherHeader(kFALSE),
-       fIsMC(kFALSE)
+    fIsMC(kFALSE),
+    fDoTHnSparse(kTRUE)
 {
   
 }
@@ -459,7 +460,8 @@ AliAnalysisTaskGammaConvCalo::AliAnalysisTaskGammaConvCalo(const char *name):
        fDoClusterQA(0),
        fIsFromMBHeader(kTRUE),
        fIsOverlappingWithOtherHeader(kFALSE),
-       fIsMC(kFALSE)
+    fIsMC(kFALSE),
+    fDoTHnSparse(kTRUE)
 {
   // Define output slots here
   DefineOutput(1, TList::Class());
@@ -500,9 +502,11 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
        Double_t xMin[nDim] = {0,0, 0,0};
        Double_t xMax[nDim] = {0.8,25,7,4};
        
-       fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
-       fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
-       
+    if(fDoTHnSparse){
+        fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
+        fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
+    }
+
        fBGHandler = new AliGammaConversionAODBGHandler*[fnCuts];
        fBGHandlerRP = new AliConversionAODBGHandlerRP*[fnCuts];
 
@@ -534,22 +538,24 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                                centMax = ((centMax*5)+45);
                        }
                        
-                       fBackList[iCut] = new TList();
-                       fBackList[iCut]->SetName(Form("%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
-                       fBackList[iCut]->SetOwner(kTRUE);
-                       fCutFolder[iCut]->Add(fBackList[iCut]);
-                       
-                       fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-                       fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
-                       
-                       fMotherList[iCut] = new TList();
-                       fMotherList[iCut]->SetName(Form("%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
-                       fMotherList[iCut]->SetOwner(kTRUE);
-                       fCutFolder[iCut]->Add(fMotherList[iCut]);
-                       
-                       fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
-                       fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
-                       
+            if(fDoTHnSparse){
+                fBackList[iCut] = new TList();
+                fBackList[iCut]->SetName(Form("%s_%s_%s_%s Back histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(), cutstringMeson.Data()));
+                fBackList[iCut]->SetOwner(kTRUE);
+                fCutFolder[iCut]->Add(fBackList[iCut]);
+
+                fSparseMotherBackInvMassPtZM[iCut] = new THnSparseF("Back_Back_InvMass_Pt_z_m","Back_Back_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+                fBackList[iCut]->Add(fSparseMotherBackInvMassPtZM[iCut]);
+
+                fMotherList[iCut] = new TList();
+                fMotherList[iCut]->SetName(Form("%s_%s_%s_%s Mother histograms",cutstringEvent.Data(),cutstringPhoton.Data(),cutstringCalo.Data(),cutstringMeson.Data()));
+                fMotherList[iCut]->SetOwner(kTRUE);
+                fCutFolder[iCut]->Add(fMotherList[iCut]);
+
+                fSparseMotherInvMassPtZM[iCut] = new THnSparseF("Back_Mother_InvMass_Pt_z_m","Back_Mother_InvMass_Pt_z_m",nDim,nBins,xMin,xMax);
+                fMotherList[iCut]->Add(fSparseMotherInvMassPtZM[iCut]);
+            }
+
                        if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
@@ -595,8 +601,12 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
   
        fCutFolder = new TList*[fnCuts];
        fESDList = new TList*[fnCuts];
-       fBackList = new TList*[fnCuts];
-       fMotherList = new TList*[fnCuts];
+
+    if(fDoTHnSparse){
+        fBackList = new TList*[fnCuts];
+        fMotherList = new TList*[fnCuts];
+    }
+
        fHistoNEvents = new TH1I*[fnCuts];
        fHistoNGoodESDTracks = new TH1I*[fnCuts];
        fHistoNGammaCandidates = new TH1I*[fnCuts];
@@ -2556,7 +2566,7 @@ void AliAnalysisTaskGammaConvCalo::CalculatePi0Candidates(){
                                 fHistoMotherEtaConvPhotonEtaPhi[fiCut]->Fill(gamma0->GetPhotonPhi(), gamma0->GetPhotonEta());
                                                        }
                                                }
-                                               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
+                        if(fDoTHnSparse && ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
                                                        Int_t zbin = 0;
                                                        Int_t mbin = 0;
                                                        
@@ -2976,15 +2986,18 @@ void AliAnalysisTaskGammaConvCalo::ProcessTrueMesonCandidatesAOD(AliAODConversio
 
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
-       
-       Int_t zbin= fBGClusHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
-       Int_t mbin = 0;
-       
-       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
-               mbin = fBGClusHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
-       } else {
-               mbin = fBGClusHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
-       }
+
+    Int_t zbin = 0;
+    Int_t mbin = 0;
+
+    if(fDoTHnSparse){
+        zbin = fBGClusHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
+        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
+            mbin = fBGClusHandler[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
+        } else {
+            mbin = fBGClusHandler[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+        }
+    }
        
        AliGammaConversionAODBGHandler::GammaConversionVertex *bgEventVertex = NULL;    
        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
@@ -3015,8 +3028,10 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
                                                ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                fHistoPhotonPairMixedEventPtconv[fiCut]->Fill(backgroundCandidate->M(),currentEventGoodV0.Pt());
-                                               Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
-                                               fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                        if(fDoTHnSparse){
+                            Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
+                            fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                        }
                                        }
                                        delete backgroundCandidate;
                                        backgroundCandidate = 0x0;
@@ -3052,8 +3067,10 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
                                                if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                        fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                                                        fHistoPhotonPairMixedEventPtconv[fiCut]->Fill(backgroundCandidate->M(),currentEventGoodV0.Pt());
-                                                       Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
-                                                       fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                            if(fDoTHnSparse){
+                                Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
+                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
+                            }
                                                }
                                                delete backgroundCandidate;
                                                backgroundCandidate = 0x0;
@@ -3067,14 +3084,17 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackground(){
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
        
-       Int_t zbin= fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
-       Int_t mbin = 0;
-       if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
-               mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
-       } else {
-               mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
-       }
-       
+    Int_t zbin = 0;
+    Int_t mbin = 0;
+
+    if(fDoTHnSparse){
+        zbin= fBGHandlerRP[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
+        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
+            mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fV0Reader->GetNumberOfPrimaryTracks());
+        } else {
+            mbin = fBGHandlerRP[fiCut]->GetMultiplicityBinIndex(fGammaCandidates->GetEntries());
+        }
+    }
        
        //Rotation Method
        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseRotationMethod()){
@@ -3099,8 +3119,10 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
                                                ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                                                fHistoPhotonPairMixedEventPtconv[fiCut]->Fill(backgroundCandidate.M(),gamma0->Pt());
-                                               Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
-                                               fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
+                        if(fDoTHnSparse){
+                            Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
+                            fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
+                        }
                                        }
                                }
                        }
@@ -3132,8 +3154,10 @@ void AliAnalysisTaskGammaConvCalo::CalculateBackgroundRP(){
                                                ->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift())){
                                                        fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                                                        fHistoPhotonPairMixedEventPtconv[fiCut]->Fill(backgroundCandidate.M(),gamma0->Pt());
-                                                       Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
-                                                       fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
+                            if(fDoTHnSparse){
+                                Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
+                                fSparseMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
+                            }
                                                }
                                        }
                                }
@@ -3453,4 +3477,4 @@ void AliAnalysisTaskGammaConvCalo::ProcessConversionPhotonsForMissingTagsAOD (){
                }       
        }       
        return;
-}      
\ No newline at end of file
+}      
index 0ca75bb..ad3b434 100644 (file)
@@ -57,7 +57,8 @@ class AliAnalysisTaskGammaConvCalo : public AliAnalysisTaskSE {
                void SetDoMesonQA(Int_t flag){fDoMesonQA = flag;}
                void SetDoPhotonQA(Int_t flag){fDoPhotonQA = flag;}
                void SetDoClusterQA(Int_t flag){fDoClusterQA = flag;}
-               
+        void SetUseTHnSparse(Bool_t flag){fDoTHnSparse = flag;}
+
            // Setting the cut lists for the conversion photons
                void SetEventCutList(Int_t nCuts, TList *CutArray){
                        fnCuts = nCuts;
@@ -321,6 +322,7 @@ class AliAnalysisTaskGammaConvCalo : public AliAnalysisTaskSE {
                Bool_t                                                          fIsFromMBHeader;                                        // flag for MC headers
                Bool_t                                                          fIsOverlappingWithOtherHeader;          // flag for particles in MC overlapping between headers
                Bool_t                                                          fIsMC;                                                          // flag for MC information
+        Bool_t                              fDoTHnSparse;                       // flag for using THnSparses for background estimation
 
                
        private:
index 360bcd3..de6b364 100644 (file)
@@ -146,12 +146,12 @@ AliCaloPhotonCuts::AliCaloPhotonCuts(const char *name,const char *title) :
     fHistClusterdEtadPhiNegTracksBeforeQA(NULL),
     fHistClusterdEtadPhiPosTracksAfterQA(NULL),
     fHistClusterdEtadPhiNegTracksAfterQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_00_05BeforeQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_05_15BeforeQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_15_99BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_00_05BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_05_15BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_15_99BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_000_075BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_075_125BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_125_999BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_000_075BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_075_125BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_125_999BeforeQA(NULL),
     fHistClusterdEtadPtBeforeQA(NULL),
     fHistClusterdPhidPtBeforeQA(NULL),
     fHistClusterM20Pt_dPhiBeforeQA(NULL),
@@ -236,12 +236,12 @@ AliCaloPhotonCuts::AliCaloPhotonCuts(const AliCaloPhotonCuts &ref) :
     fHistClusterdEtadPhiNegTracksBeforeQA(NULL),
     fHistClusterdEtadPhiPosTracksAfterQA(NULL),
     fHistClusterdEtadPhiNegTracksAfterQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_00_05BeforeQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_05_15BeforeQA(NULL),
-    fHistClusterdEtadPhiPosTracksP_15_99BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_00_05BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_05_15BeforeQA(NULL),
-    fHistClusterdEtadPhiNegTracksP_15_99BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_000_075BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_075_125BeforeQA(NULL),
+    fHistClusterdEtadPhiPosTracksP_125_999BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_000_075BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_075_125BeforeQA(NULL),
+    fHistClusterdEtadPhiNegTracksP_125_999BeforeQA(NULL),
     fHistClusterdEtadPtBeforeQA(NULL),
     fHistClusterdPhidPtBeforeQA(NULL),
     fHistClusterM20Pt_dPhiBeforeQA(NULL),
@@ -433,18 +433,18 @@ void AliCaloPhotonCuts::InitCutHistograms(TString name){
             fHistograms->Add(fHistClusterdEtadPhiPosTracksAfterQA);
             fHistClusterdEtadPhiNegTracksAfterQA = new TH2F(Form("dEtaVsdPhi_negTracks_afterClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_afterClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
             fHistograms->Add(fHistClusterdEtadPhiNegTracksAfterQA);
-            fHistClusterdEtadPhiPosTracksP_00_05BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_P<0.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_P<0.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_00_05BeforeQA);
-            fHistClusterdEtadPhiPosTracksP_05_15BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_0.5<P<1.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_0.5<P<1.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_05_15BeforeQA);
-            fHistClusterdEtadPhiPosTracksP_15_99BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_P>1.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_P>1.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_15_99BeforeQA);
-            fHistClusterdEtadPhiNegTracksP_00_05BeforeQA= new TH2F(Form("dEtaVsdPhi_negTrack_P<0.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTrack_P<0.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_00_05BeforeQA);
-            fHistClusterdEtadPhiNegTracksP_05_15BeforeQA = new TH2F(Form("dEtaVsdPhi_negTracks_0.5<P<1.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_0.5<P<1.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_05_15BeforeQA);
-            fHistClusterdEtadPhiNegTracksP_15_99BeforeQA = new TH2F(Form("dEtaVsdPhi_negTracks_P>1.5_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_P>1.5_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
-            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_15_99BeforeQA);
+            fHistClusterdEtadPhiPosTracksP_000_075BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_P<0.75_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_P<0.75_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_000_075BeforeQA);
+            fHistClusterdEtadPhiPosTracksP_075_125BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_0.75<P<1.25_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_0.75<P<1.25_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_075_125BeforeQA);
+            fHistClusterdEtadPhiPosTracksP_125_999BeforeQA = new TH2F(Form("dEtaVsdPhi_posTracks_P>1.25_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_posTracks_P>1.25_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiPosTracksP_125_999BeforeQA);
+            fHistClusterdEtadPhiNegTracksP_000_075BeforeQA= new TH2F(Form("dEtaVsdPhi_negTrack_P<0.75_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTrack_P<0.75_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_000_075BeforeQA);
+            fHistClusterdEtadPhiNegTracksP_075_125BeforeQA = new TH2F(Form("dEtaVsdPhi_negTracks_0.75<P<1.25_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_0.75<P<1.25_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_075_125BeforeQA);
+            fHistClusterdEtadPhiNegTracksP_125_999BeforeQA = new TH2F(Form("dEtaVsdPhi_negTracks_P>1.25_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsdPhi_negTracks_P>1.25_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],nPhiBins,PhiRange[0],PhiRange[1]);
+            fHistograms->Add(fHistClusterdEtadPhiNegTracksP_125_999BeforeQA);
             fHistClusterdEtadPtBeforeQA = new TH2F(Form("dEtaVsPt_beforeClusterQA %s",GetCutNumber().Data()),"dEtaVsPt_beforeClusterQA",nEtaBins,EtaRange[0],EtaRange[1],250,0,25);
             fHistograms->Add(fHistClusterdEtadPtBeforeQA);
             fHistClusterdPhidPtBeforeQA = new TH2F(Form("dPhiVsPt_beforeClusterQA %s",GetCutNumber().Data()),"dPhiVsPt_beforeClusterQA",2*nPhiBins,2*PhiRange[0],2*PhiRange[1],250,0,25);
@@ -918,15 +918,15 @@ Bool_t AliCaloPhotonCuts::MatchConvPhotonToCluster(AliAODConversionPhoton* convP
             if(fExtendedMatching){
                 if(inTrack->Charge() > 0) {
                     fHistClusterdEtadPhiPosTracksBeforeQA->Fill(dEta, dPhi);
-                    if(inTrack->P() < 0.5) fHistClusterdEtadPhiPosTracksP_00_05BeforeQA->Fill(dEta, dPhi);
-                    else if(inTrack->P() < 1.5) fHistClusterdEtadPhiPosTracksP_05_15BeforeQA->Fill(dEta, dPhi);
-                    else fHistClusterdEtadPhiPosTracksP_15_99BeforeQA->Fill(dEta, dPhi);
+                    if(inTrack->P() < 0.75) fHistClusterdEtadPhiPosTracksP_000_075BeforeQA->Fill(dEta, dPhi);
+                    else if(inTrack->P() < 1.25) fHistClusterdEtadPhiPosTracksP_075_125BeforeQA->Fill(dEta, dPhi);
+                    else fHistClusterdEtadPhiPosTracksP_125_999BeforeQA->Fill(dEta, dPhi);
                 }
                 else{
                     fHistClusterdEtadPhiNegTracksBeforeQA->Fill(dEta, dPhi);
-                    if(inTrack->P() < 0.5) fHistClusterdEtadPhiNegTracksP_00_05BeforeQA->Fill(dEta, dPhi);
-                    else if(inTrack->P() < 1.5) fHistClusterdEtadPhiNegTracksP_05_15BeforeQA->Fill(dEta, dPhi);
-                    else fHistClusterdEtadPhiNegTracksP_15_99BeforeQA->Fill(dEta, dPhi);
+                    if(inTrack->P() < 0.75) fHistClusterdEtadPhiNegTracksP_000_075BeforeQA->Fill(dEta, dPhi);
+                    else if(inTrack->P() < 1.25) fHistClusterdEtadPhiNegTracksP_075_125BeforeQA->Fill(dEta, dPhi);
+                    else fHistClusterdEtadPhiNegTracksP_125_999BeforeQA->Fill(dEta, dPhi);
                 }
                 fHistClusterdEtadPtBeforeQA->Fill(dEta, inTrack->Pt());
                 fHistClusterdPhidPtBeforeQA->Fill(dPhi, inTrack->Pt());
index d295be7..80b329e 100644 (file)
@@ -207,12 +207,12 @@ class AliCaloPhotonCuts : public AliAnalysisCuts {
         TH2F*          fHistClusterdEtadPhiNegTracksBeforeQA;  // 2-dim plot dEta vs. dPhi
         TH2F*          fHistClusterdEtadPhiPosTracksAfterQA;   // 2-dim plot dEta vs. dPhi
         TH2F*          fHistClusterdEtadPhiNegTracksAfterQA;   // 2-dim plot dEta vs. dPhi
-        TH2F*       fHistClusterdEtadPhiPosTracksP_00_05BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, P < 0.5
-        TH2F*       fHistClusterdEtadPhiPosTracksP_05_15BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, 0.5 < P < 1.5
-        TH2F*       fHistClusterdEtadPhiPosTracksP_15_99BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, P > 1.5
-        TH2F*       fHistClusterdEtadPhiNegTracksP_00_05BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, P < 0.5
-        TH2F*       fHistClusterdEtadPhiNegTracksP_05_15BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, 0.5 < P < 1.5
-        TH2F*       fHistClusterdEtadPhiNegTracksP_15_99BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, P > 1.5
+        TH2F*       fHistClusterdEtadPhiPosTracksP_000_075BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, P < 0.75
+        TH2F*       fHistClusterdEtadPhiPosTracksP_075_125BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, 0.75 < P < 1.25
+        TH2F*       fHistClusterdEtadPhiPosTracksP_125_999BeforeQA;// 2-dim plot dEta vs. dPhi, positive Tracks, P > 1.25
+        TH2F*       fHistClusterdEtadPhiNegTracksP_000_075BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, P < 0.75
+        TH2F*       fHistClusterdEtadPhiNegTracksP_075_125BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, 0.75 < P < 1.25
+        TH2F*       fHistClusterdEtadPhiNegTracksP_125_999BeforeQA;// 2-dim plot dEta vs. dPhi, negative Tracks, P > 1.25
         TH2F*          fHistClusterdEtadPtBeforeQA;                    // 2-dim plot dEta vs. Pt
         TH2F*          fHistClusterdPhidPtBeforeQA;                    // 2-dim plot dEta vs. Pt
         TH2F*          fHistClusterM20Pt_dPhiBeforeQA;                 // 2-dim plot M20 vs. Pt for given dPhi>0.05
index 7902bfe..7725091 100644 (file)
@@ -6,7 +6,8 @@ void AddTask_GammaCalo_PbPb(            Int_t trainConfig = 1,  //change different set
                                                                        Int_t headerSelectionInt = 0,  // 1 pi0 header, 2 eta header, 3 both (only for "named" boxes)
                                                                        TString cutnumberAODBranch = "1000000060084000001500000",
                                                                        TString periodName = "LHC13d2",  //name of the period for added signals and weighting
-                                    Bool_t doWeighting = kFALSE  //enable Weighting
+                                    Bool_t doWeighting = kFALSE,  //enable Weighting
+                                    Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation
                                                                ) {
 
        // ================= Load Librariers =================================
@@ -229,6 +230,7 @@ void AddTask_GammaCalo_PbPb(                Int_t trainConfig = 1,  //change different set
        task->SetDoMesonAnalysis(kTRUE);
        task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
        task->SetDoClusterQA(enableQAClusterTask);  //Attention new switch small for Cluster QA
+    task->SetUseTHnSparse(isUsingTHnSparse);
 
        //connect containers
        AliAnalysisDataContainer *coutput =
index 6785120..7a36e66 100644 (file)
@@ -6,7 +6,8 @@ void AddTask_GammaCalo_pPb(
                                                        TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input
                                                        Int_t doWeightingPart = 0,  //enable Weighting
                                                        TString generatorName = "DPMJET",
-                                                       TString cutnumberAODBranch = "8000000060084000001500000" // cutnumber for AOD branch
+                            TString cutnumberAODBranch = "8000000060084000001500000", // cutnumber for AOD branch
+                            Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation
                                                   ) {
 
        // ================= Load Librariers =================================
@@ -226,6 +227,7 @@ void AddTask_GammaCalo_pPb(
        task->SetDoMesonAnalysis(kTRUE);
        task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
        task->SetDoClusterQA(enableQAClusterTask);  //Attention new switch small for Cluster QA
+    task->SetUseTHnSparse(isUsingTHnSparse);
 
        //connect containers
        AliAnalysisDataContainer *coutput =
index 73f5a29..8ebf0ca 100644 (file)
@@ -7,7 +7,8 @@ void AddTask_GammaConvCalo_PbPb(        Int_t trainConfig = 1,  //change different s
                                                                        TString cutnumberAODBranch = "1000000060084000001500000",
                                                                        TString periodName = "LHC13d2",  //name of the period for added signals and weighting
                                     Bool_t doWeighting = kFALSE,  //enable Weighting
-                                    Bool_t enableExtendedMatching = kFALSE //enable or disable extended matching histograms for conversion electrons <-> cluster
+                                    Bool_t enableExtendedMatching = kFALSE, //enable or disable extended matching histograms for conversion electrons <-> cluster
+                                    Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation
                                                                ) {
 
        // ================= Load Librariers =================================
@@ -286,6 +287,7 @@ void AddTask_GammaConvCalo_PbPb(    Int_t trainConfig = 1,  //change different s
        task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
        task->SetDoPhotonQA(enableQAPhotonTask);  //Attention new switch small for Photon QA
        task->SetDoClusterQA(1);  //Attention new switch small for Cluster QA
+    task->SetUseTHnSparse(isUsingTHnSparse);
        
        //connect containers
        AliAnalysisDataContainer *coutput =
index ce98f90..0336d4d 100644 (file)
@@ -6,7 +6,8 @@ void AddTask_GammaConvCalo_pPb(  Int_t trainConfig = 1,  //change different set
                               Int_t doWeightingPart = 0,  //enable Weighting
                               TString generatorName = "DPMJET",
                               TString cutnumberAODBranch = "8000000060084000001500000", // cutnumber for AOD branch
-                              Bool_t enableExtendedMatching = kFALSE //enable or disable extended matching histograms for conversion electrons <-> cluster
+                              Bool_t enableExtendedMatching = kFALSE, //enable or disable extended matching histograms for conversion electrons <-> cluster
+                              Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation
                                                        ) {
 
        // ================= Load Librariers =================================
@@ -267,6 +268,7 @@ void AddTask_GammaConvCalo_pPb(  Int_t trainConfig = 1,  //change different set
        task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
        task->SetDoPhotonQA(enableQAPhotonTask);  //Attention new switch small for Photon QA
        task->SetDoClusterQA(1);  //Attention new switch small for Cluster QA
+    task->SetUseTHnSparse(isUsingTHnSparse);
 
        //connect containers
        AliAnalysisDataContainer *coutput =