- modified Jasons task in order to match the BG in both tasks
authorfbock <friederike.bock@cern.ch>
Fri, 10 Oct 2014 12:53:13 +0000 (14:53 +0200)
committerfbock <friederike.bock@cern.ch>
Fri, 10 Oct 2014 12:53:13 +0000 (14:53 +0200)
- modified BG handler in order to be able to take different number of multiplicity bins for Calo photons and depending tasks accordingly
- modified Event Selection for EMCAL triggers

15 files changed:
PWGGA/EMCALTasks/AliAnalysisTaskEMCALMesonGGSDM.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALMesonGGSDM.h
PWGGA/GammaConv/AliAnalysisTaskEtaToPiPlPiMiGamma.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaCalo.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvCalo.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.cxx
PWGGA/GammaConv/AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero.cxx
PWGGA/GammaConv/AliCaloPhotonCuts.h
PWGGA/GammaConv/AliConvEventCuts.cxx
PWGGA/GammaConv/AliConversionMesonCuts.cxx
PWGGA/GammaConv/AliConversionMesonCuts.h
PWGGA/GammaConv/AliGammaConversionAODBGHandler.cxx
PWGGA/GammaConv/AliGammaConversionAODBGHandler.h
PWGGA/GammaConv/macros/AddTask_GammaCalo_pp.C

index b0073d0..f3c5219 100644 (file)
@@ -1424,7 +1424,6 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
   //######################### DONE WITH MC ##################################
   //######################### ~~~~~~~~~~~~ ##################################
   
-
   for(int i=0; i<nclusters; i++) {
     
     AliESDCaloCluster* esdCluster=NULL;
@@ -1507,6 +1506,7 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
 
        //uncomment this to do the track matching (2 of 3 lines, esd part)!! 
        //if(isGoodEsdCluster(esdCluster) && !MatchesToTrack){
+               
        if(isGoodEsdCluster(esdCluster)){
          recalScale = PrivateEnergyRecal(esdCluster->E(), fRecalibrator);
          E1 = esdCluster->E()*recalScale;// TOTAL HACK - JJ
@@ -1519,6 +1519,8 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
          h1_E->Fill(E1);
          h2_PhiEtaClusterCut->Fill(clusterPosition.Phi(),clusterPosition.Eta());
          h2_PhiEtaMaxCellCut->Fill(cellphi,celleta);
+        
+         
        }
        clusterPosition.Delete();
       }//if(esdCluster->isEMCAL())
@@ -1627,7 +1629,7 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
     }//if(fAodEv)
     
   }//loop over nclusters. 
-  
   //Make same event pions... 
   for(unsigned int i=0; i<Photons[0][izvtx][imult].size(); i++){
     for(unsigned int j=i+1; j<Photons[0][izvtx][imult].size(); j++){
@@ -1640,7 +1642,7 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
       if     (pairasym<0.1)  asymCut = 1;
       else if(pairasym<0.7)  asymCut = 2;
       else                   asymCut = 3;
-      
+         
       h1_M        ->Fill(Parent.M());
       h3_MptAsymm ->Fill(Parent.M(),Parent.Pt(),asymCut);
       h2_dphi_deta->Fill(deltaphi,deltaeta);
@@ -1659,6 +1661,7 @@ void AliAnalysisTaskEMCALMesonGGSDM::UserExec(Option_t *)
        Double_t pairasym = fabs(Photons[0][izvtx][imult][i].Pt()-Photons[ipool][izvtx][imult][j].Pt())/
                                (Photons[0][izvtx][imult][i].Pt()+Photons[ipool][izvtx][imult][j].Pt());
        Int_t asymCut = 0;
+       
        if     (pairasym<0.1)  asymCut = 1;
        else if(pairasym<0.7)  asymCut = 2;
        else                   asymCut = 3;
@@ -1691,48 +1694,89 @@ void AliAnalysisTaskEMCALMesonGGSDM::Terminate(Option_t *) //specify what you wa
   
 }
 
+
+// //________________________________________________________________________
+// Int_t AliAnalysisTaskEMCALMesonGGSDM::GetZvtxBin(Double_t vertZ)
+// {
+//   
+//   int izvtx = -1;
+//   
+//   if     (vertZ<-35)
+//     izvtx=0;
+//   else if(vertZ<-30)
+//     izvtx=1;
+//   else if(vertZ<-25)
+//     izvtx=2;
+//   else if(vertZ<-20)
+//     izvtx=3;
+//   else if(vertZ<-15)
+//     izvtx=4;
+//   else if(vertZ<-10)
+//     izvtx=5;
+//   else if(vertZ< -5)
+//     izvtx=6;
+//   else if(vertZ<  0)
+//     izvtx=7;
+//   else if(vertZ<  5)
+//     izvtx=8;
+//   else if(vertZ< 10)
+//     izvtx=9;
+//   else if(vertZ< 15)
+//     izvtx=10;
+//   else if(vertZ< 20)
+//     izvtx=11;
+//   else if(vertZ< 25)
+//     izvtx=12;
+//   else if(vertZ< 30)
+//     izvtx=13;
+//   else if(vertZ< 35)
+//     izvtx=14;
+//   else
+//     izvtx=15;
+//   
+//   return izvtx;  
+// }
+
 //________________________________________________________________________
 Int_t AliAnalysisTaskEMCALMesonGGSDM::GetZvtxBin(Double_t vertZ)
 {
   
   int izvtx = -1;
   
-  if     (vertZ<-35)
+  if     (vertZ<-3.375)
     izvtx=0;
-  else if(vertZ<-30)
+  else if(vertZ<-1.605)
     izvtx=1;
-  else if(vertZ<-25)
+  else if(vertZ<-0.225)
     izvtx=2;
-  else if(vertZ<-20)
+  else if(vertZ<1.065)
     izvtx=3;
-  else if(vertZ<-15)
+  else if(vertZ<-2.445)
     izvtx=4;
-  else if(vertZ<-10)
+  else if(vertZ<-4.245)
     izvtx=5;
-  else if(vertZ< -5)
-    izvtx=6;
-  else if(vertZ<  0)
-    izvtx=7;
-  else if(vertZ<  5)
-    izvtx=8;
-  else if(vertZ< 10)
-    izvtx=9;
-  else if(vertZ< 15)
-    izvtx=10;
-  else if(vertZ< 20)
-    izvtx=11;
-  else if(vertZ< 25)
-    izvtx=12;
-  else if(vertZ< 30)
-    izvtx=13;
-  else if(vertZ< 35)
-    izvtx=14;
   else
-    izvtx=15;
+    izvtx=6;
   
   return izvtx;  
 }
 
+
+// //________________________________________________________________________
+// Int_t AliAnalysisTaskEMCALMesonGGSDM::GetMultBin(Int_t mult){
+// 
+//   int imult = -1;
+//   
+//   if     (mult<2)
+//     imult=0;
+//   else if(mult<25)
+//     imult=mult-2;
+//   else
+//     imult=24;
+//   
+//   return imult;  
+// }
+
 //________________________________________________________________________
 Int_t AliAnalysisTaskEMCALMesonGGSDM::GetMultBin(Int_t mult){
 
@@ -1740,14 +1784,21 @@ Int_t AliAnalysisTaskEMCALMesonGGSDM::GetMultBin(Int_t mult){
   
   if     (mult<2)
     imult=0;
-  else if(mult<25)
-    imult=mult-2;
+  else if(mult<3)
+    imult=1;
+  else if(mult<4)
+       imult=2;  
+  else if(mult<8)        
+    imult=3;
+  else if(mult<15)       
+    imult=4;
   else
-    imult=24;
+    imult=5;
   
   return imult;  
 }
 
+
 //________________________________________________________________________
 Int_t AliAnalysisTaskEMCALMesonGGSDM::isGoodEsdCluster(AliESDCaloCluster* esdclust){
 
index a52151b..a77976a 100644 (file)
@@ -42,9 +42,9 @@ class AliAnalysisTaskEMCALMesonGGSDM : public AliAnalysisTaskSE {
   void         SetFidEtaMinMax(Double_t kEtamin, Double_t kEtamax){ fEtamin = kEtamin; fEtamax = kEtamax; }
   
  private:
-  static const int zvtx_bins = 16;
-  static const int mult_bins = 25;
-  static const unsigned int poolDepth = 20;
+  static const int zvtx_bins = 8;
+  static const int mult_bins = 7;
+  static const unsigned int poolDepth = 80;
   
   Int_t GetMultBin(Int_t mult);
   Int_t GetZvtxBin(Double_t vertZ);
index 0559593..7298219 100644 (file)
@@ -304,7 +304,8 @@ void AliAnalysisTaskEtaToPiPlPiMiGamma::InitBack(){
                
                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(  collisionSystem,centMin,centMax,
                                                                                                                                ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents(),
-                                                                                                                               ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity());
+                                                                                                                               ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
+                                                                                                                               0,8,5);
                
        }
 }
index 1a1e59b..9836af2 100644 (file)
@@ -383,9 +383,9 @@ AliAnalysisTaskGammaCalo::~AliAnalysisTaskGammaCalo()
 void AliAnalysisTaskGammaCalo::InitBack(){
        
        const Int_t nDim = 4;
-       Int_t nBins[nDim] = {800,250,7,4};
+       Int_t nBins[nDim] = {800,250,7,6};
        Double_t xMin[nDim] = {0,0, 0,0};
-       Double_t xMax[nDim] = {0.8,25,7,4};
+       Double_t xMax[nDim] = {0.8,25,7,6};
        
        fSparseMotherInvMassPtZM = new THnSparseF*[fnCuts];
        fSparseMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
@@ -437,7 +437,8 @@ void AliAnalysisTaskGammaCalo::InitBack(){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       4,8,7);
                        }
                }
        }
