added new addtask + major modifications for pPb
authorfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Apr 2013 13:00:39 +0000 (13:00 +0000)
committerfbock <fbock@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Apr 2013 13:00:39 +0000 (13:00 +0000)
16 files changed:
PWGGA/GammaConv/AliAnalysisTaskConversionQA.cxx
PWGGA/GammaConv/AliAnalysisTaskConversionQA.h
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.cxx
PWGGA/GammaConv/AliAnalysisTaskGammaConvV1.h
PWGGA/GammaConv/AliConversionCuts.cxx
PWGGA/GammaConv/AliConversionCuts.h
PWGGA/GammaConv/AliConversionMesonCuts.cxx
PWGGA/GammaConv/AliConversionMesonCuts.h
PWGGA/GammaConv/AliDalitzElectronCuts.cxx
PWGGA/GammaConv/AliGammaConversionAODBGHandler.cxx
PWGGA/GammaConv/AliGammaConversionAODBGHandler.h
PWGGA/GammaConv/AliV0ReaderV1.cxx
PWGGA/GammaConv/AliV0ReaderV1.h
PWGGA/GammaConv/macros/AddTask_GammaConvV1.C
PWGGA/GammaConv/macros/AddTask_GammaConvV1_2.C [new file with mode: 0644]
PWGGA/GammaConv/macros/AddTask_GammaConvV1_3.C [new file with mode: 0644]

index f05ba50..b7a69dd 100644 (file)
@@ -117,10 +117,8 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
       fOutputList->SetOwner(kTRUE);
    }
    
