sync with GSI svn for gammaConv + changes by Hongheng in PHOS directory
authorfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 May 2013 13:16:55 +0000 (13:16 +0000)
committerfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 May 2013 13:16:55 +0000 (13:16 +0000)
15 files changed:
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvDalitzV1.h
PWGGA/GammaConv/AliConversionMesonCuts.cxx
PWGGA/GammaConv/AliConversionMesonCuts.h
PWGGA/GammaConv/AliDalitzElectronCuts.cxx
PWGGA/GammaConv/macros/AddTask_GammaConvV1.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_2.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_3.C
PWGGA/PHOSTasks/UserTasks/AliAnalysisTaskSEPHOSpPbPi0.cxx
PWGGA/PHOSTasks/UserTasks/AliAnalysisTaskSEPHOSpPbPi0.h
PWGGA/PHOSTasks/UserTasks/AliCaloClusterInfo.cxx
PWGGA/PHOSTasks/UserTasks/AliCaloClusterInfo.h
PWGGA/PHOSTasks/UserTasks/AliPHOSpPbPi0Header.cxx
PWGGA/PHOSTasks/UserTasks/AliPHOSpPbPi0Header.h
PWGGA/PHOSTasks/UserTasks/macros/AddTaskPHOSpPbPi0.C

index b0d5da4..f18e7f4 100644 (file)
@@ -2,8 +2,8 @@
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: Pedro González, Pedro Ladrón de Guevara, Ernesto López Torres, *
- *         Eulogio Serradilla                                             *
- * Version 2                                                           *
+ *         Eulogio Serradilla, Ana Marin, Friederike Bock                 *
+ * Version 2                                                              *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
@@ -15,6 +15,7 @@
  **************************************************************************/
 
 // Analysis task for pi0->e+e-gamma (Dalitz decay)
+// Analysis task for chic->JPsi+gamma
 
 #include <vector>
 
@@ -106,9 +107,13 @@ fV0Reader(NULL),
    hMCEtaGGPt(NULL), 
    hMCPi0InAccPt(NULL),
    hMCEtaInAccPt(NULL),
+   hMCChiCPt(NULL),
+   hMCChiCInAccPt(NULL),
    hESDEposEnegTruePi0DalitzInvMassPt(NULL),
    hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
    hESDEposEnegTruePhotonInvMassPt(NULL),