@@ -1156,10 +1157,12 @@ void AliAnalysisTaskGammaCalo::UserExec(Option_t *)
                fHistoNGoodESDTracksVsNGammaCanditates[iCut]->Fill(fV0Reader->GetNumberOfPrimaryTracks(),fClusterCandidates->GetEntries());
                if(fDoMesonAnalysis){ // Meson Analysis
 
+                       
                        CalculatePi0Candidates(); // Combine Gammas from conversion and from calo
 
                        if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
                                if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
+                                       
                                        CalculateBackground(); // Combinatorial Background
                                        UpdateEventByEventData(); // Store Event for mixed Events
                                }
@@ -1741,9 +1744,7 @@ void AliAnalysisTaskGammaCalo::CalculatePi0Candidates(){
                                
                                AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1);
                                pi0cand->SetLabels(firstGammaIndex,secondGammaIndex);
-                               
-                               
-                               
+                                                               
                                if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                        fHistoMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
                                        // fill new histograms
@@ -2194,13 +2195,13 @@ void AliAnalysisTaskGammaCalo::CalculateBackground(){
        if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
                for(Int_t nEventsInBG=0;nEventsInBG<fBGHandler[fiCut]->GetNBGEvents();nEventsInBG++){
                        AliGammaConversionAODVector *previousEventV0s = fBGHandler[fiCut]->GetBGGoodV0s(zbin,mbin,nEventsInBG);
-                       
                        for(Int_t iCurrent=0;iCurrent<fClusterCandidates->GetEntries();iCurrent++){
                                AliAODConversionPhoton currentEventGoodV0 = *(AliAODConversionPhoton*)(fClusterCandidates->At(iCurrent));
                                for(UInt_t iPrevious=0;iPrevious<previousEventV0s->size();iPrevious++){
                                        AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious)));
                                        AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                        backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
+                               
                                        if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))
                                                ->MesonIsSelected(backgroundCandidate,kFALSE,((AliConvEventCuts*)fEventCutArray->At(fiCut))->GetEtaShift()))){
                                                fHistoMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
@@ -2223,6 +2224,7 @@ void AliAnalysisTaskGammaCalo::CalculateBackground(){
                                                AliAODConversionPhoton previousGoodV0 = (AliAODConversionPhoton)(*(previousEventV0s->at(iPrevious)));
                                                AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
                                                backgroundCandidate->CalculateDistanceOfClossetApproachToPrimVtx(fInputEvent->GetPrimaryVertex());
+                               
                                                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};
index 1899830..8873e7a 100644 (file)
@@ -546,11 +546,13 @@ void AliAnalysisTaskGammaConvCalo::InitBack(){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       2,8,7);
                                fBGClusHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       2,8,7);
                                fBGHandlerRP[iCut] = NULL;
                        } else{
                                fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
@@ -795,7 +797,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                                
                        }
                        if(fDoMesonQA == 1){
-                fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_Calib","ESD_Mother_InvMass_vs_E_Calib",800,0,0.8,250,0,25);
+                               fHistoMotherInvMassECalib[iCut] = new TH2F("ESD_Mother_InvMass_Pt_Calib","ESD_Mother_InvMass_Pt_Calib",800,0,0.8,250,0,25);
                                fESDList[iCut]->Add(fHistoMotherInvMassECalib[iCut]);
                                fHistoMotherInvMassECalibalpha[iCut] = new TH2F("ESD_Mother_InvMass_vs_E_Calib_alpha","ESD_Mother_InvMass_vs_E_Calib_alpha",800,0,0.8,250,0,25);
                                fESDList[iCut]->Add(fHistoMotherInvMassECalibalpha[iCut]);
@@ -1056,7 +1058,7 @@ void AliAnalysisTaskGammaConvCalo::UserCreateOutputObjects(){
                        fHistoTrueConvGammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
                        fTrueList[iCut]->Add(fHistoTrueConvGammaPt[iCut]);
       
-            fHistoTrueConvPi0GammaPt[iCut] = new TH1F("ESD_TrueConvPi0Gamma_Pt","ESD_TrueConvPi0Gamma_Pt",250,0,25);
+                       fHistoTrueConvPi0GammaPt[iCut] = new TH1F("ESD_TrueConvGamma_Pt","ESD_TrueConvGamma_Pt",250,0,25);
                        fTrueList[iCut]->Add(fHistoTrueConvPi0GammaPt[iCut]);
       
                        fHistoCombinatorialPt[iCut] = new TH2F("ESD_TrueCombinatorial_Pt","ESD_TrueCombinatorial_Pt",250,0,25,16,-0.5,15.5);
@@ -1925,12 +1927,7 @@ void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidatesAOD(AliAODConversi
                        }
                }
        }