-
    if(ffillHistograms){
-      TH1::SetDefaultSumw2(kTRUE);
-      
+         
       fESDList = new TList();
       fESDList->SetOwner(kTRUE);
       fESDList->SetName("ESD QA");
@@ -143,7 +141,7 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
       fESDList->Add(hGammaPt);
       hGammaPhi = new TH1F("Gamma_Phi","Gamma_Phi",360,0,2*TMath::Pi());
       fESDList->Add(hGammaPhi);
-      hGammaEta = new TH1F("Gamma_Eta","Gamma_Eta",400,-1.2,1.2);
+      hGammaEta = new TH1F("Gamma_Eta","Gamma_Eta",600,-1.5,1.5);
       fESDList->Add(hGammaEta);
       hGammaChi2perNDF = new TH1F("Gamma_Chi2perNDF","Gamma_Chi2perNDF",500,0,100);
       fESDList->Add(hGammaChi2perNDF);
@@ -160,7 +158,7 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
 
       hElecPt = new TH2F("Electron_Positron_Pt","Electron_Positron_Pt",250,0,25,250,0,25);
       fESDList->Add(hElecPt);
-      hElecEta = new TH2F("Electron_Positron_Eta","Electron_Positron_Eta",400,-1.2,1.2,400,-1.2,1.2);
+      hElecEta = new TH2F("Electron_Positron_Eta","Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
       fESDList->Add(hElecEta);
       hElecPhi = new TH2F("Electron_Positron_Phi","Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
       fESDList->Add(hElecPhi);
@@ -186,7 +184,7 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
          fTrueList->Add(hTrueGammaPt);
          hTrueGammaPhi = new TH1F("True_Gamma_Phi","True_Gamma_Phi",360,0,2*TMath::Pi());
          fTrueList->Add(hTrueGammaPhi);
-         hTrueGammaEta = new TH1F("True_Gamma_Eta","True_Gamma_Eta",400,-1.2,1.2);
+         hTrueGammaEta = new TH1F("True_Gamma_Eta","True_Gamma_Eta",600,-1.5,1.5);
          fTrueList->Add(hTrueGammaEta);
          hTrueGammaMass = new TH1F("True_Gamma_Mass","True_Gamma_Mass",1000,0,0.3);
          fTrueList->Add(hTrueGammaMass);
@@ -205,7 +203,7 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
 
          hTrueElecPt = new TH2F("True_Electron_Positron_Pt","True_Electron_Positron_Pt",250,0,25,250,0,25);
          fTrueList->Add(hTrueElecPt);
-         hTrueElecEta = new TH2F("True_Electron_Positron_Eta","True_Electron_Positron_Eta",400,-1.2,1.2,400,-1.2,1.2);
+         hTrueElecEta = new TH2F("True_Electron_Positron_Eta","True_Electron_Positron_Eta",600,-1.5,1.5,600,-1.5,1.5);
          fTrueList->Add(hTrueElecEta);
          hTrueElecPhi = new TH2F("True_Electron_Positron_Phi","True_Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi());
          fTrueList->Add(hTrueElecPhi);
@@ -217,7 +215,6 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
       if(fConversionCuts->GetCutHistograms()){
          fOutputList->Add(fConversionCuts->GetCutHistograms());
       }
-      TH1::SetDefaultSumw2(kFALSE);
    }
    
    if(ffillTree){
@@ -225,13 +222,23 @@ void AliAnalysisTaskConversionQA::UserCreateOutputObjects()
       fStreamQA = new TTreeSRedirector(Form("GammaConvV1_QATree_%s.root",cutnumber.Data()),"recreate");
    }
 
+   fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
+   
    PostData(1, fOutputList);
 }
-
+//_____________________________________________________________________________
+Bool_t AliAnalysisTaskConversionQA::Notify()
+{
+   if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetDoEtaShift()){
+      if(fConversionCuts->GetDoEtaShift())
+      fConversionCuts->SetEtaShift(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEtaShift());
+   }
+   return kTRUE;
+}
 //________________________________________________________________________
 void AliAnalysisTaskConversionQA::UserExec(Option_t *){
 
-   fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
+
 
    Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality();
    if(eventQuality != 0){// Event Not Accepted
index 7dda119..a945c20 100644 (file)
@@ -26,6 +26,7 @@ class AliAnalysisTaskConversionQA : public AliAnalysisTaskSE{
    virtual ~AliAnalysisTaskConversionQA();
 
    virtual void   UserCreateOutputObjects();
+   virtual Bool_t Notify();
    virtual void   UserExec(Option_t *option);
    virtual void   Terminate(Option_t *);
 
index 40d14e2..dbe66b0 100644 (file)
@@ -266,51 +266,10 @@ AliAnalysisTaskGammaConvV1::~AliAnalysisTaskGammaConvV1()
 //___________________________________________________________
 void AliAnalysisTaskGammaConvV1::InitBack(){
 
-   Double_t *zBinLimitsArray= new Double_t[9] ;
-   zBinLimitsArray[0] = -50.00;
-   zBinLimitsArray[1] = -3.375;
-   zBinLimitsArray[2] = -1.605;
-   zBinLimitsArray[3] = -0.225;
-   zBinLimitsArray[4] = 1.065;
-   zBinLimitsArray[5] = 2.445;
-   zBinLimitsArray[6] = 4.245;
-   zBinLimitsArray[7] = 50.00;
-   zBinLimitsArray[8] = 1000.00;
-
-   Double_t *multiplicityBinLimitsArrayTracks= new Double_t[6];
-   multiplicityBinLimitsArrayTracks[0] = 0;
-   multiplicityBinLimitsArrayTracks[1] = 8.5;
-   multiplicityBinLimitsArrayTracks[2] = 16.5;
-   multiplicityBinLimitsArrayTracks[3] = 27.5;
-   multiplicityBinLimitsArrayTracks[4] = 41.5;
-   multiplicityBinLimitsArrayTracks[5] = 200.;
-   if(fIsHeavyIon){
-      multiplicityBinLimitsArrayTracks[0] = 0;
-      multiplicityBinLimitsArrayTracks[1] = 200.;
-      multiplicityBinLimitsArrayTracks[2] = 500.;
-      multiplicityBinLimitsArrayTracks[3] = 1000.;
-      multiplicityBinLimitsArrayTracks[4] = 1500.;
-      multiplicityBinLimitsArrayTracks[5] = 5000.;
-   }
-
-   Double_t *multiplicityBinLimitsArrayV0s= new Double_t[5];
-   multiplicityBinLimitsArrayV0s[0] = 2;
-   multiplicityBinLimitsArrayV0s[1] = 3;
-   multiplicityBinLimitsArrayV0s[2] = 4;
-   multiplicityBinLimitsArrayV0s[3] = 5;
-   multiplicityBinLimitsArrayV0s[4] = 9999;
-   if(fIsHeavyIon){
-      multiplicityBinLimitsArrayV0s[0] = 2;
-      multiplicityBinLimitsArrayV0s[1] = 10;
-      multiplicityBinLimitsArrayV0s[2] = 30;
-      multiplicityBinLimitsArrayV0s[3] = 50;
-      multiplicityBinLimitsArrayV0s[4] = 9999;
-   }
-
    const Int_t nDim = 4;
-   Int_t nBins[nDim] = {800,250,8,5};
+   Int_t nBins[nDim] = {800,250,7,4};
    Double_t xMin[nDim] = {0,0, 0,0};
-   Double_t xMax[nDim] = {0.8,25,8,5};
+   Double_t xMax[nDim] = {0.8,25,7,4};
 
    sESDMotherInvMassPtZM = new THnSparseF*[fnCuts];
    sESDMotherBackInvMassPtZM = new THnSparseF*[fnCuts];
@@ -321,6 +280,26 @@ void AliAnalysisTaskGammaConvV1::InitBack(){
       if (((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->DoBGCalculation()){
          TString cutstring = ((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber();
          TString cutstringMeson = ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetCutNumber();
+         
+         Int_t collisionSystem = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(0,1));
+         Int_t centMin = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(1,1));
+         Int_t centMax = atoi((TString)(((AliConversionCuts*)fCutArray->At(iCut))->GetCutNumber())(2,1));
+         
+         if(collisionSystem == 1 || collisionSystem == 2 ||
+            collisionSystem == 5 || collisionSystem == 8 ||
+            collisionSystem == 9){
+            centMin = centMin*10;
+            centMax = centMax*10; 
+         }
+         else if(collisionSystem == 3 || collisionSystem == 6){
+            centMin = centMin*5;
+            centMax = centMax*5;
+         }
+         else if(collisionSystem == 4 || collisionSystem == 7){
+            centMin = ((centMin*5)+45);
+            centMax = ((centMax*5)+45);
+         }
+         
          fBackList[iCut] = new TList();
          fBackList[iCut]->SetName(Form("%s_%s Back histograms",cutstring.Data(),cutstringMeson.Data()));
          fBackList[iCut]->SetOwner(kTRUE);
@@ -338,16 +317,11 @@ void AliAnalysisTaskGammaConvV1::InitBack(){
          fMotherList[iCut]->Add(sESDMotherInvMassPtZM[iCut]);
 
          if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->BackgroundHandlerType() == 0){
-            if(((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity()){
-               fBGHandler[iCut] = new AliGammaConversionAODBGHandler(9,6,((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
-               fBGHandler[iCut]->Initialize(zBinLimitsArray, multiplicityBinLimitsArrayTracks);
-               fBGHandlerRP[iCut] = NULL;
-            }
-            else{
-               fBGHandler[iCut] = new AliGammaConversionAODBGHandler(9,5,((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents());
-               fBGHandler[iCut]->Initialize(zBinLimitsArray, multiplicityBinLimitsArrayV0s);
-               fBGHandlerRP[iCut] = NULL;
-            }
+            fBGHandler[iCut] = new AliGammaConversionAODBGHandler(
+                                                                  collisionSystem,centMin,centMax,
+                                                                  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->GetNumberOfBGEvents(),
+                                                                  ((AliConversionMesonCuts*)fMesonCutArray->At(iCut))->UseTrackMultiplicity());
+            fBGHandlerRP[iCut] = NULL;
          }
          else{
             fBGHandlerRP[iCut] = new AliConversionAODBGHandlerRP(
@@ -692,8 +666,6 @@ void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects()
       }
    }
 
-
-
    fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1");
    if(!fV0Reader){printf("Error: No V0 Reader");return;} // GetV0Reader
 
@@ -715,7 +687,18 @@ void AliAnalysisTaskGammaConvV1::UserCreateOutputObjects()
 
    PostData(1, fOutputContainer);
 }
-
+//_____________________________________________________________________________
+Bool_t AliAnalysisTaskGammaConvV1::Notify()
+{
+   if(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetDoEtaShift()){
+      for(Int_t iCut = 0; iCut<fnCuts;iCut++){
+//          cout << iCut << "\t eta shift \t" <<((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()<< endl;
+         if(!((AliConversionCuts*)fCutArray->At(iCut))->GetDoEtaShift()) continue;
+         ((AliConversionCuts*)fCutArray->At(iCut))->SetEtaShift(((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEtaShift());
+      }
+   }
+   return kTRUE;
+}
 //_____________________________________________________________________________
 void AliAnalysisTaskGammaConvV1::UserExec(Option_t *)
 {
@@ -1090,7 +1073,7 @@ void AliAnalysisTaskGammaConvV1::ProcessMCParticles()
          }
       } // Converted MC Gamma
       if(fDoMesonAnalysis){
-         if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack)){
+         if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelectedMC(particle,fMCStack,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
             TParticle* daughter0 = (TParticle*)fMCStack->Particle(particle->GetFirstDaughter());
             TParticle* daughter1 = (TParticle*)fMCStack->Particle(particle->GetLastDaughter());
 
@@ -1102,9 +1085,9 @@ void AliAnalysisTaskGammaConvV1::ProcessMCParticles()
             }
             Double_t mesonY = 10.;
             if(particle->Energy() - particle->Pz() == 0 || particle->Energy() + particle->Pz() == 0){
-               mesonY=10.;
+               mesonY=10.-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
             } else{
-               mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())));
+               mesonY = 0.5*(TMath::Log((particle->Energy()+particle->Pz()) / (particle->Energy()-particle->Pz())))-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift();
             }
 
             if(particle->GetPdgCode() == 111){
@@ -1149,13 +1132,12 @@ void AliAnalysisTaskGammaConvV1::CalculatePi0Candidates(){
             AliAODConversionMother *pi0cand = new AliAODConversionMother(gamma0,gamma1);
             pi0cand->SetLabels(firstGammaIndex,secondGammaIndex);
 
-            if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE))){
+            if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(pi0cand,kTRUE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
                hESDMotherInvMassPt[fiCut]->Fill(pi0cand->M(),pi0cand->Pt());
-
                if(pi0cand->GetAlpha()<0.1)
                   hESDMotherInvMassEalpha[fiCut]->Fill(pi0cand->M(),pi0cand->E());
                if (fDoMesonQA){
-                  Double_t sparesFill2[3] = {pi0cand->M(),pi0cand->Pt(),pi0cand->Rapidity()};
+                  Double_t sparesFill2[3] = {pi0cand->M(),pi0cand->Pt(),pi0cand->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()};
                   sESDMotherInvMassPtY[fiCut]->Fill(sparesFill2,1);
                }
                if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->DoBGCalculation()){
@@ -1163,7 +1145,6 @@ void AliAnalysisTaskGammaConvV1::CalculatePi0Candidates(){
                   Int_t mbin = 0;
 
                   if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->BackgroundHandlerType() == 0){
-
                      zbin = fBGHandler[fiCut]->GetZBinIndex(fInputEvent->GetPrimaryVertex()->GetZ());
                      if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->UseTrackMultiplicity()){
                         mbin = fBGHandler[fiCut]->GetMultiplicityBinIndex(fNumberOfESDTracks);
@@ -1279,7 +1260,7 @@ void AliAnalysisTaskGammaConvV1::ProcessTrueMesonCandidates(AliAODConversionMoth
                hESDTruePrimaryMotherInvMassPt[fiCut]->Fill(Pi0Candidate->M(),Pi0Candidate->Pt(),weighted);
 
                if (fDoMesonQA){
-                  Double_t sparesFill[3] = {Pi0Candidate->M(),Pi0Candidate->Pt(),Pi0Candidate->Rapidity()};
+                  Double_t sparesFill[3] = {Pi0Candidate->M(),Pi0Candidate->Pt(),Pi0Candidate->Rapidity()-((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()};
                   sESDTruePrimaryMotherInvMassPtY[fiCut]->Fill(sparesFill,1);
                   if(isTruePi0){ // Only primary pi0 for resolution
                      hESDTruePrimaryPi0MCPtResolPt[fiCut]->Fill(((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),(Pi0Candidate->Pt()-((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt())/((TParticle*)MCStack->Particle(gamma1MotherLabel))->Pt(),weighted);
@@ -1340,7 +1321,7 @@ void AliAnalysisTaskGammaConvV1::CalculateBackground(){
 
                RotateParticle(&currentEventGoodV02);
                AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&currentEventGoodV02);
-               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE))){
+               if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
                   hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                   Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                   sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -1369,7 +1350,7 @@ void AliAnalysisTaskGammaConvV1::CalculateBackground(){
                   }
 
                   AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
-                  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE))){
+                  if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
                      hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                      Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                      sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -1399,7 +1380,7 @@ void AliAnalysisTaskGammaConvV1::CalculateBackground(){
 
                      AliAODConversionMother *backgroundCandidate = new AliAODConversionMother(&currentEventGoodV0,&previousGoodV0);
 
-                     if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE))){
+                     if((((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift()))){
                         hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate->M(),backgroundCandidate->Pt());
                         Double_t sparesFill[4] = {backgroundCandidate->M(),backgroundCandidate->Pt(),(Double_t)zbin,(Double_t)mbin};
                         sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,1);
@@ -1445,7 +1426,7 @@ void AliAnalysisTaskGammaConvV1::CalculateBackgroundRP(){
 
                AliAODConversionMother backgroundCandidate(gamma0,gamma1);
 
-               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate,kFALSE)){
+               if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
                   hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                   Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
                   sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
@@ -1479,7 +1460,7 @@ void AliAnalysisTaskGammaConvV1::CalculateBackgroundRP(){
 
                   AliAODConversionMother backgroundCandidate(gamma0,gamma1);
 
-                  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate,kFALSE)){
+                  if(((AliConversionMesonCuts*)fMesonCutArray->At(fiCut))->MesonIsSelected(&backgroundCandidate,kFALSE,((AliConversionCuts*)fCutArray->At(fiCut))->GetEtaShift())){
                      hESDMotherBackInvMassPt[fiCut]->Fill(backgroundCandidate.M(),backgroundCandidate.Pt());
                      Double_t sparesFill[4] = {backgroundCandidate.M(),backgroundCandidate.Pt(),(Double_t)zbin,(Double_t)mbin};
                      sESDMotherBackInvMassPtZM[fiCut]->Fill(sparesFill,weight);
index ba6b2e6..abfcc4e 100644 (file)
@@ -8,6 +8,7 @@
 #include "AliGammaConversionAODBGHandler.h"
 #include "AliConversionAODBGHandlerRP.h"
 #include "AliConversionMesonCuts.h"
+#include "AliAnalysisManager.h"
 #include "TH3.h"
 #include "TH3F.h"
 
@@ -19,6 +20,7 @@ class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
    virtual ~AliAnalysisTaskGammaConvV1();
 
    virtual void   UserCreateOutputObjects();
+   virtual Bool_t Notify();
    virtual void   UserExec(Option_t *);
    virtual void   Terminate(const Option_t*);
    void InitBack();
@@ -134,7 +136,7 @@ class AliAnalysisTaskGammaConvV1 : public AliAnalysisTaskSE {
    TH1I **hNGoodESDTracks;
    TH1I **hNGammaCandidates;
    TH1I **hNV0Tracks;
-
+   
    TRandom3 fRandom;
    Int_t fnGammaCandidates;
    Double_t *fUnsmearedPx; //[fnGammaCandidates]
index 5ae5c66..287f9f0 100644 (file)
@@ -174,6 +174,9 @@ AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
    fGeneratorNames(NULL),
    fCutString(NULL),
    fUtils(NULL),
+   fEtaShift(0.0),
+   fDoEtaShift(kFALSE),
+   fForceEtaShift(0),
    hdEdxCuts(NULL),
    hTPCdEdxbefore(NULL),
    hTPCdEdxafter(NULL),
@@ -195,6 +198,7 @@ AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
    hVertexZ(NULL),
    hTriggerClass(NULL),
    hTriggerClassSelected(NULL)
+
 {
    InitPIDResponse();
    for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
@@ -203,9 +207,9 @@ AliConversionCuts::AliConversionCuts(const char *name,const char *title) :
    fElectronLabelArray = new Int_t[fElectronArraySize];
    fUtils = new AliAnalysisUtils();
    //if you do not want to apply the cut on the distance between the SPD and TRK vertex:
-   //fUtils->SetCutOnZVertexSPD(kFALSE); 
+   //fUtils->SetCutOnZVertexSPD(kFALSE);
+
 
-   
 }
 
 //________________________________________________________________________
@@ -299,6 +303,9 @@ AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
    fGeneratorNames(ref.fGeneratorNames),
    fCutString(NULL),
    fUtils(NULL),
+   fEtaShift(ref.fEtaShift),
+   fDoEtaShift(ref.fDoEtaShift),
+   fForceEtaShift(ref.fForceEtaShift),
    hdEdxCuts(NULL),
    hTPCdEdxbefore(NULL),
    hTPCdEdxafter(NULL),
@@ -327,6 +334,7 @@ AliConversionCuts::AliConversionCuts(const AliConversionCuts &ref) :
    fElectronLabelArray = new Int_t[fElectronArraySize];
    fUtils = new AliAnalysisUtils();
    // dont copy histograms (if you like histograms, call InitCutHistograms())
+
 }
 
 
@@ -520,7 +528,7 @@ void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
       hVertexZ=new TH1F(Form("VertexZ %s",GetCutNumber().Data()),"VertexZ",1000,-50,50);
       fHistograms->Add(hVertexZ);
 
-      hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",34,-0.5,33.5);
+      hTriggerClass= new TH1F(Form("OfflineTrigger %s",GetCutNumber().Data()),"OfflineTrigger",35,-0.5,34.5);
       hTriggerClass->GetXaxis()->SetBinLabel( 1,"kMB");
       hTriggerClass->GetXaxis()->SetBinLabel( 2,"kINT7");
       hTriggerClass->GetXaxis()->SetBinLabel( 3,"kMUON");
@@ -549,15 +557,16 @@ void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
       hTriggerClass->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
       hTriggerClass->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
       hTriggerClass->GetXaxis()->SetBinLabel(28,"kUserDefined");
-      hTriggerClass->GetXaxis()->SetBinLabel(29,"kFastOnly");
-      hTriggerClass->GetXaxis()->SetBinLabel(30,"kAnyINT");
-      hTriggerClass->GetXaxis()->SetBinLabel(31,"kAny");
-      hTriggerClass->GetXaxis()->SetBinLabel(32,"V0AND");
-      hTriggerClass->GetXaxis()->SetBinLabel(33,"NOT kFastOnly");
-      hTriggerClass->GetXaxis()->SetBinLabel(34,"failed Physics Selection");
+      hTriggerClass->GetXaxis()->SetBinLabel(29,"kTRD");
+      hTriggerClass->GetXaxis()->SetBinLabel(30,"kFastOnly");
+      hTriggerClass->GetXaxis()->SetBinLabel(31,"kAnyINT");
+      hTriggerClass->GetXaxis()->SetBinLabel(32,"kAny");
+      hTriggerClass->GetXaxis()->SetBinLabel(33,"V0AND");
+      hTriggerClass->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
+      hTriggerClass->GetXaxis()->SetBinLabel(35,"failed Physics Selection");
       fHistograms->Add(hTriggerClass);
 
-      hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",33,-0.5,32.5);
+      hTriggerClassSelected= new TH1F(Form("OfflineTriggerSelected %s",GetCutNumber().Data()),"OfflineTriggerSelected",34,-0.5,33.5);
       hTriggerClassSelected->GetXaxis()->SetBinLabel( 1,"kMB");
       hTriggerClassSelected->GetXaxis()->SetBinLabel( 2,"kINT7");
       hTriggerClassSelected->GetXaxis()->SetBinLabel( 3,"kMUON");
@@ -586,11 +595,12 @@ void AliConversionCuts::InitCutHistograms(TString name, Bool_t preCut){
       hTriggerClassSelected->GetXaxis()->SetBinLabel(26,"kMuonUnlikeLowPt8");
       hTriggerClassSelected->GetXaxis()->SetBinLabel(27,"kMuonUnlikeLowPt0");
       hTriggerClassSelected->GetXaxis()->SetBinLabel(28,"kUserDefined");
-      hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kFastOnly");
-      hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kAnyINT");
-      hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAny");
-      hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"V0AND");
-      hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"NOT kFastOnly");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(29,"kTRD");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(30,"kFastOnly");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(31,"kAnyINT");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(32,"kAny");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(33,"V0AND");
+      hTriggerClassSelected->GetXaxis()->SetBinLabel(34,"NOT kFastOnly");
       fHistograms->Add(hTriggerClassSelected);
    }
 }
@@ -651,7 +661,7 @@ Bool_t AliConversionCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMC
    if(fInputEvent->IsA()==AliESDEvent::Class()){
       AliTriggerAnalysis fTriggerAnalysis;// = new AliTriggerAnalysis;
       fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((AliESDEvent*)fInputEvent, AliTriggerAnalysis::kV0AND);
-      if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(31);
+      if(fHasV0AND&&hTriggerClass)hTriggerClass->Fill(32);
    }
 
    // Number of Contributors Cut
@@ -706,9 +716,14 @@ Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCSt
 
    if (particle->GetPdgCode() == 22){
 
-      if(particle->R() > fMaxR) return kFALSE;
-      if(abs(particle->Eta())> fEtaCut || abs(particle->Eta())< fEtaCutMin) return kFALSE;
 
+      if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) )
+         return kFALSE;
+      if(fEtaCutMin>-0.1){
+         if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) )
+            return kFALSE;
+      }
+      
       if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
          return kFALSE; // no photon as mothers!
       }
@@ -744,9 +759,14 @@ Bool_t AliConversionCuts::PhotonIsSelectedMC(TParticle *particle,AliStack *fMCSt
          return kFALSE; // no reconstruction below the Pt cut
       }
 
-      if( abs(ePos->Eta())> fEtaCut || abs(ePos->Eta())< fEtaCutMin ||
-          abs(eNeg->Eta())> fEtaCut || abs(eNeg->Eta())< fEtaCutMin ) {
+      if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ||
+          eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) )
          return kFALSE;
+
+      if(fEtaCutMin > -0.1){
+         if( (ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift)) ||
+             (eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift)) )
+            return kFALSE;
       }
 
       if(ePos->R()>fMaxR){
@@ -904,7 +924,7 @@ Bool_t AliConversionCuts::PhotonIsSelected(AliConversionPhotonBase *photon, AliV
    //Selection of Reconstructed Photons
 
    FillPhotonCutIndex(kPhotonIn);
-   
+
    if(event->IsA()==AliESDEvent::Class()) {
       if(!SelectV0Finder( ( ((AliESDEvent*)event)->GetV0(photon->GetV0Index())) ) ){
          FillPhotonCutIndex(kOnFly);
@@ -1011,13 +1031,18 @@ Bool_t AliConversionCuts::AcceptanceCuts(AliConversionPhotonBase *photon) {
    cutIndex++;
 
 
-   if(abs(photon->GetPhotonEta())> fEtaCut || abs(photon->GetPhotonEta())< fEtaCutMin){
+   if( photon->GetPhotonEta() > (fEtaCut + fEtaShift)    || photon->GetPhotonEta() < (-fEtaCut + fEtaShift) ){
       if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
       return kFALSE;
    }
+   if(fEtaCutMin>-0.1){
+      if( photon->GetPhotonEta() < (fEtaCutMin + fEtaShift) && photon->GetPhotonEta() > (-fEtaCutMin + fEtaShift) ){
+         if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
+         return kFALSE;
+      }
+   }
    cutIndex++;
 
-
    if(photon->GetPhotonPt()<fPtCut){
       if(hAcceptanceCuts)hAcceptanceCuts->Fill(cutIndex);
       return kFALSE;
@@ -1091,14 +1116,20 @@ Bool_t AliConversionCuts::TracksAreSelected(AliVTrack * negTrack, AliVTrack * po
       return kFALSE;
    }
    cutIndex++;
-
+   
    // Acceptance
-
-   if(abs(negTrack->Eta()) > fEtaCut || abs(negTrack->Eta()) < fEtaCutMin ||
-      abs(posTrack->Eta())> fEtaCut || abs(posTrack->Eta())< fEtaCutMin) {
+   if( posTrack->Eta() > (fEtaCut + fEtaShift) || posTrack->Eta() < (-fEtaCut + fEtaShift) ||
+       negTrack->Eta() > (fEtaCut + fEtaShift) || negTrack->Eta() < (-fEtaCut + fEtaShift) ){
       if(hTrackCuts)hTrackCuts->Fill(cutIndex);
       return kFALSE;
    }
+   if(fEtaCutMin>-0.1){
+      if( (posTrack->Eta() < (fEtaCutMin + fEtaShift) && posTrack->Eta() > (-fEtaCutMin + fEtaShift)) ||
+          (negTrack->Eta() < (fEtaCutMin + fEtaShift) && negTrack->Eta() > (-fEtaCutMin + fEtaShift)) ){
+         if(hTrackCuts)hTrackCuts->Fill(cutIndex);
+         return kFALSE;
+      }
+   }
    cutIndex++;
 
    // Single Pt Cut
@@ -1406,18 +1437,28 @@ Bool_t AliConversionCuts::AcceptanceCut(TParticle *particle, TParticle * ePos,TP
       return kFALSE;
    }
 
-   if(abs(particle->Eta())> fEtaCut || abs(particle->Eta())< fEtaCutMin){
+   
+   if( particle->Eta() > (fEtaCut + fEtaShift) || particle->Eta() < (-fEtaCut + fEtaShift) ){
       return kFALSE;
    }
-
-   if(abs(ePos->Eta())> fEtaCut || abs(ePos->Eta())< fEtaCutMin){
+   if( ePos->Eta() > (fEtaCut + fEtaShift) || ePos->Eta() < (-fEtaCut + fEtaShift) ){
       return kFALSE;
    }
-
-   if(abs(eNeg->Eta())> fEtaCut || abs(eNeg->Eta())< fEtaCutMin){
+   if( eNeg->Eta() > (fEtaCut + fEtaShift) || eNeg->Eta() < (-fEtaCut + fEtaShift) ){
       return kFALSE;
    }
-
+   if(fEtaCutMin>-0.1){
+      if( particle->Eta() < (fEtaCutMin + fEtaShift) && particle->Eta() > (-fEtaCutMin + fEtaShift) ){
+         return kFALSE;
+      }
+      if( ePos->Eta() < (fEtaCutMin + fEtaShift) && ePos->Eta() > (-fEtaCutMin + fEtaShift) ){
+         return kFALSE;
+      }
+      if( eNeg->Eta() < (fEtaCutMin + fEtaShift) && eNeg->Eta() > (-fEtaCutMin + fEtaShift) ){
+         return kFALSE;
+      }
+   }
+   
    if( ePos->Pt()< fSinglePtCut ||  eNeg->Pt()< fSinglePtCut){
       return kFALSE;
    }
@@ -1722,7 +1763,7 @@ Bool_t AliConversionCuts::SetIsHeavyIon(Int_t isHeavyIon)
    case 9:
       fIsHeavyIon=2;
       fDetectorCentrality=1;
-      break;         
+      break;
    default:
       AliError(Form("SetHeavyIon not defined %d",isHeavyIon));
       return kFALSE;
@@ -1883,11 +1924,11 @@ Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
       fEtaCutMin               = -0.1;
       fLineCutZRSlopeMin = 0.;
       break;
-   case 5: // 0.9 - 1.4
-      fEtaCut          = 1.4;
+   case 5: // 0.5
+      fEtaCut          = 0.5;
       fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
-      fEtaCutMin               = 0.9;
-      fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
+      fEtaCutMin               = -0.1;
+      fLineCutZRSlopeMin = 0.;
       break;
    case 6: // 5.
       fEtaCut          = 5.;
@@ -1895,17 +1936,23 @@ Bool_t AliConversionCuts::SetEtaCut(Int_t etaCut)
       fEtaCutMin               = -0.1;
       fLineCutZRSlopeMin = 0.;
       break;
-   case 7: // 0.1 - 0.8
-      fEtaCut          = 0.8;
+   case 7: 
+      fEtaCut          = 0.3;
       fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
-      fEtaCutMin               = 0.1;
-      fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
+      fEtaCutMin               = -0.1;
+      fLineCutZRSlopeMin = 0.;
       break;
-   case 8: // 0.1 - 0.8
-      fEtaCut          = 0.9;
+   // case 8: // 0.1 - 0.8
+   //    fEtaCut               = 0.9;
+   //    fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
+   //    fEtaCutMin            = 0.1;
+   //    fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
+   //    break;
+   case 8: // 0.4
+      fEtaCut          = 0.4;
       fLineCutZRSlope = tan(2*atan(exp(-fEtaCut)));
-      fEtaCutMin               = 0.1;
-      fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin)));
+      fEtaCutMin               = -0.1;
+      fLineCutZRSlopeMin = 0.;
       break;
    case 9: // 10
       fEtaCut          = 10;
@@ -2615,7 +2662,7 @@ Double_t AliConversionCuts::GetCentrality(AliVEvent *event)
        if (fIsHeavyIon==2){
          return fESDCentrality->GetCentralityPercentile("V0A"); // default for pPb
        }
-       else{         
+       else{
          return fESDCentrality->GetCentralityPercentile("V0M"); // default
        }
       }
@@ -2719,13 +2766,13 @@ Bool_t AliConversionCuts::VertexZCut(AliVEvent *event){
    Double_t fVertexZ=event->GetPrimaryVertex()->GetZ();
 
    if(abs(fVertexZ)>fMaxVertexZ)return kFALSE;
-   
+
    if (fIsHeavyIon == 2){
      if(fUtils->IsFirstEventInChunk(event)) return kFALSE;
      if(!fUtils->IsVertexSelected2013pA(event)) return kFALSE;
 
    }
-   
+
    return kTRUE;
 }
 ///________________________________________________________________________
@@ -2790,7 +2837,7 @@ Bool_t AliConversionCuts::IsTriggerSelected()
 
    // Fill Histogram
    if(hTriggerClass){
-      if (fIsSDDFired) hTriggerClass->Fill(32);
+      if (fIsSDDFired) hTriggerClass->Fill(33);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClass->Fill(0);
       if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClass->Fill(1);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClass->Fill(2);
@@ -2827,14 +2874,15 @@ Bool_t AliConversionCuts::IsTriggerSelected()
       if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClass->Fill(25);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClass->Fill(26);
       if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClass->Fill(27);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(28);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(29);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(30);
-      if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(33);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClass->Fill(28);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClass->Fill(29);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClass->Fill(30);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClass->Fill(31);
+      if (!fInputHandler->IsEventSelected()) hTriggerClass->Fill(34);
    }
 
    if(hTriggerClassSelected && isSelected){
-      if (!fIsSDDFired) hTriggerClassSelected->Fill(32);
+      if (!fIsSDDFired) hTriggerClassSelected->Fill(33);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMB)hTriggerClassSelected->Fill(0);
       if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)hTriggerClassSelected->Fill(1);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)hTriggerClassSelected->Fill(2);
@@ -2871,9 +2919,10 @@ Bool_t AliConversionCuts::IsTriggerSelected()
       if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)hTriggerClassSelected->Fill(25);
       if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)hTriggerClassSelected->Fill(26);
       if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)hTriggerClassSelected->Fill(27);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(28);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(29);
-      if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(30);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)hTriggerClassSelected->Fill(28);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)hTriggerClassSelected->Fill(29);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)hTriggerClassSelected->Fill(30);
+      if (fInputHandler->IsEventSelected() & AliVEvent::kAny)hTriggerClassSelected->Fill(31);
    }
 
    if(!isSelected)return kFALSE;
@@ -3103,12 +3152,12 @@ void AliConversionCuts::GetNotRejectedParticles(Int_t rejection, TList *HeaderLi
       fGeneratorNames = new TString[1];
       fGeneratorNames[0] = "NoCocktailGeneratorFound";
 //       }
-            
-      AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent->GenEventHeader());      
+
+      AliGenPythiaEventHeader *mcHeaderPythia = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent->GenEventHeader());
       if (mcHeaderPythia) fGeneratorNames[0] = "NoCocktailGeneratorFound_Pythia";
-      AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(MCEvent->GenEventHeader());      
+      AliGenDPMjetEventHeader *mcHeaderPhojet = dynamic_cast<AliGenDPMjetEventHeader*>(MCEvent->GenEventHeader());
       if (mcHeaderPhojet) fGeneratorNames[0] = "NoCocktailGeneratorFound_Phojet";
-      AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(MCEvent->GenEventHeader());      
+      AliGenHijingEventHeader *mcHeaderHijing = dynamic_cast<AliGenHijingEventHeader*>(MCEvent->GenEventHeader());
       if (mcHeaderHijing) fGeneratorNames[0] = "NoCocktailGeneratorFound_Hijing";
 
       SetRejectExtraSignalsCut(0);
@@ -3164,7 +3213,7 @@ Int_t AliConversionCuts::IsEventAcceptedByConversionCut(AliConversionCuts *Reade
 
 Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack){
    if (!(period.CompareTo("LHC12f1a") == 0 || period.CompareTo("LHC12f1b") == 0  || period.CompareTo("LHC12i3") == 0 )) return 1.;
-   
+
    Int_t kCaseGen = 0;
    for (Int_t i = 0; i < fnHeaders; i++){
       if (index >= fNotRejectedStart[i] && index < fNotRejectedEnd[i]+1){
@@ -3187,13 +3236,13 @@ Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliSta
             kCaseGen = 2;
          } else if (fGeneratorNames[i].CompareTo("NoCocktailGeneratorFound_Hijing") == 0){
             kCaseGen = 3;
-         } 
+         }
 //          cout << "resulting kCaseGen :" << kCaseGen << endl;
       }
    }
-   
+
    Double_t mesonPt = ((TParticle*)MCStack->Particle(index))->Pt();
-   
+
    Double_t mesonMass = ((TParticle*)MCStack->Particle(index))->GetCalcMass();
    Float_t functionResult = 1.;
    if (kCaseGen == 1){
@@ -3246,7 +3295,7 @@ Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliSta
       }
       functionResult = a*TMath::Power(mesonPt,-1.*(b+c/(TMath::Power(mesonPt,d)+e)))*1./mesonPt *1./1.6 *1./(2.* TMath::Pi());
    }
-   
+
    Float_t dNdyData = 2.2328;
    Float_t nData = 7.1473;
    Float_t tData = 0.1346;
@@ -3262,7 +3311,7 @@ Float_t AliConversionCuts::GetWeightForMeson(TString period, Int_t index, AliSta
    Float_t tsallisData = dNdyData / ( 2 * TMath::Pi())*(nData-1.)*(nData-2.) / (nData*tData*(nData*tData+mesonMass*(nData-2.)))  * TMath::Power(1.+(TMath::Sqrt(mesonPt*mesonPt+mesonMass*mesonMass)-mesonMass)/(nData*tData), -nData);
 //    cout << "tsallisData/functionResult: " << tsallisData/functionResult << endl;
    return tsallisData/functionResult;
-//       return 
+//       return
 }
 
 ///________________________________________________________________________
index 41f0a51..e92be4a 100644 (file)
@@ -15,7 +15,7 @@
 #include "AliAnalysisCuts.h"
 #include "TH1F.h"
 #include "AliAnalysisUtils.h"
-
+#include "AliAnalysisManager.h"
 
 class AliESDEvent;
 class AliAODEvent;
@@ -110,9 +110,9 @@ class AliConversionCuts : public AliAnalysisCuts {
   virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
 
   TString GetCutNumber();
-
+  
   void GetCentralityRange(Double_t range[2]){range[0]=10*fCentralityMin;range[1]=10*fCentralityMax;};
-
+  
   // Cut Selection
   Bool_t EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent);
   Int_t IsEventAcceptedByConversionCut(AliConversionCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Bool_t isHeavyIon);
@@ -135,6 +135,21 @@ class AliConversionCuts : public AliAnalysisCuts {
   void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};}
   TList *GetCutHistograms(){return fHistograms;}
   void FillPhotonCutIndex(Int_t photoncut){if(hCutIndex)hCutIndex->Fill(photoncut);}
+  void SetEtaShift(Double_t etaShift) {
+     fEtaShift = etaShift;
+     fLineCutZRSlope = tan(2*atan(exp(-fEtaCut + etaShift)));
+     if(fEtaCutMin > -0.1)
+        fLineCutZRSlopeMin = tan(2*atan(exp(-fEtaCutMin + etaShift)));
+     fDoEtaShift = kTRUE;
+  }
+  Double_t GetEtaShift() {return fEtaShift;}
+  Bool_t GetDoEtaShift(){return fDoEtaShift;}
+  void DoEtaShift(Bool_t doEtaShift){fDoEtaShift = doEtaShift;}
+  void ForceEtaShift(Int_t forcedShift){
+     fForceEtaShift = forcedShift;
+     if(forcedShift>0)fDoEtaShift = kTRUE;
+  }
+  Int_t IsEtaShiftForced() {return fForceEtaShift;}
 
   static AliVTrack * GetTrack(AliVEvent * event, Int_t label);
   static AliESDtrack *GetESDTrack(AliESDEvent * event, Int_t label);
@@ -198,6 +213,8 @@ class AliConversionCuts : public AliAnalysisCuts {
   Bool_t SetSharedElectronCut(Int_t sharedElec);
   Bool_t SetToCloseV0sCut(Int_t toClose);
   Bool_t SetRejectExtraSignalsCut(Int_t extraSignal);
+
+
   // Request Flags
 
   Int_t IsHeavyIon(){return fIsHeavyIon;}
@@ -214,7 +231,8 @@ class AliConversionCuts : public AliAnalysisCuts {
   Int_t * GetAcceptedHeaderStart(){return fNotRejectedStart;}
   Int_t * GetAcceptedHeaderEnd(){return fNotRejectedEnd;}
   TList* GetAcceptedHeader(){return fHeaderList;}
-
+  
+  
   protected:
   TList *fHistograms;
   TList *fHeaderList;
@@ -307,6 +325,9 @@ class AliConversionCuts : public AliAnalysisCuts {
   TString *fGeneratorNames; //[fnHeaders]
   TObjString *fCutString; // cut number used for analysis
   AliAnalysisUtils *fUtils;
+  Double_t fEtaShift;
+  Bool_t fDoEtaShift;
+  Int_t  fForceEtaShift;
 
   // Histograms
   TH1F *hdEdxCuts;  // bookkeeping for dEdx cuts
index 0a74603..d1d9564 100644 (file)
@@ -207,7 +207,7 @@ void AliConversionMesonCuts::InitCutHistograms(TString name){
 
 
 //________________________________________________________________________
-Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack){
+Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
    // Returns true for all pions within acceptance cuts for decay into 2 photons
    // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
    
@@ -218,9 +218,9 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *
       
       Double_t rapidity = 10.;
       if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
-         rapidity=8.;
+         rapidity=8.-fRapidityShift;
       } else{
-         rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())));
+         rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
       }        
       
       // Rapidity Cut
@@ -244,7 +244,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *
 }
 
 //________________________________________________________________________
-Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack){
+Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
    // Returns true for all pions within acceptance cuts for decay into 2 photons
    // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
 
@@ -256,10 +256,10 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliS
 
       Double_t rapidity = 10.;
       if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
-         rapidity=8.;
+         rapidity=8.-fRapidityShift;
       }
       else{
-         rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())));
+         rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
       }        
                
       // Rapidity Cut