+   hESDEposEnegTrueJPsiInvMassPt(NULL),
+   hESDTrueMotherChiCInvMassPt(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTrueMotherPi0GGInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassMCPt(NULL),
@@ -192,9 +197,13 @@ AliAnalysisTaskGammaConvDalitzV1::AliAnalysisTaskGammaConvDalitzV1( const char*
    hMCEtaGGPt(NULL),
    hMCPi0InAccPt(NULL),
    hMCEtaInAccPt(NULL),
+   hMCChiCPt(NULL),
+   hMCChiCInAccPt(NULL),
    hESDEposEnegTruePi0DalitzInvMassPt(NULL),
    hESDEposEnegTrueEtaDalitzInvMassPt(NULL),
    hESDEposEnegTruePhotonInvMassPt(NULL),
+   hESDEposEnegTrueJPsiInvMassPt(NULL),
+   hESDTrueMotherChiCInvMassPt(NULL),
    hESDTrueMotherInvMassPt(NULL),
    hESDTrueMotherPi0GGInvMassPt(NULL),
    hESDTruePrimaryMotherInvMassMCPt(NULL),
@@ -502,12 +511,15 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
       hMCEtaGGPt = new TH1F*[fnCuts];
       hMCPi0InAccPt = new TH1F*[fnCuts];
       hMCEtaInAccPt = new TH1F*[fnCuts];
-      
+                       hMCChiCPt = new TH1F*[fnCuts];
+                       hMCChiCInAccPt = new TH1F*[fnCuts];
       
       hESDEposEnegTruePi0DalitzInvMassPt           = new TH2F*[fnCuts];
       hESDEposEnegTrueEtaDalitzInvMassPt           = new TH2F*[fnCuts];
       hESDEposEnegTruePhotonInvMassPt              = new TH2F*[fnCuts];
+      hESDEposEnegTrueJPsiInvMassPt                = new TH2F*[fnCuts];
       
+      hESDTrueMotherChiCInvMassPt = new TH2F*[fnCuts];
       hESDTrueMotherInvMassPt = new TH2F*[fnCuts];
       hESDTrueMotherPi0GGInvMassPt = new TH2F*[fnCuts];
       hESDTruePrimaryPi0DalitzESDPtMCPt = new TH2F*[fnCuts];
@@ -530,68 +542,67 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
          fCutFolder[iCut]->Add(fMCList[iCut]);
 
 
-                hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
-
-                hMCAllPositronsPt[iCut] = new TH1F("MC_AllPositrons_Pt","MC_AllPositrons_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCAllPositronsPt[iCut]);
-
-                hMCAllElectronsPt[iCut] = new TH1F("MC_AllElectrons_Pt","MC_AllElectrons_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCAllElectronsPt[iCut]);
-
-                hMCPi0DalitzGammaPt[iCut] = new TH1F("MC_Pi0DalitzGamma_Pt","MC_Pi0DalitzGamma_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0DalitzGammaPt[iCut]);
-
-                hMCPi0DalitzPositronPt[iCut] = new TH1F("MC_Pi0DalitzPositron_Pt","MC_Pi0DalitzPositron_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0DalitzPositronPt[iCut]);
-
-                hMCPi0DalitzElectronPt[iCut] = new TH1F("MC_Pi0DalitzElectron_Pt","MC_Pi0DalitzElectron_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0DalitzElectronPt[iCut]);
-
-
-                hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0Pt[iCut]);
-        
-                hMCPi0GGPt[iCut] = new TH1F("MC_Pi0_GG_Pt","MC_Pi0_GG_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0GGPt[iCut]);
-
-
-                hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCEtaPt[iCut]);
-
-                hMCEtaGGPt[iCut] = new TH1F("MC_Eta_GG_Pt","MC_Eta_GG_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCEtaGGPt[iCut]);
-
-
-                hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0DalitzInAcc_Pt","MC_Pi0DalitzInAcc_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCPi0InAccPt[iCut]);
-                hMCEtaInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",250,0,25);
-                fMCList[iCut]->Add(hMCEtaInAccPt[iCut]);
+                                hMCAllGammaPt[iCut] = new TH1F("MC_AllGamma_Pt","MC_AllGamma_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCAllGammaPt[iCut]);
+                                
+                                hMCAllPositronsPt[iCut] = new TH1F("MC_AllPositrons_Pt","MC_AllPositrons_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCAllPositronsPt[iCut]);
+                                
+                                hMCAllElectronsPt[iCut] = new TH1F("MC_AllElectrons_Pt","MC_AllElectrons_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCAllElectronsPt[iCut]);
+                                
+                                hMCPi0DalitzGammaPt[iCut] = new TH1F("MC_Pi0DalitzGamma_Pt","MC_Pi0DalitzGamma_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0DalitzGammaPt[iCut]);
+                                
+                                hMCPi0DalitzPositronPt[iCut] = new TH1F("MC_Pi0DalitzPositron_Pt","MC_Pi0DalitzPositron_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0DalitzPositronPt[iCut]);
+                                
+                                hMCPi0DalitzElectronPt[iCut] = new TH1F("MC_Pi0DalitzElectron_Pt","MC_Pi0DalitzElectron_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0DalitzElectronPt[iCut]);
+                                
+                                
+                                hMCPi0Pt[iCut] = new TH1F("MC_Pi0_Pt","MC_Pi0_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0Pt[iCut]);
+                                
+                                hMCPi0GGPt[iCut] = new TH1F("MC_Pi0_GG_Pt","MC_Pi0_GG_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0GGPt[iCut]);
+                                
+                                hMCEtaPt[iCut] = new TH1F("MC_Eta_Pt","MC_Eta_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCEtaPt[iCut]);
+
+                                hMCEtaGGPt[iCut] = new TH1F("MC_Eta_GG_Pt","MC_Eta_GG_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCEtaGGPt[iCut]);
+                                
+                                hMCPi0InAccPt[iCut] = new TH1F("MC_Pi0DalitzInAcc_Pt","MC_Pi0DalitzInAcc_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCPi0InAccPt[iCut]);
+
+                                hMCEtaInAccPt[iCut] = new TH1F("MC_EtaDalitzInAcc_Pt","MC_EtaDalitzInAcc_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCEtaInAccPt[iCut]);
+
+                                hMCChiCPt[iCut] = new TH1F("MC_ChiC_Pt","MC_ChiC_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCChiCPt[iCut]);
+
+                                hMCChiCInAccPt[iCut] = new TH1F("MC_ChiCInAcc_Pt","MC_ChiCInAcc_Pt",250,0,25);
+                                fMCList[iCut]->Add(hMCChiCInAccPt[iCut]);
 
          fTrueList[iCut] = new TList();
          fTrueList[iCut]->SetName(Form("%s_%s_%s True histograms",cutstringGamma.Data(),cutstringElectron.Data(),cutstringMeson.Data()));
          fTrueList[iCut]->SetOwner(kTRUE);
          fCutFolder[iCut]->Add(fTrueList[iCut]);
 
-
-         
-
-
-
-
-
         
+                                hESDEposEnegTruePi0DalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_InvMassPt","ESD_EposEneg_TruePi0Dalitz_InvMassPt",5000,0.,5.,100,0.,10.);
+                                fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzInvMassPt[iCut]);
         
-        hESDEposEnegTruePi0DalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePi0Dalitz_InvMassPt","ESD_EposEneg_TruePi0Dalitz_InvMassPt",5000,0.,5.,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTruePi0DalitzInvMassPt[iCut]);
+                                hESDEposEnegTrueEtaDalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_InvMassPt","ESD_EposEneg_TrueEtaDalitz_InvMassPt",5000,0.,5.,100,0.,10.);
+                                fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzInvMassPt[iCut]);
         
-        hESDEposEnegTrueEtaDalitzInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueEtaDalitz_InvMassPt","ESD_EposEneg_TrueEtaDalitz_InvMassPt",5000,0.,5.,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTrueEtaDalitzInvMassPt[iCut]);
+                                hESDEposEnegTruePhotonInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePhoton_InvMassPt","ESD_EposEneg_TruePhoton_InvMassPt",5000,0.,5.,100,0.,10.);
+                                fTrueList[iCut]->Add(hESDEposEnegTruePhotonInvMassPt[iCut]);
         
-        hESDEposEnegTruePhotonInvMassPt[iCut] = new TH2F("ESD_EposEneg_TruePhoton_InvMassPt","ESD_EposEneg_TruePhoton_InvMassPt",5000,0.,5.,100,0.,10.);
-        fTrueList[iCut]->Add(hESDEposEnegTruePhotonInvMassPt[iCut]);
-        
-         
+                                hESDEposEnegTrueJPsiInvMassPt[iCut] = new TH2F("ESD_EposEneg_TrueJPsi_InvMassPt","ESD_EposEneg_TrueJPsi_InvMassPt",5000,0.,5.,100,0.,10.);
+                                fTrueList[iCut]->Add(hESDEposEnegTrueJPsiInvMassPt[iCut]);
+
 
          hESDTruePositronPt[iCut] = new TH1F("ESD_TruePositron_Pt","ESD_TruePositron_Pt",250,0,25);
          fTrueList[iCut]->Add(hESDTruePositronPt[iCut]);
@@ -613,6 +624,8 @@ void AliAnalysisTaskGammaConvDalitzV1::UserCreateOutputObjects()
 
 
 
+                                hESDTrueMotherChiCInvMassPt[iCut] = new TH2F("ESD_TrueMotherChiC_InvMass_Pt","ESD_TrueMotherChiC_InvMass_Pt",1000,0,1,250,0,25);
+         fTrueList[iCut]->Add(hESDTrueMotherChiCInvMassPt[iCut]);
 
 
          hESDTrueMotherInvMassPt[iCut] = new TH2F("ESD_TrueMother_InvMass_Pt","ESD_TrueMother_InvMass_Pt",1000,0,1,250,0,25);
@@ -892,18 +905,18 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
       if(! ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelected(electronCandidate) ) continue;
          lGoodElectronIndex.push_back(   fSelectorElectronIndex[i] );
          hESDDalitzElectronPt[fiCut]->Fill(electronCandidate->Pt());
-            if( fMCEvent ) {
-                    Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
-                    if( labelelectron < fMCStack->GetNtrack() ){
-                    TParticle* electron = fMCStack->Particle(labelelectron);
-                      if( electron->GetPdgCode() ==  11 ){
-                            hESDTrueElectronPt[fiCut]->Fill(electron->Pt());
-                        if( IsPi0DalitzDaughter(labelelectron) == kTRUE ) {
-                            hESDTruePi0DalitzElectronPt[fiCut]->Fill(electron->Pt());
-                       }
-                     }
-                   }
-            }
+                                if( fMCEvent ) {
+                                        Int_t labelelectron = TMath::Abs( electronCandidate->GetLabel() );
+                                        if( labelelectron < fMCStack->GetNtrack() ){
+                                                TParticle* electron = fMCStack->Particle(labelelectron);
+                                                if( electron->GetPdgCode() ==  11 ){
+                                                        hESDTrueElectronPt[fiCut]->Fill(electron->Pt());
+                                                        if( IsPi0DalitzDaughter(labelelectron) == kTRUE ) {
+                                                                hESDTruePi0DalitzElectronPt[fiCut]->Fill(electron->Pt());
+                                                        }
+                                                }
+                                        }
+                                }
    }
 
    for(UInt_t i = 0; i < fSelectorPositronIndex.size(); i++){
@@ -913,8 +926,8 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
         lGoodPositronIndex.push_back(   fSelectorPositronIndex[i] );
         hESDDalitzPositronPt[fiCut]->Fill(positronCandidate->Pt());
         if( fMCEvent ) {
-                    Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
-                    if( labelpositron < fMCStack->GetNtrack() ) {
+                                       Int_t labelpositron = TMath::Abs( positronCandidate->GetLabel() );
+                                       if( labelpositron < fMCStack->GetNtrack() ) {
                     TParticle* positron = fMCStack->Particle(labelpositron);
                       if( positron->GetPdgCode() ==  -11 ){
                             hESDTruePositronPt[fiCut]->Fill(positron->Pt());
@@ -971,10 +984,10 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
 
          AliESDtrack *positronCandidate = fESDEvent->GetTrack(lGoodPositronIndex[j]);
          AliKFParticle positronCandidateKF( *positronCandidate->GetConstrainedParam(), ::kPositron );
-        Bool_t isPhoton    = kFALSE;
-        Bool_t isPi0Dalitz = kFALSE;
-        Bool_t isEtaDalitz = kFALSE;
-        
+                                Bool_t isPhoton    = kFALSE;
+                                Bool_t isPi0Dalitz = kFALSE;
+                                Bool_t isEtaDalitz = kFALSE;
+                                Bool_t isJPsi      = kFALSE;
 
          Double_t psiPair = GetPsiPair(positronCandidate,electronCandidate);
          Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->GetConstrainedParam()->Phi()-positronCandidate->GetConstrainedParam()->Phi());
@@ -1001,40 +1014,43 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessElectronCandidates(){
                virtualPhoton->SetMCLabelPositive(labelp);
                virtualPhoton->SetMCLabelNegative(labeln);
             
-           }
+                                               }
             
             TParticle *mcVgamma=virtualPhoton->GetMCParticle(fMCStack);
-           Int_t labelgamma    = -1;
-           Int_t labelelectron = -1;
-           Int_t labelpositron = -1;
-
-           if(mcVgamma){
-             // Check if it is a true photon
-             if(mcVgamma->GetPdgCode() == 22){
-               isPhoton = kTRUE;
-             }
-             else if( IsDalitz( mcVgamma,labelgamma,labelelectron,labelpositron ) ){
-                 if     ( mcVgamma->GetPdgCode() == 111 ) isPi0Dalitz = kTRUE;
-                 else if( mcVgamma->GetPdgCode() == 221 ) isEtaDalitz = kTRUE;
-             }
-           }
-          }
-
-            
+                                               Int_t labelgamma    = -1;
+                                               Int_t labelelectron = -1;
+                                               Int_t labelpositron = -1;
+                                               
+                                               if(mcVgamma){
+                                                       // Check if it is a true photon
+                                                       if(mcVgamma->GetPdgCode() == 22){
+                                                               isPhoton = kTRUE;
+                                                       }else if(mcVgamma->GetPdgCode() == 443){
+                                                               isJPsi = kTRUE;
+                                                       }
+                                                       else if( IsDalitz( mcVgamma,labelgamma,labelelectron,labelpositron ) ){
+                                                               if     ( mcVgamma->GetPdgCode() == 111 ) isPi0Dalitz = kTRUE;
+                                                               else if( mcVgamma->GetPdgCode() == 221 ) isEtaDalitz = kTRUE;
+                                                       }
+                                               }
+                                }
+                                
+         
          AliAODConversionPhoton *vphoton = new AliAODConversionPhoton(virtualPhoton); //To Apply PsiPairCut
-
+                                
          hESDEposEnegPsiPairDPhi[fiCut]->Fill(deltaPhi,psiPair);   
          hESDEposEnegInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
-        
-        if( fMCEvent ) {
-           if(isPhoton)        hESDEposEnegTruePhotonInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
-           else if(isPi0Dalitz)hESDEposEnegTruePi0DalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
-           else if(isEtaDalitz)hESDEposEnegTrueEtaDalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
-           
-        }
-        
-        fGoodVirtualGammas->Add(  vphoton );
-                        
+                                
+                                if( fMCEvent ) {
+                                        if(isPhoton)   hESDEposEnegTruePhotonInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+                else if(isJPsi) hESDEposEnegTrueJPsiInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+                                else if(isPi0Dalitz)hESDEposEnegTruePi0DalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+                                        else if(isEtaDalitz)hESDEposEnegTrueEtaDalitzInvMassPt[fiCut]->Fill(vphoton->GetMass(),vphoton->Pt());
+                                        
+                                }
+                                
+                                fGoodVirtualGammas->Add(  vphoton );
+                                
       }
    }
    
@@ -1344,6 +1360,7 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
 
       Bool_t isTruePi0 = kFALSE;
       Bool_t isTrueEta = kFALSE;
+      Bool_t isTrueChiC = kFALSE;
       Int_t gammaMCLabel = TrueGammaCandidate->GetMCParticleLabel(MCStack);
       Int_t gammaMotherLabel = -1;
 
@@ -1406,6 +1423,13 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
          if(((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 221){
             isTrueEta=kTRUE;
          }
+                                
+                                if(((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 445 ||
+                                               ((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 10443 ||
+                                               ((TParticle*)MCStack->Particle(virtualGammaMotherLabel))->GetPdgCode() == 20443 ){
+            isTrueChiC=kTRUE;
+                                               hESDTrueMotherChiCInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt());
+         }
 
       }
 
@@ -1440,6 +1464,8 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessTrueMesonCandidates(AliAODConversi
       }
    }
 }
+
+
 //________________________________________________________________________
 void AliAnalysisTaskGammaConvDalitzV1::MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex){
    //see header file for documentation
@@ -1481,98 +1507,108 @@ void AliAnalysisTaskGammaConvDalitzV1::ProcessMCParticles()
 
    // Loop over all primary MC particle
 
-   for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) {
-      TParticle* particle = (TParticle *)fMCStack->Particle(i);
-      if (!particle) continue;
-
-
+       for(Int_t i = 0; i < fMCStack->GetNprimary(); i++) {
+               TParticle* particle = (TParticle *)fMCStack->Particle(i);
+               if (!particle) continue;
+               
+               
     if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(particle,fMCStack,kFALSE)){
-         hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
+                       hMCAllGammaPt[fiCut]->Fill(particle->Pt()); // All MC Gamma
     }
-
-    if(  ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(i,fMCStack)){
-        if( particle->GetPdgCode() == -11)hMCAllPositronsPt[fiCut]->Fill(particle->Pt()); // All positrons
-        if( particle->GetPdgCode() ==  11)hMCAllElectronsPt[fiCut]->Fill(particle->Pt()); // All electrons
+               
+    if(((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(i,fMCStack)){
+                       if( particle->GetPdgCode() == -11)hMCAllPositronsPt[fiCut]->Fill(particle->Pt()); // All positrons
+                       if( particle->GetPdgCode() ==  11)hMCAllElectronsPt[fiCut]->Fill(particle->Pt()); // All electrons
     }
-
+               
     if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack)){
-
-            if(particle->GetPdgCode() == 111)hMCPi0GGPt[fiCut]->Fill( particle->Pt() ); // All MC Pi0 GG decay
-            if(particle->GetPdgCode() == 221)hMCEtaGGPt[fiCut]->Fill( particle->Pt() ); // All MC Eta GG decay
+                       if(particle->GetPdgCode() == 111)hMCPi0GGPt[fiCut]->Fill( particle->Pt() ); // All MC Pi0 GG decay
+                       if(particle->GetPdgCode() == 221)hMCEtaGGPt[fiCut]->Fill( particle->Pt() ); // All MC Eta GG decay
     }
 
     if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCDalitz(particle,fMCStack)){
-       
-         if(particle->GetPdgCode() == 111)hMCPi0Pt[fiCut]->Fill(particle->Pt()); // All MC Pi0
-         if(particle->GetPdgCode() == 221)hMCEtaPt[fiCut]->Fill(particle->Pt()); // All MC Eta
-
-         // Check the acceptance for gamma and electrons
-        
-        Int_t labelgamma =    -1;
-        Int_t labelelectron = -1;
-        Int_t labelpositron = -1;
-        
-        if( IsDalitz( particle,labelgamma,labelelectron,labelpositron) == kTRUE ) {
-         
-         
-              TParticle *gamma    = fMCStack->Particle(labelgamma);
-              TParticle *electron = fMCStack->Particle(labelelectron);
-              TParticle *positron = fMCStack->Particle(labelpositron);
-        
-                      
-               if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
-                  TMath::Abs( electron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut()  &&
-                  TMath::Abs( positron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut() ){
-                  if(particle->GetPdgCode() == 111){ 
-                        hMCPi0InAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0Dalitz with gamma and e+e- in acc
-                        hMCPi0DalitzGammaPt[fiCut]->Fill( gamma->Pt());
-                        hMCPi0DalitzPositronPt[fiCut]->Fill( positron->Pt());
-                        hMCPi0DalitzElectronPt[fiCut]->Fill( electron->Pt());
-                  }
-                  if(particle->GetPdgCode() == 221)hMCEtaInAccPt[fiCut]->Fill(particle->Pt()); // MC EtaDalitz with gamma and e+e- in acc
-               }
-         }
-      }
-   }
+                       if(particle->GetPdgCode() == 111)hMCPi0Pt[fiCut]->Fill(particle->Pt()); // All MC Pi0
+                       if(particle->GetPdgCode() == 221)hMCEtaPt[fiCut]->Fill(particle->Pt()); // All MC Eta
+                       
+                       // Check the acceptance for gamma and electrons
+                       
+                       Int_t labelgamma =    -1;
+                       Int_t labelelectron = -1;
+                       Int_t labelpositron = -1;
+                       
+                       if( IsDalitz( particle,labelgamma,labelelectron,labelpositron) == kTRUE ) {
+                                        
+                                        
+                               TParticle *gamma    = fMCStack->Particle(labelgamma);
+                               TParticle *electron = fMCStack->Particle(labelelectron);
+                               TParticle *positron = fMCStack->Particle(labelpositron);
+                               
+           
+                               if(((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC(gamma,fMCStack,kFALSE) &&
+                                        TMath::Abs( electron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut()  &&
+                                        TMath::Abs( positron->Eta() ) < ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->GetEtaCut() ){
+                                       if(particle->GetPdgCode() == 111){ 
+                                               hMCPi0InAccPt[fiCut]->Fill(particle->Pt()); // MC Pi0Dalitz with gamma and e+e- in acc
+                                               hMCPi0DalitzGammaPt[fiCut]->Fill( gamma->Pt());
+                                               hMCPi0DalitzPositronPt[fiCut]->Fill( positron->Pt());
+                                               hMCPi0DalitzElectronPt[fiCut]->Fill( electron->Pt());
+                                       }
+                                       if(particle->GetPdgCode() == 221)hMCEtaInAccPt[fiCut]->Fill(particle->Pt()); // MC EtaDalitz with gamma and e+e- in acc
+                               }
+                       }
+               }
+               Int_t labelgammaChiC=-1;
+               Int_t labelpositronChiC=-1;
+               Int_t labelelectronChiC=-1;
+
+
+
+               if(((AliConversionMesonCuts*)fCutMesonArray->At(fiCut))->MesonIsSelectedMCChiC(particle,fMCStack,labelelectronChiC,labelpositronChiC,labelgammaChiC)){
+                       hMCChiCPt[fiCut]->Fill(particle->Pt()); // All MC ChiC
+                       TParticle * gammaChiC  =fMCStack->Particle(labelgammaChiC);
+
+                       if( ((AliConversionCuts*)fCutGammaArray->At(fiCut))->PhotonIsSelectedMC( gammaChiC,fMCStack,kFALSE) &&
+                                       ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelelectronChiC,fMCStack) && 
+                                       ((AliDalitzElectronCuts*)fCutElectronArray->At(fiCut))->ElectronIsSelectedMC(labelpositronChiC,fMCStack) ){
+                               hMCChiCInAccPt[fiCut]->Fill(particle->Pt()); // All MC ChiC
+                       } 
+               }
+       }
 }
 //_____________________________________________________________________________
 Bool_t AliAnalysisTaskGammaConvDalitzV1::IsDalitz(TParticle *fMCMother,Int_t &labelgamma, Int_t &labelelectron,Int_t &labelpositron)
 {
 
-           if( fMCMother->GetNDaughters() != 3 ) return kFALSE;
-           if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
-           
-           TParticle *positron = 0x0;
-           TParticle *electron = 0x0;
-           TParticle *gamma    = 0x0;
-                   
-             
-
-
-            for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
-
-
-               TParticle* temp = (TParticle*)fMCStack->Particle( index );
-
-               switch( temp->GetPdgCode() ) {
-               case ::kPositron:
-                               positron =  temp;
-                               labelpositron = index;
-                               break;
-               case ::kElectron:
-                               electron =  temp;
-                               labelelectron = index;
-                               break;
-               case ::kGamma:
-                               gamma    =  temp;
-                               labelgamma = index;
-                               break;
-               }
-            }
-            
-            if( positron && electron && gamma) return kTRUE;
+       if( fMCMother->GetNDaughters() != 3 ) return kFALSE;
+       if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
+       
+       TParticle *positron = 0x0;
+       TParticle *electron = 0x0;
+       TParticle *gamma        = 0x0;
+       
+       for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){                           
 
-return kFALSE;
+               TParticle* temp = (TParticle*)fMCStack->Particle( index );
+               
+               switch( temp->GetPdgCode() ) {
+               case ::kPositron:
+                       positron =  temp;
+                       labelpositron = index;
+                       break;
+               case ::kElectron:
+                       electron =  temp;
+                       labelelectron = index;
+                       break;
+               case ::kGamma:
+                       gamma    =  temp;
+                       labelgamma = index;
+                       break;
+               }
+       }
+  
+       if( positron && electron && gamma) return kTRUE;
+       
+       return kFALSE;
 }
 //_____________________________________________________________________________________
 Bool_t AliAnalysisTaskGammaConvDalitzV1::IsPi0DalitzDaughter( Int_t label ) const
index cd3a040..9c5c885 100644 (file)
@@ -119,9 +119,13 @@ class AliAnalysisTaskGammaConvDalitzV1: public AliAnalysisTaskSE
     TH1F **hMCEtaGGPt;
     TH1F **hMCPi0InAccPt;
     TH1F **hMCEtaInAccPt;
+    TH1F **hMCChiCPt;
+    TH1F **hMCChiCInAccPt;
     TH2F **hESDEposEnegTruePi0DalitzInvMassPt;
     TH2F **hESDEposEnegTrueEtaDalitzInvMassPt;
     TH2F **hESDEposEnegTruePhotonInvMassPt;
+    TH2F **hESDEposEnegTrueJPsiInvMassPt;
+    TH2F **hESDTrueMotherChiCInvMassPt;
     TH2F **hESDTrueMotherInvMassPt;
     TH2F **hESDTrueMotherPi0GGInvMassPt;
     TH2F **hESDTruePrimaryMotherInvMassMCPt;
index 605c51b..69f47e7 100644 (file)
@@ -296,6 +296,78 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliS
    }
    return kFALSE;
 }
+//________________________________________________________________________
+Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
+   // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
+   // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
+
+   if(!fMCStack)return kFALSE;
+        // if(fMCMother->GetPdgCode()==20443 ){
+        //      return kFALSE;
+        // }
+   if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
+                if(fMCMother->R()>fMaxR)       return kFALSE; // cuts on distance from collision point
+
+                Double_t rapidity = 10.;
+                if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
+                        rapidity=8.-fRapidityShift;
+                }
+                else{
+                        rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
+                }      
+               
+                // Rapidity Cut
+                if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
+
+                // Select only -> ChiC radiative (JPsi+gamma) decay channel
+      if(fMCMother->GetNDaughters()!=2)return kFALSE;
+
+                       TParticle *jpsi         = 0x0;
+                       TParticle *gamma        = 0x0;
+                       TParticle *positron = 0x0;
+                       TParticle *electron = 0x0;
+
+                       Int_t labeljpsiChiC = -1;
+       
+                       for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){                           
+                               
+                               TParticle* temp = (TParticle*)fMCStack->Particle( index );
+                               
+                               switch( temp->GetPdgCode() ) {
+                               case 443:
+                                       jpsi =  temp;
+                                       labeljpsiChiC = index;
+                                       break;
+                               case 22:
+                                       gamma    =  temp;
+                                       labelgammaChiC = index;
+                                       break;
+                               }
+                       }
+
+      if ( !jpsi || ! gamma) return kFALSE;
+                       if(jpsi->GetNDaughters()!=2)return kFALSE;
+                
+
+                       for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){                             
+                               TParticle* temp = (TParticle*)fMCStack->Particle( index );
+                               switch( temp->GetPdgCode() ) {
+                               case -11:
+                                       electron =  temp;
+                                       labelelectronChiC = index;
+                                       break;
+                               case 11:
+                                       positron =  temp;
+                                       labelpositronChiC = index;
+                                       break;
+                               }
+                       }
+                       if( !electron || !positron) return kFALSE;
+                       if( positron && electron && gamma) return kTRUE;
+   }
+   return kFALSE;
+}
+
 
 
 ///________________________________________________________________________
index 2824608..6233ce8 100644 (file)
@@ -75,6 +75,7 @@ class AliConversionMesonCuts : public AliAnalysisCuts {
   Bool_t MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal=kTRUE, Double_t fRapidityShift=0.);
   Bool_t MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift=0.);
   Bool_t MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift=0.);
+  Bool_t MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0. );
   void PrintCuts();
 
   void InitCutHistograms(TString name="");
index aeaafd3..6ea8e0b 100644 (file)
@@ -409,126 +409,126 @@ Bool_t AliDalitzElectronCuts::dEdxCuts(AliVTrack *fCurrentTrack){
     cutIndex++;\r
 \r
 \r
-  if( fDodEdxSigmaITSCut == kTRUE ){\r
+               if( fDodEdxSigmaITSCut == kTRUE ){\r
 \r
 \r
-        if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||\r
-                fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){\r
-\r
-          if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-          return kFALSE;\r
+                       if( fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineITS ||\r
+                                       fPIDResponse->NumberOfSigmasITS(fCurrentTrack,AliPID::kElectron)> fPIDnSigmaAboveElectronLineITS ){\r
+                               \r
+                               if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                               return kFALSE;\r
       }\r
-     \r
-  }\r
-\r
- if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
-\r
-\r
-  cutIndex++;\r
-\r
-\r
-  if(fDodEdxSigmaTPCCut == kTRUE){\r
-\r
-\r
+                       \r
+               }\r
+               \r
+               if(hITSdEdxafter)hITSdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasITS(fCurrentTrack, AliPID::kElectron));\r
+               \r
+               \r
+               cutIndex++;\r
+               \r
+               \r
+               if(fDodEdxSigmaTPCCut == kTRUE){\r
+                       \r
+                       \r
       // TPC Electron Line\r
       if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLineTPC ||\r
-               fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){\r
-\r
-         if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-         return kFALSE;\r
+                                       fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLineTPC){\r
+                               \r
+                               if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                               return kFALSE;\r
       }\r
       cutIndex++;\r
-\r
+                       \r
       // TPC Pion Line\r
-       if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){\r
-         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC     &&\r
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&\r
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){\r
-\r
-             if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-             return kFALSE;\r
-         }\r
-       }\r
-       cutIndex++;\r
-   \r
-       // High Pt Pion rej\r
-       if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){\r
-         if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&\r
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&\r
-                fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){\r
-\r
-                if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-               return kFALSE;\r
-         }\r
-       }\r
-\r
-       cutIndex++;\r
-  }\r
-\r
-  else{ cutIndex+=3; }\r
-\r
-\r
-  if(   fDoKaonRejectionLowP == kTRUE   ){\r
-\r
-        if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){\r
-\r
-          if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){\r
-\r
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                       if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLineTPC && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLineTPC ){\r
+                               if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC     &&\r
+                                        fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC &&\r
+                                        fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPC){\r
+                                       \r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       return kFALSE;\r
+                               }\r
+                       }\r
+                       cutIndex++;\r
+                       \r
+                       // High Pt Pion rej\r
+                       if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLineTPC ){\r
+                               if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLineTPC &&\r
+                                        fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLineTPC&&\r
+                                        fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineTPCHighPt){\r
+                                       \r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       return kFALSE;\r
+                               }\r
+                       }\r
+                       \r
+                       cutIndex++;\r
+               }\r
 \r