-
-    if( ((AliAODMCParticle*)AODMCTrackArray->At(Photon->GetMother()))->GetPdgCode() == 111)
-    {
-        fHistoTrueConvPi0GammaPt[fiCut]->Fill(TruePhotonCandidate->Pt());
-    }
-
+  
 }
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvCalo::ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate)
index db36ee4..a919b69 100644 (file)
@@ -489,7 +489,8 @@ void AliAnalysisTaskGammaConvDalitzV1::InitBack(){
                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                collisionSystem,centMin,centMax,
                                                                                                                                ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->NumberOfRotationEvents(),
-                                                                                                                               ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                               ((AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                               1,8,5);
                
                if( ( (AliDalitzElectronCuts*)fCutElectronArray->At(iCut))->GetBKGMethod() == 3 ){
                        fGammasPool[iCut] = new TList();
index 3a8cb61..3a22d94 100644 (file)
@@ -421,7 +421,8 @@ void AliAnalysisTaskGammaConvV1::InitBack(){
                                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
                                                                                                                                        collisionSystem,centMin,centMax,
                                                                                                                                        ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
-                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+                                                                                                                                       ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity(),
+                                                                                                                                       0,8,5);
                                fBGHandlerRP[iCut] = NULL;
                        } else {
                                fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
index d4a7744..0e07494 100644 (file)
@@ -353,7 +353,8 @@ void AliAnalysisTaskNeutralMesonToPiPlPiMiPiZero::InitBack(){
                
                fBGHandler[iCut] = new AliGammaConversionAODBGHandler(  collisionSystem,centMin,centMax,
                                                                                                                                ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->GetNumberOfBGEvents(),
-                                                                                                                               ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity());
+                                                                                                                               ((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity(),
+                                                                                                                               0,8,5);
        }
 }
 
index 73b7085..4169300 100644 (file)
@@ -160,7 +160,7 @@ class AliCaloPhotonCuts : public AliAnalysisCuts {
                // CutString
                TObjString *fCutString;                                         // cut number used for analysis
                
-        // Cluster quality related histograms
+               // Histograms
                TH1F *fHistCutIndex;                                            // bookkeeping for cuts
                TH1F *fHistAcceptanceCuts;                                      // bookkeeping for acceptance cuts
                TH1F *fHistClusterIdentificationCuts;           // bookkeeping for cluster identification cuts
@@ -168,34 +168,31 @@ class AliCaloPhotonCuts : public AliAnalysisCuts {
                TH2F* fHistClusterEtavsPhiBeforeAcc;            // eta-phi-distribution before acceptance cuts
                TH2F* fHistClusterEtavsPhiAfterAcc;             // eta-phi-distribution of all after acceptance cuts
                TH2F* fHistClusterEtavsPhiAfterQA;                      // eta-phi-distribution of all after cluster quality cuts
-        //TH1F* fHistDistanceToBadChannelBeforeAcc;   // distance to bad channel before acceptance cuts
-        //TH1F* fHistDistanceToBadChannelAfterAcc;     // distance to bad channel after acceptance cuts
-        TH2F* fHistClusterTimevsEBeforeQA;                     // Cluster time vs E before cluster quality cuts
-        TH2F* fHistClusterTimevsEAfterQA;                      // Cluster time vs E after cluster quality cuts
-        //TH2F* fHistExoticCellBeforeQA;                               // Exotic cell: 1-Ecross/E cell vs Ecluster before acceptance cuts
-        //TH2F* fHistExoticCellAfterQA;                                // Exotic cell: 1-Ecross/E cell vs Ecluster after cluster quality cuts
-        //TH1F* fHistNMatchedTracks;                                   // number of matched tracks
-        TH1F* fHistEnergyOfClusterBeforeQA;                    // enery per cluster before acceptance cuts
-        TH1F* fHistEnergyOfClusterAfterQA;                     // enery per cluster after cluster quality cuts
-        TH1F* fHistNCellsBeforeQA;                                     // number of cells per cluster before acceptance cuts
-        TH1F* fHistNCellsAfterQA;                                      // number of cells per cluster after cluster quality cuts
-        TH1F* fHistM02BeforeQA;                                                // M02 before acceptance cuts
-        TH1F* fHistM02AfterQA;                                         // M02 after cluster quality cuts
-        TH1F* fHistM20BeforeQA;                                                // M20 before acceptance cuts
-        TH1F* fHistM20AfterQA;                                         // M20 after cluster quality cuts
-        TH1F* fHistDispersionBeforeQA;                         // dispersion before acceptance cuts
-        TH1F* fHistDispersionAfterQA;                          // dispersion after cluster quality cuts
-        //TH1F* fHistNLMBeforeQA;                                              // number of local maxima in cluster before acceptance cuts
-        //TH1F* fHistNLMAfterQA;                                               // number of local maxima in cluster after cluster quality cuts
-
-        //Track matching histograms
-        TH1F* fHistClusterRBeforeQA;                           // cluster position in R=SQRT(x^2+y^2) (before QA)
+//             TH1F* fHistDistanceToBadChannelBeforeAcc;   // distance to bad channel before acceptance cuts
+//             TH1F* fHistDistanceToBadChannelAfterAcc;        // distance to bad channel after acceptance cuts
+               TH2F* fHistClusterTimevsEBeforeQA;                      // Cluster time vs E before cluster quality cuts
+               TH2F* fHistClusterTimevsEAfterQA;                       // Cluster time vs E after cluster quality cuts
+//             TH2F* fHistExoticCellBeforeQA;                          // Exotic cell: 1-Ecross/E cell vs Ecluster before acceptance cuts
+//             TH2F* fHistExoticCellAfterQA;                           // Exotic cell: 1-Ecross/E cell vs Ecluster after cluster quality cuts
+//             TH1F* fHistNMatchedTracks;                                      // number of matched tracks
+               TH1F* fHistEnergyOfClusterBeforeQA;                     // enery per cluster before acceptance cuts
+               TH1F* fHistEnergyOfClusterAfterQA;                      // enery per cluster after cluster quality cuts
+               TH1F* fHistNCellsBeforeQA;                                      // number of cells per cluster before acceptance cuts
+               TH1F* fHistNCellsAfterQA;                                       // number of cells per cluster after cluster quality cuts
+               TH1F* fHistM02BeforeQA;                                         // M02 before acceptance cuts
+               TH1F* fHistM02AfterQA;                                          // M02 after cluster quality cuts
+               TH1F* fHistM20BeforeQA;                                         // M20 before acceptance cuts
+               TH1F* fHistM20AfterQA;                                          // M20 after cluster quality cuts
+               TH1F* fHistDispersionBeforeQA;                          // dispersion before acceptance cuts
+               TH1F* fHistDispersionAfterQA;                           // dispersion after cluster quality cuts
+//             TH1F* fHistNLMBeforeQA;                                         // number of local maxima in cluster before acceptance cuts
+//             TH1F* fHistNLMAfterQA;                                          // number of local maxima in cluster after cluster quality cuts
+               TH1F* fHistClusterRBeforeQA;                            // cluster position in R=SQRT(x^2+y^2) (before QA)
                TH1F* fHistClusterRAfterQA;                                     // cluster position in R=SQRT(x^2+y^2) for matched tracks (After QA)
                TH2F* fHistClusterdEtadPhiBeforeQA;                     // 2-dim plot dEta vs. dPhi
                TH2F* fHistClusterdEtadPhiAfterQA;                      // 2-dim plot dEta vs. dPhi for matched tracks (after QA)
-        TH1F* fHistDistanceTrackToClusterBeforeQA;     // distance cluster to track before acceptance cuts
-        TH1F* fHistDistanceTrackToClusterAfterQA;      // distance cluster to track after cluster quality cuts
-                               
+               TH1F* fHistDistanceTrackToClusterBeforeQA;      // distance cluster to track before acceptance cuts
+               TH1F* fHistDistanceTrackToClusterAfterQA;       // distance cluster to track after cluster quality cuts                         
        private:
 
                ClassDef(AliCaloPhotonCuts,2)
index 33079d0..a0a330d 100644 (file)
@@ -1425,6 +1425,7 @@ Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent, Bool_t isMC)
 {
 
        AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
        
        UInt_t isSelected = AliVEvent::kAny;
        TString periodName = ((AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data()))->GetPeriodName();
@@ -1451,6 +1452,8 @@ Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent, Bool_t isMC)
        //       if (fPreSelCut) cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask for Precut: " << fOfflineTriggerMask << endl;
        //       else cout << "Trigger selected from outside: "<< fTriggerSelectedManually <<"\t Offline Trigger mask: " << fOfflineTriggerMask << endl;
 
+               if (isMC) fOfflineTriggerMask = AliVEvent::kAny;
+       
                if (fOfflineTriggerMask){
                        isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected();             
                        
@@ -1462,10 +1465,10 @@ Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent, Bool_t isMC)
                                }
                                if (fSpecialSubTrigger>0 && !isMC){
                                        if (!firedTrigClass.Contains(fSpecialSubTriggerName.Data())) isSelected = 0;
-                               } else if (fSpecialSubTrigger>0 && isMC){
+                               } else if (isMC){
                                        if (fSpecialTrigger == 5 || fSpecialTrigger == 8 || fSpecialTrigger == 9){ // EMCAL triggers
                                                isSelected = 0;
-//                                             cout << "triggers: " << fTriggersEMCAL << "    selected triggers: " << fTriggersEMCALSelected << endl;
+//                                             if (fTriggersEMCAL > 0)cout << "Special Trigger " << fSpecialTrigger << " triggers: " << fTriggersEMCAL << "    selected triggers: " << fTriggersEMCALSelected << " run number: " <<fInputEvent->GetRunNumber()<<endl;
                                                if (fTriggersEMCAL&fTriggersEMCALSelected){
 //                                                     cout << "accepted ++++++++++++++++++++" << endl;
                                                        isSelected = 1;
@@ -2202,21 +2205,46 @@ ULong_t AliConvEventCuts::GetTriggerList(){
        Int_t nJ2 = 0;
        Int_t nL0 = 0;
        AliEmcalTriggerPatchInfo *patch;
+//     if (nPatch> 0) {cout << "NEW Triggers in this event*********************************" << endl;}
        for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
                patch = (AliEmcalTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
-               if (patch->IsGammaHigh()) nG1++;
-               if (patch->IsGammaLow())  nG2++;
-               if (patch->IsJetHigh()) nJ1++;
-               if (patch->IsJetLow())  nJ2++;
-               if (patch->IsLevel0())  nL0++;
+//             cout << "Patch energy: "<<patch->GetPatchE() << "\t ADC counts: " << patch->GetADCAmp() << endl;
+//             cout << "Phi: " << patch->GetPhiMin() << " - " << patch->GetPhiMax() << " delta phi: " <<abs(patch->GetPhiMin()-patch->GetPhiMax())<< endl;
+//             cout << "Eta: " << patch->GetEtaMin() << " - " << patch->GetEtaMax() << " delta eta: " <<abs(patch->GetEtaMin()-patch->GetEtaMax())<< endl;
+               if (patch->IsGammaHigh()){
+//                     cout << "fired L1GA high" << endl;
+                       nG1++;
+               }       
+               if (patch->IsGammaLow()){
+//                     cout << "fired L1GA low" << endl;
+                       nG2++;
+               }       
+               if (patch->IsJetHigh()){
+//                     cout << "fired L1JE high" << endl;
+                       nJ1++;
+               }
+               if (patch->IsJetLow()){
+//                     cout << "fired L1JE low" << endl;
+                       nJ2++;
+               }       
+               if (patch->IsLevel0()){
+//                     cout << "fired L0" << endl;
+                       nL0++;
+               }       
+//             cout << patch->GetPatchE()      << "\t" << patch->GetADCAmp()   << "\t" << patch->IsGammaHigh() << "\t" << patch->IsGammaLow()  
+//                  << "\t" << patch->IsJetHigh()      << "\t" << patch->IsJetLow()    << "\t" << patch->IsLevel0() 
+//                      << "\t" << patch->GetPhiMin()  << "\t" << patch->GetPhiMax()   << "\t" << abs(patch->GetPhiMin()-patch->GetPhiMax())
+//                      << "\t" << patch->GetEtaMin()  << "\t" << patch->GetEtaMax()   << "\t" << abs(patch->GetEtaMin()-patch->GetEtaMax()) << endl;
        }
 
-//       AliDebug(2, "Patch summary: ");
-//       AliDebug(2, Form("Number of patches: %d", nPatch));
-//       AliDebug(2, Form("Level0: [%d]" ,nL0));
-//       AliDebug(2, Form("Jet:    low[%d], high[%d]" ,nJ2, nJ1));
-//       AliDebug(2, Form("Gamma:  low[%d], high[%d]" ,nG2, nG1));
-
+       if (nPatch > 0){
+               AliDebug(2, "Patch summary: ");
+               AliDebug(2, Form("Number of patches: %d", nPatch));
+               AliDebug(2, Form("Level0: [%d]" ,nL0));
+               AliDebug(2, Form("Jet:    low[%d], high[%d]" ,nJ2, nJ1));
+               AliDebug(2, Form("Gamma:  low[%d], high[%d]" ,nG2, nG1));
+       }
+               
 //     if (nPatch > 0){
 //             cout <<           Form("Number of patches: %d", nPatch) << endl;
 //             cout <<           Form("Level0: [%d]" ,nL0) << endl;
@@ -2226,15 +2254,15 @@ ULong_t AliConvEventCuts::GetTriggerList(){
          
        ULong_t triggers(0);
        if (nG1>0)
-       SETBIT(triggers, kG1);
+               SETBIT(triggers, kG1);
        if (nG2>0)
-       SETBIT(triggers, kG2);
+               SETBIT(triggers, kG2);
        if (nJ1>0)
-       SETBIT(triggers, kJ1);
+               SETBIT(triggers, kJ1);
        if (nJ2>0)
-       SETBIT(triggers, kJ2);
+               SETBIT(triggers, kJ2);
        if (nL0>0)
-       SETBIT(triggers, kL0);
+               SETBIT(triggers, kL0);
        return triggers;
 }
 
index d5996ef..51bd459 100644 (file)
@@ -102,6 +102,9 @@ AliConversionMesonCuts::AliConversionMesonCuts(const char *name,const char *titl
    fDCAGammaGammaCut(1000),
    fDCAZMesonPrimVtxCut(1000),
    fDCARMesonPrimVtxCut(1000),
+   fDCAGammaGammaCutOn(kFALSE),
+   fDCAZMesonPrimVtxCutOn(kFALSE),
+   fDCARMesonPrimVtxCutOn(kFALSE),
    fBackgroundHandler(0),
    fCutString(NULL),
    hMesonCuts(NULL),
@@ -160,6 +163,9 @@ AliConversionMesonCuts::AliConversionMesonCuts(const AliConversionMesonCuts &ref
    fDCAGammaGammaCut(ref.fDCAGammaGammaCut),
    fDCAZMesonPrimVtxCut(ref.fDCAZMesonPrimVtxCut),
    fDCARMesonPrimVtxCut(ref.fDCARMesonPrimVtxCut),
+   fDCAGammaGammaCutOn(ref.fDCAGammaGammaCutOn),
+   fDCAZMesonPrimVtxCutOn(ref.fDCAZMesonPrimVtxCutOn),
+   fDCARMesonPrimVtxCutOn(ref.fDCARMesonPrimVtxCutOn),
    fBackgroundHandler(ref.fBackgroundHandler),
    fCutString(NULL),
    hMesonCuts(NULL),
@@ -584,102 +590,108 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliSta
 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
 {
 
-   // Selection of reconstructed Meson candidates
-   // Use flag IsSignal in order to fill Fill different
-   // histograms for Signal and Background
-   TH1 *hist=0x0;
+       // Selection of reconstructed Meson candidates
+       // Use flag IsSignal in order to fill Fill different
+       // histograms for Signal and Background
+       TH1 *hist=0x0;
 
-   if(IsSignal){hist=hMesonCuts;}
-   else{hist=hMesonBGCuts;}
+       if(IsSignal){hist=hMesonCuts;}
+       else{hist=hMesonBGCuts;}
 
-   Int_t cutIndex=0;
+       Int_t cutIndex=0;
 
-   if(hist)hist->Fill(cutIndex);
-   cutIndex++;
+       if(hist)hist->Fill(cutIndex);
+       cutIndex++;
 
-   // Undefined Rapidity -> Floating Point exception
-   if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
-      if(hist)hist->Fill(cutIndex);
-      cutIndex++;
-//       cout << "undefined rapidity" << endl;
-      return kFALSE;
-   }
-   else{
-      // PseudoRapidity Cut --> But we cut on Rapidity !!!
-      cutIndex++;
-      if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
-         if(hist)hist->Fill(cutIndex);
-//              cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
-         return kFALSE;
-      }
-   }
-   cutIndex++;
-
-   // Opening Angle Cut
-   //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
-   if( pi0->GetOpeningAngle() < fOpeningAngle){
-//       cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
+       // Undefined Rapidity -> Floating Point exception
+       if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
+               if(hist)hist->Fill(cutIndex);
+               cutIndex++;
+               if (!IsSignal)cout << "undefined rapidity" << endl;
+               return kFALSE;
+       }
+       else{
+               // PseudoRapidity Cut --> But we cut on Rapidity !!!
+               cutIndex++;
+               if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
+                       if(hist)hist->Fill(cutIndex);
+                       if (!IsSignal)   cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
+                       return kFALSE;
+               }
+       }
+       cutIndex++;
+
+       // Opening Angle Cut
+       //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
+       if( pi0->GetOpeningAngle() < fOpeningAngle){
+               if (!IsSignal) cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl; 
+               if(hist)hist->Fill(cutIndex);
+               return kFALSE;
+       }
+       cutIndex++;
 
-   if ( fAlphaPtDepCut == kTRUE ) {
-       fAlphaCutMeson = fFAlphaCut->Eval( pi0->Pt() );
-   }
-   
-   
-   // Alpha Max Cut
-   if(pi0->GetAlpha()>fAlphaCutMeson){
-//        cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
+       if ( fAlphaPtDepCut == kTRUE ) {
+       
+               fAlphaCutMeson = fFAlphaCut->Eval( pi0->Pt() );
+       }
+       
+       
+       // Alpha Max Cut
+       if(pi0->GetAlpha()>fAlphaCutMeson){
+               if (!IsSignal) cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl; 
+               if(hist)hist->Fill(cutIndex);
+               return kFALSE;
+       }
+       cutIndex++;
 
-   // Alpha Min Cut
-   if(pi0->GetAlpha()<fAlphaMinCutMeson){
-//       cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
+       // Alpha Min Cut
+       if(pi0->GetAlpha()<fAlphaMinCutMeson){
+               if (!IsSignal)cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl; 
+               if(hist)hist->Fill(cutIndex);
+               return kFALSE;
+       }
+       cutIndex++;
 
-   if (hDCAGammaGammaMesonBefore)hDCAGammaGammaMesonBefore->Fill(pi0->GetDCABetweenPhotons());
-   if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
+       if (hDCAGammaGammaMesonBefore)hDCAGammaGammaMesonBefore->Fill(pi0->GetDCABetweenPhotons());
+       if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
 
-   if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
-//       cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
-
-   if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
-//        cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
+       if (fDCAGammaGammaCutOn){
+               if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
+                       if (!IsSignal)cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl; 
+                       if(hist)hist->Fill(cutIndex);
+                       return kFALSE;
+               }
+       }       
+       cutIndex++;
+
+       if (fDCARMesonPrimVtxCutOn){
+               if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
+                       if (!IsSignal) cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl; 
+                       if(hist)hist->Fill(cutIndex);
+                       return kFALSE;
+               }
+       }       
+       cutIndex++;
 
 
-   if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
+       if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
 
-   if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
-//       cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl; 
-      if(hist)hist->Fill(cutIndex);
-      return kFALSE;
-   }
-   cutIndex++;
+       if (fDCAZMesonPrimVtxCutOn){
+               if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
+                       if (!IsSignal) cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl; 
+                       if(hist)hist->Fill(cutIndex);
+                       return kFALSE;
+               }
+       }
+       cutIndex++;
 
 
-   if (hDCAGammaGammaMesonAfter)hDCAGammaGammaMesonAfter->Fill(pi0->GetDCABetweenPhotons());
-   if (hDCARMesonPrimVtxAfter)hDCARMesonPrimVtxAfter->Fill(pi0->GetDCARMotherPrimVtx());
-   if (hDCAZMesonPrimVtxAfter)hDCAZMesonPrimVtxAfter->Fill(pi0->M(),pi0->GetDCAZMotherPrimVtx());
+       if (hDCAGammaGammaMesonAfter)hDCAGammaGammaMesonAfter->Fill(pi0->GetDCABetweenPhotons());
+       if (hDCARMesonPrimVtxAfter)hDCARMesonPrimVtxAfter->Fill(pi0->GetDCARMotherPrimVtx());
+       if (hDCAZMesonPrimVtxAfter)hDCAZMesonPrimVtxAfter->Fill(pi0->M(),pi0->GetDCAZMotherPrimVtx());
 
-   if(hist)hist->Fill(cutIndex);
-   return kTRUE;
+       if(hist)hist->Fill(cutIndex);
+       return kTRUE;
 }
 
 
@@ -852,9 +864,9 @@ void AliConversionMesonCuts::PrintCutsWithValues() {
        printf("\t |y| < %3.2f \n", fRapidityCutMeson);
        printf("\t theta_{open} < %3.2f\n", fOpeningAngle);
        if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
-       printf("\t dca_{gamma,gamma} > %3.2f\n", fDCAGammaGammaCut);
-       printf("\t dca_{R, prim Vtx} > %3.2f\n", fDCARMesonPrimVtxCut); 
-       printf("\t dca_{Z, prim Vtx} > %3.2f\n\n", fDCAZMesonPrimVtxCut); 
+       if (fDCAGammaGammaCutOn)printf("\t dca_{gamma,gamma} > %3.2f\n", fDCAGammaGammaCut);
+       if (fDCARMesonPrimVtxCutOn)printf("\t dca_{R, prim Vtx} > %3.2f\n", fDCARMesonPrimVtxCut); 
+       if (fDCAZMesonPrimVtxCutOn)printf("\t dca_{Z, prim Vtx} > %3.2f\n\n", fDCAZMesonPrimVtxCut); 
        printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh); 
        
         printf("Meson BG settings \n");
@@ -1313,125 +1325,155 @@ Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
 
 ///________________________________________________________________________
 Bool_t AliConversionMesonCuts::SetDCAGammaGammaCut(Int_t DCAGammaGamma){
-   // Set Cut
-   switch(DCAGammaGamma){
-   case 0:  //
-      fDCAGammaGammaCut   = 1000;
-      break;
-   case 1:  //
-      fDCAGammaGammaCut   = 10;
-      break;
-   case 2:  //
-      fDCAGammaGammaCut   = 5;
-      break;
-   case 3:  //
-      fDCAGammaGammaCut   = 4;
-      break;
-   case 4:  //
-      fDCAGammaGammaCut   = 3;
-      break;
-   case 5:  //
-      fDCAGammaGammaCut   = 2.5;
-      break;
-   case 6:  //
-      fDCAGammaGammaCut   = 2;
-      break;
-   case 7:  //
-      fDCAGammaGammaCut   = 1.5;
-      break;
-   case 8:  //
-      fDCAGammaGammaCut   = 1;
-      break;
-   case 9:  //
-      fDCAGammaGammaCut   = 0.5;
-      break;
-   default:
-      cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
-      return kFALSE;
-   }
-   return kTRUE;
+       // Set Cut
+       switch(DCAGammaGamma){
+       case 0:  //
+               fDCAGammaGammaCutOn = kFALSE;
+               fDCAGammaGammaCut   = 1000;
+               break;
+       case 1:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 10;
+               break;
+       case 2:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 5;
+               break;
+       case 3:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 4;
+               break;
+       case 4:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 3;
+               break;
+       case 5:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 2.5;
+               break;
+       case 6:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 2;
+               break;
+       case 7:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 1.5;
+               break;
+       case 8:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 1;
+               break;
+       case 9:  //
+               fDCAGammaGammaCutOn = kTRUE;
+               fDCAGammaGammaCut   = 0.5;
+               break;
+       default:
+               cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
+               return kFALSE;
+       }
+       return kTRUE;
 }
 
 ///________________________________________________________________________
 Bool_t AliConversionMesonCuts::SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx){
-   // Set Cut
-   switch(DCAZMesonPrimVtx){
-   case 0:  //
-      fDCAZMesonPrimVtxCut   = 1000;
-      break;
-   case 1:  //
-      fDCAZMesonPrimVtxCut   = 10;
-      break;
-   case 2:  //
-      fDCAZMesonPrimVtxCut   = 5;
-      break;
-   case 3:  //
-      fDCAZMesonPrimVtxCut   = 4;
-      break;
-   case 4:  //
-      fDCAZMesonPrimVtxCut   = 3;
-      break;
-   case 5:  //
-      fDCAZMesonPrimVtxCut   = 2.5;
-      break;
-   case 6:  //
-      fDCAZMesonPrimVtxCut   = 2;
-      break;
-   case 7:  //
-      fDCAZMesonPrimVtxCut   = 1.5;
-      break;
-   case 8:  //
-      fDCAZMesonPrimVtxCut   = 1;
-      break;
-   case 9:  //
-      fDCAZMesonPrimVtxCut   = 0.5;
-      break;
-   default:
-      cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
-      return kFALSE;
-   }
-   return kTRUE;
+       // Set Cut
+       switch(DCAZMesonPrimVtx){
+       case 0:  //
+               fDCAZMesonPrimVtxCutOn = kFALSE;
+               fDCAZMesonPrimVtxCut   = 1000;
+               break;
+       case 1:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 10;
+               break;
+       case 2:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 5;
+               break;
+       case 3:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 4;
+               break;
+       case 4:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 3;
+               break;
+       case 5:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 2.5;
+               break;
+       case 6:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 2;
+               break;
+       case 7:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 1.5;
+               break;
+       case 8:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 1;
+               break;
+       case 9:  //
+               fDCAZMesonPrimVtxCutOn = kTRUE;
+               fDCAZMesonPrimVtxCut   = 0.5;
+               break;
+       default:
+               cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
+               return kFALSE;
+       }
+       return kTRUE;
 }
 
 ///________________________________________________________________________
 Bool_t AliConversionMesonCuts::SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx){
-   // Set Cut
-   switch(DCARMesonPrimVtx){
-   case 0:  //
-      fDCARMesonPrimVtxCut   = 1000;
-      break;
-   case 1:  //
-      fDCARMesonPrimVtxCut   = 10;
-      break;
-   case 2:  //
-      fDCARMesonPrimVtxCut   = 5;
-      break;
-   case 3:  //
-      fDCARMesonPrimVtxCut   = 4;
-      break;
-   case 4:  //
-      fDCARMesonPrimVtxCut   = 3;
-      break;
-   case 5:  //
-      fDCARMesonPrimVtxCut   = 2.5;
-      break;
-   case 6:  //
-      fDCARMesonPrimVtxCut   = 2;
-      break;
-   case 7:  //
-      fDCARMesonPrimVtxCut   = 1.5;
-      break;
-   case 8:  //
-      fDCARMesonPrimVtxCut   = 1;
-      break;
-   case 9:  //
-      fDCARMesonPrimVtxCut   = 0.5;
-      break;
-   default:
-      cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
-      return kFALSE;
-   }
-   return kTRUE;
+       // Set Cut
+       switch(DCARMesonPrimVtx){
+       case 0:  //
+               fDCARMesonPrimVtxCutOn = kFALSE;
+               fDCARMesonPrimVtxCut   = 1000;
+               break;
+       case 1:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 10;
+               break;
+       case 2:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 5;
+               break;
+       case 3:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 4;
+               break;
+       case 4:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 3;
+               break;
+       case 5:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 2.5;
+               break;
+       case 6:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 2;
+               break;
+       case 7:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 1.5;
+               break;
+       case 8:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 1;
+               break;
+       case 9:  //
+               fDCARMesonPrimVtxCutOn = kTRUE;
+               fDCARMesonPrimVtxCut   = 0.5;
+               break;
+       default:
+               cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
+               return kFALSE;
+       }
+       return kTRUE;
 }
 
 
index 3a47fde..c04b1be 100644 (file)
@@ -158,6 +158,10 @@ class AliConversionMesonCuts : public AliAnalysisCuts {
                Double_t        fDCAGammaGammaCut;                      // cut value for the maximum distance between the two photons [cm]
                Double_t        fDCAZMesonPrimVtxCut;           // cut value for the maximum distance in Z between the production point of the Meson & the primary vertex [cm]
                Double_t        fDCARMesonPrimVtxCut;           // cut value for the maximum distance in R between the production point of the Meson & the primary vertex [cm]
+               Bool_t          fDCAGammaGammaCutOn;            // cut flag for the maximum distance between the two photons
+               Bool_t          fDCAZMesonPrimVtxCutOn;         // cut flag for the maximum distance in Z between the production point of the Meson & the primary vertex 
+               Bool_t          fDCARMesonPrimVtxCutOn;         // cut flag for the maximum distance in R between the production point of the Meson & the primary vertex 
+
                Int_t           fBackgroundHandler;             //
                
                // Histograms
@@ -174,7 +178,7 @@ class AliConversionMesonCuts : public AliAnalysisCuts {
        private:
 
 
-               ClassDef(AliConversionMesonCuts,6)
+               ClassDef(AliConversionMesonCuts,7)
 };
 
 
index 5a6599d..56eece8 100644 (file)
@@ -71,7 +71,8 @@ AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t binsZ,UInt
 
 
 //_____________________________________________________________________________________________________________________________
-AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult) :
+AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t collisionSystem, UInt_t centMin, UInt_t centMax, 
+                                                                                                                          UInt_t nEvents, Bool_t useTrackMult, UInt_t mode, UInt_t binsZ, UInt_t binsMultiplicity) :
        TObject(),
        fNEvents(nEvents),
        fBGEventCounter(NULL),
@@ -79,250 +80,209 @@ AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t collisionS
        fBGEventMesonCounter(NULL),
        fBGProbability(NULL),
        fBGEventVertex(NULL),
-       fNBinsZ(8),
-       fNBinsMultiplicity(5),
+       fNBinsZ(binsZ),
+       fNBinsMultiplicity(binsMultiplicity),
        fBinLimitsArrayZ(NULL),
        fBinLimitsArrayMultiplicity(NULL),
-       fBGEvents(fNBinsZ,AliGammaConversionMultipicityVector(fNBinsMultiplicity,AliGammaConversionBGEventVector(nEvents))),
-       fBGEventsENeg(fNBinsZ,AliGammaConversionMultipicityVector(fNBinsMultiplicity,AliGammaConversionBGEventVector(nEvents))),
-       fBGEventsMeson(fNBinsZ,AliGammaConversionMotherMultipicityVector(fNBinsMultiplicity,AliGammaConversionMotherBGEventVector(nEvents)))
+       fBGEvents(binsZ,AliGammaConversionMultipicityVector(binsMultiplicity,AliGammaConversionBGEventVector(nEvents))),
+       fBGEventsENeg(binsZ,AliGammaConversionMultipicityVector(binsMultiplicity,AliGammaConversionBGEventVector(nEvents))),
+       fBGEventsMeson(binsZ,AliGammaConversionMotherMultipicityVector(binsMultiplicity,AliGammaConversionMotherBGEventVector(nEvents)))
 {
        // constructor
+       if (fNBinsZ>8)fNBinsZ = 8;
        
-       fBinLimitsArrayZ= new Double_t[8] ;
+       if (mode == 0 || mode == 1){
+               if (fNBinsMultiplicity>5)fNBinsMultiplicity = 5;        
+       } else if (mode == 2 || mode == 3 || mode == 4 || mode == 5){
+               if (useTrackMult){
+                       if (fNBinsMultiplicity>5)fNBinsMultiplicity = 5;
+               } else {
+                       if (fNBinsMultiplicity>7)fNBinsMultiplicity = 7;
+               }       
+       } else {
+               if (fNBinsMultiplicity>5)fNBinsMultiplicity = 5;
+       }       
+       // Initializing z vertex bins
+       fBinLimitsArrayZ= new Double_t[fNBinsZ] ;
        if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
-               fBinLimitsArrayZ[0] = -50.00;
-               fBinLimitsArrayZ[1] = -5.5;
-               fBinLimitsArrayZ[2] = -2.9;
-               fBinLimitsArrayZ[3] = -0.65;
-               fBinLimitsArrayZ[4] = 1.45;
-               fBinLimitsArrayZ[5] = 3.65;
-               fBinLimitsArrayZ[6] = 6.15;
-               fBinLimitsArrayZ[7] = 50;
-       }
-       else if(collisionSystem == 0){
-               fBinLimitsArrayZ[0] = -50.00;
-               fBinLimitsArrayZ[1] = -3.375;
-               fBinLimitsArrayZ[2] = -1.605;
-               fBinLimitsArrayZ[3] = -0.225;
-               fBinLimitsArrayZ[4] = 1.065;
-               fBinLimitsArrayZ[5] = 2.445;
-               fBinLimitsArrayZ[6] = 4.245;
-               fBinLimitsArrayZ[7] = 50.00;
-       }
-       else{ 
-               fBinLimitsArrayZ[0] = -50.00;
-               fBinLimitsArrayZ[1] = -5.85;
-               fBinLimitsArrayZ[2] = -3.35;
-               fBinLimitsArrayZ[3] = -1.15;
-               fBinLimitsArrayZ[4] = 0.85;
-               fBinLimitsArrayZ[5] = 2.95;
-               fBinLimitsArrayZ[6] = 5.55;
-               fBinLimitsArrayZ[7] = 50.00;
-       }
-
-
-
-       fBinLimitsArrayMultiplicity= new Double_t[5];
-       if(useTrackMult){ // pp
-               fBinLimitsArrayMultiplicity[0] = 0;
-               fBinLimitsArrayMultiplicity[1] = 8.5;
-               fBinLimitsArrayMultiplicity[2] = 16.5;
-               fBinLimitsArrayMultiplicity[3] = 27.5;
-               fBinLimitsArrayMultiplicity[4] = 200.;
-               if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
-                       if(centMin == 0 && centMax == 5){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 1540.;
-                               fBinLimitsArrayMultiplicity[2] = 1665.;
-                               fBinLimitsArrayMultiplicity[3] = 1780.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 0 && centMax == 10){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 1360.;
-                               fBinLimitsArrayMultiplicity[2] = 1520.;
-                               fBinLimitsArrayMultiplicity[3] = 1685.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 0 && centMax == 20){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 1110.;
-                               fBinLimitsArrayMultiplicity[2] = 1360.;
-                               fBinLimitsArrayMultiplicity[3] = 1600.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 0 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 890.;
-                               fBinLimitsArrayMultiplicity[2] = 1240.;
-                               fBinLimitsArrayMultiplicity[3] = 1540.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
+               Double_t fBinLimitsArrayZPbPb[8] =      {-50,   -5.5,   -2.9,   -0.65,
+                                                                                        1.45,  3.65,   6.15,   50};
+               for (Int_t i = 0; i < fNBinsZ; i++){
+                       fBinLimitsArrayZ[i] =  fBinLimitsArrayZPbPb[i];
+               }       
+       } else if(collisionSystem == 0){                                // pp
+               Double_t fBinLimitsArrayZpp[8] =        {-50,   -3.375, -1.605, -0.225, 
+                                                                                        1.065, 2.445,  4.245,  50};
+               for (Int_t i = 0; i < fNBinsZ; i++){
+                       fBinLimitsArrayZ[i] =  fBinLimitsArrayZpp[i];
+               }       
+       } else {                                                                                // pPb
+               Double_t fBinLimitsArrayZpPb[8] =       {-50,   -5.85,  -3.35,  -1.15, 
+                                                                                        0.85,  2.95,   5.55,   50};
+               for (Int_t i = 0; i < fNBinsZ; i++){
+                       fBinLimitsArrayZ[i] =  fBinLimitsArrayZpPb[i];
+               }       
+       }
+
+       // Initializing multiplicity bins 
+       fBinLimitsArrayMultiplicity= new Double_t[fNBinsMultiplicity];
+       if(useTrackMult){ // multiplicity binning based on number of good global tracks
+               // default pp values
+               Double_t fBinLimitsArrayMultiplicitypp[5] =     {0.,    8.5,    16.5,   27.5,   200.};
+               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypp[i];
+               }       
+               if(collisionSystem > 0 && collisionSystem < 8){ // PbPb values
+                       if(centMin == 0 && centMax == 5){ // 0-5% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb0005[5] =       {0., 1540., 1665., 1780., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0005[i];
+                               }       
+                       } else if(centMin == 0 && centMax == 10){ // 0-10% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb0010[5] =       {0., 1360., 1520., 1685., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0010[i];
+                               }       
+                       } else if(centMin == 0 && centMax == 20){ // 0-20% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb0020[5] =       {0., 1110., 1360., 1600., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0020[i];
+                               }       
+                       } else if(centMin == 0 && centMax == 80){ // 0-80% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb0080[5] =       {0., 890., 1240., 1540., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0080[i];
+                               }       
+                       } else if(centMin == 5 && centMax == 10){ // 5-10% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb0510[5] =       {0., 1250., 1345., 1445., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0510[i];
+                               }       
+                       } else if(centMin == 10 && centMax == 20){ // 10-20% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb1020[5] =       {0., 915., 1020., 1130., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb1020[i];
+                               }       
+                       } else if(centMin == 20 && centMax == 40){ // 20-40% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb2040[5] =       {0., 510., 625., 730., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb2040[i];
+                               }       
+                       } else if(centMin == 40 && centMax == 80){ // 40-80% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb4080[5] =       {0., 185., 250., 300., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb4080[i];
+                               }       
+                       } else if(centMin == 60 && centMax == 80){ // 60-80% central
+                               Double_t fBinLimitsArrayMultiplicityPbPb6080[5] =       {0., 55., 80., 100., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb6080[i];
+                               }       
+                       } else { // all other centrality classes 
+                               Double_t fBinLimitsArrayMultiplicityPbPb[5] =   {0., 510., 625., 730., 5000};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb[i];
+                               }       
                        }