@@ -296,7 +296,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliS
 
 
 ///________________________________________________________________________
-Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal)
+Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
 {
    // Selection of reconstructed Meson candidates
    // Use flag IsSignal in order to fill Fill different
@@ -320,7 +320,7 @@ Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_
    else{
       // PseudoRapidity Cut --> But we cut on Rapidity !!!
       cutIndex++;
-      if(abs(pi0->Rapidity())>fRapidityCutMeson){
+      if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
          if(hist)hist->Fill(cutIndex);
          return kFALSE;
       }
@@ -361,13 +361,10 @@ Bool_t AliConversionMesonCuts::UpdateCutString() {
    ///Update the cut string (if it has been created yet)
 
    if(fCutString && fCutString->GetString().Length() == kNCuts) {
-      //         cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
       fCutString->SetString(GetCutNumber());
    } else {
-      //         cout << "fCutString not yet initialized, will not be updated" << endl;
       return kFALSE;
    }
-   //   cout << fCutString->GetString().Data() << endl;
    return kTRUE;
 }
 
@@ -651,7 +648,15 @@ Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
    case 6:  //
       fRapidityCutMeson   = 0.75;
       break;
-
+   case 7:  //
+      fRapidityCutMeson   = 0.3;
+      break;
+   case 8:  //
+      fRapidityCutMeson   = 0.35;
+      break;
+   case 9:  //
+      fRapidityCutMeson   = 0.4;
+      break;
    default:
       cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
       return kFALSE;
index d1d5990..2824608 100644 (file)
@@ -72,9 +72,9 @@ class AliConversionMesonCuts : public AliAnalysisCuts {
   TString GetCutNumber();
 
   // Cut Selection
-  Bool_t MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal=kTRUE);
-  Bool_t MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack);
-  Bool_t MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack);
+  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.);
   void PrintCuts();
 
   void InitCutHistograms(TString name="");