-              return kFALSE;\r
-          }\r
-        }\r
-  }\r
-  cutIndex++;\r
-   \r
-  if(   fDoProtonRejectionLowP == kTRUE    ){\r
+               else{ cutIndex+=3; }\r
 \r
-        if( fCurrentTrack->P()  < fPIDMinPProtonRejectionLowP ){\r
-          if( TMath::Abs(   fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){\r
 \r
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-              return kFALSE;\r
-          }\r
-        }\r
-  }\r
-   cutIndex++;\r
-   \r
-  if(fDoPionRejectionLowP == kTRUE){\r
-        if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){\r
-          if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){\r
-\r
-              if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-                return kFALSE;\r
-          }\r
-        }\r
-  }\r
-  cutIndex++;\r
+               if(   fDoKaonRejectionLowP == kTRUE   ){\r
 \r
-   \r
-  if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){\r
-   if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
-     if(fUseTOFpid){\r
+                       if( fCurrentTrack->P() < fPIDMinPKaonRejectionLowP ){\r
+                               \r
+                               if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){\r
+                                       \r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       \r
+                                       return kFALSE;\r
+                               }\r
+                       }\r
+               }\r
+               cutIndex++;\r
+               \r
+               if(   fDoProtonRejectionLowP == kTRUE    ){\r
+                       \r
+                       if( fCurrentTrack->P()  < fPIDMinPProtonRejectionLowP ){\r
+                               if( TMath::Abs(   fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){\r
+                                       \r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       return kFALSE;\r
+                               }\r
+                       }\r
+               }\r
+               cutIndex++;\r
+               \r
+               if(fDoPionRejectionLowP == kTRUE){\r
+                       if( fCurrentTrack->P() < fPIDMinPPionRejectionLowP ){\r
+                               if( TMath::Abs( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)) < fPIDnSigmaAtLowPAroundPionLine ){\r
+                                       \r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       return kFALSE;\r
+                               }\r
+                       }\r
+               }\r
+               cutIndex++;\r
+               \r
+               \r
+               if( ( fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && ( !( fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch) ) ){\r
+                       if(hTOFbefore) hTOFbefore->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
+                       if(fUseTOFpid){\r
         if(fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine ||\r
            fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine ){\r
-           if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-           return kFALSE;\r
+                                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                                       return kFALSE;\r
         }\r
-     }\r
-     if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
-  }\r
-  else if ( fRequireTOF == kTRUE ) {\r
-\r
-            if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-            return kFALSE;\r
-  }\r
-     cutIndex++;\r
-\r
-  if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
-  if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
-  if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
-\r
-  return kTRUE;\r
+                       }\r
+                       if(hTOFafter)hTOFafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTOF(fCurrentTrack, AliPID::kElectron));\r
+               }\r
+               else if ( fRequireTOF == kTRUE ) {\r
+                       \r
+                       if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+                       return kFALSE;\r
+               }\r
+               cutIndex++;\r
+               \r
+               if(hdEdxCuts)hdEdxCuts->Fill(cutIndex);\r
+               if(hTPCdEdxafter)hTPCdEdxafter->Fill(fCurrentTrack->P(),fPIDResponse->NumberOfSigmasTPC(fCurrentTrack, AliPID::kElectron));\r
+               if(hTPCdEdxSignalafter)hTPCdEdxSignalafter->Fill(fCurrentTrack->P(),TMath::Abs(fCurrentTrack->GetTPCsignal()));\r
+               \r
+               return kTRUE;\r
 }\r
 ///________________________________________________________________________\r
 \r
@@ -692,100 +692,100 @@ Bool_t AliDalitzElectronCuts::SetCut(cutIds cutID, const Int_t value) {
          return kTRUE;\r
        } else return kFALSE;\r
 \r