-                       else if(centMin == 5 && centMax == 10){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 1250.;
-                               fBinLimitsArrayMultiplicity[2] = 1345.;
-                               fBinLimitsArrayMultiplicity[3] = 1445.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 10 && centMax == 20){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 915.;
-                               fBinLimitsArrayMultiplicity[2] = 1020.;
-                               fBinLimitsArrayMultiplicity[3] = 1130.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 20 && centMax == 40){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 510.;
-                               fBinLimitsArrayMultiplicity[2] = 625.;
-                               fBinLimitsArrayMultiplicity[3] = 730.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 40 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 185.;
-                               fBinLimitsArrayMultiplicity[2] = 250.;
-                               fBinLimitsArrayMultiplicity[3] = 300.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else if(centMin == 60 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 55.;
-                               fBinLimitsArrayMultiplicity[2] = 80.;
-                               fBinLimitsArrayMultiplicity[3] = 100.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-                       else{ // Std 20-40
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 510.;
-                               fBinLimitsArrayMultiplicity[2] = 625.;
-                               fBinLimitsArrayMultiplicity[3] = 730.;
-                               fBinLimitsArrayMultiplicity[4] = 5000.;
-                       }
-               }
-
-               else if(collisionSystem == 8 || collisionSystem == 9){ //pPb
-
-                       fBinLimitsArrayMultiplicity[0] = 0.;
-                       fBinLimitsArrayMultiplicity[1] = 7.5;
-                       fBinLimitsArrayMultiplicity[2] = 16.5;
-                       fBinLimitsArrayMultiplicity[3] = 29.5;
-                       fBinLimitsArrayMultiplicity[4] = 500.;  
-                       
-                       if(centMin == 0 && centMax == 20){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 31.5;
-                               fBinLimitsArrayMultiplicity[2] = 40.5;
-                               fBinLimitsArrayMultiplicity[3] = 50.5;
-                               fBinLimitsArrayMultiplicity[4] = 500.;
+               } else if(collisionSystem == 8 || collisionSystem == 9){ // pPb
+                       Double_t fBinLimitsArrayMultiplicitypPb[5] =    {0., 7.5, 16.5, 29.5, 500};
+                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb[i];
+                       }       
+                       if(centMin == 0 && centMax == 20){ // pPb 0-20 %
+                               Double_t fBinLimitsArrayMultiplicitypPb0020[5] =        {0., 31.5, 40.5, 50.5, 500};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb0020[i];
+                               }       
                        } else if(centMin == 20 && centMax == 40){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 19.5;
-                               fBinLimitsArrayMultiplicity[2] = 25.5;
-                               fBinLimitsArrayMultiplicity[3] = 32.5;
-                               fBinLimitsArrayMultiplicity[4] = 500.;
+                               Double_t fBinLimitsArrayMultiplicitypPb2040[5] =        {0., 19.5, 25.5, 32.5, 500};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb2040[i];
+                               }       
                        } else if(centMin == 40 && centMax == 60){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 12.5;
-                               fBinLimitsArrayMultiplicity[2] = 16.5;
-                               fBinLimitsArrayMultiplicity[3] = 22.5;
-                               fBinLimitsArrayMultiplicity[4] = 500.;
+                               Double_t fBinLimitsArrayMultiplicitypPb4060[5] =        {0., 12.5, 16.5, 22.5, 500};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb4060[i];
+                               }       
                        } else if(centMin == 60 && centMax == 80){ 
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 5.5;
-                               fBinLimitsArrayMultiplicity[2] = 9.5;
-                               fBinLimitsArrayMultiplicity[3] = 13.5;
-                               fBinLimitsArrayMultiplicity[4] = 500.;
+                               Double_t fBinLimitsArrayMultiplicitypPb6080[5] =        {0., 5.5, 9.5, 13.5, 500};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb6080[i];
+                               }       
                        } else if(centMin == 60 && centMax == 100){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 2.5;
-                               fBinLimitsArrayMultiplicity[2] = 6.5;
-                               fBinLimitsArrayMultiplicity[3] = 11.5;
-                               fBinLimitsArrayMultiplicity[4] = 500.;
+                               Double_t fBinLimitsArrayMultiplicitypPb60100[5] =       {0., 2.5, 6.5, 11.5, 500};
+                               for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                       fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypPb60100[i];
+                               }       
                        }  
                }