index 1c71284..27bbfad 100644 (file)
@@ -598,10 +598,10 @@ Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
 ///Update the cut string (if it has been created yet)
 
   if(fCutString && fCutString->GetString().Length() == kNCuts) {
-        cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
+//         cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
        fCutString->SetString(GetCutNumber());
   } else {
-        cout << "fCutString not yet initialized, will not be updated" << endl;
+//         cout << "fCutString not yet initialized, will not be updated" << endl;
        return kFALSE;
   }
  // cout << fCutString->GetString().Data() << endl;
@@ -612,7 +612,7 @@ Bool_t AliDalitzElectronCuts::UpdateCutString(cutIds cutID, Int_t value) {
 Bool_t AliDalitzElectronCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
    // Initialize Cuts from a given Cut string
 
-  cout<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
+//   out<<"Set Cut Number: "<<analysisCutSelection.Data()<<endl;
   if(analysisCutSelection.Length()!=kNCuts) {
        AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
        return kFALSE;
index e647d5a..d7c3975 100644 (file)
@@ -62,6 +62,259 @@ AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t binsZ,UInt
   // constructor
 }
 
+
+AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult) :
+  TObject(),
+  fNEvents(nEvents),
+  fBGEventCounter(NULL),
+  fBGEventENegCounter(NULL),
+  fBGProbability(NULL),
+  fBGEventVertex(NULL),
+  fNBinsZ(8),
+  fNBinsMultiplicity(5),
+  fBinLimitsArrayZ(NULL),
+  fBinLimitsArrayMultiplicity(NULL),
+  fBGEvents(fNBinsZ,AliGammaConversionMultipicityVector(fNBinsMultiplicity,AliGammaConversionBGEventVector(nEvents))),
+  fBGEventsENeg(fNBinsZ,AliGammaConversionMultipicityVector(fNBinsMultiplicity,AliGammaConversionBGEventVector(nEvents)))
+{
+  // constructor
+   
+   fBinLimitsArrayZ= new Double_t[8] ;
+   if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
+      fBinLimitsArrayZ[0] = -50.00;
+      fBinLimitsArrayZ[1] = -5.5;
+      fBinLimitsArrayZ[2] = -2.9;
+      fBinLimitsArrayZ[3] = -0.65;
+      fBinLimitsArrayZ[4] = 1.45;
+      fBinLimitsArrayZ[5] = 3.65;
+      fBinLimitsArrayZ[6] = 6.15;
+      fBinLimitsArrayZ[7] = 50;
+   }
+   else if(collisionSystem == 0){
+      fBinLimitsArrayZ[0] = -50.00;
+      fBinLimitsArrayZ[1] = -3.375;
+      fBinLimitsArrayZ[2] = -1.605;
+      fBinLimitsArrayZ[3] = -0.225;
+      fBinLimitsArrayZ[4] = 1.065;
+      fBinLimitsArrayZ[5] = 2.445;
+      fBinLimitsArrayZ[6] = 4.245;
+      fBinLimitsArrayZ[7] = 50.00;
+   }
+   else{ 
+      fBinLimitsArrayZ[0] = -50.00;
+      fBinLimitsArrayZ[1] = -5.85;
+      fBinLimitsArrayZ[2] = -3.35;
+      fBinLimitsArrayZ[3] = -1.15;
+      fBinLimitsArrayZ[4] = 0.85;
+      fBinLimitsArrayZ[5] = 2.95;
+      fBinLimitsArrayZ[6] = 5.55;
+      fBinLimitsArrayZ[7] = 50.00;
+   }
+
+
+
+   fBinLimitsArrayMultiplicity= new Double_t[5];
+   if(useTrackMult){ // pp
+      fBinLimitsArrayMultiplicity[0] = 0;
+      fBinLimitsArrayMultiplicity[1] = 8.5;
+      fBinLimitsArrayMultiplicity[2] = 16.5;
+      fBinLimitsArrayMultiplicity[3] = 27.5;
+      fBinLimitsArrayMultiplicity[4] = 200.;
+      if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
+         if(centMin == 0 && centMax == 5){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 1540.;
+            fBinLimitsArrayMultiplicity[2] = 1665.;
+            fBinLimitsArrayMultiplicity[3] = 1780.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 0 && centMax == 10){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 1360.;
+            fBinLimitsArrayMultiplicity[2] = 1520.;
+            fBinLimitsArrayMultiplicity[3] = 1685.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 0 && centMax == 20){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 1110.;
+            fBinLimitsArrayMultiplicity[2] = 1360.;
+            fBinLimitsArrayMultiplicity[3] = 1600.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 0 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 890.;
+            fBinLimitsArrayMultiplicity[2] = 1240.;
+            fBinLimitsArrayMultiplicity[3] = 1540.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 5 && centMax == 10){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 1250.;
+            fBinLimitsArrayMultiplicity[2] = 1345.;
+            fBinLimitsArrayMultiplicity[3] = 1445.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 10 && centMax == 20){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 915.;
+            fBinLimitsArrayMultiplicity[2] = 1020.;
+            fBinLimitsArrayMultiplicity[3] = 1130.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 20 && centMax == 40){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 510.;
+            fBinLimitsArrayMultiplicity[2] = 625.;
+            fBinLimitsArrayMultiplicity[3] = 730.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 40 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 185.;
+            fBinLimitsArrayMultiplicity[2] = 250.;
+            fBinLimitsArrayMultiplicity[3] = 300.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else if(centMin == 60 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 55.;
+            fBinLimitsArrayMultiplicity[2] = 80.;
+            fBinLimitsArrayMultiplicity[3] = 100.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+         else{ // Std 20-40
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 510.;
+            fBinLimitsArrayMultiplicity[2] = 625.;
+            fBinLimitsArrayMultiplicity[3] = 730.;
+            fBinLimitsArrayMultiplicity[4] = 5000.;
+         }
+      }
+
+      else if(collisionSystem == 8 || collisionSystem == 9){ //pPb
+
+       fBinLimitsArrayMultiplicity[0] = 0.;
+       fBinLimitsArrayMultiplicity[1] = 7.5;
+       fBinLimitsArrayMultiplicity[2] = 16.5;
+       fBinLimitsArrayMultiplicity[3] = 29.5;
+       fBinLimitsArrayMultiplicity[4] = 500.;  
+       
+       if(centMin == 0 && centMax == 20){
+         fBinLimitsArrayMultiplicity[0] = 0.;
+         fBinLimitsArrayMultiplicity[1] = 31.5;
+         fBinLimitsArrayMultiplicity[2] = 40.5;
+         fBinLimitsArrayMultiplicity[3] = 50.5;
+         fBinLimitsArrayMultiplicity[4] = 500.;
+         }     
+       else if(centMin == 20 && centMax == 40){
+         fBinLimitsArrayMultiplicity[0] = 0.;
+         fBinLimitsArrayMultiplicity[1] = 19.5;
+         fBinLimitsArrayMultiplicity[2] = 25.5;
+         fBinLimitsArrayMultiplicity[3] = 32.5;
+         fBinLimitsArrayMultiplicity[4] = 500.;
+         }     
+       else if(centMin == 40 && centMax == 60){
+         fBinLimitsArrayMultiplicity[0] = 0.;
+         fBinLimitsArrayMultiplicity[1] = 12.5;
+         fBinLimitsArrayMultiplicity[2] = 16.5;
+         fBinLimitsArrayMultiplicity[3] = 22.5;
+         fBinLimitsArrayMultiplicity[4] = 500.;
+         }     
+       else if(centMin == 60 && centMax == 80){
+         fBinLimitsArrayMultiplicity[0] = 0.;
+         fBinLimitsArrayMultiplicity[1] = 5.5;
+         fBinLimitsArrayMultiplicity[2] = 9.5;
+         fBinLimitsArrayMultiplicity[3] = 13.5;
+         fBinLimitsArrayMultiplicity[4] = 500.;
+         }     
+      }
+   }
+   else{// pp or pPb V0 Mult
+      fBinLimitsArrayMultiplicity[0] = 2;
+      fBinLimitsArrayMultiplicity[1] = 3;
+      fBinLimitsArrayMultiplicity[2] = 4;
+      fBinLimitsArrayMultiplicity[3] = 5;
+      fBinLimitsArrayMultiplicity[4] = 9999;
+      if(collisionSystem > 0 && collisionSystem < 8){ // PbPb
+         if(centMin == 0 && centMax == 5){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 27.;
+            fBinLimitsArrayMultiplicity[2] = 31.;
+            fBinLimitsArrayMultiplicity[3] = 36.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 0 && centMax == 10){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 25.;
+            fBinLimitsArrayMultiplicity[2] = 30.;
+            fBinLimitsArrayMultiplicity[3] = 36.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 0 && centMax == 20){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 22.;
+            fBinLimitsArrayMultiplicity[2] = 27.;
+            fBinLimitsArrayMultiplicity[3] = 33.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 0 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 18.;
+            fBinLimitsArrayMultiplicity[2] = 25.;
+            fBinLimitsArrayMultiplicity[3] = 32.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 5 && centMax == 10){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 23.;
+            fBinLimitsArrayMultiplicity[2] = 27.;
+            fBinLimitsArrayMultiplicity[3] = 32.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 10 && centMax == 20){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 18.;
+            fBinLimitsArrayMultiplicity[2] = 22.;
+            fBinLimitsArrayMultiplicity[3] = 27.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 20 && centMax == 40){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 11.;
+            fBinLimitsArrayMultiplicity[2] = 14.;
+            fBinLimitsArrayMultiplicity[3] = 18.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 40 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 5.;
+            fBinLimitsArrayMultiplicity[2] = 7.;
+            fBinLimitsArrayMultiplicity[3] = 11.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else if(centMin == 60 && centMax == 80){
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 2.;
+            fBinLimitsArrayMultiplicity[2] = 3.;
+            fBinLimitsArrayMultiplicity[3] = 5.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+         else{ // Std 20-40
+            fBinLimitsArrayMultiplicity[0] = 0.;
+            fBinLimitsArrayMultiplicity[1] = 11.;
+            fBinLimitsArrayMultiplicity[2] = 14.;
+            fBinLimitsArrayMultiplicity[3] = 18.;
+            fBinLimitsArrayMultiplicity[4] = 100.;
+         }
+      }
+   }
+   
+   Initialize(fBinLimitsArrayZ,fBinLimitsArrayMultiplicity);
+
+}
+
 AliGammaConversionAODBGHandler::AliGammaConversionAODBGHandler(const AliGammaConversionAODBGHandler & original) :
   TObject(original),
   fNEvents(original.fNEvents),
index 2ab8a80..f1aa2da 100644 (file)
@@ -29,57 +29,58 @@ typedef vector<AliAODConversionPhoton*> AliGammaConversionAODVector;
 
 class AliGammaConversionAODBGHandler : public TObject {
 
- public: 
-  struct GammaConversionVertex
-  {
-    Double_t fX;
-    Double_t fY;
-    Double_t fZ;
-  };
-  typedef struct GammaConversionVertex GammaConversionVertex; //!
-
-  typedef vector<AliGammaConversionAODVector> AliGammaConversionBGEventVector;
-  typedef vector<AliGammaConversionBGEventVector> AliGammaConversionMultipicityVector;
-  typedef vector<AliGammaConversionMultipicityVector> AliGammaConversionBGVector;
-
-  AliGammaConversionAODBGHandler();                                                        //constructor
-  AliGammaConversionAODBGHandler(UInt_t binsZ,UInt_t binsMultiplicity,UInt_t fNEvents);    //constructor
-  AliGammaConversionAODBGHandler(const AliGammaConversionAODBGHandler & g);                   //copy constructor
-  AliGammaConversionAODBGHandler & operator = (const AliGammaConversionAODBGHandler & g);     //assignment operator
-  virtual ~AliGammaConversionAODBGHandler();                                               //virtual destructor
-
-  void Initialize(Double_t * const zBinLimitsArray, Double_t * const multiplicityBinLimitsArray);
-
-  Int_t GetZBinIndex(Double_t z) const;
-
-  Int_t GetMultiplicityBinIndex(Int_t mult) const;
-
-  void AddEvent(TList* const eventGammas, Double_t xvalue,Double_t yvalue,Double_t zvalue, Int_t multiplicity);
-  void AddElectronEvent(TClonesArray* const eventENeg, Double_t zvalue, Int_t multiplicity);
-
-  Int_t GetNBGEvents()const {return fNEvents;}
-
-  AliGammaConversionAODVector* GetBGGoodV0s(Int_t zbin, Int_t mbin, Int_t event);
-  AliGammaConversionAODVector* GetBGGoodENeg(Int_t event, Double_t zvalue, Int_t multiplicity);
-  void PrintBGArray();
-
-  GammaConversionVertex * GetBGEventVertex(Int_t zbin, Int_t mbin, Int_t event){return &fBGEventVertex[zbin][mbin][event];}
-
-  Double_t GetBGProb(Int_t z, Int_t m){return fBGProbability[z][m];}
-
- private:
-
-  Int_t fNEvents; // number of events
-  Int_t ** fBGEventCounter; //! bg counter
-  Int_t ** fBGEventENegCounter;//! bg electron counter
-  Double_t ** fBGProbability; //! prob per bin
-  GammaConversionVertex *** fBGEventVertex;//! array of event vertex
-  Int_t fNBinsZ; //n z bins
-  Int_t fNBinsMultiplicity; //n bins multiplicity
-  Double_t *fBinLimitsArrayZ;//! bin limits z array
-  Double_t *fBinLimitsArrayMultiplicity;//! bin limit multiplicity array
-  AliGammaConversionBGVector fBGEvents; //background events
-  AliGammaConversionBGVector fBGEventsENeg; //background electron events
-  ClassDef(AliGammaConversionAODBGHandler,2)
+public: 
+   struct GammaConversionVertex
+   {
+      Double_t fX;
+      Double_t fY;
+      Double_t fZ;
+   };
+   typedef struct GammaConversionVertex GammaConversionVertex; //!
+
+   typedef vector<AliGammaConversionAODVector> AliGammaConversionBGEventVector;
+   typedef vector<AliGammaConversionBGEventVector> AliGammaConversionMultipicityVector;
+   typedef vector<AliGammaConversionMultipicityVector> AliGammaConversionBGVector;
+
+   AliGammaConversionAODBGHandler();                                                        //constructor
+   AliGammaConversionAODBGHandler(UInt_t binsZ,UInt_t binsMultiplicity,UInt_t nEvents); // constructor
+   AliGammaConversionAODBGHandler(UInt_t collisionSystem,UInt_t centMin,UInt_t centMax,UInt_t nEvents, Bool_t useTrackMult);
+   AliGammaConversionAODBGHandler(const AliGammaConversionAODBGHandler & g);                   //copy constructor
+   AliGammaConversionAODBGHandler & operator = (const AliGammaConversionAODBGHandler & g);     //assignment operator
+   virtual ~AliGammaConversionAODBGHandler();                                               //virtual destructor
+
+   void Initialize(Double_t * const zBinLimitsArray, Double_t * const multiplicityBinLimitsArray);
+
+   Int_t GetZBinIndex(Double_t z) const;
+
+   Int_t GetMultiplicityBinIndex(Int_t mult) const;
+
+   void AddEvent(TList* const eventGammas, Double_t xvalue,Double_t yvalue,Double_t zvalue, Int_t multiplicity);
+   void AddElectronEvent(TClonesArray* const eventENeg, Double_t zvalue, Int_t multiplicity);
+
+   Int_t GetNBGEvents()const {return fNEvents;}
+
+   AliGammaConversionAODVector* GetBGGoodV0s(Int_t zbin, Int_t mbin, Int_t event);
+   AliGammaConversionAODVector* GetBGGoodENeg(Int_t event, Double_t zvalue, Int_t multiplicity);
+   void PrintBGArray();
+
+   GammaConversionVertex * GetBGEventVertex(Int_t zbin, Int_t mbin, Int_t event){return &fBGEventVertex[zbin][mbin][event];}
+
+   Double_t GetBGProb(Int_t z, Int_t m){return fBGProbability[z][m];}
+
+private:
+
+   Int_t fNEvents; // number of events
+   Int_t ** fBGEventCounter; //! bg counter
+   Int_t ** fBGEventENegCounter;//! bg electron counter
+   Double_t ** fBGProbability; //! prob per bin
+   GammaConversionVertex *** fBGEventVertex;//! array of event vertex
+   Int_t fNBinsZ; //n z bins
+   Int_t fNBinsMultiplicity; //n bins multiplicity
+   Double_t *fBinLimitsArrayZ;//! bin limits z array
+   Double_t *fBinLimitsArrayMultiplicity;//! bin limit multiplicity array
+   AliGammaConversionBGVector fBGEvents; //background events
+   AliGammaConversionBGVector fBGEventsENeg; //background electron events
+   ClassDef(AliGammaConversionAODBGHandler,2)
 };
 #endif
index 109d355..df11891 100644 (file)
@@ -1,14 +1,14 @@
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                                                                * 
- * Authors: Svein Lindal, Daniel Lohner                                                          *
- * Version 1.0                                                                                                 *
- *                                                                                                                       *
- *                                                                         *
- * based on: on older version (see aliroot up to v5-04-42-AN)              *
- *           AliV0Reader.cxx                                               *
- *           Authors: Kathrin Koch, Kenneth Aamodt, Ana Marin              *
- *                                                                         *
+ *                                                                       *
+ * Authors: Svein Lindal, Daniel Lohner                                          *
+ * Version 1.0                                                           *
+ *                                                                       *
+ *                                                                        *
+ * based on: on older version (see aliroot up to v5-04-42-AN)             *
+ *           AliV0Reader.cxx                                              *
+ *           Authors: Kathrin Koch, Kenneth Aamodt, Ana Marin             *
+ *                                                                        *
  * Permission to use, copy, modify and distribute this software and its          *
  * documentation strictly for non-commercial purposes is hereby granted          *
  * without fee, provided that the above copyright notice appears in all          *
@@ -154,7 +154,6 @@ void AliV0ReaderV1::Init()
            fConversionGammas = new TClonesArray("AliKFConversionPhoton",100);}
     }
     fConversionGammas->Delete();//Reset the TClonesArray