- case kededxSigmaTPCCut:\r
-        if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
-          fCuts[kededxSigmaTPCCut] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
+       case kededxSigmaTPCCut:\r
+               if( SetTPCdEdxCutElectronLine(value)) { //NOTE SetITSdEdxCutElectronLine: To be implemented \r
+                       fCuts[kededxSigmaTPCCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kpidedxSigmaTPCCut:\r
-        if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented\r
-          fCuts[kpidedxSigmaTPCCut] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
+               if( SetTPCdEdxCutPionLine(value)) { //NOTE SetITSdEdxCutPionLine: To be implemented\r
+                       fCuts[kpidedxSigmaTPCCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kpiMinMomdedxSigmaTPCCut:\r
-       if( SetMinMomPiondEdxTPCCut(value)) {\r
-         fCuts[kpiMinMomdedxSigmaTPCCut] = value;\r
-         UpdateCutString(cutID, value);\r
-         return kTRUE;\r
-       } else return kFALSE;\r
-\r
+               if( SetMinMomPiondEdxTPCCut(value)) {\r
+                       fCuts[kpiMinMomdedxSigmaTPCCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kpiMaxMomdedxSigmaTPCCut:\r
-        if( SetMaxMomPiondEdxTPCCut(value)) {\r
-          fCuts[kpiMaxMomdedxSigmaTPCCut] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
+               if( SetMaxMomPiondEdxTPCCut(value)) {\r
+                       fCuts[kpiMaxMomdedxSigmaTPCCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kLowPRejectionSigmaCut:\r
-        if( SetLowPRejectionCuts(value) ) {\r
-          fCuts[kLowPRejectionSigmaCut] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
-\r
+               if( SetLowPRejectionCuts(value) ) {\r
+                       fCuts[kLowPRejectionSigmaCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
+               \r
   case kTOFelectronPID:\r
-        if( SetTOFElectronPIDCut(value)) {\r
-          fCuts[kTOFelectronPID] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
+               if( SetTOFElectronPIDCut(value)) {\r
+                       fCuts[kTOFelectronPID] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
   case kclsITSCut:\r
-       if( SetITSClusterCut(value) ) {\r
-         fCuts[kclsITSCut] = value;\r
-         UpdateCutString(cutID, value);\r
-         return kTRUE;                 \r
-        } else return kFALSE;\r
+               if( SetITSClusterCut(value) ) {\r
+                       fCuts[kclsITSCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;                   \r
+               } else return kFALSE;\r
   case kclsTPCCut:\r
-       if( SetTPCClusterCut(value)) {\r
-         fCuts[kclsTPCCut] = value;\r
-         UpdateCutString(cutID, value);\r
-         return kTRUE;\r
-       } else return kFALSE;\r
-\r
+               if( SetTPCClusterCut(value)) {\r
+                       fCuts[kclsTPCCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case ketaCut:\r
-       if( SetEtaCut(value)) {\r
-         fCuts[ketaCut] = value;\r
-         UpdateCutString(cutID, value);\r
-         return kTRUE;\r
-       } else return kFALSE;\r
-   case kPsiPair:\r
-        if( SetPsiPairCut(value)) {\r
-          fCuts[kPsiPair] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
+               if( SetEtaCut(value)) {\r
+                       fCuts[ketaCut] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+       case kPsiPair:\r
+               if( SetPsiPairCut(value)) {\r
+                       fCuts[kPsiPair] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kRejectSharedElecGamma:\r
-        if( SetRejectSharedElecGamma(value)) {\r
-          fCuts[kRejectSharedElecGamma] = value;\r
-          UpdateCutString(cutID, value);\r
+               if( SetRejectSharedElecGamma(value)) {\r
+                       fCuts[kRejectSharedElecGamma] = value;\r
+                       UpdateCutString(cutID, value);\r
           return kTRUE;\r
-        } else return kFALSE;\r
-\r
+               } else return kFALSE;\r
+               \r
   case kBackgroundScheme:\r
-        if( SetBackgroundScheme(value)) {\r
-          fCuts[kBackgroundScheme] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
+               if( SetBackgroundScheme(value)) {\r
+                       fCuts[kBackgroundScheme] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
 \r
   case kNumberOfRotations:\r
-        if( SetNumberOfRotations(value)) {\r
-          fCuts[kNumberOfRotations] = value;\r
-          UpdateCutString(cutID, value);\r
-          return kTRUE;\r
-        } else return kFALSE;\r
-\r
+               if( SetNumberOfRotations(value)) {\r
+                       fCuts[kNumberOfRotations] = value;\r
+                       UpdateCutString(cutID, value);\r
+                       return kTRUE;\r
+               } else return kFALSE;\r
+               \r
   case kNCuts:\r
-       cout << "Error:: Cut id out of range"<< endl;\r
-       return kFALSE;\r
+               cout << "Error:: Cut id out of range"<< endl;\r
+               return kFALSE;\r
   }\r
-\r
+       \r
   cout << "Error:: Cut id " << cutID << " not recognized "<< endl;\r
   return kFALSE;\r
 \r
@@ -1086,28 +1086,29 @@ Bool_t AliDalitzElectronCuts::SetEtaCut(Int_t etaCut)
 { \r
   // Set eta Cut\r
        switch(etaCut){\r
-                case 0: fEtaCut         = 100.;\r
-                        break;\r
-               case 1: // 1.4\r
-                       fEtaCut         = 1.4;\r
-                       break;\r
-               case 2: // 1.2\r
-                       fEtaCut         = 1.2;\r
-                       break;\r
-               case 3: // 0.9\r
-                       fEtaCut         = 0.9;\r
-                       break;\r
-               case 4: // 0.8\r
-                       fEtaCut         = 0.8;\r
-                       break;\r
-               case 5: // 0.75\r
-                       fEtaCut         = 0.75;\r
-                       break;\r
-               default:\r
-                       cout<<"Warning: EtaCut not defined "<<etaCut<<endl;\r
-                       return kFALSE;\r
-    }\r
-    return kTRUE;\r
+       case 0: \r
+               fEtaCut = 100.;\r
+               break;\r
+       case 1: // 1.4\r
+               fEtaCut = 1.4;\r
+               break;\r
+       case 2: // 1.2\r
+               fEtaCut = 1.2;\r
+               break;\r
+       case 3: // 0.9\r
+               fEtaCut = 0.9;\r
+               break;\r
+       case 4: // 0.8\r
+               fEtaCut = 0.8;\r
+               break;\r
+       case 5: // 0.75\r
+               fEtaCut = 0.75;\r
+               break;\r
+       default:\r
+               cout<<"Warning: EtaCut not defined "<<etaCut<<endl;\r
+               return kFALSE;\r
+       }\r
+       return kTRUE;\r
 }\r
 \r
 ///________________________________________________________________________\r
index 569351d..9cf7fd8 100644 (file)
@@ -1,5 +1,5 @@
 
-void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC     = kFALSE){
+void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC     = kFALSE, UInt_t triggerMaskpPb = AliVEvent::kINT7 ){
 
    gSystem->Load("libCore.so");  
    gSystem->Load("libTree.so");
@@ -76,7 +76,7 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC    = kFALSE){
       fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
       if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
          if (IsHeavyIon==2){
-            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->SelectCollisionCandidates(triggerMaskpPb);
             fCuts->DoEtaShift(doEtaShift);
          }
          fV0ReaderV1->SetConversionCuts(fCuts);
@@ -122,10 +122,11 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
       cutarray[ 1] = "3120001042092970023220000"; mesonCutArray[ 1] = "01522045000"; // Standard cut 5-10
       cutarray[ 2] = "1120001042092970023220000"; mesonCutArray[ 2] = "01522045000"; // Standard cut 10-20
    } else if(trainConfig.Contains("pPb")){ //pA needs thighter rapidity cut y < 0.5
-     cutarray[ 0] = "8020000082093172023290000"; mesonCutArray[0] = "01629045000";  //standard cut Pi0 Pb 00-20 shifted Eta 0.4
-     cutarray[ 1] = "8240000082093172023290000"; mesonCutArray[1] = "01629045000";  //standard cut Pi0 Pb 20-40 shifted Eta 0.4
-     cutarray[ 2] = "8460000082093172023290000"; mesonCutArray[2] = "01629045000";  //standard cut Pi0 Pb 40-60 shifted Eta 0.4
-     cutarray[ 3] = "8600000082093172023290000"; mesonCutArray[3] = "01629045000";  //standard cut Pi0 Pb 60-100 shifted Eta 0.4
+     cutarray[ 0] = "8020000082093172023290000"; mesonCutArray[ 0] =     "01629045000";
+     cutarray[ 1] = "8240000082093172023290000"; mesonCutArray[ 1] =     "01629045000";
+     cutarray[ 2] = "8460000082093172023290000"; mesonCutArray[ 2] =     "01629045000";
+     cutarray[ 3] = "8600000082093172023290000"; mesonCutArray[ 3] =     "01629045000";
+
    } else {
       cutarray[ 0] = "0000012002093663003800000"; mesonCutArray[0] = "01631031009"; //standard cut Pi0 pp 2.76TeV without SDD , only boxes
       cutarray[ 1] = "0001012002093663003800000"; mesonCutArray[1] = "01631031009"; //standard cut Pi0 pp 2.76TeV without SDD, V0AND , only boxes
@@ -157,7 +158,7 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
       analysisCuts[i] = new AliConversionCuts();
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
-         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+         analysisCuts[i]->SelectCollisionCandidates(triggerMaskpPb);
          if (i<4){
             analysisCuts[i]->DoEtaShift(kTRUE);
             analysisCuts[i]->SetEtaShift("Pbp");
@@ -177,8 +178,8 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
    task->SetMesonCutList(numberOfCuts,MesonCutList);
    task->SetMoveParticleAccordingToVertex(kTRUE);
    task->SetDoMesonAnalysis(kTRUE);
-//    if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoMesonQA(kTRUE); //Attention new switch for Pi0 QA
-//    if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoPhotonQA(kTRUE);  //Attention new switch small for Photon QA
+   if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoMesonQA(kTRUE); //Attention new switch for Pi0 QA
+   if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoPhotonQA(kTRUE);  //Attention new switch small for Photon QA
 
    //connect containers
    AliAnalysisDataContainer *coutput =
index fd0df70..7089ac5 100644 (file)
@@ -1,5 +1,5 @@
 
-void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC   = kFALSE){
+void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC   = kFALSE, UInt_t triggerMaskpPb = AliVEvent::kINT7){
 
    gSystem->Load("libCore.so");  
    gSystem->Load("libTree.so");
@@ -76,7 +76,7 @@ void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
       fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
       if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
          if (IsHeavyIon==2){
-            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->SelectCollisionCandidates(triggerMaskpPb);
             fCuts->DoEtaShift(doEtaShift);
          }
          fV0ReaderV1->SetConversionCuts(fCuts);
@@ -122,8 +122,8 @@ void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
       cutarray[ 1] = "3010003042092970723220000"; mesonCutArray[ 1] = "01022045000";  // most central
       cutarray[ 2] = "1680003042092970723220000"; mesonCutArray[ 2] = "01022065000";  // peripheral
    } else if(trainConfig.Contains("pPb")){ //pA needs thighter rapidity cut y < 0.5
-      cutarray[ 0] = "8000000082093172023290000"; mesonCutArray[0] = "01629045000";  //standard cut Pi0 Pb 00-100 shifted Eta 0.4
-      cutarray[ 1] = "8000000072093172023290000"; mesonCutArray[1] = "01627045000";  //standard cut Pi0 Pb 00-100 wo shifted Eta 0.3
+      cutarray[ 0] = "8000000082093172023290000"; mesonCutArray[ 0] = "01629045000"; //shifted Pbp
+      cutarray[ 1] = "8000000002093172023290000"; mesonCutArray[ 1] = "01621045000"; //standard cut Pi0 PbPb 00-100 Full Eta Range
    } else {
       cutarray[ 0] = "0000011002093663003800000"; mesonCutArray[0] = "01631031009"; //standard cut Pi0 pp 2.76TeV without SDD , only Minbias MC
       cutarray[ 1] = "0001011002093663003800000"; mesonCutArray[1] = "01631031009"; //standard cut Pi0 pp 2.76TeV without SDD, V0AND
@@ -155,7 +155,7 @@ void AddTask_GammaConvV1_2(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
       analysisCuts[i] = new AliConversionCuts();
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
-         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+         analysisCuts[i]->SelectCollisionCandidates(triggerMaskpPb);
          if (i<1){
             analysisCuts[i]->DoEtaShift(kTRUE);
             analysisCuts[i]->SetEtaShift("Pbp");
index ad2e930..e6ec8ed 100644 (file)
@@ -1,5 +1,5 @@
 
-void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC   = kFALSE){
+void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC   = kFALSE, UInt_t triggerMaskpPb = AliVEvent::kINT7){
 
    gSystem->Load("libCore.so");  
    gSystem->Load("libTree.so");
@@ -76,7 +76,7 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
       fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
       if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
          if (IsHeavyIon==2){
-            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->SelectCollisionCandidates(triggerMaskpPb);
             fCuts->DoEtaShift(doEtaShift);
          }
          fV0ReaderV1->SetConversionCuts(fCuts);
@@ -123,10 +123,11 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC      = kFALSE){
 // Standard cut gamma 0-20%
       cutarray[ 2] = "1480003042092370023750000"; mesonCutArray[ 2] = "01522065009"; // Standard cut gamma 40-80
    } else if(trainConfig.Contains("pPb")){ //pA needs thighter rapidity cut y < 0.5
-     cutarray[ 0] = "8020000072093172023290000"; mesonCutArray[0] = "01627045000";  //standard cut Pi0 Pb 00-20  wo shifted Eta 0.3
-     cutarray[ 1] = "8240000072093172023290000"; mesonCutArray[1] = "01627045000";  //standard cut Pi0 Pb 20-40 wo shifted Eta 0.3
-     cutarray[ 2] = "8460000072093172023290000"; mesonCutArray[2] = "01627045000";  //standard cut Pi0 Pb 40-60 wo shifted Eta 0.3
-     cutarray[ 3] = "8600000072093172023290000"; mesonCutArray[3] = "01627045000";  //standard cut Pi0 Pb 60-100 wo shifted Eta 0.3
+       cutarray[ 0] = "8020000002093172023290000"; mesonCutArray[0] = "01621045000";  //standard cut Pi0 PbPb 00-20
+       cutarray[ 1] = "8240000002093172023290000"; mesonCutArray[1] = "01621045000";  //standard cut Pi0 PbPb 20-40
+       cutarray[ 2] = "8460000002093172023290000"; mesonCutArray[2] = "01621045000";  //standard cut Pi0 PbPb 40-60
+       cutarray[ 3] = "8600000002093172023290000"; mesonCutArray[3] = "01621045000";  //standard cut Pi0 PbPb 60-100
+
    } else {
       cutarray[ 0] = "0002011002093663003800000"; mesonCutArray[0] = "01631031009"; //standard cut Pi0 pp 2.76TeV with SDD , only Minbias MC
       cutarray[ 1] = "0003011002093663003800000"; mesonCutArray[1] = "01631031009"; //standard cut Pi0 pp 2.76TeV with SDD, V0AND , only Minbias MC
@@ -158,7 +159,7 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
       analysisCuts[i] = new AliConversionCuts();
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
       if (trainConfig.Contains("pPb")){
-         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+         analysisCuts[i]->SelectCollisionCandidates(triggerMaskpPb);
       }
       ConvCutList->Add(analysisCuts[i]);
 
@@ -175,9 +176,10 @@ void AddTask_GammaConvV1_3(TString trainConfig = "pp",   Bool_t isMC       = kFALSE){
    task->SetMesonCutList(numberOfCuts,MesonCutList);
    task->SetMoveParticleAccordingToVertex(kTRUE);
    task->SetDoMesonAnalysis(kTRUE);
-//    if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoMesonQA(kTRUE); //Attention new switch for Pi0 QA
-//    if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoPhotonQA(kTRUE);  //Attention new switch small for Photon QA
+   if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoMesonQA(kTRUE); //Attention new switch for Pi0 QA
+   if (trainConfig.Contains("pPb") || trainConfig.Contains("pp") )task->SetDoPhotonQA(kTRUE);  //Attention new switch small for Photon QA
 
+   
    //connect containers
    AliAnalysisDataContainer *coutput =
       mgr->CreateContainer("GammaConvV1", TList::Class(),
index 0204292..cfbe38d 100644 (file)
@@ -56,8 +56,8 @@ Double_t AliAnalysisTaskSEPHOSpPbPi0::fgMinDistToBad     = 2.5;
 
 //________________________________________________________________________
 AliAnalysisTaskSEPHOSpPbPi0::AliAnalysisTaskSEPHOSpPbPi0():
-  AliAnalysisTaskSE(), fIsMC(kFALSE), fCentralityBin(10), fBufferSize(10),
-  fRunNumber(-1), fPHOSGeo(0), fList(0), fHeader(0), fCaloClArr(0)
+  AliAnalysisTaskSE(), fIsMC(kFALSE), fCentralityBin(10), fBufferSize(10), fRunNumber(-1), fPHOSGeo(0),
+  fListEvent(0), fListCaloCl(0), fListPi0(0), fListMC(0), fHeader(0), fCaloClArr(0)
 {
   //
   // Default constructor
@@ -70,8 +70,8 @@ AliAnalysisTaskSEPHOSpPbPi0::AliAnalysisTaskSEPHOSpPbPi0():
 }
 //________________________________________________________________________
 AliAnalysisTaskSEPHOSpPbPi0::AliAnalysisTaskSEPHOSpPbPi0(const char *name):
-  AliAnalysisTaskSE(name), fIsMC(kFALSE), fCentralityBin(10), fBufferSize(10),
-  fRunNumber(-1), fPHOSGeo(0), fList(0), fHeader(0), fCaloClArr(0)
+  AliAnalysisTaskSE(name), fIsMC(kFALSE), fCentralityBin(10), fBufferSize(10), fRunNumber(-1), fPHOSGeo(0),
+  fListEvent(0), fListCaloCl(0), fListPi0(0), fListMC(0), fHeader(0), fCaloClArr(0)
 {
   // Constructor
   for (Int_t i=0; i<10; i++) { for (Int_t j=0; j<10; j++) fEventList[i][j] = 0; }
@@ -81,6 +81,9 @@ AliAnalysisTaskSEPHOSpPbPi0::AliAnalysisTaskSEPHOSpPbPi0(const char *name):
     fPHOSBadMap[i] = new TH2I(Form("PHOS_BadMap_mod%d", i), Form("PHOS_BadMap_mod%d", i), 64, 0., 64., 56, 0., 56.);
 
   DefineOutput(1, TList::Class());
+  DefineOutput(2, TList::Class());
+  DefineOutput(3, TList::Class());
+  DefineOutput(4, TList::Class());
 }
 
 //_____________________________________________________________________________
@@ -89,9 +92,12 @@ AliAnalysisTaskSEPHOSpPbPi0::~AliAnalysisTaskSEPHOSpPbPi0()
   //
   // Default destructor
   //
-  if (fList)        { delete fList;        fList      = NULL; }
-  if (fHeader)      { delete fHeader;      fHeader    = NULL; }
-  if (fCaloClArr)   { delete fCaloClArr;   fCaloClArr = NULL; }
+  if (fListEvent)   { delete fListEvent;   fListEvent  = NULL; }
+  if (fListCaloCl)  { delete fListCaloCl;  fListCaloCl = NULL; }
+  if (fListPi0)     { delete fListPi0;     fListPi0    = NULL; }
+  if (fListMC)      { delete fListMC;      fListMC     = NULL; }
+  if (fHeader)      { delete fHeader;      fHeader     = NULL; }
+  if (fCaloClArr)   { delete fCaloClArr;   fCaloClArr  = NULL; }
 }
 
 //________________________________________________________________________
@@ -102,16 +108,23 @@ void AliAnalysisTaskSEPHOSpPbPi0::UserCreateOutputObjects()
 //fPHOSGeo = new AliPHOSGeoUtils("PHOSGeo");
 //fPHOSGeo =  AliPHOSGeometry::GetInstance("IHEP");
 
-  if (!fHeader)    fHeader    = new AliPHOSpPbPi0Header();
-  if (!fCaloClArr) fCaloClArr = new TClonesArray("AliCaloClusterInfo", 0);
-  if (!fList)      fList      = new TList();
+  if (!fHeader)     fHeader     = new AliPHOSpPbPi0Header();
+  if (!fCaloClArr)  fCaloClArr  = new TClonesArray("AliCaloClusterInfo", 0);
+  if (!fListEvent)  fListEvent  = new TList();
+  if (!fListCaloCl) fListCaloCl = new TList();
+  if (!fListPi0)    fListPi0    = new TList();
+  if (!fListMC)     fListMC     = new TList();
 
   fHeader->SetIsMC(fIsMC);
-  fHeader->SetNCent(fCentralityBin.GetSize());
-  fHeader->CreateHistograms(fList);
+  fHeader->SetNCent(fCentralityBin.GetSize()-1);
+  fHeader->CreateHistograms(fListEvent, fListCaloCl, fListPi0, fListMC);
 
   // Post output data.
-  PostData(1, fList);
+  PostData(1, fListEvent);
+  PostData(2, fListCaloCl);
+  PostData(3, fListPi0);
+  PostData(4, fListMC);
+
   return;
 }
 
@@ -128,7 +141,6 @@ void AliAnalysisTaskSEPHOSpPbPi0::UserExec(Option_t *)
     } else { AliError("MC event not found. Nothing done!"); return; }
   }
 
-  Int_t       nclsts = 0;
   AliAODEvent *aod   = 0;
   AliESDEvent *esd   = 0;
 
@@ -136,19 +148,17 @@ void AliAnalysisTaskSEPHOSpPbPi0::UserExec(Option_t *)
     aod = dynamic_cast<AliAODEvent*>(fInputEvent);
     if (!aod) { AliError("AOD event not found. Nothing done!");   return; }
     if (!fIsMC && (aod->GetHeader()->GetEventType()!=7))          return; // check event type; should be PHYSICS = 7 for data and 0 for MC
-    if (!fHeader->IspAVertexOK(aod))                              return; // check p-A collision vertex
-    nclsts = aod->GetNumberOfCaloClusters();   if (nclsts<1)      return;
   } else {
     esd = dynamic_cast<AliESDEvent*>(fInputEvent);
     if (!esd) { AliError("ESD event not found. Nothing done!");   return; }
     if (!fIsMC && (esd->GetHeader()->GetEventType()!=7))          return; // check event type; should be PHYSICS = 7 for data and 0 for MC
-    if (!fHeader->IspAVertexOK(esd))                              return; // check p-A collision vertex
-    nclsts = esd->GetNumberOfCaloClusters();   if (nclsts<1)      return;
   }
 
   // Fill Event info
   fHeader->SetEventInfo(fInputHandler);
-  fHeader->FillHistosEvnH(fList);
+  fHeader->FillHistosEvent(fListEvent);
+
+  if (!fHeader->IsSelected()) return; // event selection
 
   // PHOS Geometry and Misalignment initialization at the first time it runs
   if(fRunNumber != fInputEvent->GetRunNumber()) {
@@ -157,54 +167,55 @@ void AliAnalysisTaskSEPHOSpPbPi0::UserExec(Option_t *)
   }
 
   // Fill PHOS cells QA histograms
-  fHeader->FillHistosCaloCellsQA(fList, fInputEvent->GetPHOSCells(), fPHOSGeo);
-//aod = 0;
+  fHeader->FillHistosCaloCellsQA(fListCaloCl, fInputEvent->GetPHOSCells(), fPHOSGeo);
+  aod = 0;
 
   // Fill PHOS cluster Clones Array
-  FillCaloClusterInfo(nclsts, esd);
+  FillCaloClusterInfo(esd);
 
   if (!fCaloClArr->GetEntriesFast()) return;
-  Int_t zvtx = (Int_t)((fHeader->Vz() + 10.)/2.);    if (zvtx<0) zvtx = 0; if (zvtx>9) zvtx = 9;
-  Int_t cent = TMath::BinarySearch<Double_t>(fCentralityBin.GetSize()-1, fCentralityBin.GetArray(), fHeader->Centrality());
+
+  // vertex bining and centrality bining
+  Int_t zvtx = (Int_t)((fHeader->Vz() + 10.)/2.);   if (zvtx<0) zvtx = 0;   if (zvtx>9) zvtx = 9;
+  Int_t cent = TMath::BinarySearch<Float_t>(fCentralityBin.GetSize()-1, fCentralityBin.GetArray(), fHeader->Centrality());
   if (!fEventList[zvtx][cent]) fEventList[zvtx][cent] = new TList(); 
   TList *eventList = fEventList[zvtx][cent];
 
   // Fill cluster histograms
-  fHeader->FillHistosCaloCluster(fList, fCaloClArr, cent);
+  fHeader->FillHistosCaloCluster(fListCaloCl, fCaloClArr, cent);
 
   // Fill pi0 histograms
-  fHeader->FillHistosPi0(fList, fCaloClArr, cent);
+  fHeader->FillHistosPi0(fListPi0, fCaloClArr, cent);
 
   // Fill mixed pi0 histograms
-  fHeader->FillHistosMixPi0(fList, fCaloClArr, eventList, cent);
+  fHeader->FillHistosMixPi0(fListPi0, fCaloClArr, eventList, cent);
 
   // Fill MC info
-  AliStack *stack = 0;
+  AliStack *stack = 0x0;
   if (fIsMC) {
     if (esd) {
-      if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()){
-      if(static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent())
+      if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()) {
+      if (static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent())
         stack = static_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())->MCEvent()->Stack();
       }
-      fHeader->FillHistosMC(fList, stack, fPHOSGeo, cent);
+      fHeader->FillHistosMC(fListMC, stack, fPHOSGeo, cent);
     } else
-      fHeader->FillHistosMC(fList, MCEvent(), fPHOSGeo, cent);
+      fHeader->FillHistosMC(fListMC, MCEvent(), fPHOSGeo, cent);
   }
-//esd = 0;
+  esd = 0;
 
   // Fill event list for mixing
-  if(fCaloClArr->GetEntriesFast()>0) {
+  if (fCaloClArr->GetEntriesFast()>0) {
     eventList->AddFirst(fCaloClArr);   fCaloClArr = 0;
-    //fCaloClArr->Clear();
-    if(eventList->GetSize()>fBufferSize[cent]) { // Remove redundant events
-      TClonesArray * tmp = static_cast<TClonesArray*>(eventList->Last()) ;
+    if (eventList->GetSize()>fBufferSize[cent]) { // Remove redundant events
+      TClonesArray *tmp = static_cast<TClonesArray*>(eventList->Last());
       eventList->RemoveLast();
-      delete tmp ;
+      delete tmp;
     }
   }
 
   return;
-}      
+}
 
 //________________________________________________________________________
 void AliAnalysisTaskSEPHOSpPbPi0::Terminate(Option_t *) 
@@ -241,18 +252,19 @@ void AliAnalysisTaskSEPHOSpPbPi0::PHOSInitialize(AliESDEvent* const esd)
 }
 
 //________________________________________________________________________
-void AliAnalysisTaskSEPHOSpPbPi0::FillCaloClusterInfo(Int_t nclsts, AliESDEvent* const esd)
+void AliAnalysisTaskSEPHOSpPbPi0::FillCaloClusterInfo(AliESDEvent* const esd)
 {
   // Fill calo cluster info
   if (fCaloClArr) fCaloClArr->Clear();
   else fCaloClArr = new TClonesArray("AliCaloClusterInfo", 0);
 
-  TClonesArray       &caloRef     = *fCaloClArr;
-  Int_t              countN       = 0;
-  Int_t              relId[4]     = {0,0,0,0}; // module = relId[0]; cellX = relId[2]; cellZ = relId[3];
-  Float_t            position[3]  = {0,0,0};
-  Double_t           vtx[3]       = {0,0,0}; fHeader->GetXYZ(vtx);
-  TLorentzVector     momentum;
+  Int_t    nclsts       = fInputEvent->GetNumberOfCaloClusters();
+  Int_t    countN       = 0;
+  Int_t    relId[4]     = {0,0,0,0}; // module = relId[0]; cellX = relId[2]; cellZ = relId[3];
+  Float_t  position[3]  = {0,0,0};
+  Double_t vtx[3]       = {0,0,0};   fHeader->GetXYZ(vtx);
+  TClonesArray &caloRef = *fCaloClArr;
+  TLorentzVector momentum;
   AliVCluster        *clust       = 0;
   AliCaloClusterInfo *caloCluster = 0;
   for (Int_t iclst=0; iclst<nclsts; iclst++) {  // loop over all clusters
@@ -266,8 +278,8 @@ void AliAnalysisTaskSEPHOSpPbPi0::FillCaloClusterInfo(Int_t nclsts, AliESDEvent*
     if (relId[0] == 2)                                                    { clust=0; continue; } // !remove module 2
 
     caloCluster = new AliCaloClusterInfo(clust, esd, fPHOSGeo, vtx);
-//  if (esd && !(caloCluster->LorentzVector().E()>fgMinClusterEnergy)) { delete caloCluster; caloCluster=0; clust=0; continue; } // check again for ESD
-    if (caloCluster->TestCPV(fHeader->MagneticField())) caloCluster->SetPIDBit(BIT(0));          // set CPV bit
+    if (esd && !(caloCluster->LorentzVector().E()>fgMinClusterEnergy)) { delete caloCluster; caloCluster=0; clust=0; continue; } // check again for ESD
+    if (caloCluster->GetTrackPt()==-1. || caloCluster->TestCPV(fHeader->MagneticField()))    caloCluster->SetPIDBit(BIT(0));     // set CPV bit
 
     clust = 0;
 
index 68f5367..036cd11 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef ALIANALYSISTASKSEPHOSPPBPI0_cxx\r
-#define ALIANALYSISTAKSSEPHOSPPBPI0_cxx\r
+#ifndef ALIANALYSISTASKSEPHOSPPBPI0_H\r
+#define ALIANALYSISTAKSSEPHOSPPBPI0_H\r
 \r
 /* Copyright(c) 1998-2006, ALICE Experiment at CERN, All rights reserved. *\r
  * See cxx source for full Copyright notice                               */\r
@@ -27,7 +27,7 @@ class AliAnalysisTaskSEPHOSpPbPi0 : public AliAnalysisTaskSE {
 \r
   AliAnalysisTaskSEPHOSpPbPi0();\r
   AliAnalysisTaskSEPHOSpPbPi0(const char *name);\r
-  virtual ~AliAnalysisTaskSEPHOSpPbPi0(); \r
+  virtual ~AliAnalysisTaskSEPHOSpPbPi0();\r
   \r
   virtual void UserCreateOutputObjects();\r
   virtual void UserExec(Option_t *option);\r
@@ -40,8 +40,8 @@ class AliAnalysisTaskSEPHOSpPbPi0 : public AliAnalysisTaskSE {
     printf("Set %s \n",fPHOSBadMap[mod]->GetName());\r
   }\r
 \r
-  void SetUseMC(Bool_t isMC)                                  { fIsMC          = isMC;                         }\r
-  void SetXBins(const TArrayD& tCent, const TArrayI& tBuffer) { fCentralityBin = tCent; fBufferSize = tBuffer; }\r
+  void SetUseMC(Bool_t isMC=kFALSE)                           { fIsMC          = isMC;                         }\r
+  void SetXBins(const TArrayF& tCent, const TArrayI& tBuffer) { fCentralityBin = tCent; fBufferSize = tBuffer; }\r
   void SetLogWeight(Float_t logWeight)                  const { AliCaloClusterInfo::SetLogWeight(logWeight);   }\r
 \r
   static void SetMinNCells(Int_t ncells=2)                    { fgMinNCells                         = ncells;  }\r
@@ -55,7 +55,7 @@ class AliAnalysisTaskSEPHOSpPbPi0 : public AliAnalysisTaskSE {
   AliAnalysisTaskSEPHOSpPbPi0& operator=(const AliAnalysisTaskSEPHOSpPbPi0&); // not implemented\r
 \r
   void PHOSInitialize(AliESDEvent* const esd);\r
-  void FillCaloClusterInfo(Int_t nclsts, AliESDEvent* const esd);\r
+  void FillCaloClusterInfo(AliESDEvent* const esd);\r
 \r
   Bool_t IsGoodCaloCluster(Int_t iMod, Int_t cellX, Int_t cellZ);\r
 \r
@@ -65,17 +65,20 @@ class AliAnalysisTaskSEPHOSpPbPi0 : public AliAnalysisTaskSE {
   static Double_t fgMinDistToBad;\r
 \r
   Bool_t               fIsMC;               // flag of whether the input is MC\r
-  TArrayD              fCentralityBin;      // Centrality bin\r
+  TArrayF              fCentralityBin;      // Centrality bin\r
   TArrayI              fBufferSize;         // Buffer size for event mixing\r
 \r
   Int_t                fRunNumber;          // Run Number\r
-  TH2I                *fPHOSBadMap[5];      // Container for PHOS bad channels map\r
+  TH2I                *fPHOSBadMap[5];      // Container of PHOS bad channels map\r
   AliPHOSGeoUtils     *fPHOSGeo;            // PHOS geometry\r
 \r
   TList               *fEventList[10][10];  // Event list for mixing\r
-  TList               *fList;               // output list of histograms\r
-  AliPHOSpPbPi0Header *fHeader;             // output for info at ev level\r
-  TClonesArray        *fCaloClArr;          // output clones array for Calo clusters\r
+  TList               *fListEvent;          // output list of Event\r
+  TList               *fListCaloCl;         // output list of Calo Cluster histograms\r
+  TList               *fListPi0;            // output list of Pi0 histograms\r
+  TList               *fListMC;             // output list of MC histograms\r
+  AliPHOSpPbPi0Header *fHeader;             // output for info at event level\r
+  TClonesArray        *fCaloClArr;          // Container of Calo clusters Info\r
    \r
   ClassDef(AliAnalysisTaskSEPHOSpPbPi0, 1);\r
 };\r
index 6c30f16..24276df 100644 (file)
@@ -56,7 +56,7 @@ Double_t NonLinear(Double_t *x, Double_t * /*par*/)
 
 //-------------------------------------------------------------------------------------------
 AliCaloClusterInfo::AliCaloClusterInfo():
-  TObject(), fLorentzVector(), fModule(0), fNCells(0), fTRUNumber(0), fNTracksMatched(0), fTrackCharge(0), fPIDBit(0),
+  TObject(), fLorentzVector(), fModule(0), fNCells(0), fTRUNumber(0), fNTracksMatched(0), fTrackCharge(0), fPIDBit(0x0),
   fDistToBad(0.), fEmcCpvDistance(0.), fM02(0.), fM20(0.), fTOF(0.), fTrackDz(0.), fTrackDx(0.), fTrackPt(0.)
 {
   //
@@ -66,7 +66,7 @@ AliCaloClusterInfo::AliCaloClusterInfo():
 
 //-------------------------------------------------------------------------------------------
 AliCaloClusterInfo::AliCaloClusterInfo(AliVCluster* const clust, AliESDEvent* const esd, AliPHOSGeoUtils* const phosGeo, Double_t vtx[3]):
-  TObject(), fLorentzVector(), fModule(0), fNCells(0), fTRUNumber(0), fNTracksMatched(0), fTrackCharge(0), fPIDBit(0),
+  TObject(), fLorentzVector(), fModule(0), fNCells(0), fTRUNumber(0), fNTracksMatched(0), fTrackCharge(0), fPIDBit(0x0),
   fDistToBad(0.), fEmcCpvDistance(0.), fM02(0.), fM20(0.), fTOF(0.), fTrackDz(0.), fTrackDx(0.), fTrackPt(0.)
 {
   //
@@ -136,10 +136,9 @@ void AliCaloClusterInfo::FillCaloClusterInfo(AliVCluster* const clust, AliESDEve
   fModule         = relId[0];
   fTRUNumber      = GetTRUNumber(relId[2], relId[3]);
 
-  AliPHOSCalibData *calibData = 0x0;
-  calibData = new AliPHOSCalibData();
   if (esd) { // TODO recalibration for ESD
     TVector3 vtxVector(vtx);
+    AliPHOSCalibData *calibData = new AliPHOSCalibData();
     TF1 *nonLinCorr = new TF1("Non-linear", NonLinear, 0., 40., 0);
 
     AliPHOSEsdCluster phosClust( *(AliESDCaloCluster*) (clust) );
@@ -165,21 +164,25 @@ void AliCaloClusterInfo::FillCaloClusterInfo(AliVCluster* const clust, AliESDEve
     if (fModule==3) fLorentzVector *= 135.5/137.2;
 
     Int_t iESDtrack = clust->GetTrackMatchedIndex();
-    if (iESDtrack>-1) trkESD = esd->GetTrack(iESDtrack);
-    if (!trkESD) { fTrackPt = 0.; fTrackCharge = 0; }
-    else {
-      fTrackPt     = trkESD->Pt();
-      fTrackCharge = trkESD->Charge();
+    if (iESDtrack>-1) { 
+      trkESD = esd->GetTrack(iESDtrack);
+      if (trkESD) {
+        fTrackPt     = trkESD->Pt();
+        fTrackCharge = trkESD->Charge();
+      }
     }
+    else { fTrackPt = -1.; fTrackCharge = 0; }
   }else {
     clust->GetMomentum(fLorentzVector, vtx);
 
-    trkAOD = dynamic_cast <AliAODTrack*> (clust->GetTrackMatched(0));
-    if (!trkAOD) { fTrackPt = 0.; fTrackCharge = 0; }
-    else {
-      fTrackPt     = trkAOD->Pt();
-      fTrackCharge = trkAOD->Charge();
+    if (clust->GetNTracksMatched()>0) {
+      trkAOD = dynamic_cast <AliAODTrack*> (clust->GetTrackMatched(0));
+      if (trkAOD) {
+        fTrackPt     = trkAOD->Pt();
+        fTrackCharge = trkAOD->Charge();
+      }
     }
+    else { fTrackPt = -1.; fTrackCharge = 0; }
   }
 
   fNCells         = clust->GetNCells();
@@ -192,7 +195,7 @@ void AliCaloClusterInfo::FillCaloClusterInfo(AliVCluster* const clust, AliESDEve
   fTrackDz        = clust->GetTrackDz();
   fTrackDx        = clust->GetTrackDx();
   if (TestDisp())                             fPIDBit |= BIT(1); // Disp
-  if (IsInFiducialRegion(/*relId[2], relId[3])*/)) fPIDBit |= BIT(2); // Fiducial
+  if (IsInFiducialRegion(relId[2], relId[3])) fPIDBit |= BIT(2); // Fiducial
 
   return;
 }
@@ -303,42 +306,36 @@ Bool_t AliCaloClusterInfo::TestDisp()
 }
 
 //-----------------------------------------------------------------------------
-Bool_t AliCaloClusterInfo::IsInFiducialRegion(/*Int_t cellX, Int_t cellZ*/)
+Bool_t AliCaloClusterInfo::IsInFiducialRegion(Int_t cellX, Int_t cellZ)
 {
-/*const Int_t edgeX = 2;
-  const Int_t edgeZ = 8;
-  if (cellX >edgeX && cellX<(65-edgeX) && cellZ>edgeZ && cellZ <(57-edgeZ)) return kTRUE; // remove 2 cells in x direction and 8 cells in z direction
-  return kFALSE;*/
+  const Int_t edgeX = 2;
+  const Int_t edgeZ = 2;
+  if (cellX >edgeX && cellX<(65-edgeX) && cellZ>edgeZ && cellZ <(57-edgeZ)) return kTRUE;
+  return kFALSE;
 
-  Double_t eta = TMath::Abs(fLorentzVector.Eta());                                // abs eta
+//Double_t eta = TMath::Abs(fLorentzVector.Eta());                                // abs eta
 //Double_t phi = (fLorentzVector.Phi())*TMath::RadToDeg(); if (phi<0.) phi+=360.; // phi in degree
 
-  return (Bool_t)(eta<0.13 /*&& ((phi>260.25 && phi<279.75) || (phi>300.25 && phi<319.75))*/);
+//return (Bool_t)(eta<0.13 /*&& ((phi>260.25 && phi<279.75) || (phi>300.25 && phi<319.75))*/);
 }
 
 //-----------------------------------------------------------------------------
 Bool_t AliCaloClusterInfo::AreNeighbors(Int_t id1, Int_t id2, AliPHOSGeoUtils* const phosGeo)
 {
   // return true if absId are "Neighbors" (adjacent, including diagornaly,)
-  // false if not.
-
-  Int_t relid1[4] ;
-  phosGeo->AbsToRelNumbering(id1, relid1) ;
 
-  Int_t relid2[4] ;
-  phosGeo->AbsToRelNumbering(id2, relid2) ;
+  Int_t relid1[4];   phosGeo->AbsToRelNumbering(id1, relid1);
+  Int_t relid2[4];   phosGeo->AbsToRelNumbering(id2, relid2);
 
   // if inside the same PHOS module
-  if ( (relid1[0] == relid2[0]) && (relid1[1]==relid2[1]) ) {
-    const Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
-    const Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
+  if ((relid1[0] == relid2[0]) && (relid1[1]==relid2[1])) {
+    const Int_t rowdiff = TMath::Abs(relid1[2]-relid2[2]);
+    const Int_t coldiff = TMath::Abs(relid1[3]-relid2[3]);
 
     // and if diff in both direction is 1 or less
-    if (( coldiff <= 1 )  && ( rowdiff <= 1 ))
-      return kTRUE; // are neighbors
+    if ((coldiff<2)  && (rowdiff<2)) return kTRUE; // are neighbors
   }
 
-  // else false
   return kFALSE;
 }
 
index 0b9c067..dd646ba 100644 (file)
@@ -21,7 +21,7 @@ class AliPHOSGeoUtils;
 
 class AliCaloClusterInfo : public TObject{
  public:
-  
   AliCaloClusterInfo();
   AliCaloClusterInfo(AliVCluster* const clust, AliESDEvent* const esd, AliPHOSGeoUtils* const phosGeo, Double_t vtx[3]);
   AliCaloClusterInfo(const AliCaloClusterInfo &src);
@@ -58,7 +58,7 @@ class AliCaloClusterInfo : public TObject{
 
   Bool_t TestDisp();
   Bool_t AreNeighbors(Int_t id1,Int_t id2, AliPHOSGeoUtils* const phosGeo);
-  Bool_t IsInFiducialRegion(/*Int_t cellX, Int_t cellZ*/);
+  Bool_t IsInFiducialRegion(Int_t cellX, Int_t cellZ);
   Int_t  GetTRUNumber(Int_t cellX, Int_t cellZ);
 
   static Float_t fgLogWeight; 
index 8742acb..d7674f2 100644 (file)
@@ -57,6 +57,7 @@ TNamed(),
 fFiredTriggerClass(),
 fSelMask(0),
 fVtxContrsN(0),
+fIspAVertexOK(kFALSE),
 fIsPileupSPD(kFALSE),
 fCentrality(0.),
 fMagneticField(0.)
@@ -73,6 +74,7 @@ TNamed(),
 fFiredTriggerClass(src.fFiredTriggerClass),
 fSelMask(src.fSelMask),
 fVtxContrsN(src.fVtxContrsN),
+fIspAVertexOK(src.fIspAVertexOK),
 fIsPileupSPD(src.fIsPileupSPD),
 fCentrality(src.fCentrality),
 fMagneticField(src.fMagneticField)
@@ -95,6 +97,7 @@ AliPHOSpPbPi0Header& AliPHOSpPbPi0Header::operator=(const AliPHOSpPbPi0Header &s
   fFiredTriggerClass            = src.fFiredTriggerClass;
   fSelMask                      = src.fSelMask;
   fVtxContrsN                   = src.fVtxContrsN;
+  fIspAVertexOK                 = src.fIspAVertexOK;
   fIsPileupSPD                  = src.fIsPileupSPD;
   fCentrality                   = src.fCentrality;
   fMagneticField                = src.fMagneticField;
@@ -120,17 +123,14 @@ void AliPHOSpPbPi0Header::SetEventInfo(AliInputEventHandler* const handler)
   AliAODEvent *aod = dynamic_cast<AliAODEvent*>(event);
   AliESDEvent *esd = dynamic_cast<AliESDEvent*>(event);
 
-  if (aod) fFiredTriggerClass = aod->GetFiredTriggerClasses();
-  if (esd) fFiredTriggerClass = esd->GetFiredTriggerClasses();
+  if (aod) { fFiredTriggerClass = aod->GetFiredTriggerClasses(); fIspAVertexOK = IspAVertexOK(aod); }
+  if (esd) { fFiredTriggerClass = esd->GetFiredTriggerClasses(); fIspAVertexOK = IspAVertexOK(esd); }
   fSelMask = handler->IsEventSelected();
   
-  const AliVVertex *vertex = event->GetPrimaryVertex(); vertex->GetXYZ(fVtx);
-  fVtxContrsN  = vertex->GetNContributors();
   fIsPileupSPD = (aod && !aod->GetTracklets()) ? event->IsPileupFromSPD(3,0.8,3.,2.,5.) : event->IsPileupFromSPDInMultBins(); //TODO not sure!!!
-//fIsPileupSPD = event->IsPileupFromSPD(3,0.8,3.,2.,5.);
-  
+
   AliCentrality *cent = event->GetCentrality();
-  if (cent) fCentrality = cent->GetCentralityPercentileUnchecked("V0M");
+  if (cent) fCentrality = cent->GetCentralityPercentile("V0M");
 
   fMagneticField = event->GetMagneticField();
 
@@ -139,18 +139,28 @@ void AliPHOSpPbPi0Header::SetEventInfo(AliInputEventHandler* const handler)
 }
 
 //_____________________________________________________________________________
+Bool_t AliPHOSpPbPi0Header::IsSelected()
+{
+  // select event according to the event selection cuts
+  if (!fIspAVertexOK)                      return kFALSE;
+  if (!(TMath::Abs(fVtx[2])<10.))          return kFALSE;
+  if (fCentrality<0. || fCentrality>100.)  return kFALSE;
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
 Bool_t AliPHOSpPbPi0Header::IspAVertexOK(AliAODEvent* const event)
 {
   // check p-A collection vertex
-  const AliAODVertex* trkVtx = event->GetPrimaryVertex();   Double_t zvtx = trkVtx->GetZ();
-  if (!trkVtx || trkVtx->GetNContributors()<1)                                            return kFALSE;
+  const AliAODVertex* trkVtx = event->GetPrimaryVertex();   trkVtx->GetXYZ(fVtx);   fVtxContrsN  = trkVtx->GetNContributors();
+  if (!trkVtx || fVtxContrsN<1)                                                           return kFALSE;
   if (!((TString)trkVtx->GetTitle()).Contains("VertexerTracks"))                          return kFALSE;
   const AliAODVertex* spdVtx = event->GetPrimaryVertexSPD();
   if (spdVtx->GetNContributors()<1)                                                       return kFALSE;
   Double_t cov[6]={0}; spdVtx->GetCovarianceMatrix(cov);
   if (((TString)spdVtx->GetTitle()).Contains("vertexer:Z") && (TMath::Sqrt(cov[5])>0.25)) return kFALSE; // Double_t zRes = TMath::Sqrt(cov[5]);
-  if (TMath::Abs(spdVtx->GetZ() - zvtx)>0.5)                                              return kFALSE;
-  if (TMath::Abs(zvtx>10.))                                                               return kFALSE;
+  if (TMath::Abs(spdVtx->GetZ() - fVtx[2])>0.5)                                           return kFALSE;
 
   return kTRUE;
 }
@@ -159,36 +169,35 @@ Bool_t AliPHOSpPbPi0Header::IspAVertexOK(AliAODEvent* const event)
 Bool_t AliPHOSpPbPi0Header::IspAVertexOK(AliESDEvent* const event)
 {
   // check p-A collection vertex
-  const AliESDVertex* trkVtx = event->GetPrimaryVertex();   Double_t zvtx = trkVtx->GetZ();
-  if (!trkVtx || trkVtx->GetNContributors()<1)                                            return kFALSE;
+  const AliESDVertex* trkVtx = event->GetPrimaryVertex();   trkVtx->GetXYZ(fVtx);   fVtxContrsN  = trkVtx->GetNContributors();
+  if (!trkVtx || fVtxContrsN<1)                                                           return kFALSE;
   if (!((TString)trkVtx->GetTitle()).Contains("VertexerTracks"))                          return kFALSE;
   const AliESDVertex* spdVtx = event->GetPrimaryVertexSPD();
   if (spdVtx->GetNContributors()<1)                                                       return kFALSE;
   Double_t cov[6]={0}; spdVtx->GetCovarianceMatrix(cov);
   if (((TString)spdVtx->GetTitle()).Contains("vertexer:Z") && (TMath::Sqrt(cov[5])>0.25)) return kFALSE; // Double_t zRes = TMath::Sqrt(cov[5]);
-  if (TMath::Abs(spdVtx->GetZ() - zvtx)>0.5)                                              return kFALSE;
-  if (TMath::Abs(zvtx>10.))                                                               return kFALSE;
+  if (TMath::Abs(spdVtx->GetZ() - fVtx[2])>0.5)                                           return kFALSE;
 
   return kTRUE;
 }
 
 //_____________________________________________________________________________
-void AliPHOSpPbPi0Header::CreateHistograms(TList *list)
+void AliPHOSpPbPi0Header::CreateHistograms(TList *listEvent, TList *listCaloCl, TList *listPi0, TList *listMC)
 {
-  // create output histos of partcorr analysis according to the MC flag
+  // create output histos of pi0 analysis according to the MC flag
 
-  this->CreateHistosEvnH(list);
-  this->CreateHistosCaloCellsQA(list);
-  this->CreateHistosCaloCluster(list);
-  this->CreateHistosPi0(list);
-  this->CreateHistosMixPi0(list);
-  if (fgIsMC) this->CreateHistosMC(list);
+  this->CreateHistosEvent(listEvent);
+  this->CreateHistosCaloCellsQA(listCaloCl);
+  this->CreateHistosCaloCluster(listCaloCl);
+  this->CreateHistosPi0(listPi0);
+  this->CreateHistosMixPi0(listPi0);
+  if (fgIsMC) this->CreateHistosMC(listMC);
 
   return;
 }
 
 //_____________________________________________________________________________
-void AliPHOSpPbPi0Header::CreateHistosEvnH(TList *list)
+void AliPHOSpPbPi0Header::CreateHistosEvent(TList *list)
 {
   // create histograms at event level
 
@@ -199,14 +208,19 @@ void AliPHOSpPbPi0Header::CreateHistosEvnH(TList *list)
 
   const Int_t nhs    = 4;
   TString tName[nhs] = { "VtxNcontr", "Centrality", "Vz", "Pileup" };
-  Int_t   nbins[nhs] = {       202  ,         100 , 200 ,     200  };
-  Double_t xlow[nhs] = {        -2.5,           0., -10.,     -10. };
-  Double_t  xup[nhs] = {       199.5,         100.,  10.,      10. };
+  Int_t   nbins[nhs] = {       202  ,         200 , 500 ,     500  };
+  Double_t xlow[nhs] = {        -2.5,        -100., -25.,     -25. };
+  Double_t  xup[nhs] = {       199.5,         100.,  25.,      25. };
 
-  TH1D *histo = 0;
+  TString hName;
+  TH1D   *histo = 0;
   for (Int_t i=0; i<nhs; i++) {
-    char *hName = Form("hEvnH_%s", tName[i].Data());
-    histo = new TH1D(hName, hName, nbins[i], xlow[i], xup[i]);
+    hName = Form("hEvent_%s", tName[i].Data());
+    histo = new TH1D(hName.Data(), hName.Data(), nbins[i], xlow[i], xup[i]);
+    histo->Sumw2(); list->Add(histo); histo = 0;
+
+    hName = Form("hEventSel_%s", tName[i].Data());
+    histo = new TH1D(hName.Data(), hName.Data(), nbins[i], xlow[i], xup[i]);
     histo->Sumw2(); list->Add(histo); histo = 0;
   }
   TH1::AddDirectory(oldStatus);
@@ -298,32 +312,24 @@ void AliPHOSpPbPi0Header::CreateHistosCaloCluster(TList *list)
   hncells = new TH1I(hName.Data(), hName.Data(), bins[kNClustersClu], (Int_t)xMin[kNClustersClu], (Int_t)xMax[kNClustersClu]);
   hncells->Sumw2(); list->Add(hncells); hncells = 0;
 
-  for (Int_t icent=0; icent<fgNCent; icent++) {
-    hName  = Form("hCaloCluster_%s_cent%d", tName[kPtClu].Data(), icent);
-    histo1 = new TH1D(hName.Data(), hName.Data(), bins[kPtClu], xMin[kPtClu], xMax[kPtClu]);
-    histo1->Sumw2(); list->Add(histo1); histo1 = 0;
-  }
-
   for (Int_t iPID=0; iPID<kPIDs; iPID++) {
     hName  = Form("hCaloCluster_%s_%s", tName[kPtClu].Data(), namePID[iPID].Data());
     histo1 = new TH1D(hName.Data(), hName.Data(), bins[kPtClu], xMin[kPtClu], xMax[kPtClu]);
     histo1->Sumw2(); list->Add(histo1); histo1 = 0;
 
-    if (iPID>kFiducial) {
-      for (Int_t icent=0; icent<fgNCent; icent++) {
-        hName  = Form("hCaloCluster_%s_%s_cent%d", tName[kPtClu].Data(), namePID[iPID].Data(), icent);
-        histo1 = new TH1D(hName.Data(), hName.Data(), bins[kPtClu], xMin[kPtClu], xMax[kPtClu]);
-        histo1->Sumw2(); list->Add(histo1); histo1 = 0;
-      }
+    for (Int_t icent=0; icent<fgNCent; icent++) {
+      hName  = Form("hCaloCluster_%s_%s_cent%d", tName[kPtClu].Data(), namePID[iPID].Data(), icent);
+      histo1 = new TH1D(hName.Data(), hName.Data(), bins[kPtClu], xMin[kPtClu], xMax[kPtClu]);
+      histo1->Sumw2(); list->Add(histo1); histo1 = 0;
+    }
 
-      hName = Form("hCaloCluster_%s%s_%s", tName[kEtaClu].Data(), tName[kPhiClu].Data(), namePID[iPID].Data());
-      histo2 = new TH2D(hName.Data(), hName.Data(), bins[kEtaClu], xMin[kEtaClu], xMax[kEtaClu], bins[kPhiClu], xMin[kPhiClu], xMax[kPhiClu]);
+    hName = Form("hCaloCluster_%s%s_%s", tName[kEtaClu].Data(), tName[kPhiClu].Data(), namePID[iPID].Data());
+    histo2 = new TH2D(hName.Data(), hName.Data(), bins[kEtaClu], xMin[kEtaClu], xMax[kEtaClu], bins[kPhiClu], xMin[kPhiClu], xMax[kPhiClu]);
+    histo2->Sumw2(); list->Add(histo2); histo2 = 0;
+    for (Int_t i=0; i<kVarsClu-3; i++) {
+      hName = Form("hCaloCluster_%s%s_%s", tName[0].Data(), tName[i+1].Data(), namePID[iPID].Data());
+      histo2 = new TH2D(hName.Data(), hName.Data(), bins[0], xMin[0], xMax[0], bins[i+1], xMin[i+1], xMax[i+1]);
       histo2->Sumw2(); list->Add(histo2); histo2 = 0;
-      for (Int_t i=0; i<kVarsClu-3; i++) {
-        hName = Form("hCaloCluster_%s%s_%s", tName[0].Data(), tName[i+1].Data(), namePID[iPID].Data());
-        histo2 = new TH2D(hName.Data(), hName.Data(), bins[0], xMin[0], xMax[0], bins[i+1], xMin[i+1], xMax[i+1]);
-        histo2->Sumw2(); list->Add(histo2); histo2 = 0;
-      }
     }
   }
 
@@ -399,21 +405,20 @@ void AliPHOSpPbPi0Header::CreateHistosPi0(TList *list)
     hName  = Form("hPi0_%s%s_%s", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), namePID[iPID].Data());
     histo = new TH2D(hName.Data(), hName.Data(), bins[kPtPi0], xMin[kPtPi0], xMax[kPtPi0], bins[kInvMassPi0], xMin[kInvMassPi0], xMax[kInvMassPi0]);
     histo->Sumw2(); list->Add(histo); histo = 0;
-    if (iPID>kFiducial) {
-      hName  = Form("hPi0_%s%s_%s", tName[kEtaPi0].Data(), tName[kPhiPi0].Data(), namePID[iPID].Data());
-      histo = new TH2D(hName.Data(), hName.Data(), bins[kEtaPi0], xMin[kEtaPi0], xMax[kEtaPi0], bins[kPhiPi0], xMin[kPhiPi0], xMax[kPhiPi0]);
+
+    hName  = Form("hPi0_%s%s_%s", tName[kEtaPi0].Data(), tName[kPhiPi0].Data(), namePID[iPID].Data());
+    histo = new TH2D(hName.Data(), hName.Data(), bins[kEtaPi0], xMin[kEtaPi0], xMax[kEtaPi0], bins[kPhiPi0], xMin[kPhiPi0], xMax[kPhiPi0]);
+    histo->Sumw2(); list->Add(histo); histo = 0;
+    for (Int_t icent=0; icent<fgNCent; icent++) {
+      hName  = Form("hPi0_%s%s_%s_cent%d", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), namePID[iPID].Data(), icent);
+      histo = new TH2D(hName.Data(), hName.Data(), bins[kPtPi0], xMin[kPtPi0], xMax[kPtPi0], bins[kInvMassPi0], xMin[kInvMassPi0], xMax[kInvMassPi0]);
       histo->Sumw2(); list->Add(histo); histo = 0;
-      for (Int_t icent=0; icent<fgNCent; icent++) {
-        hName  = Form("hPi0_%s%s_%s_cent%d", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), namePID[iPID].Data(), icent);
-        histo = new TH2D(hName.Data(), hName.Data(), bins[kPtPi0], xMin[kPtPi0], xMax[kPtPi0], bins[kInvMassPi0], xMin[kInvMassPi0], xMax[kInvMassPi0]);
-        histo->Sumw2(); list->Add(histo); histo = 0;
-      }
+    }
 
-      for (Int_t i=0; i<kVarsPi0-2; i++) {
-        hName  = Form("hPi0_%s%s_%s", tName[0].Data(), tName[i+1].Data(), namePID[iPID].Data());
-        histo = new TH2D(hName.Data(), hName.Data(), bins[0], xMin[0], xMax[0], bins[i+1], xMin[i+1], xMax[i+1]);
-        histo->Sumw2(); list->Add(histo); histo = 0;
-      }
+    for (Int_t i=0; i<kVarsPi0-2; i++) {
+      hName  = Form("hPi0_%s%s_%s", tName[0].Data(), tName[i+1].Data(), namePID[iPID].Data());
+      histo = new TH2D(hName.Data(), hName.Data(), bins[0], xMin[0], xMax[0], bins[i+1], xMin[i+1], xMax[i+1]);
+      histo->Sumw2(); list->Add(histo); histo = 0;
     }
     for (Int_t iComb=0; iComb<nComb; iComb++) {
       hName  = Form("hPi0_%s%s_%s_%s", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), namePID[iPID].Data(), srcMod[iComb].Data());
@@ -458,18 +463,16 @@ void AliPHOSpPbPi0Header::CreateHistosMixPi0(TList *list)
     histo = new TH2D(hName.Data(), hName.Data(), bins[kPtMixPi0],      xMin[kPtMixPi0],      xMax[kPtMixPi0],
                                                  bins[kInvMassMixPi0], xMin[kInvMassMixPi0], xMax[kInvMassMixPi0]);
     histo->Sumw2(); list->Add(histo); histo = 0;
-    if (iPID>kFiducial) {
-      hName  = Form("hMixPi0_%s%s_%s", tName[kEtaMixPi0].Data(), tName[kPhiMixPi0].Data(), namePID[iPID].Data());
-      histo = new TH2D(hName.Data(), hName.Data(), bins[kEtaMixPi0], xMin[kEtaMixPi0], xMax[kEtaMixPi0], 
-                                                   bins[kPhiMixPi0], xMin[kPhiMixPi0], xMax[kPhiMixPi0]);
+    hName  = Form("hMixPi0_%s%s_%s", tName[kEtaMixPi0].Data(), tName[kPhiMixPi0].Data(), namePID[iPID].Data());
+    histo = new TH2D(hName.Data(), hName.Data(), bins[kEtaMixPi0], xMin[kEtaMixPi0], xMax[kEtaMixPi0], 
+                                                 bins[kPhiMixPi0], xMin[kPhiMixPi0], xMax[kPhiMixPi0]);
+    histo->Sumw2(); list->Add(histo); histo = 0;
+    for (Int_t icent=0; icent<fgNCent; icent++) {
+      hName  = Form("hMixPi0_%s%s_%s_cent%d", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(), namePID[iPID].Data(), icent);
+      histo = new TH2D(hName.Data(), hName.Data(), bins[kPtMixPi0],      xMin[kPtMixPi0],      xMax[kPtMixPi0],
+                                                   bins[kInvMassMixPi0], xMin[kInvMassMixPi0], xMax[kInvMassMixPi0]);
       histo->Sumw2(); list->Add(histo); histo = 0;
-      for (Int_t icent=0; icent<fgNCent; icent++) {
-        hName  = Form("hMixPi0_%s%s_%s_cent%d", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(), namePID[iPID].Data(), icent);
-        histo = new TH2D(hName.Data(), hName.Data(), bins[kPtMixPi0],      xMin[kPtMixPi0],      xMax[kPtMixPi0],
-                                                     bins[kInvMassMixPi0], xMin[kInvMassMixPi0], xMax[kInvMassMixPi0]);
-        histo->Sumw2(); list->Add(histo); histo = 0;
-      } 
-    }
+    } 
     for (Int_t iComb=0; iComb<nComb; iComb++) {
       hName  = Form("hMixPi0_%s%s_%s_%s", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(), namePID[iPID].Data(), srcMod[iComb].Data());
       histo = new TH2D(hName.Data(), hName.Data(), bins[kPtMixPi0],      xMin[kPtMixPi0],      xMax[kPtMixPi0],
@@ -491,11 +494,11 @@ void AliPHOSpPbPi0Header::CreateHistosMC(TList *list)
 
   Bool_t oldStatus = TH2::AddDirectoryStatus(); TH2::AddDirectory(kFALSE);
   const Int_t method = 2;
-  char *mName[method]= {"IsPrimary", "RCut"};
+  const char *mName[method] = {"IsPrimary", "RCut"};
   const Int_t cut    = 3;
-  char *cName[cut]   = {"WideY", "NarrY", "Acc"};
+  const char *cName[cut]    = {"WideY", "NarrY", "Acc"};
   const Int_t type   = 3;
-  char *pName[type]  = {"Pi0", "Eta", "Gamma"};
+  const char *pName[type]   = {"Pi0", "Eta", "Gamma"};
                        //  { kVertexMC, kPtMC, kRapidityMC,          kPhiMC, kWeightMC, kVarsMC };   // MC
   TString tName[kVarsMC] = {  "Vertex",  "Pt",  "Rapidity",           "Phi",  "Weight"          };
   Int_t    bins[kVarsMC] = {     1000 ,  500 ,        200 ,            360 ,     100            };
@@ -538,7 +541,7 @@ void AliPHOSpPbPi0Header::CreateHistosMC(TList *list)
 }
 
 //_____________________________________________________________________________
-void AliPHOSpPbPi0Header::FillHistosEvnH(TList *list)
+void AliPHOSpPbPi0Header::FillHistosEvent(TList *list)
 {
   // fill histograms at event level according to event selection cuts
 
@@ -547,8 +550,14 @@ void AliPHOSpPbPi0Header::FillHistosEvnH(TList *list)
   const Int_t nhs      = 3;
   TString tName[nhs+1] = { "VtxNcontr", "Centrality",    "Vz", "Pileup" };
   Double_t dist[nhs]   = { fVtxContrsN,  fCentrality, fVtx[2]           };
-  for (Int_t i=nhs; i--;) ((TH1D*)list->FindObject(Form("hEvnH_%s",tName[i].Data())))->Fill(dist[i]);
-  if (fIsPileupSPD)       ((TH1D*)list->FindObject(Form("hEvnH_%s",tName[nhs].Data())))->Fill(dist[nhs-1]);
+  for (Int_t i=nhs; i--;) {
+    ((TH1D*)list->FindObject(Form("hEvent_%s",tName[i].Data())))->Fill(dist[i]);
+    if (this->IsSelected()) ((TH1D*)list->FindObject(Form("hEventSel_%s",tName[i].Data())))->Fill(dist[i]);
+  }
+  if (fIsPileupSPD) {
+    ((TH1D*)list->FindObject(Form("hEvent_%s",tName[nhs].Data())))->Fill(dist[nhs-1]);
+    if (this->IsSelected())  ((TH1D*)list->FindObject(Form("hEventSel_%s",tName[nhs].Data())))->Fill(dist[nhs-1]);
+  }
 
   return;
 }
@@ -589,7 +598,7 @@ void AliPHOSpPbPi0Header::FillHistosCaloCluster(TList *list, TClonesArray* const
                          // { kPtClu, kEtaClu, kPhiClu, kM02Clu, kM20Clu, kTOFClu, kNCellsClu, kNClustersClu, kVarsClu };   // clusters
   TString tName[kVarsClu] = {   "Pt",   "Eta",   "Phi",   "M02",   "M20",   "TOF",   "NCells",   "NClusters"           };
 
-  Int_t entries = caloClArr->GetEntries();
+  Int_t entries = caloClArr->GetEntriesFast();
   Int_t iMod = 0, iTRU = 0, nclusters[3] = { 0, 0, 0 };
   UInt_t pidBit = 0;
   AliCaloClusterInfo *caloCluster = 0;
@@ -610,21 +619,17 @@ void AliPHOSpPbPi0Header::FillHistosCaloCluster(TList *list, TClonesArray* const
  
     ((TH1I*)list->FindObject(Form("hCaloCluster_%s", tName[kNCellsClu].Data())))->Fill((Int_t)vars[kNCellsClu]);
     ((TH1I*)list->FindObject(Form("hCaloCluster_%s_Mod%d", tName[kNCellsClu].Data(), iMod)))->Fill((Int_t)vars[kNCellsClu]);
-
     ((TH1D*)list->FindObject(Form("hCaloCluster_%s_Mod%d_TRU%d", tName[kPtClu].Data(), iMod, iTRU)))->Fill(vars[kPtClu]);
-    ((TH1D*)list->FindObject(Form("hCaloCluster_%s_cent%d", tName[kPtClu].Data(), cent)))->Fill(vars[kPtClu]);
 
     for (Int_t iPID=0; iPID<kPIDs; iPID++) {
       if ((pidBit&PIDBIT[iPID])==PIDBIT[iPID]) {
         ((TH1D*)list->FindObject(Form("hCaloCluster_%s_%s", tName[kPtClu].Data(), namePID[iPID].Data())))->Fill(vars[kPtClu]);
         ((TH1D*)list->FindObject(Form("hCaloCluster_%s_Mod%d_%s", tName[kPtClu].Data(), iMod, namePID[iPID].Data())))->Fill(vars[kPtClu]);
-        if (iPID>kFiducial) {
-          ((TH1D*)list->FindObject(Form("hCaloCluster_%s_%s_cent%d", tName[kPtClu].Data(), namePID[iPID].Data(), cent)))->Fill(vars[kPtClu]);
-          ((TH2D*)list->FindObject(Form("hCaloCluster_%s%s_%s", tName[kEtaClu].Data(), tName[kPhiClu].Data(),
-                                                                namePID[iPID].Data())))->Fill(vars[kEtaClu], vars[kPhiClu]);
-          for (Int_t j=0; j<kVarsClu-3; j++)
-            ((TH2D*)list->FindObject(Form("hCaloCluster_%s%s_%s", tName[0].Data(), tName[j+1].Data(), namePID[iPID].Data())))->Fill(vars[0], vars[j+1]);
-        }
+        ((TH1D*)list->FindObject(Form("hCaloCluster_%s_%s_cent%d", tName[kPtClu].Data(), namePID[iPID].Data(), cent)))->Fill(vars[kPtClu]);
+        ((TH2D*)list->FindObject(Form("hCaloCluster_%s%s_%s", tName[kEtaClu].Data(), tName[kPhiClu].Data(),
+                                                              namePID[iPID].Data())))->Fill(vars[kEtaClu], vars[kPhiClu]);
+        for (Int_t j=0; j<kVarsClu-3; j++)
+          ((TH2D*)list->FindObject(Form("hCaloCluster_%s%s_%s", tName[0].Data(), tName[j+1].Data(), namePID[iPID].Data())))->Fill(vars[0], vars[j+1]);
       }
     }
 
@@ -655,7 +660,7 @@ void AliPHOSpPbPi0Header::FillHistosPi0(TList *list, TClonesArray* const caloClA
                          // { kPtPi0, kEtaPi0, kPhiPi0, kAsyPi0, kAnglePi0, kInvMassPi0, kVarsPi0                      };   // pi0
   TString tName[kVarsPi0] = {   "Pt",   "Eta",   "Phi",   "Asy",   "Angle",   "InvMass"                                };
 
-  Int_t entries = caloClArr->GetEntries();
+  Int_t entries = caloClArr->GetEntriesFast();
   Int_t iMod = 0, jMod = 0, srcMod = 0;
   UInt_t iPIDBit = 0, jPIDBit = 0;
   Double_t vars[kVarsPi0];
@@ -667,7 +672,7 @@ void AliPHOSpPbPi0Header::FillHistosPi0(TList *list, TClonesArray* const caloClA
     iPIDBit = iCaloCluster->GetPIDBit();
     iGamma  = iCaloCluster->LorentzVector();
     
-    for (Int_t j=0; j<entries; j++) { // Loop calo cluster j
+    for (Int_t j=i+1; j<entries; j++) { // Loop calo cluster j
       jCaloCluster = (AliCaloClusterInfo*)caloClArr->At(j);
       jMod    = jCaloCluster->GetModule();
       jPIDBit = jCaloCluster->GetPIDBit();
@@ -694,18 +699,16 @@ void AliPHOSpPbPi0Header::FillHistosPi0(TList *list, TClonesArray* const caloClA
 
       for (Int_t iPID=0; iPID<kPIDs; iPID++) {
         if ((iPIDBit & jPIDBit & PIDBIT[iPID])==PIDBIT[iPID]) {
+          ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s", tName[kEtaPi0].Data(), tName[kPhiPi0].Data(),
+                                                        namePID[iPID].Data())))->Fill(vars[kEtaPi0], vars[kPhiPi0]);
           ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(),
                                                         namePID[iPID].Data())))->Fill(vars[kPtPi0], vars[kInvMassPi0]);
           ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s_Mod%d", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(),
                                                               namePID[iPID].Data(), srcMod)))->Fill(vars[kPtPi0], vars[kInvMassPi0]);
-          if (iPID>kFiducial) {
-            ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s", tName[kEtaPi0].Data(), tName[kPhiPi0].Data(),
-                                                          namePID[iPID].Data())))->Fill(vars[kEtaPi0], vars[kPhiPi0]);
-            ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s_cent%d", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), 
-                                                                 namePID[iPID].Data(), cent)))->Fill(vars[kPtPi0], vars[kInvMassPi0]);
-            for (Int_t k=0; k<kVarsPi0-2; k++) {
-              ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s", tName[0].Data(), tName[k+1].Data(), namePID[iPID].Data())))->Fill(vars[0], vars[k+1]);
-            }
+          ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s_cent%d", tName[kPtPi0].Data(), tName[kInvMassPi0].Data(), 
+                                                               namePID[iPID].Data(), cent)))->Fill(vars[kPtPi0], vars[kInvMassPi0]);
+          for (Int_t k=0; k<kVarsPi0-2; k++) {
+            ((TH2D*)list->FindObject(Form("hPi0_%s%s_%s", tName[0].Data(), tName[k+1].Data(), namePID[iPID].Data())))->Fill(vars[0], vars[k+1]);
           }
         }
       }
@@ -729,7 +732,7 @@ void AliPHOSpPbPi0Header::FillHistosMixPi0(TList *list, TClonesArray* const iCal
                             // { kPtMixPi0, kEtaMixPi0, kPhiMixPi0, kInvMassMixPi0, kVarsMixPi0                        };   // Mix pi0
   TString tName[kVarsMixPi0] = {      "Pt",      "Eta",      "Phi",      "InvMass"                                     };
 
-  Int_t iEntries = iCaloClArr->GetEntries();
+  Int_t iEntries = iCaloClArr->GetEntriesFast();
   Int_t iMod = 0, jMod = 0, srcMod = 0;
   UInt_t iPIDBit = 0, jPIDBit = 0;
   Double_t vars[kVarsMixPi0];
@@ -745,7 +748,7 @@ void AliPHOSpPbPi0Header::FillHistosMixPi0(TList *list, TClonesArray* const iCal
     Int_t nev = eventList->GetSize();
     for(Int_t ev=0; ev<nev; ev++){ // Loop events for mixing
       jCaloClArr     = static_cast<TClonesArray*>(eventList->At(ev));
-      Int_t jEntries = jCaloClArr->GetEntries();
+      Int_t jEntries = jCaloClArr->GetEntriesFast();
       for(Int_t j=0; j<jEntries; j++){ // Loop calo cluster j
         jCaloCluster=(AliCaloClusterInfo*)jCaloClArr->At(j);
         jMod    = jCaloCluster->GetModule();   if (TMath::Abs(iMod-jMod)>1) { jCaloCluster = 0; continue; }
@@ -766,16 +769,14 @@ void AliPHOSpPbPi0Header::FillHistosMixPi0(TList *list, TClonesArray* const iCal
         ((TH2D*)list->FindObject(Form("hMixPi0_%s%s", tName[kEtaMixPi0].Data(), tName[kPhiMixPi0].Data())))->Fill(vars[kEtaMixPi0], vars[kPhiMixPi0]);
         for (Int_t iPID=0; iPID<kPIDs; iPID++) {
           if ((iPIDBit & jPIDBit & PIDBIT[iPID])==PIDBIT[iPID]) {
+            ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s", tName[kEtaMixPi0].Data(), tName[kPhiMixPi0].Data(),
+                                                             namePID[iPID].Data())))->Fill(vars[kEtaMixPi0], vars[kPhiMixPi0]);
             ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(),
                                                              namePID[iPID].Data())))->Fill(vars[kPtMixPi0], vars[kInvMassMixPi0]);
             ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s_Mod%d", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(),
                                                                    namePID[iPID].Data(), srcMod)))->Fill(vars[kPtMixPi0], vars[kInvMassMixPi0]);
-            if (iPID>kFiducial) {
-              ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s", tName[kEtaMixPi0].Data(), tName[kPhiMixPi0].Data(),
-                                                               namePID[iPID].Data())))->Fill(vars[kEtaMixPi0], vars[kPhiMixPi0]);
-              ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s_cent%d", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(),
-                                                                      namePID[iPID].Data(), cent)))->Fill(vars[kPtMixPi0], vars[kInvMassMixPi0]);
-            }
+            ((TH2D*)list->FindObject(Form("hMixPi0_%s%s_%s_cent%d", tName[kPtMixPi0].Data(), tName[kInvMassMixPi0].Data(),
+                                                                    namePID[iPID].Data(), cent)))->Fill(vars[kPtMixPi0], vars[kInvMassMixPi0]);
           }
         }
         jCaloCluster = 0;
@@ -813,6 +814,8 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliMCEvent* const mcEvent, A
 
     ((TH2D*)list->FindObject(Form("hMC%s_PtVertex", pName.Data())))->Fill(pt, r);
     ((TH2D*)list->FindObject(Form("hMC%s_PtRapidity", pName.Data())))->Fill(pt, y);
+
+    Int_t mod1 = 0, mod2 = 0;
     AliAODMCParticle *gamma1=0x0, *gamma2=0x0;
     if (r<1.) {
       ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_RCut", pName.Data(), cent)))->Fill(pt, weight);
@@ -824,7 +827,9 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliMCEvent* const mcEvent, A
         gamma1 = (AliAODMCParticle*)mcEvent->GetTrack(pMC->GetDaughter(0));
         gamma2 = (AliAODMCParticle*)mcEvent->GetTrack(pMC->GetDaughter(1));
         //Number of pi0s decayed into acceptance
-        if (IsHitPHOS(gamma1, phosGeo) && IsHitPHOS(gamma2, phosGeo))
+        mod1 = HitPHOSModule(gamma1, phosGeo);
+        mod2 = HitPHOSModule(gamma2, phosGeo);
+        if (mod1!=-1 && mod1!=2 && mod2!=-1 && mod2!=2 && TMath::Abs(mod1-mod2)<2) // !remove module 2
           ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_Acc_RCut", pName.Data(), cent)))->Fill(pt, weight);
       }
     }
@@ -841,7 +846,9 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliMCEvent* const mcEvent, A
         gamma1 = (AliAODMCParticle*)mcEvent->GetTrack(pMC->GetDaughter(0));
         gamma2 = (AliAODMCParticle*)mcEvent->GetTrack(pMC->GetDaughter(1));
         //Number of pi0s decayed into acceptance
-        if (IsHitPHOS(gamma1, phosGeo) && IsHitPHOS(gamma2, phosGeo))
+        mod1 = HitPHOSModule(gamma1, phosGeo);
+        mod2 = HitPHOSModule(gamma2, phosGeo);
+        if (mod1!=-1 && mod1!=2 && mod2!=-1 && mod2!=2 && TMath::Abs(mod1-mod2)<2) // !remove module 2
           ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_Acc_IsPrimary", pName.Data(), cent)))->Fill(pt, weight);
       }
     }
@@ -877,8 +884,9 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliStack* const stack, AliPH
     ((TH2D*)list->FindObject(Form("hMC%s_PtVertex", pName.Data())))->Fill(pt, r);
     ((TH2D*)list->FindObject(Form("hMC%s_PtRapidity", pName.Data())))->Fill(pt, y);
 
+    Int_t mod1 = 0, mod2 = 0;
     TParticle *gamma1 = 0x0, *gamma2 = 0x0;
-    if (r<1.) {
+    if (r<1.) { // R_Cut
       ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_RCut", pName.Data(), cent)))->Fill(pt, weight);
       ((TH2D*)list->FindObject(Form("hMC%s_RapidityWeight_cent%d_RCut", pName.Data(), cent)))->Fill(y, weight);
       ((TH2D*)list->FindObject(Form("hMC%s_PhiWeight_cent%d_RCut", pName.Data(), cent)))->Fill(phi, weight);
@@ -888,11 +896,13 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliStack* const stack, AliPH
         gamma1 = stack->Particle(pMC->GetFirstDaughter());
         gamma2 = stack->Particle(pMC->GetLastDaughter());
         //Number of pi0s decayed into acceptance
-        if (IsHitPHOS(gamma1, phosGeo) && IsHitPHOS(gamma2, phosGeo))
+        mod1 = HitPHOSModule(gamma1, phosGeo);
+        mod2 = HitPHOSModule(gamma2, phosGeo);
+        if (mod1!=-1 && mod1!=2 && mod2!=-1 && mod2!=2 && TMath::Abs(mod1-mod2)<2) // !remove module 2
           ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_Acc_RCut", pName.Data(), cent)))->Fill(pt, weight);
       }
     }
-    if (pMC->IsPrimary()) {
+    if (pMC->IsPrimary()) { // IsPrimary
       ((TH2D*)list->FindObject(Form("hMC%s_PtVertex_IsPrimary", pName.Data())))->Fill(pt, r);
       ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_IsPrimary", pName.Data(), cent)))->Fill(pt, weight);
       ((TH2D*)list->FindObject(Form("hMC%s_RapidityWeight_cent%d_IsPrimary", pName.Data(), cent)))->Fill(y, weight);
@@ -903,12 +913,12 @@ void AliPHOSpPbPi0Header::FillHistosMC(TList *list, AliStack* const stack, AliPH
         gamma1 = stack->Particle(pMC->GetFirstDaughter());
         gamma2 = stack->Particle(pMC->GetLastDaughter());
         //Number of pi0s decayed into acceptance
-        if (IsHitPHOS(gamma1, phosGeo) && IsHitPHOS(gamma2, phosGeo))
+        mod1 = HitPHOSModule(gamma1, phosGeo);
+        mod2 = HitPHOSModule(gamma2, phosGeo);
+        if (mod1!=-1 && mod1!=2 && mod2!=-1 && mod2!=2 && TMath::Abs(mod1-mod2)<2) // !remove module 2
           ((TH2D*)list->FindObject(Form("hMC%s_PtWeight_cent%d_Acc_IsPrimary", pName.Data(), cent)))->Fill(pt, weight);
       }
     }
-
-
   }
 
   return;
@@ -919,10 +929,10 @@ Double_t AliPHOSpPbPi0Header::PrimaryParticleWeight(Int_t pdg, Double_t pt)
 {
 
   Int_t type=0 ;
-  if (pdg == 111 || TMath::Abs(pdg)==211) type = 1;
+  if (pdg == 111 || TMath::Abs(pdg)==211) type = 1; // Pi0/Eta 
   else if (TMath::Abs(pdg)<1000)          type = 2; // Kaon-like
-  else                                    type = 3;  //baryons
-    
+  else                                    type = 3; // baryons
+
   if (type==1) {
     if (fCentrality<5.)       // 0-5
       return (1.662990+1.140890*pt-0.192088*pt*pt)/(1.-0.806630*pt+0.304771*pt*pt)+0.141690*pt;
@@ -970,27 +980,39 @@ Double_t AliPHOSpPbPi0Header::PrimaryParticleWeight(Int_t pdg, Double_t pt)
 }
 
 //________________________________________________________________________
-Bool_t AliPHOSpPbPi0Header::IsHitPHOS(AliAODMCParticle* const pMC, AliPHOSGeoUtils* const phosGeo)
+Int_t AliPHOSpPbPi0Header::HitPHOSModule(AliAODMCParticle* const pMC, AliPHOSGeoUtils* const phosGeo)
 { 
 
-  Int_t mod=0; 
+  Int_t mod=0, relId[4]={0,0,0,0}; 
   Double_t x=0., z=0.;
   Double_t vtx[3]; pMC->XvYvZv(vtx);
   Double_t theta = pMC->Theta();
   Double_t phi   = pMC->Phi();
     
-  return (phosGeo->ImpactOnEmc(vtx, theta, phi, mod, z, x) && mod!=2);
-}   
+  if (!phosGeo->ImpactOnEmc(vtx, theta, phi, mod, z, x)) return -1;
+
+  const Int_t edgeX = 2;
+  const Int_t edgeZ = 2;
+  phosGeo->RelPosToRelId(mod, x, z, relId);
+  if (relId[2] >edgeX && relId[2]<(65-edgeX) && relId[3]>edgeZ && relId[3] <(57-edgeZ)) return relId[0];
+  else return -1;
+}
 
 //________________________________________________________________________
-Bool_t AliPHOSpPbPi0Header::IsHitPHOS(TParticle* const pMC, AliPHOSGeoUtils* const phosGeo)
+Int_t AliPHOSpPbPi0Header::HitPHOSModule(TParticle* const pMC, AliPHOSGeoUtils* const phosGeo)
 {
 
-  Int_t mod=0;
+  Int_t mod=0, relId[4]={0,0,0,0}; 
   Double_t x=0., z=0.;
   Double_t vtx[3] = { pMC->Vx(), pMC->Vy(), pMC->Vz() };
   Double_t theta = pMC->Theta();
   Double_t phi   = pMC->Phi();
 
-  return (phosGeo->ImpactOnEmc(vtx, theta, phi, mod, z, x) && mod!=2);
+  if (!phosGeo->ImpactOnEmc(vtx, theta, phi, mod, z, x)) return -1;
+
+  const Int_t edgeX = 2;
+  const Int_t edgeZ = 2;
+  phosGeo->RelPosToRelId(mod, x, z, relId);
+  if (relId[2] >edgeX && relId[2]<(65-edgeX) && relId[3]>edgeZ && relId[3] <(57-edgeZ)) return relId[0];
+  else return -1;
 }
index 519207f..78e4e5a 100644 (file)
@@ -42,17 +42,16 @@ class AliPHOSpPbPi0Header : public TNamed {
   TString  FiredTriggerClass()     const { return fFiredTriggerClass;              }
   UInt_t   SelectionMask()         const { return fSelMask;                        }
   Int_t    VtxContrsN()            const { return fVtxContrsN;                     }
+  Bool_t   IspAVertexOK()          const { return fIspAVertexOK;                   }
   Bool_t   IsPileupSPD()           const { return fIsPileupSPD;                    }
   Float_t  Centrality()            const { return fCentrality;                     }
   Double_t MagneticField()         const { return fMagneticField;                  }
-
-  Bool_t   IspAVertexOK(AliAODEvent* const event);
-  Bool_t   IspAVertexOK(AliESDEvent* const event);
+  Bool_t   IsSelected();
 
   void SetEventInfo(AliInputEventHandler* const handler);
 
-  void CreateHistograms(TList *list);
-  void FillHistosEvnH(TList *list);
+  void CreateHistograms(TList *listEvent, TList *listCaloCl, TList *listPi0, TList *listMC);
+  void FillHistosEvent(TList *list);
   void FillHistosCaloCellsQA(TList *list, AliVCaloCells* const cells, AliPHOSGeoUtils* const phosGeo);
   void FillHistosCaloCluster(TList *list, TClonesArray* const caloClArr, Int_t cent);
   void FillHistosPi0(TList *list, TClonesArray* const caloClArr, Int_t cent);
@@ -65,16 +64,19 @@ class AliPHOSpPbPi0Header : public TNamed {
 
  private :
 
-  void CreateHistosEvnH(TList *list);
+  void CreateHistosEvent(TList *list);
   void CreateHistosCaloCellsQA(TList *list);
   void CreateHistosCaloCluster(TList *list);
   void CreateHistosPi0(TList *list);
   void CreateHistosMixPi0(TList *list);
   void CreateHistosMC(TList *list);
 
+  Bool_t IspAVertexOK(AliAODEvent* const event);
+  Bool_t IspAVertexOK(AliESDEvent* const event);
+
+  Int_t  HitPHOSModule(AliAODMCParticle* const pMC, AliPHOSGeoUtils* const phosGeo);
+  Int_t  HitPHOSModule(TParticle* const pMC, AliPHOSGeoUtils* const phosGeo);
   Double_t PrimaryParticleWeight(Int_t pdg, Double_t pt);
-  Bool_t   IsHitPHOS(AliAODMCParticle* const pMC, AliPHOSGeoUtils* const phosGeo);
-  Bool_t   IsHitPHOS(TParticle* const pMC, AliPHOSGeoUtils* const phosGeo);
 
   static Bool_t fgIsMC;            // flag to use MC
   static Int_t  fgNCent;           // # of centrality bins
@@ -89,6 +91,7 @@ class AliPHOSpPbPi0Header : public TNamed {
   TString  fFiredTriggerClass;            // trigger class
   UInt_t   fSelMask;                      // mask of physics selection
   Int_t    fVtxContrsN;                   // num. of contributors of vtx rec
+  Bool_t   fIspAVertexOK;                 // is pA collision vertex OK
   Bool_t   fIsPileupSPD;                  // is Pileup from SPD
   Float_t  fCentrality;                   // event certrality
   Double_t fMagneticField;                // magnetic field
index a77a3ae..46ae6de 100644 (file)
@@ -1,5 +1,8 @@
-AliAnalysisTaskSEPHOSpPbPi0* AddTaskPHOSpPbPi0(Bool_t isMCtruth=kFALSE, UInt_t triggerMask = AliVEvent::kMB, Bool_t isBadMap=kFALSE)
+AliAnalysisTaskSEPHOSpPbPi0* AddTaskPHOSpPbPi0(UInt_t triggerTag = 0, Bool_t isMCtruth=kFALSE, Bool_t isBadMap=kFALSE, Double_t logWeight = 0.)
 {
+// Creates a task to analysis pi0 in p-Pb collisions with PHOS
+// H. ZHu - 05/05/2013
+
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
     ::Error("AddTaskPHOSpPbPi0", "No analysis manager to connect to.");
@@ -19,19 +22,23 @@ AliAnalysisTaskSEPHOSpPbPi0* AddTaskPHOSpPbPi0(Bool_t isMCtruth=kFALSE, UInt_t t
   }
 
   const Int_t nBins = 6;
-  Double_t cBin[nBins+1] = {0., 20., 40., 60., 80., 90., 100.}; TArrayD tCent(nBins+1, cBin);
-  Int_t    buffer[nBins] = { 40,  80,  80,  100,  100,  100  }; TArrayI tBuffer(nBins, buffer);
+  Float_t cBin[nBins+1] = {0., 20., 40., 60., 80., 90., 100.}; TArrayF tCent(nBins+1, cBin);
+  Int_t   buffer[nBins] = { 40,  80,  80,  100,  100,  100  }; TArrayI tBuffer(nBins, buffer);
 
   AliAnalysisTaskSEPHOSpPbPi0 *task = new AliAnalysisTaskSEPHOSpPbPi0("TaskPHOSpPbPi0");
   task->SetUseMC(isMCtruth);
   task->SetXBins(tCent, tBuffer);
-  task->SetLogWeight(0.06);
+  task->SetLogWeight(logWeight); // for ESD decalibration
+  task->SetMinDistToBad(2.5);
   task->SetMinNCells(2);
   task->SetMinClusterEnergy(0.3);
   task->SetMinM02(0.2);
-  task->SetMinDistToBad(2.5);
   task->SetDebugLevel(-1);
 
+  if (triggerTag==0) task->SelectCollisionCandidates(AliVEvent::kINT7);
+  if (triggerTag==1) task->SelectCollisionCandidates(AliVEvent::kPHI7);
+  if (triggerTag==2) task->SelectCollisionCandidates(AliVEvent::kMB);
+
   // Bad maps for PHOS
   if (isBadMap) {
     AliOADBContainer badmapContainer("phosBadMap");
@@ -44,13 +51,20 @@ AliAnalysisTaskSEPHOSpPbPi0* AddTaskPHOSpPbPi0(Bool_t isMCtruth=kFALSE, UInt_t t
     }
   }
 
-  task->SelectCollisionCandidates(triggerMask); 
   mgr->AddTask(task);
 
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
 
-  AliAnalysisDataContainer *coutput = mgr->CreateContainer("histosPHOS", TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root");
-  mgr->ConnectOutput(task, 1, coutput);
+  AliAnalysisDataContainer *output1 = mgr->CreateContainer("EventInfo", TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root");
+  AliAnalysisDataContainer *output2 = mgr->CreateContainer("CaloClInfo", TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root");
+  AliAnalysisDataContainer *output3 = mgr->CreateContainer("Pi0Info", TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root");
+  mgr->ConnectOutput(task, 1, output1);
+  mgr->ConnectOutput(task, 2, output2);
+  mgr->ConnectOutput(task, 3, output3);
+  if (isMCtruth) {
+    AliAnalysisDataContainer *output4 = mgr->CreateContainer("MCInfo", TList::Class(), AliAnalysisManager::kOutputContainer, "histosPHOS.root");
+    mgr->ConnectOutput(task, 4, output4);
+  }
 
   return task;
 }