-       }
-       else{// pp or pPb V0 Mult
-               fBinLimitsArrayMultiplicity[0] = 2;
-               fBinLimitsArrayMultiplicity[1] = 3;
-               fBinLimitsArrayMultiplicity[2] = 4;
-               fBinLimitsArrayMultiplicity[3] = 5;
-               fBinLimitsArrayMultiplicity[4] = 9999;
-               if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
-                       if(centMin == 0 && centMax == 5){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 27.;
-                               fBinLimitsArrayMultiplicity[2] = 31.;
-                               fBinLimitsArrayMultiplicity[3] = 36.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 0 && centMax == 10){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 25.;
-                               fBinLimitsArrayMultiplicity[2] = 30.;
-                               fBinLimitsArrayMultiplicity[3] = 36.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 0 && centMax == 20){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 22.;
-                               fBinLimitsArrayMultiplicity[2] = 27.;
-                               fBinLimitsArrayMultiplicity[3] = 33.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 0 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 18.;
-                               fBinLimitsArrayMultiplicity[2] = 25.;
-                               fBinLimitsArrayMultiplicity[3] = 32.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 5 && centMax == 10){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 23.;
-                               fBinLimitsArrayMultiplicity[2] = 27.;
-                               fBinLimitsArrayMultiplicity[3] = 32.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 10 && centMax == 20){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 18.;
-                               fBinLimitsArrayMultiplicity[2] = 22.;
-                               fBinLimitsArrayMultiplicity[3] = 27.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 20 && centMax == 40){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 11.;
-                               fBinLimitsArrayMultiplicity[2] = 14.;
-                               fBinLimitsArrayMultiplicity[3] = 18.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 40 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 5.;
-                               fBinLimitsArrayMultiplicity[2] = 7.;
-                               fBinLimitsArrayMultiplicity[3] = 11.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else if(centMin == 60 && centMax == 80){
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 2.;
-                               fBinLimitsArrayMultiplicity[2] = 3.;
-                               fBinLimitsArrayMultiplicity[3] = 5.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
-                       }
-                       else{ // Std 20-40
-                               fBinLimitsArrayMultiplicity[0] = 0.;
-                               fBinLimitsArrayMultiplicity[1] = 11.;
-                               fBinLimitsArrayMultiplicity[2] = 14.;
-                               fBinLimitsArrayMultiplicity[3] = 18.;
-                               fBinLimitsArrayMultiplicity[4] = 100.;
+       } else{ // Initializing Multiplicity binning with photon Mult 
+               if (mode == 0 || mode == 1) { // settings for Conv-Conv && Conv-Dalitz
+                       // pp & pPb defaults
+                       Double_t fBinLimitsArrayMultiplicitypp[5] =     {2., 3., 4., 5., 9999.};
+                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypp[i];
+                       }       
+                       if(collisionSystem > 0 && collisionSystem < 8){ // settings PbPb
+                               if(centMin == 0 && centMax == 5){                       // 0-5% 
+                                       Double_t fBinLimitsArrayMultiplicityPbPb0005[5] =       {0., 27., 31., 36., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0005[i];
+                                       }       
+                               } else if(centMin == 0 && centMax == 10){       // 0-10%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb0010[5] =       {0., 25., 30., 36., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0010[i];
+                                       }       
+                               } else if(centMin == 0 && centMax == 20){       // 0-20%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb0020[5] =       {0., 22., 27., 33., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0020[i];
+                                       }       
+                               } else if(centMin == 0 && centMax == 80){       // 0-80%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb0080[5] =       {0., 18., 25., 32., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0080[i];
+                                       }       
+                               } else if(centMin == 5 && centMax == 10){       // 5-10%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb0510[5] =       {0., 23., 27., 32., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb0510[i];
+                                       }       
+                               } else if(centMin == 10 && centMax == 20){      //10-20%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb1020[5] =       {0., 18., 22., 27., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb1020[i];
+                                       }       
+                               } else if(centMin == 20 && centMax == 40){      // 20-40%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb2040[5] =       {0., 11., 14., 18., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb2040[i];
+                                       }       
+                               } else if(centMin == 40 && centMax == 80){ // 40-80%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb4080[5] =       {0., 5., 7., 11., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb4080[i];
+                                       }       
+                               } else if(centMin == 60 && centMax == 80){ // 60-80%
+                                       Double_t fBinLimitsArrayMultiplicityPbPb6080[5] =       {0., 2., 3., 5., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb6080[i];
+                                       }       
+                               } else{ // default PbPb
+                                       Double_t fBinLimitsArrayMultiplicityPbPb[5] =   {0., 11., 14., 18., 100.};
+                                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicityPbPb[i];
+                                       }       
+                               }
                        }