-
 }
 
 //________________________________________________________________________
@@ -175,10 +174,9 @@ void AliV0ReaderV1::UserCreateOutputObjects()
     }
 
 }
-
 //________________________________________________________________________
-void AliV0ReaderV1::UserExec(Option_t *){
-
+Bool_t AliV0ReaderV1::Notify()
+{
    if (fPeriodName.CompareTo("") == 0){
       AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
       if(man) {
@@ -194,11 +192,65 @@ void AliV0ReaderV1::UserExec(Option_t *){
                   fPeriodName = testObjString->GetString();
                   i = arr->GetEntriesFast();
                }
-            }     
-//             cout << fileName.Data() << "\t" <<fPeriodName.Data() << endl;
+            }
          }
       }
+
+      if(fConversionCuts->GetDoEtaShift()){
+         if(fPeriodName.CompareTo("LHC12g") == 0 || //pilot run 2012
+            fPeriodName.CompareTo("LHC13b") == 0 || //mainly minimum bias
+            fPeriodName.CompareTo("LHC13c") == 0 || //mainly minimum bias
+            fPeriodName.CompareTo("LHC13d") == 0 || //mainly triggered
+            fPeriodName.CompareTo("LHC13e") == 0 || //mainly triggered
+            fPeriodName.CompareTo("LHC13c3") == 0 || //MC Starlight, anchor LHC13d+e
+            fPeriodName.CompareTo("LHC13c2") == 0 || //MC Starlight, coherent J/Psi, UPC muon anchor LHC13d+e
+            fPeriodName.CompareTo("LHC13b4") == 0 || //MC Pythia 6 (Jet-Jet), anchor LHC13b
+            fPeriodName.CompareTo("LHC13b2_fix_1") == 0 || //MC DPMJET, anchr LHC13b+c
+            fPeriodName.CompareTo("LHC13b3") == 0 || //MC HIJING, weighted to number of events per run, anchor LHC13b
+            fPeriodName.CompareTo("LHC13b2") == 0 ||  // MC DPMJET, wrong energy, anchor LHC13b
+            fPeriodName.CompareTo("LHC13b2_plus") == 0 || // MC DPMJET, weighted to number event per run, anchor LHC13b
+            fPeriodName.CompareTo("LHC13c1_bis") == 0 || // MC AMPT fast generation, pT hardbin, anchor ?
+            fPeriodName.CompareTo("LHC13c1") == 0 || // MC AMPT fast generation, anchor ?
+            fPeriodName.CompareTo("LHC13b1") == 0 || // MC DPMJET, fragments, with fixed label 0, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g4b_fix") == 0 || // MC DPMJET, with fixed label 0, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g1_fix") == 0 || // MC ?, with fixed label 0, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g4c") == 0 || // MC DPMJET, shifted vertex runs, anchor LHC12g
+            fPeriodName.CompareTo("LHC12h6") == 0 || // MC muon cocktail, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g4b") == 0 || // MC DPMJET 3rd iteration, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g4a") == 0 || // MC DPMJET improved, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g4") == 0 || // MC DPMJET, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g5") == 0 || // MC PHOJET, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g2") == 0 || // MC Starlight background, anchor LHC12g
+            fPeriodName.CompareTo("LHC12g1") == 0  // MC ?, anchor LHC12g
+            ){
+            cout<<"AliV0ReaderV1 --> pPb Run!!! Eta Shift of "<<-0.465<<endl;
+            fConversionCuts->SetEtaShift(-0.465);
+         }
+         else if(fPeriodName.CompareTo("LHC13f") == 0 ||
+                  fPeriodName.CompareTo("LHC13c6b") == 0 ||// MC Jpsi -> mumu, anchor LHC13f
+                  fPeriodName.CompareTo("LHC13c5") == 0 || //MC Starlight, gamma gamma UPC muon, anchor LHC13f
+                  fPeriodName.CompareTo("LHC13c4") == 0 //MC Starlight, coherent JPsi, UPC muon, anchor LHC13f
+                 ){
+            cout<<"AliV0ReaderV1 --> Pbp Run!!! Eta Shift of +"<<0.465<<endl;
+            fConversionCuts->SetEtaShift(+0.465);
+         }
+         else cout<<"AliV0ReaderV1 --> Eta Shift Requested but Period not Known"<<endl;
+      }
+      if(fConversionCuts->IsEtaShiftForced() == 1){
+         cout<<"AliV0ReaderV1 --> Force Eta Shift for non Pbp or pPb Run!!! Eta Shift of "<<-0.465<<endl;
+         fConversionCuts->SetEtaShift(-0.465);
+      }
+      else if(fConversionCuts->IsEtaShiftForced() == 2){
+         cout<<"AliV0ReaderV1 --> Force Eta Shift for non Pbp or pPb Run!!! Eta Shift of +"<<0.465<<endl;
+         fConversionCuts->SetEtaShift(0.465);
+      }
    }
