From 10e3319b31f1d321b58258be006979361a5afbd3 Mon Sep 17 00:00:00 2001 From: kaamodt Date: Sat, 10 Jul 2010 13:21:54 +0000 Subject: [PATCH] Added new cuts, fixed bug in backround calculation. --- .../AliAnalysisTaskGammaConversion.cxx | 35 ++++++++- PWG4/GammaConv/AliV0Reader.cxx | 61 +++++++++++++-- PWG4/GammaConv/AliV0Reader.h | 28 ++++++- .../macros/Extract_Pi0_Characteristics.C | 17 +++++ .../macros/Plot_Pi0_Characteristics.C | 75 +++++++++++++++++-- .../macros/start_GammaConversionAnalysis.sh | 1 + PWG4/macros/ConfigGammaConversion.C | 70 ++++++++++++++--- 7 files changed, 255 insertions(+), 32 deletions(-) diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx index 41d0c505f86..00344bbd728 100644 --- a/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx +++ b/PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx @@ -416,7 +416,11 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/) if(!fV0Reader->GetESDEvent()->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL")) return; } */ - + + if(!fV0Reader->CheckForPrimaryVertexZ() ){ + return; + } + // Process the MC information if(fDoMCTruth){ ProcessMCData(); @@ -953,6 +957,10 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){ fHistograms->FillHistogram("MC_Pi0_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta()); fHistograms->FillHistogram("MC_Pi0_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity); fHistograms->FillHistogram("MC_Pi0_ZR_ConvGamma_withinAcceptance", particle->Vz(),particle->R()); + fHistograms->FillHistogram("MC_Pi0_ConvGamma_OpeningAngle_Pt", particle->Pt(),GetMCOpeningAngle(daughter0,daughter1)); + fHistograms->FillHistogram("MC_Pi0_ConvGamma_PtGamma_Pt", particle->Pt(),daughter0->Pt()); + fHistograms->FillHistogram("MC_Pi0_ConvGamma_PtGamma_Pt", particle->Pt(),daughter1->Pt()); + Double_t alfa=0.; if((daughter0->Energy()+daughter1->Energy())!= 0.){ alfa= TMath::Abs((daughter0->Energy()-daughter1->Energy())/(daughter0->Energy()+daughter1->Energy())); @@ -984,6 +992,10 @@ void AliAnalysisTaskGammaConversion::ProcessMCData(){ fHistograms->FillHistogram("MC_Eta_Pt_Eta_ConvGamma_withinAcceptance", particle->Pt(),particle->Eta()); fHistograms->FillHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance", particle->Pt(),rapidity); fHistograms->FillHistogram("MC_Eta_ZR_ConvGamma_withinAcceptance", particle->Vz(),particle->R()); + fHistograms->FillHistogram("MC_Eta_ConvGamma_OpeningAngle_Pt", particle->Pt(),GetMCOpeningAngle(daughter0,daughter1)); + fHistograms->FillHistogram("MC_Eta_ConvGamma_PtGamma_Pt", particle->Pt(),daughter0->Pt()); + fHistograms->FillHistogram("MC_Eta_ConvGamma_PtGamma_Pt", particle->Pt(),daughter1->Pt()); + } } @@ -1758,6 +1770,16 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){ } fHistograms->FillHistogram("ESD_Mother_InvMass",massTwoGammaCandidate); + /* Kenneth, just for testing*/ + AliGammaConversionBGHandler * bgHandler = fV0Reader->GetBGHandler(); + + Int_t zbin= bgHandler->GetZBinIndex(fV0Reader->GetVertexZ()); + Int_t mbin= bgHandler->GetMultiplicityBinIndex(fV0Reader->CountESDTracks()); + + fHistograms->FillHistogram(Form("%d%dESD_Mother_InvMass",zbin,mbin),massTwoGammaCandidate); + + /* end Kenneth, just for testing*/ + if(fCalculateBackground){ AliGammaConversionBGHandler * bgHandler = fV0Reader->GetBGHandler(); Int_t mbin= bgHandler->GetMultiplicityBinIndex(fV0Reader->CountESDTracks()); @@ -1771,6 +1793,7 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){ fV0Reader->GetV0(indexKF1);//updates to the correct v0 Double_t eta1 = fV0Reader->GetMotherCandidateEta(); Bool_t isRealPi0=kFALSE; + Bool_t isRealEta=kFALSE; Int_t gamma1MotherLabel=-1; if(fV0Reader->HasSameMCMother() == kTRUE){ //cout<<"This v0 is a real v0!!!!"<CheckIfPi0IsMother(gamma1MotherLabel)){ isRealPi0=kTRUE; } + if(fV0Reader->CheckIfEtaIsMother(gamma1MotherLabel)){ + isRealEta=kTRUE; + } + } if(TMath::Abs(eta1)>0.9 && TMath::Abs(eta2)>0.9){ // fHistograms->FillHistogram("ESD_Mother_InvMass_1212",massTwoGammaCandidate); // fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt1212",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); - if(isRealPi0){ + if(isRealPi0 || isRealEta){ fHistograms->FillHistogram("ESD_TruePi0_InvMass_1212",massTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_OpeningAngle_1212",openingAngleTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_InvMass_vs_Pt1212",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); @@ -1823,7 +1850,7 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){ else if(TMath::Abs(eta1)>0.9 || TMath::Abs(eta2)>0.9){ // fHistograms->FillHistogram("ESD_Mother_InvMass_0912",massTwoGammaCandidate); // fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt0912",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); - if(isRealPi0){ + if(isRealPi0 || isRealEta){ fHistograms->FillHistogram("ESD_TruePi0_InvMass_0912",massTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_OpeningAngle_0912",openingAngleTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_InvMass_vs_Pt0912",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); @@ -1834,7 +1861,7 @@ void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){ else{ // fHistograms->FillHistogram("ESD_Mother_InvMass_0909",massTwoGammaCandidate); // fHistograms->FillHistogram("ESD_Mother_InvMass_vs_Pt0909",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); - if(isRealPi0){ + if(isRealPi0 || isRealEta){ fHistograms->FillHistogram("ESD_TruePi0_InvMass_0909",massTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_OpeningAngle_0909",openingAngleTwoGammaCandidate); fHistograms->FillHistogram("ESD_TruePi0_InvMass_vs_Pt0909",massTwoGammaCandidate,momentumVectorTwoGammaCandidate.Pt()); diff --git a/PWG4/GammaConv/AliV0Reader.cxx b/PWG4/GammaConv/AliV0Reader.cxx index 44345f0098a..b13a295a2c3 100644 --- a/PWG4/GammaConv/AliV0Reader.cxx +++ b/PWG4/GammaConv/AliV0Reader.cxx @@ -82,6 +82,7 @@ AliV0Reader::AliV0Reader() : fUseKFParticle(kTRUE), fUseESDTrack(kFALSE), fDoMC(kFALSE), + fMaxVertexZ(100.),// 100 cm(from the 0) fMaxR(10000),// 100 meter(outside of ALICE) fEtaCut(0.), fPtCut(0.), @@ -100,6 +101,7 @@ AliV0Reader::AliV0Reader() : fPIDnSigmaBelowElectronLine(-100), fPIDnSigmaAbovePionLine(-100), fPIDMinPnSigmaAbovePionLine(100), + fPIDMaxPnSigmaAbovePionLine(100), fDoKaonRejectionLowP(kFALSE), fDoProtonRejectionLowP(kFALSE), fDoPionRejectionLowP(kFALSE), @@ -167,6 +169,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) : fUseKFParticle(kTRUE), fUseESDTrack(kFALSE), fDoMC(kFALSE), + fMaxVertexZ(original.fMaxVertexZ), fMaxR(original.fMaxR), fEtaCut(original.fEtaCut), fPtCut(original.fPtCut), @@ -185,6 +188,7 @@ AliV0Reader::AliV0Reader(const AliV0Reader & original) : fPIDnSigmaBelowElectronLine(original.fPIDnSigmaBelowElectronLine), fPIDnSigmaAbovePionLine(original.fPIDnSigmaAbovePionLine), fPIDMinPnSigmaAbovePionLine(original.fPIDMinPnSigmaAbovePionLine), + fPIDMaxPnSigmaAbovePionLine(original.fPIDMaxPnSigmaAbovePionLine), fDoKaonRejectionLowP(original.fDoKaonRejectionLowP), fDoProtonRejectionLowP(original.fDoProtonRejectionLowP), fDoPionRejectionLowP(original.fDoPionRejectionLowP), @@ -322,7 +326,7 @@ void AliV0Reader::Initialize(){ if(fBGEventInitialized == kFALSE){ - Double_t *zBinLimitsArray = new Double_t[8]; + Double_t *zBinLimitsArray = new Double_t[9]; zBinLimitsArray[0] = -50.00; zBinLimitsArray[1] = -4.07; zBinLimitsArray[2] = -2.17; @@ -331,15 +335,18 @@ void AliV0Reader::Initialize(){ zBinLimitsArray[5] = 2.17; zBinLimitsArray[6] = 4.11; zBinLimitsArray[7] = 50.00; + zBinLimitsArray[8] = 1000.00; - Double_t *multiplicityBinLimitsArray= new Double_t[5]; + + Double_t *multiplicityBinLimitsArray= new Double_t[6]; multiplicityBinLimitsArray[0] = 0; multiplicityBinLimitsArray[1] = 8.5; multiplicityBinLimitsArray[2] = 16.5; multiplicityBinLimitsArray[3] = 27.5; multiplicityBinLimitsArray[4] = 41.5; + multiplicityBinLimitsArray[5] = 100.; - fBGEventHandler = new AliGammaConversionBGHandler(8,5,nEventsForBGCalculation); + fBGEventHandler = new AliGammaConversionBGHandler(9,6,nEventsForBGCalculation); /* // --------------------------------- @@ -369,6 +376,16 @@ Bool_t AliV0Reader::CheckForPrimaryVertex(){ return fESDEvent->GetPrimaryVertex()->GetNContributors()>0; } +Bool_t AliV0Reader::CheckForPrimaryVertexZ(){ + //see headerfile for documentation + + if(TMath::Abs(fESDEvent->GetPrimaryVertex()->GetZ())GetParticleContainer()->Fill(containerInput,kStepdEdx_electronselection); // for CF } - if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine){ + if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentPositiveESDTrack->P()NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && fgESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)P()>fPIDMinPnSigmaAbovePionLine){ + if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentNegativeESDTrack->P()NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine && fgESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)P()NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kKaon))P()NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kProton))P()NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion))fQtMax){ @@ -773,6 +791,23 @@ Bool_t AliV0Reader::NextV0(){ fCurrentV0IndexNumber++; continue; } + + if(TMath::Abs(fCurrentNegativeKFParticle->GetEta())> fEtaCut){ + if(fHistograms != NULL){ + fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass()); + } + fCurrentV0IndexNumber++; + continue; + } + + if(TMath::Abs(fCurrentPositiveKFParticle->GetEta())> fEtaCut){ + if(fHistograms != NULL){ + fHistograms->FillHistogram("ESD_CutEta_InvMass",GetMotherCandidateMass()); + } + fCurrentV0IndexNumber++; + continue; + } + if(fDoCF){ fCFManager->GetParticleContainer()->Fill(containerInput,kStepEta); // for CF } @@ -1454,6 +1489,16 @@ Bool_t AliV0Reader::CheckIfPi0IsMother(Int_t label){ return iResult; } +Bool_t AliV0Reader::CheckIfEtaIsMother(Int_t label){ + // see headerfile for documentation + Bool_t iResult=kFALSE; + // cout<<"Checking particle label, particle is: "<Particle(TMath::Abs(label))->GetName()<Particle(TMath::Abs(label))->GetPdgCode() == 221){ + iResult=kTRUE; + } + return iResult; +} + Bool_t AliV0Reader::GetArmenterosQtAlfa(AliKFParticle* positiveKFParticle, AliKFParticle * negativeKFParticle, AliKFParticle * gammaKFCandidate, Double_t armenterosQtAlfa[2] ){ //see header file for documentation diff --git a/PWG4/GammaConv/AliV0Reader.h b/PWG4/GammaConv/AliV0Reader.h index e8b3bc92122..817381a3be3 100644 --- a/PWG4/GammaConv/AliV0Reader.h +++ b/PWG4/GammaConv/AliV0Reader.h @@ -435,6 +435,11 @@ class AliV0Reader : public TObject { * Update data which need to be updated every event. */ void UpdateEventByEventData(); + + /* + * Gets the MaxRCut value. + */ + Double_t GetMaxVertexZ() const{return fMaxVertexZ;} /* * Gets the MaxRCut value. @@ -492,6 +497,11 @@ class AliV0Reader : public TObject { Double_t GetPositiveNTPCClusters() const{return fCurrentPositiveESDTrack->GetTPCNcls();} Double_t GetNegativeNTPCClusters() const{return fCurrentNegativeESDTrack->GetTPCNcls();} + /* + * Sets the MaxVertexZ value. + */ + void SetMaxVertexZ(Double_t maxVertexZ){fMaxVertexZ=maxVertexZ;} + /* * Sets the MaxRCut value. */ @@ -595,6 +605,11 @@ class AliV0Reader : public TObject { */ void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;} + /* + * Sets the PIDMinPnSigmaAbovePion cut value for the tracks. + */ + void SetPIDMaxPnSigmaAbovePionLine(Double_t MaxPnSigmaAbovePion){fPIDMaxPnSigmaAbovePionLine=MaxPnSigmaAbovePion;} + /* * Sets the SigmaMassCut value. */ @@ -688,6 +703,11 @@ class AliV0Reader : public TObject { */ Bool_t CheckForPrimaryVertex(); + /* + * Check for primary vertex Z. + */ + Bool_t CheckForPrimaryVertexZ(); + /* * Gets a vector of good v0s. */ @@ -734,6 +754,7 @@ class AliV0Reader : public TObject { Int_t GetCurrentV0IndexNumber() const {return fCurrentV0IndexNumber;} Bool_t CheckIfPi0IsMother(Int_t label); + Bool_t CheckIfEtaIsMother(Int_t label); static void InitESDpid(Int_t type=0); static void SetESDpid(AliESDpid * const pid) {fgESDpid=pid;} @@ -790,7 +811,9 @@ class AliV0Reader : public TObject { Bool_t fUseKFParticle; // flag Bool_t fUseESDTrack; // flag Bool_t fDoMC; // flag - + + //Event Cuts + Double_t fMaxVertexZ; //cuts Double_t fMaxR; //r cut Double_t fEtaCut; //eta cut @@ -810,6 +833,7 @@ class AliV0Reader : public TObject { Double_t fPIDnSigmaBelowElectronLine; // sigma cut Double_t fPIDnSigmaAbovePionLine; // sigma cut Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut + Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut Double_t fDoKaonRejectionLowP; // Kaon rejection at low p Double_t fDoProtonRejectionLowP; // Proton rejection at low p Double_t fDoPionRejectionLowP; // Pion rejection at low p @@ -851,7 +875,7 @@ class AliV0Reader : public TObject { Int_t nEventsForBGCalculation; - ClassDef(AliV0Reader,11) + ClassDef(AliV0Reader,12) }; inline void AliV0Reader::InitESDpid(Int_t type) diff --git a/PWG4/GammaConv/macros/Extract_Pi0_Characteristics.C b/PWG4/GammaConv/macros/Extract_Pi0_Characteristics.C index c7b3790d87e..f1a0d6d5f0d 100644 --- a/PWG4/GammaConv/macros/Extract_Pi0_Characteristics.C +++ b/PWG4/GammaConv/macros/Extract_Pi0_Characteristics.C @@ -49,6 +49,23 @@ void Extract_Pi0_Characteristics(const char *cutSelection="", const char *inputR TList *fMCContainer = (TList*)fHistosGammaConversion->FindObject("MC histograms"); TList *fBackgroundContainer = (TList*)fHistosGammaConversion->FindObject("Background histograms"); + TH1F *ESD_Mother_InvMass =fESDContainer->FindObject("ESD_Mother_InvMass"); + ESD_Mother_InvMass->SetName(Form("ESD_Mother_InvMass_%s",cutSelection)); + ESD_Mother_InvMass->Write(); + + TH1F *ESD_Background_InvMass =fBackgroundContainer->FindObject("ESD_Background_InvMass"); + ESD_Background_InvMass->SetName(Form("ESD_Background_InvMass_%s",cutSelection)); + ESD_Background_InvMass->Write(); + + TH1F *ESD_dedx =fESDContainer->FindObject("ESD_ConvGamma_E_dEdxP"); + ESD_dedx->SetName(Form("ESD_ConvGamma_E_dEdxP_%s",cutSelection)); + ESD_dedx->Write(); + + TH2F *ESD_alfaqt = fESDContainer->FindObject("ESD_ConvGamma_alfa_qt"); + ESD_alfaqt->SetName(Form("ESD_ConvGamma_alfa_qt_%s",cutSelection)); + ESD_alfaqt->Write(); + + TH2F *ESD_Mother_InvMass_vs_Pt = fESDContainer->FindObject("ESD_Mother_InvMass_vs_Pt"); ESD_Mother_InvMass_vs_Pt->Sumw2(); TH2F *ESD_Background_InvMass_vs_Pt = fBackgroundContainer->FindObject("ESD_Background_InvMass_vs_Pt"); diff --git a/PWG4/GammaConv/macros/Plot_Pi0_Characteristics.C b/PWG4/GammaConv/macros/Plot_Pi0_Characteristics.C index 63d6c0873c8..248c3e5d4cd 100644 --- a/PWG4/GammaConv/macros/Plot_Pi0_Characteristics.C +++ b/PWG4/GammaConv/macros/Plot_Pi0_Characteristics.C @@ -30,6 +30,8 @@ void Plot_Pi0_Characteristics(const char *inputRootFile = "Pi0Characteristics",c TH1F* MassPerBin[32]; TH1F* FWHMPerBin[32]; + Double_t BGFit_range[2] = {0.6,0.69}; + Float_t lowBinLimits[32]; Float_t highBinLimits[32]; @@ -441,6 +443,7 @@ void Plot_Pi0_Characteristics(const char *inputRootFile = "Pi0Characteristics",c signalt->SetAxisRange(0.,0.7); signalt->Draw(); + TString nameb= Form("Mapping_Back_InvMass_in_Pt_Bin%s%02d",cutSelectionArray[cuts].Data(),bin); cout<<"Getting histogram: "<SetTitle(titleb.Data()); signalb->SetAxisRange(0.,0.7); signalb->SetLineColor(4); + + TLine *lowline= new TLine(BGFit_range[0],0,BGFit_range[0],signalt->GetMaximum()); + lowline->SetLineColor(3); + lowline->Draw("same"); + TLine *highline= new TLine(BGFit_range[1],0,BGFit_range[1],signalt->GetMaximum()); + highline->SetLineColor(3); + highline->Draw("same"); + //normalixation + TAxis *xaxis_reco = signalt->GetXaxis(); + Int_t r_1 = xaxis_reco->FindBin(BGFit_range[0]); + Int_t r_2 = xaxis_reco->FindBin(BGFit_range[1]); + Double_t r = signalt->Integral(r_1,r_2); // Integral(75,125) + TAxis *xaxis_back = signalb->GetXaxis(); + Int_t b_1 = xaxis_back->FindBin(BGFit_range[0]); + Int_t b_2 = xaxis_back->FindBin(BGFit_range[1]); + Double_t b = signalb->Integral(b_1,b_2); + Double_t norm = 1; + if(b != 0) norm = r/b; + signalb->Sumw2(); + signalb->Scale(norm); + signalb->Draw("same"); canvasTest->Update(); @@ -492,7 +516,7 @@ void Plot_Pi0_Characteristics(const char *inputRootFile = "Pi0Characteristics",c for(Int_t bin=0;bincd(bin+1); - pad->cd(bin+1)->SetLogz(1); + // pad->cd(bin+1)->SetLogz(1); TString namet= Form("ESD_Mother_InvMass_%s",cutSelectionArray[bin].Data()); cout<<"Getting histogram: "<SetTitle(titlet.Data()); massAll->Draw(); + + TString nameb= Form("ESD_Background_InvMass_%s",cutSelectionArray[bin].Data()); + TH1F * massAllBG = (TH1F*)f.Get(nameb.Data()); + /* + TLine *lowline= new TLine(BGFit_range[0],0,BGFit_range[0],signalt->GetMaximum()); + lowline->SetLineColor(3); + lowline->Draw("same"); + TLine *highline= new TLine(BGFit_range[1],0,BGFit_range[1],signalt->GetMaximum()); + highline->SetLineColor(3); + highline->Draw("same"); + */ + + //normalixation + TAxis *xaxis_reco = massAll->GetXaxis(); + Int_t r_1 = xaxis_reco->FindBin(BGFit_range[0]); + Int_t r_2 = xaxis_reco->FindBin(BGFit_range[1]); + Double_t r = massAll->Integral(r_1,r_2); // Integral(75,125) + TAxis *xaxis_back = massAllBG->GetXaxis(); + Int_t b_1 = xaxis_back->FindBin(BGFit_range[0]); + Int_t b_2 = xaxis_back->FindBin(BGFit_range[1]); + Double_t b = massAllBG->Integral(b_1,b_2); + Double_t norm = 1; + if(b != 0) norm = r/b; + massAllBG->Sumw2(); + massAllBG->Scale(norm); + + + TString titleb= Form("CutId%s",cutSelectionArray[bin].Data()); + massAllBG->SetTitle(titleb.Data()); + massAllBG->SetLineColor(4); + massAllBG->Draw("same"); + /* canvasTest->Update(); - canvasTest->Print("massAll.gif"); + canvasTest->Print(Form("%smassAllAndBG%s.gif",path,cutSelectionArray[bin].Data())); + */ } + canvasTest->Update(); + canvasTest->Print(Form("%smassAll%s.gif",path,cutSelectionArray[bin].Data())); + ps_characteristics->NewPage(); + delete canvasTest; // for(Int_t bin=2;bin<15;bin++){ TCanvas *canvasTest = new TCanvas("canvastest","",200,10,600,600); TPad *pad = new TPad(padname.Data(),"",0.,0.,1.,1.,0); @@ -520,15 +581,17 @@ void Plot_Pi0_Characteristics(const char *inputRootFile = "Pi0Characteristics",c pad->cd(bin+1)->SetLogz(1); TString namet= Form("ESD_ConvGamma_E_dEdxP_%s",cutSelectionArray[bin].Data()); cout<<"Getting histogram: "<SetTitle(titlet.Data()); dedxp->Draw("col2"); - canvasTest->Update(); - canvasTest->Print("dedxp.gif"); } + canvasTest->Update(); + canvasTest->Print(Form("%sdedxp%s.gif",path,cutSelectionArray[bin].Data())); + ps_characteristics->NewPage(); + TCanvas *canvasTest = new TCanvas("canvastest","",200,10,600,600); TPad *pad = new TPad(padname.Data(),"",0.,0.,1.,1.,0); pad->SetFillColor(0); @@ -548,7 +611,7 @@ void Plot_Pi0_Characteristics(const char *inputRootFile = "Pi0Characteristics",c armen->SetTitle(titlet.Data()); armen->Draw("col2"); canvasTest->Update(); - canvasTest->Print("armen.gif"); + canvasTest->Print(Form("%sarmen%s.gif",path,cutSelectionArray[bin].Data())); } ps_characteristics->Close(); diff --git a/PWG4/GammaConv/macros/start_GammaConversionAnalysis.sh b/PWG4/GammaConv/macros/start_GammaConversionAnalysis.sh index 98b5f92a357..c44984e2909 100755 --- a/PWG4/GammaConv/macros/start_GammaConversionAnalysis.sh +++ b/PWG4/GammaConv/macros/start_GammaConversionAnalysis.sh @@ -65,3 +65,4 @@ done root -b -q $ALICE_ROOT/PWG4/GammaConv/macros/Plot_IntegratedPi0Yield.C\(\"$DatFilenameBase\"\,\"$OutputDirectory\"\,\"$Suffix\"\) + root -b -q $ALICE_ROOT/PWG4/GammaConv/macros/Plot_Pi0_Characteristics.C \ No newline at end of file diff --git a/PWG4/macros/ConfigGammaConversion.C b/PWG4/macros/ConfigGammaConversion.C index 2a2b1521748..291c05c75c4 100644 --- a/PWG4/macros/ConfigGammaConversion.C +++ b/PWG4/macros/ConfigGammaConversion.C @@ -15,7 +15,7 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ -const int c_array_size = 13; +const int c_array_size = 14; class AliAnalysisDataContainer; class AliGammaConversionHistograms; @@ -36,13 +36,14 @@ Bool_t kGCrunRES = kFALSE; Bool_t kGCRecalculateV0ForGamma = kFALSE; /** ---------------------------------- define cuts here ------------------------------------*/ -TString kGCAnalysisCutSelectionId="9000111000100"; // do not change here, use -set-cut-selection in argument instead +TString kGCAnalysisCutSelectionId="90001110001004"; // do not change here, use -set-cut-selection in argument instead Int_t kGCNEventsForBGCalculation=10; Int_t kGCpidOfNegativeTrack=11; Int_t kGCpidOfPositiveTrack=-11; +Double_t kGCmaxVertexZ = 10.; Double_t kGCmaxRCut = 180.; Double_t kGCetaCut = 0.9; Double_t kGCptCut = 0.02; @@ -175,6 +176,8 @@ Bool_t kGCplotMCPi0Pt = kTRUE; Bool_t kGCplotMCPi0PtFiducial = kTRUE; Bool_t kGCplotMCPi0PtWithinAcceptanceFiducial = kTRUE; Bool_t kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial = kTRUE; +Bool_t kGCplotMCPi0OpeningPtConvGammaWithinAcceptance = kTRUE; +Bool_t kGCplotMCPi0PtGammaPtConvGammaWithinAcceptance = kTRUE; Bool_t kGCplotMCPi0Energy = kFALSE; Bool_t kGCplotMCPi0Mass = kTRUE; Bool_t kGCplotMCPi0Alpha = kTRUE; @@ -217,6 +220,8 @@ Bool_t kGCplotMCEtaPtvsEtaWithinAcceptance = kTRUE; Bool_t kGCplotMCEtaPtvsRapidWithinAcceptance = kTRUE; Bool_t kGCplotMCEtaPtvsEtaConvGammaWithinAcceptance = kTRUE; Bool_t kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance = kTRUE; +Bool_t kGCplotMCEtaOpeningPtConvGammaWithinAcceptance = kTRUE; +Bool_t kGCplotMCEtaPtGammaPtConvGammaWithinAcceptance = kTRUE; Bool_t kGCplotMCEtaZRConvGammaWithinAcceptance = kTRUE; // Histograms from esd tracks @@ -642,6 +647,7 @@ Double_t kGCfirstXBinGammaWidth = 0.; Double_t kGClastXBinGammaWidth = 1.; //GammaChi2-plots +Int_t kGCnXBinsMesonChi2 = 200; Int_t kGCnXBinsGammaChi2 = 100; Double_t kGCfirstXBinGammaChi2 = 0; Double_t kGClastXBinGammaChi2 = 200.; @@ -780,7 +786,8 @@ Bool_t kGCdodEdxSigmaCut= kTRUE; Double_t kGCPIDnSigmaAboveElectronLine=5; Double_t kGCPIDnSigmaBelowElectronLine=-3; Double_t kGCPIDnSigmaAbovePionLine=0; -Double_t kGCPIDMinPnSigmaAbovePionLine=1; +Double_t kGCPIDMinPnSigmaAbovePionLine=1.; +Double_t kGCPIDMaxPnSigmaAbovePionLine=3.; /**------- Flag to apply rejection at LowP of Kaons, protons , pions------------*/ Bool_t kGCdoPionRejectionLowP=kTRUE; @@ -1167,7 +1174,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal cinput1 = mgr->GetCommonInputContainer(); } - // Common Output Tree in common ‘default’ output file + // Common Output Tree in common ??????default?????? output file // CKB kGCusePWG4PartCorr and writestandard are not mutually exclusive? AliAnalysisDataContainer *coutput1 = NULL; if(kGCusePWG4PartCorr){ @@ -1243,6 +1250,8 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal else if(kGCuseESDTrack){ v0Reader->UseESDTrack(); } + + v0Reader->SetMaxVertexZ(kGCmaxVertexZ); v0Reader->SetNegativeTrackPID(kGCpidOfNegativeTrack); v0Reader->SetPositiveTrackPID(kGCpidOfPositiveTrack); v0Reader->SetMaxRCut(kGCmaxRCut); @@ -1274,6 +1283,7 @@ AliAnalysisTaskGammaConversion* ConfigGammaConversion(TString arguments, AliAnal v0Reader->SetPIDnSigmaBelowElectronLine(kGCPIDnSigmaBelowElectronLine); v0Reader->SetPIDnSigmaAbovePionLine(kGCPIDnSigmaAbovePionLine); v0Reader->SetPIDMinPnSigmaAbovePionLine(kGCPIDMinPnSigmaAbovePionLine); + v0Reader->SetPIDMaxPnSigmaAbovePionLine(kGCPIDMaxPnSigmaAbovePionLine); v0Reader->SetOnFlyFlag(kGCUseOnFlyV0Finder); v0Reader->SetCalculateBackground(kGCcalculateBackground); @@ -1683,7 +1693,7 @@ void AddHistograms(AliGammaConversionHistograms *histograms){ if(kGCplotESDNoCutConversionMCXY == kTRUE){ histograms->AddHistogram("ESD_NoCutConversion_MC_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");} - if(kGCplotESDMotherChi2 == kTRUE){ histograms->AddHistogram("ESD_Mother_Chi2","" , kGCnXBinsGammaChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");} + if(kGCplotESDMotherChi2 == kTRUE){ histograms->AddHistogram("ESD_Mother_Chi2","" , kGCnXBinsMesonChi2, kGCfirstXBinGammaChi2, kGClastXBinGammaChi2, "", "");} if(kGCplotESDMotherOpeningAngleGamma == kTRUE){ histograms->AddHistogram("ESD_Mother_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} if(kGCplotESDMotherEnergy == kTRUE){ histograms->AddHistogram("ESD_Mother_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");} if(kGCplotESDMotherPt == kTRUE){ histograms->AddHistogram("ESD_Mother_Pt" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} @@ -1696,7 +1706,7 @@ void AddHistograms(AliGammaConversionHistograms *histograms){ if(kGCplotESDMotherRapid == kTRUE){ histograms->AddHistogram("ESD_Mother_Rapid" ,"" , kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");} for(Int_t z=0;z<8;z++){ - for(Int_t m=0;m<4;m++){ + for(Int_t m=0;m<6;m++){ if(kGCplotESDBackgroundOpeningAngleGamma == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_GammaDaughter_OpeningAngle",z,m) ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} if(kGCplotESDBackgroundEnergy == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Energy",z,m) ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");} if(kGCplotESDBackgroundPt == kTRUE){ histograms->AddHistogram(Form("%d%dESD_Background_Pt",z,m) ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} @@ -1914,15 +1924,16 @@ histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt } if(kGCplotPi0Spectra == kTRUE && kGCcalculateBackground == kTRUE){ - for(Int_t m=0;m<4;m++){ + for(Int_t m=0;m<6;m++){ histograms->AddHistogram(Form("%dESD_Mother_InvMass_vs_Pt",m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]"); } for(Int_t z=0;z<8;z++){ - for(Int_t m=0;m<4;m++){ + for(Int_t m=0;m<6;m++){ histograms->AddHistogram(Form("%d%dESD_Background_InvMass_vs_Pt",z,m) ,"Background Invariant Mass vs Pt" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]"); histograms->AddHistogram(Form("%d%dESD_Background_InvMass",z,m),"Invariant mass background",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts"); + histograms->AddHistogram(Form("%d%dESD_Mother_InvMass",z,m),"Invariant mass in z and m bins",kGCnXBinsSpectra,kGCfirstXBinSpectra, kGClastXBinSpectra,"InvMass BG [GeV]","Counts"); histograms->AddHistogram(Form("%d%dESD_Background_InvMassvsPtFid",z,m) ,"Background Invariant Mass vs Pt |eta|<0.9" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,"InvMass [GeV]","Pt [GeV]"); @@ -2020,12 +2031,13 @@ histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt if(kGCplotMCPi0PtFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_Fiducial" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} if(kGCplotMCPi0PtWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_withinAcceptance_Fiducial" ,"" , kGCnXBinsPt,kGCfirstXBinPt, kGClastXBinPt, "", "");} if(kGCplotMCPi0PtConvGammaWithinAcceptanceFiducial == kTRUE){ histograms->AddHistogram("MC_Pi0_Pt_ConvGamma_withinAcceptance_Fiducial","" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} - + if(kGCplotMCPi0OpeningPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ConvGamma_OpeningAngle_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} + if(kGCplotMCPi0PtGammaPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Pi0_ConvGamma_PtGamma_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} if(kGCplotMCPi0Energy == kTRUE){ histograms->AddHistogram("MC_Pi0_Energy" ,"" , kGCnXBinsEnergy, kGCfirstXBinEnergy, kGClastXBinEnergy, "", "");} if(kGCplotMCPi0Mass == kTRUE){ histograms->AddHistogram("MC_Pi0_Mass" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Mass, kGClastXBinPi0Mass, "", "");} if(kGCplotMCPi0Alpha == kTRUE){ histograms->AddHistogram("MC_Pi0_alpha" ,"" , kGCnXBinsPi0Mass, kGCfirstXBinPi0Alpha, kGClastXBinPi0Alpha, "", "");} - if(kGCplotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} + if(kGCplotMCPi0OpeningAngle == kTRUE){ histograms->AddHistogram("MC_Pi0_GammaDaughter_OpeningAngle" ,"" , kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} if(kGCplotMCPi0R == kTRUE){ histograms->AddHistogram("MC_Pi0_R" ,"" , kGCnXBinsR, kGCfirstXBinR, kGClastXBinR, "", "");} if(kGCplotMCPi0ZR == kTRUE){ histograms->AddHistogram("MC_Pi0_ZR" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");} if(kGCplotMCPi0XY == kTRUE){ histograms->AddHistogram("MC_Pi0_XY" ,"" , kGCnXBinsXY, kGCfirstXBinXY, kGClastXBinXY, kGCnYBinsXY, kGCfirstYBinXY, kGClastYBinXY, "", "");} @@ -2069,7 +2081,8 @@ histograms->AddHistogram("ESD_Mother_InvMass_vs_Pt_alpha" ,"Invariant Mass vs Pt if(kGCplotMCEtaPtvsRapidConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_Pt_Rapid_ConvGamma_withinAcceptance" ,"" , kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsRapid, kGCfirstXBinRapid, kGClastXBinRapid, "", "");} if(kGCplotMCEtaZRConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ZR_ConvGamma_withinAcceptance" ,"" , kGCnXBinsZR, kGCfirstXBinZR, kGClastXBinZR, kGCnYBinsZR, kGCfirstYBinZR, kGClastYBinZR, "", "");} } - + if(kGCplotMCEtaOpeningPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ConvGamma_OpeningAngle_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsOpeningAngle, kGCfirstXBinOpeningAngle, kGClastXBinOpeningAngle, "", "");} + if(kGCplotMCEtaPtGammaPtConvGammaWithinAcceptance == kTRUE){ histograms->AddHistogram("MC_Eta_ConvGamma_PtGamma_Pt","", kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, kGCnXBinsPt, kGCfirstXBinPt, kGClastXBinPt, "", "");} }// end kGCrunNeutralMeson @@ -2108,7 +2121,7 @@ Int_t SetAnalysisCutSelection(TString analysisCutSelection){ // set the cuts depending on the Cut Selection Id // first number is dummy always set to 9 // const char* cutSelection = analysisCutSelection.Data(); - if(analysisCutSelection.Length()!=13){ + if(analysisCutSelection.Length()!=14){ cout<<"Cut selection has the wrong length!"<