-               }
-       }
+               } else if (mode == 2 || mode == 3 || mode == 4 || mode == 5){ // setting for EMCAL-Conv, PHOS-Conv, EMCAL-EMCAL, PHOS-PHOS
+                       Double_t fBinLimitsArrayMultiplicitypp[7] =     {0., 2., 3., 4., 8., 15., 9999.};
+                       for (Int_t i = 0; i < fNBinsMultiplicity; i++){
+                               fBinLimitsArrayMultiplicity[i] =  fBinLimitsArrayMultiplicitypp[i];
+                       }       
+               }       
+       } 
        
        Initialize(fBinLimitsArrayZ,fBinLimitsArrayMultiplicity);
 }
index a655abe..880949d 100644 (file)
@@ -50,7 +50,7 @@ class AliGammaConversionAODBGHandler : public TObject {
        
        AliGammaConversionAODBGHandler();                                                                                                                                                                                       //constructor
        AliGammaConversionAODBGHandler(UInt_t binsZ,UInt_t binsMultiplicity,UInt_t nEvents);                                                                            // constructor
-       AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult);
+       AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult, UInt_t mode,UInt_t binsZ, UInt_t binsMultiplicity);
        AliGammaConversionAODBGHandler(const AliGammaConversionAODBGHandler & g);                                                                                                       //copy constructor
        AliGammaConversionAODBGHandler & operator = (const AliGammaConversionAODBGHandler & g);                                                                         //assignment operator
        virtual ~AliGammaConversionAODBGHandler();                                                                                                                                                                      //virtual destructor