+   
+   return kTRUE;
+}
+//________________________________________________________________________
+void AliV0ReaderV1::UserExec(Option_t *option){
+
 
     // Check if correctly initialized
     if(!fConversionGammas)Init();
@@ -471,7 +523,7 @@ Double_t AliV0ReaderV1::GetPsiPair(const AliESDv0* v0, const AliExternalTrackPar
 
    // Double_t u[3] = {pPlus[0]+pMinus[0],pPlus[1]+pMinus[1],pPlus[2]+pMinus[2]};
    // Double_t normu = sqrt( (u[0]*u[0]) + (u[1]*u[1]) + (u[2]*u[2]) );
-   
+
    // u[0] = u[0] / normu;
    // u[1] = u[1] / normu;
    // u[2] = u[2] / normu;
@@ -491,7 +543,7 @@ Double_t AliV0ReaderV1::GetPsiPair(const AliESDv0* v0, const AliExternalTrackPar
    // v[0] = (pPlus[1]*pMinus[2]) - (pPlus[2]*pMinus[1]);
    // v[1] = (pPlus[2]*pMinus[0]) - (pPlus[0]*pMinus[2]);
    // v[2] = (pPlus[0]*pMinus[1]) - (pPlus[1]*pMinus[0]);
-   
+
    // Double_t w[3] = {0,0,0}; // u X v
    // w[0] = (u[1]*v[2]) - (u[2]*v[1]);
    // w[1] = (u[2]*v[0]) - (u[0]*v[2]);
index 4ba0a2e..061e45b 100644 (file)
@@ -6,7 +6,7 @@
 #include "AliESDv0.h"
 #include "AliConversionCuts.h"
 #include "AliExternalTrackParam.h"
-#include "TObject.h" 
+#include "TObject.h"
 #include "AliMCEvent.h"   // for CF
 #include "AliESDEvent.h"
 #include "AliKFParticle.h"
@@ -15,7 +15,7 @@
 #include "AliESDpid.h"
 #include "TF1.h"
 #include "TRandom3.h"
-
+#include "AliAnalysisManager.h"
 
 class AliConversionPhotonBase;
 class TRandom3;
@@ -31,14 +31,13 @@ class AliAODConversionPhoton;
 using namespace std;
 
 class AliV0ReaderV1 : public AliAnalysisTaskSE {
-       
- public: 
-       
+
+ public:
+
   AliV0ReaderV1(const char *name="V0ReaderV1");
   virtual ~AliV0ReaderV1();                            //virtual destructor
   void UserCreateOutputObjects();
-
-
+  virtual Bool_t Notify();
   virtual void UserExec(Option_t *option);
   virtual void Terminate(Option_t *);
   virtual void Init();
@@ -62,7 +61,7 @@ class AliV0ReaderV1 : public AliAnalysisTaskSE {
   void SetDeltaAODFilename(TString s){fDeltaAODFilename=s;}
   void SetDeltaAODBranchName(TString string) { fDeltaAODBranchName = string;AliInfo(Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));}
   TString GetPeriodName(){return fPeriodName;}
-
+  
 protected:
     // Reconstruct Gammas
     Bool_t ProcessESDV0s();
@@ -70,7 +69,7 @@ protected:
     void FillAODOutput();
     void FindDeltaAODBranchName();
     Bool_t GetAODConversionGammas();
-   
+
     // Getter Functions
 
     const AliExternalTrackParam *GetExternalTrackParam(AliESDv0 *fCurrentV0,Int_t &tracklabel,Int_t charge);
@@ -96,7 +95,7 @@ protected:
     TString fDeltaAODFilename; // set filename for delta/satellite aod
     Bool_t fEventIsSelected;
     TString fPeriodName;
-
+    
 private:
     AliV0ReaderV1(AliV0ReaderV1 &original);
     AliV0ReaderV1 &operator=(const AliV0ReaderV1 &ref);
index fac9321..6ffff56 100644 (file)
@@ -30,13 +30,16 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC  = kFALSE){
    if (trainConfig.Contains("PbPb")) IsHeavyIon=1;
    else if (trainConfig.Contains("pPb")) IsHeavyIon=2;
 
-   
+   Bool_t doEtaShift = kFALSE;
+   Int_t forceEtaShift = 0; // Carefull !!! Should be zero otherwise will shift eta cut for all periods
+                            // Use doEtaShift flag for pPb or Pbp instead (1: shift +0.465, 2: shift -0.465)
 
    TString cutnumber = "";
    if(IsHeavyIon == 1){
       cutnumber = "1000000002084001001500000";
     } else if (IsHeavyIon==2){
-     cutnumber = "8000000002084001001500000";   
+     cutnumber = "8000000062084001001500000";
+     doEtaShift = kTRUE;
    } else{
       cutnumber = "0000000002084000002200000";
    }
@@ -74,6 +77,11 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC   = kFALSE){
    if(cutnumber!=""){
       fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
       if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
+         if (IsHeavyIon==2){
+            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->DoEtaShift(doEtaShift);
+         }
+         fCuts->ForceEtaShift(forceEtaShift);
          fV0ReaderV1->SetConversionCuts(fCuts);
          fCuts->SetFillCutHistograms("",kTRUE);
       }
@@ -104,23 +112,28 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC        = kFALSE){
    task= new AliAnalysisTaskGammaConvV1("GammaConvV1");
    task->SetIsHeavyIon(IsHeavyIon);
    // Cut Numbers to use in Analysis
-   Int_t numberOfCuts = 1;
+   Int_t numberOfCuts = 2;
    if(trainConfig.Contains("PbPb")) numberOfCuts = 3;
-   else numberOfCuts = 1;
+   else if(trainConfig.Contains("pPb")) numberOfCuts = 4;
+   else numberOfCuts = 3;
 
    TString *cutarray = new TString[numberOfCuts];
    TString *mesonCutArray = new TString[numberOfCuts];
 
    if(trainConfig.Contains("PbPb")){
-      cutarray[ 0] = "1000003042092970723220000"; mesonCutArray[ 0] = "01022045000";  // all centralities
-      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] = "8000000042092172023290000"; mesonCutArray[0] = "01024045000";  //standard cut Pi0 PbPb 00-100
+      cutarray[ 0] = "1010001042092970023220000"; mesonCutArray[ 0] = "01522045000"; // Standard cut 0-10
+      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] = "8680000082093172023290000"; mesonCutArray[3] = "01629045000";  //standard cut Pi0 Pb 60-80 shifted Eta 0.4
    } else {
-      cutarray[ 0] = "0000011002093663003800000"; mesonCutArray[0] = "01631031009";
+      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
+      cutarray[ 2] = "0000012002093260003800000"; mesonCutArray[2] = "01631031009"; //standard cut Gamma pp 2-76TeV , only boxes
+
    }
 
    TList *ConvCutList = new TList();
@@ -146,7 +159,10 @@ void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC = kFALSE){
    for(Int_t i = 0; i<numberOfCuts; i++){
       analysisCuts[i] = new AliConversionCuts();
       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
-      if (trainConfig.Contains("pPb")) analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7|AliVEvent::kTRD);
+      if (trainConfig.Contains("pPb")){
+         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+         if (i<4) analysisCuts[i]->DoEtaShift(1);
+      }
       ConvCutList->Add(analysisCuts[i]);
 
       analysisCuts[i]->SetFillCutHistograms("",kFALSE);
@@ -162,6 +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
 
    //connect containers
    AliAnalysisDataContainer *coutput =
diff --git a/PWGGA/GammaConv/macros/AddTask_GammaConvV1_2.C b/PWGGA/GammaConv/macros/AddTask_GammaConvV1_2.C
new file mode 100644 (file)
index 0000000..7c00441
--- /dev/null
@@ -0,0 +1,193 @@
+
+void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC     = kFALSE){
+
+   gSystem->Load("libCore.so");  
+   gSystem->Load("libTree.so");
+   gSystem->Load("libGeom.so");
+   gSystem->Load("libVMC.so");
+   gSystem->Load("libPhysics.so");
+   gSystem->Load("libMinuit");
+   gSystem->Load("libSTEERBase");
+   gSystem->Load("libESD");
+   gSystem->Load("libAOD");
+   gSystem->Load("libANALYSIS");
+   gSystem->Load("libANALYSISalice");  
+   gSystem->Load("libPWGGAGammaConv.so");
+   gSystem->Load("libCDB.so");
+   gSystem->Load("libSTEER.so");
+   gSystem->Load("libSTEERBase.so");
+   gSystem->Load("libTENDER.so");
+   gSystem->Load("libTENDERSupplies.so");
+      
+
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      Error("AddTask_GammaConvV1", "No analysis manager found.");
+      return 0;
+   }
+      
+   Int_t IsHeavyIon=0;
+   if (trainConfig.Contains("PbPb")) IsHeavyIon=1;
+   else if (trainConfig.Contains("pPb")) IsHeavyIon=2;
+
+   Bool_t doEtaShift = kFALSE;
+   Int_t forceEtaShift = 0; // Carefull !!! Should be zero otherwise will shift eta cut for all periods
+                            // Use doEtaShift flag for pPb or Pbp instead (1: shift +0.465, 2: shift -0.465)
+
+   TString cutnumber = "";
+   if(IsHeavyIon == 1){
+      cutnumber = "1000000002084001001500000";
+    } else if (IsHeavyIon==2){
+     cutnumber = "8000000062084001001500000";
+     doEtaShift = kTRUE;
+   } else{
+      cutnumber = "0000000002084000002200000";
+   }
+
+   //========= Add PID Reponse to ANALYSIS manager ====
+   if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+      AddTaskPIDResponse();
+   }
+      
+   //========= Add V0 Reader to  ANALYSIS manager =====
+   AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1");
+   
+   fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE);
+   fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output
+   fV0ReaderV1->SetUseAODConversionPhoton(kTRUE);
+
+   if (!mgr) {
+      Error("AddTask_V0ReaderV1", "No analysis manager found.");
+      return;
+   }
+   AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
+
+   if(inputHandler->IsA()==AliESDInputHandler::Class()){
+      // ESD mode
+   }
+
+   if(inputHandler->IsA()==AliAODInputHandler::Class()){
+      // AOD mode
+      //   task->SetUseSatelliteAODs(kTRUE);
+   }
+
+   // Set AnalysisCut Number
+   AliConversionCuts *fCuts=NULL;
+   if(cutnumber!=""){
+      fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
+      if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
+         if (IsHeavyIon==2){
+            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->DoEtaShift(doEtaShift);
+         }
+         fCuts->ForceEtaShift(forceEtaShift);
+         fV0ReaderV1->SetConversionCuts(fCuts);
+         fCuts->SetFillCutHistograms("",kTRUE);
+      }
+   }
+   fV0ReaderV1->Init();
+
+
+
+   AliLog::SetGlobalLogLevel(AliLog::kInfo);
+
+   //================================================
+   //              data containers
+   //================================================
+   //            find input container
+   //below the trunk version
+   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+   //connect input V0Reader
+   mgr->AddTask(fV0ReaderV1);
+   mgr->ConnectInput(fV0ReaderV1,0,cinput);
+
+   //================================================
+   //========= Add task to the ANALYSIS manager =====
+   //================================================
+   //              data containers
+   //================================================
+   //            find input container
+   AliAnalysisTaskGammaConvV1 *task=NULL;
+   task= new AliAnalysisTaskGammaConvV1("GammaConvV1");
+   task->SetIsHeavyIon(IsHeavyIon);
+   // Cut Numbers to use in Analysis
+   Int_t numberOfCuts = 2;
+   if(trainConfig.Contains("PbPb")) numberOfCuts = 3;
+   else if(trainConfig.Contains("pPb")) numberOfCuts = 2;
+   else numberOfCuts = 3;
+
+   TString *cutarray = new TString[numberOfCuts];
+   TString *mesonCutArray = new TString[numberOfCuts];
+
+   if(trainConfig.Contains("PbPb")){
+      cutarray[ 0] = "1000003042092970723220000"; mesonCutArray[ 0] = "01022045000";  // all centralities
+      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
+   } 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
+      cutarray[ 2] = "0000011002093260003800000"; mesonCutArray[2] = "01631031009"; //standard cut Gamma pp 2-76TeV
+
+   }
+
+   TList *ConvCutList = new TList();
+   TList *MesonCutList = new TList();
+
+   TList *HeaderList = new TList();
+   // TObjString *Header1 = new TObjString("PARAM");
+   // HeaderList->Add(Header1);
+    TObjString *Header2 = new TObjString("BOX");
+    HeaderList->Add(Header2);
+//   TObjString *Header3 = new TObjString("Pythia");
+//   HeaderList->Add(Header3);
+//   TObjString *Header4 = new TObjString("Hijing");
+//   HeaderList->Add(Header4);
+
+
+   ConvCutList->SetOwner(kTRUE);
+   AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts];
+   MesonCutList->SetOwner(kTRUE);
+   AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts];
+
+
+   for(Int_t i = 0; i<numberOfCuts; i++){
+      analysisCuts[i] = new AliConversionCuts();
+      analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
+      if (trainConfig.Contains("pPb")){
+         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+         if (i<1) analysisCuts[i]->DoEtaShift(1);
+      }
+      ConvCutList->Add(analysisCuts[i]);
+
+      analysisCuts[i]->SetFillCutHistograms("",kFALSE);
+      analysisMesonCuts[i] = new AliConversionMesonCuts();
+      analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data());
+      MesonCutList->Add(analysisMesonCuts[i]);
+      analysisMesonCuts[i]->SetFillCutHistograms("");
+      analysisCuts[i]->SetAcceptedHeader(HeaderList);
+   }
+
+
+   task->SetConversionCutList(numberOfCuts,ConvCutList);
+   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
+
+   //connect containers
+   AliAnalysisDataContainer *coutput =
+      mgr->CreateContainer("GammaConvV1", TList::Class(),
+                           AliAnalysisManager::kOutputContainer,"GammaConvV1.root");
+
+   mgr->AddTask(task);
+   mgr->ConnectInput(task,0,cinput);
+   mgr->ConnectOutput(task,1,coutput);
+
+   return task;
+
+}
diff --git a/PWGGA/GammaConv/macros/AddTask_GammaConvV1_3.C b/PWGGA/GammaConv/macros/AddTask_GammaConvV1_3.C
new file mode 100644 (file)
index 0000000..b7f7d64
--- /dev/null
@@ -0,0 +1,195 @@
+
+void AddTask_GammaConvV1(TString trainConfig = "pp",   Bool_t isMC     = kFALSE){
+
+   gSystem->Load("libCore.so");  
+   gSystem->Load("libTree.so");
+   gSystem->Load("libGeom.so");
+   gSystem->Load("libVMC.so");
+   gSystem->Load("libPhysics.so");
+   gSystem->Load("libMinuit");
+   gSystem->Load("libSTEERBase");
+   gSystem->Load("libESD");
+   gSystem->Load("libAOD");
+   gSystem->Load("libANALYSIS");
+   gSystem->Load("libANALYSISalice");  
+   gSystem->Load("libPWGGAGammaConv.so");
+   gSystem->Load("libCDB.so");
+   gSystem->Load("libSTEER.so");
+   gSystem->Load("libSTEERBase.so");
+   gSystem->Load("libTENDER.so");
+   gSystem->Load("libTENDERSupplies.so");
+      
+
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      Error("AddTask_GammaConvV1", "No analysis manager found.");
+      return 0;
+   }
+      
+   Int_t IsHeavyIon=0;
+   if (trainConfig.Contains("PbPb")) IsHeavyIon=1;
+   else if (trainConfig.Contains("pPb")) IsHeavyIon=2;
+
+   Bool_t doEtaShift = kFALSE;
+   Int_t forceEtaShift = 0; // Carefull !!! Should be zero otherwise will shift eta cut for all periods
+                            // Use doEtaShift flag for pPb or Pbp instead (1: shift +0.465, 2: shift -0.465)
+
+   TString cutnumber = "";
+   if(IsHeavyIon == 1){
+      cutnumber = "1000000002084001001500000";
+    } else if (IsHeavyIon==2){
+     cutnumber = "8000000062084001001500000";
+     doEtaShift = kTRUE;
+   } else{
+      cutnumber = "0000000002084000002200000";
+   }
+
+   //========= Add PID Reponse to ANALYSIS manager ====
+   if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+      AddTaskPIDResponse();
+   }
+      
+   //========= Add V0 Reader to  ANALYSIS manager =====
+   AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1");
+   
+   fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE);
+   fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output
+   fV0ReaderV1->SetUseAODConversionPhoton(kTRUE);
+
+   if (!mgr) {
+      Error("AddTask_V0ReaderV1", "No analysis manager found.");
+      return;
+   }
+   AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
+
+   if(inputHandler->IsA()==AliESDInputHandler::Class()){
+      // ESD mode
+   }
+
+   if(inputHandler->IsA()==AliAODInputHandler::Class()){
+      // AOD mode
+      //   task->SetUseSatelliteAODs(kTRUE);
+   }
+
+   // Set AnalysisCut Number
+   AliConversionCuts *fCuts=NULL;
+   if(cutnumber!=""){
+      fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
+      if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
+         if (IsHeavyIon==2){
+            fCuts->SelectCollisionCandidates(AliVEvent::kINT7);
+            fCuts->DoEtaShift(doEtaShift);
+         }
+         fCuts->ForceEtaShift(forceEtaShift);
+         fV0ReaderV1->SetConversionCuts(fCuts);
+         fCuts->SetFillCutHistograms("",kTRUE);
+      }
+   }
+   fV0ReaderV1->Init();
+
+
+
+   AliLog::SetGlobalLogLevel(AliLog::kInfo);
+
+   //================================================
+   //              data containers
+   //================================================
+   //            find input container
+   //below the trunk version
+   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+   //connect input V0Reader
+   mgr->AddTask(fV0ReaderV1);
+   mgr->ConnectInput(fV0ReaderV1,0,cinput);
+
+   //================================================
+   //========= Add task to the ANALYSIS manager =====
+   //================================================
+   //              data containers
+   //================================================
+   //            find input container
+   AliAnalysisTaskGammaConvV1 *task=NULL;
+   task= new AliAnalysisTaskGammaConvV1("GammaConvV1");
+   task->SetIsHeavyIon(IsHeavyIon);
+   // Cut Numbers to use in Analysis
+   Int_t numberOfCuts = 2;
+   if(trainConfig.Contains("PbPb")) numberOfCuts = 3;
+   else if(trainConfig.Contains("pPb")) numberOfCuts = 4;
+   else numberOfCuts = 4;
+
+   TString *cutarray = new TString[numberOfCuts];
+   TString *mesonCutArray = new TString[numberOfCuts];
+
+   if(trainConfig.Contains("PbPb")){
+      cutarray[ 0] = "1460001042092970023220000"; mesonCutArray[ 0] = "01522065000"; // Standard cut 40-60
+      cutarray[ 1] = "1020003042092370023750000"; mesonCutArray[ 1] = "01522045009";\r// 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] = "8680000072093172023290000"; mesonCutArray[3] = "01627045000";  //standard cut Pi0 Pb 60-80 wo shifted Eta 0.3
+   } 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
+      cutarray[ 2] = "0002011002093663003800000"; mesonCutArray[2] = "01631031009"; //standard cut Pi0 pp 2.76TeV with SDD , only Boxes MC
+      cutarray[ 3] = "0003012002093663003800000"; mesonCutArray[3] = "01631031009"; //standard cut Pi0 pp 2.76TeV with SDD, V0AND, only Boxes MC
+   }
+
+   TList *ConvCutList = new TList();
+   TList *MesonCutList = new TList();
+
+   TList *HeaderList = new TList();
+   // TObjString *Header1 = new TObjString("PARAM");
+   // HeaderList->Add(Header1);
+    TObjString *Header2 = new TObjString("BOX");
+    HeaderList->Add(Header2);
+//   TObjString *Header3 = new TObjString("Pythia");
+//   HeaderList->Add(Header3);
+//   TObjString *Header4 = new TObjString("Hijing");
+//   HeaderList->Add(Header4);
+
+
+   ConvCutList->SetOwner(kTRUE);
+   AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts];
+   MesonCutList->SetOwner(kTRUE);
+   AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts];
+
+
+   for(Int_t i = 0; i<numberOfCuts; i++){
+      analysisCuts[i] = new AliConversionCuts();
+      analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
+      if (trainConfig.Contains("pPb")){
+         analysisCuts[i]->SelectCollisionCandidates(AliVEvent::kINT7);
+//          if (i<4) analysisCuts[i]->DoEtaShift(1);
+      }
+      ConvCutList->Add(analysisCuts[i]);
+
+      analysisCuts[i]->SetFillCutHistograms("",kFALSE);
+      analysisMesonCuts[i] = new AliConversionMesonCuts();
+      analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data());
+      MesonCutList->Add(analysisMesonCuts[i]);
+      analysisMesonCuts[i]->SetFillCutHistograms("");
+      analysisCuts[i]->SetAcceptedHeader(HeaderList);
+   }
+
+
+   task->SetConversionCutList(numberOfCuts,ConvCutList);
+   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
+
+   //connect containers
+   AliAnalysisDataContainer *coutput =
+      mgr->CreateContainer("GammaConvV1", TList::Class(),
+                           AliAnalysisManager::kOutputContainer,"GammaConvV1.root");
+
+   mgr->AddTask(task);
+   mgr->ConnectInput(task,0,cinput);
+   mgr->ConnectOutput(task,1,coutput);
+
+   return task;
+
+}