@@ -96,6 +96,6 @@ class AliGammaConversionAODBGHandler : public TObject {
                AliGammaConversionBGVector                      fBGEventsENeg;                                  // electron background electron events
                AliGammaConversionMotherBGVector        fBGEventsMeson;                                 // neutral meson background events
                
-       ClassDef(AliGammaConversionAODBGHandler,4)
+       ClassDef(AliGammaConversionAODBGHandler,5)
 };
 #endif
index f12d2a9..4ad433a 100644 (file)
@@ -106,6 +106,8 @@ void AddTask_GammaCalo_pp(  Int_t trainConfig = 1,  //change different set of cu
        task->SetIsMC(isMC);
        // Cut Numbers to use in Analysis
        Int_t numberOfCuts = 4;
+       if (trainConfig == 9) numberOfCuts = 6;
+       if (trainConfig == 10) numberOfCuts = 1;
        
        TString *eventCutArray = new TString[numberOfCuts];
        TString *clusterCutArray = new TString[numberOfCuts];
@@ -154,6 +156,15 @@ void AddTask_GammaCalo_pp(  Int_t trainConfig = 1,  //change different set of cu
                eventCutArray[ 1] = "0000011"; clusterCutArray[1] = "10000040062031000"; mesonCutArray[1] = "01631031009000"; // 400 MeV cluster min energy, min M20 > 0.02
                eventCutArray[ 2] = "0005211"; clusterCutArray[2] = "10000040062030000"; mesonCutArray[2] = "01631031009000"; // 400 MeV cluster min energy
                eventCutArray[ 3] = "0005211"; clusterCutArray[3] = "10000040062031000"; mesonCutArray[3] = "01631031009000"; // 400 MeV cluster min energy, min M20 > 0.02
+       } else if (trainConfig == 9){ // Trigger test
+               eventCutArray[ 0] = "0000011"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[0] = "01631031009000"; 
+               eventCutArray[ 1] = "0005011"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[1] = "01631031009000"; 
+               eventCutArray[ 2] = "0008311"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[2] = "01631031009000"; 
+               eventCutArray[ 3] = "0009311"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[3] = "01631031009000"; 
+               eventCutArray[ 4] = "0008511"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[4] = "01631031009000"; 
+               eventCutArray[ 5] = "0009511"; clusterCutArray[5] = "10000040022030000"; mesonCutArray[5] = "01631031009000"; 
+       } else if (trainConfig == 10){ // Validation
+               eventCutArray[ 0] = "0000011"; clusterCutArray[0] = "10000040062000000"; mesonCutArray[0] = "01630031009000"; 
        } else if (trainConfig == 31) { //PHOS clusters
                eventCutArray[ 0] = "0002011"; clusterCutArray[0] = "20000030022000000"; mesonCutArray[0] = "01631031009000"; //pp LHC11a with SDD, PHOS
                eventCutArray[ 1] = "0000011"; clusterCutArray[1] = "20000030022000000"; mesonCutArray[1] = "01631031009000"; //pp LHC13g default MB