From fc7e3b59bcf4859adc2a5d250fc7e13a21811c76 Mon Sep 17 00:00:00 2001 From: slindal Date: Tue, 15 Mar 2011 15:37:40 +0000 Subject: [PATCH] Moving gamma jet ana to separate folder. Addding several ana processors. --- PWG4/CMakelibPWG4GammaConv.pkg | 16 +- .../AliAnalysisTaskGCPartToPWG4Part.h | 1 - PWG4/GammaConv/AliAnalysisTaskGammaJet.cxx | 654 ------------------ PWG4/GammaConv/AliAnalysisTaskGammaJet.h | 116 ---- .../ConvCorrelations/AliAnaConvCorrBase.cxx | 216 ++++++ .../ConvCorrelations/AliAnaConvCorrBase.h | 116 ++++ .../ConvCorrelations/AliAnaConvCorrPhoton.cxx | 77 +++ .../ConvCorrelations/AliAnaConvCorrPhoton.h | 43 ++ .../AliAnaConvCorrPhotonJet.cxx | 64 ++ .../AliAnaConvCorrPhotonJet.h | 36 + .../ConvCorrelations/AliAnaConvCorrPion.cxx | 97 +++ .../ConvCorrelations/AliAnaConvCorrPion.h | 40 ++ .../ConvCorrelations/AliAnaConvIsolation.cxx | 257 +++++++ .../ConvCorrelations/AliAnaConvIsolation.h | 118 ++++ .../AliAnalysisTaskGammaJet.cxx | 503 ++++++++++++++ .../AliAnalysisTaskGammaJet.h | 105 +++ .../ConvCorrelations/macros/ConfigGammaJet.C | 102 +++ PWG4/PWG4GammaConvLinkDef.h | 8 +- 18 files changed, 1796 insertions(+), 773 deletions(-) delete mode 100644 PWG4/GammaConv/AliAnalysisTaskGammaJet.cxx delete mode 100644 PWG4/GammaConv/AliAnalysisTaskGammaJet.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.h create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.cxx create mode 100644 PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.h create mode 100644 PWG4/GammaConv/ConvCorrelations/macros/ConfigGammaJet.C diff --git a/PWG4/CMakelibPWG4GammaConv.pkg b/PWG4/CMakelibPWG4GammaConv.pkg index 64fbb3cdb14..8aab4978fa1 100644 --- a/PWG4/CMakelibPWG4GammaConv.pkg +++ b/PWG4/CMakelibPWG4GammaConv.pkg @@ -25,7 +25,21 @@ # SHLIBS - Shared Libraries and objects for linking (Executables only) # #--------------------------------------------------------------------------------# -set ( SRCS GammaConv/AliV0Reader.cxx GammaConv/AliAnalysisTaskGammaConversion.cxx GammaConv/AliGammaConversionHistograms.cxx GammaConv/AliGammaConversionAODObject.cxx GammaConv/AliAODConversionParticle.cxx GammaConv/AliGammaConversionBGHandler.cxx GammaConv/AliAnalysisTaskCaloConv.cxx GammaConv/AliAnalysisTaskGammaJet.cxx GammaConv/AliAnalysisTaskGammaConvDalitz.cxx GammaConv/AliAnalysisTaskGCPartToPWG4Part.cxx ) +set ( SRCS GammaConv/AliV0Reader.cxx + GammaConv/AliAnalysisTaskGammaConversion.cxx + GammaConv/AliGammaConversionHistograms.cxx + GammaConv/AliGammaConversionAODObject.cxx + GammaConv/AliAODConversionParticle.cxx + GammaConv/AliGammaConversionBGHandler.cxx + GammaConv/AliAnalysisTaskCaloConv.cxx + GammaConv/AliAnalysisTaskGammaConvDalitz.cxx + GammaConv/AliAnalysisTaskGCPartToPWG4Part.cxx + GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.cxx + GammaConv/ConvCorrelations/AliAnaConvIsolation.cxx + GammaConv/ConvCorrelations/AliAnaConvCorrBase.cxx + GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx + GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx + GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.cxx) string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" ) diff --git a/PWG4/GammaConv/AliAnalysisTaskGCPartToPWG4Part.h b/PWG4/GammaConv/AliAnalysisTaskGCPartToPWG4Part.h index 36dd9e779d4..fe30e153b21 100644 --- a/PWG4/GammaConv/AliAnalysisTaskGCPartToPWG4Part.h +++ b/PWG4/GammaConv/AliAnalysisTaskGCPartToPWG4Part.h @@ -12,7 +12,6 @@ class AliAODPWG4ParticleCorrelation; class AliAODPWG4Particle; class TClonesArray; class TString; -class AliMCAnalysisUtils; class AliAODMCHeader; #include "AliAnalysisTaskSE.h" diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaJet.cxx b/PWG4/GammaConv/AliAnalysisTaskGammaJet.cxx deleted file mode 100644 index bcfd18ad3bf..00000000000 --- a/PWG4/GammaConv/AliAnalysisTaskGammaJet.cxx +++ /dev/null @@ -1,654 +0,0 @@ -#include -#include "TChain.h" -#include "TTree.h" -#include "TH1F.h" -#include "TCanvas.h" -#include "TString.h" - -#include "AliAnalysisTask.h" -#include "AliAnalysisManager.h" -#include "AliAnalysisTaskGammaJet.h" - -#include "AliESDEvent.h" -#include "AliESDCaloCluster.h" -#include "AliESDInputHandler.h" - -#include "AliAODPWG4ParticleCorrelation.h" -#include "AliAODEvent.h" -#include "AliAODHandler.h" -#include "AliAODCaloCluster.h" -#include "AliGammaConversionAODObject.h" -#include "AliAODConversionParticle.h" -#include "AliAODJet.h" - -#include "AliAODInputHandler.h" - -// Gamma - jet correlation analysis task -// Authors: Svein Lindal - - -using namespace std; - -ClassImp(AliAnalysisTaskGammaJet) - -//________________________________________________________________________ -AliAnalysisTaskGammaJet::AliAnalysisTaskGammaJet() : AliAnalysisTaskSE(), - fOutputList(NULL), - fHistPt(NULL), - fHistPtPhos(NULL), - fHistPtEmcal(NULL), - - fHistPhotPhi(NULL), - fHistHadPhi(NULL), - fHistJetPhi(NULL), - - fHistPtJets(NULL), - fHistGammaJets(NULL), - fHistGammaJetsIso(NULL), - fHistMaxdPhi(NULL), - fHistMaxdPhiIso(NULL), - fHistMaxdPhiIsoPt(NULL), - - fHadHistPt(NULL), //! Pt spectrum - fHadHistdPhi(NULL), //!Phi correlations - fHadHistdPhiIso(NULL), //!Phi correlations - fHadHistMaxdPhi(NULL), //!Phi correlations - fHadHistMaxdPhiIso(NULL), //!Phi correlations - fHadHistMaxdPhiIsoPt(NULL), //!Phi correlations - - fMinPt(2.0), - fConeSize(0.9), - fPtThreshold(2.0), - fDeltaAODFileName(""), - fPhotons(NULL) -{ - // Dummy Constructor -} - -//________________________________________________________________________________ -AliAnalysisTaskGammaJet::~AliAnalysisTaskGammaJet() { - - if(fOutputList) - delete fOutputList; - fOutputList = NULL; - - if(fHistPt) - fHistPt = NULL; - delete fHistPt; - - if(fHistPtPhos) - fHistPtPhos = NULL; - delete fHistPtPhos; - - if(fHistPtEmcal) - fHistPtEmcal = NULL; - delete fHistPtEmcal; - - if(fHistPtJets) - fHistPtJets= NULL; - delete fHistPtJets; - - if(fHistGammaJets) - fHistGammaJets = NULL; - delete fHistGammaJets; - - if(fHistGammaJetsIso) - fHistGammaJetsIso = NULL; - delete fHistGammaJetsIso; - - if(fHistMaxdPhi) - fHistMaxdPhi = NULL; - delete fHistMaxdPhi; - - if(fHistMaxdPhiIso) - fHistMaxdPhiIso = NULL; - delete fHistMaxdPhiIso; - - if(fHistMaxdPhiIsoPt) - fHistMaxdPhiIsoPt = NULL; - delete fHistMaxdPhiIsoPt; - - if(fPhotons) - fPhotons = NULL; - delete fPhotons; - - -} - - - -//________________________________________________________________________ -AliAnalysisTaskGammaJet::AliAnalysisTaskGammaJet(const char *name) : - AliAnalysisTaskSE(name), - fOutputList(0), - fHistPt(0), - fHistPtPhos(0), - fHistPtEmcal(0), - - fHistPhotPhi(NULL), - fHistHadPhi(NULL), - fHistJetPhi(NULL), - - fHistPtJets(0), - fHistGammaJets(NULL), - fHistGammaJetsIso(NULL), - fHistMaxdPhi(NULL), - fHistMaxdPhiIso(NULL), - fHistMaxdPhiIsoPt(NULL), - - fHadHistPt(NULL), //! Pt spectrum - fHadHistdPhi(NULL), //!Phi correlations - fHadHistdPhiIso(NULL), //!Phi correlations - fHadHistMaxdPhi(NULL), //!Phi correlations - fHadHistMaxdPhiIso(NULL), //!Phi correlations - fHadHistMaxdPhiIsoPt(NULL), //!Phi correlations - - fMinPt(0.0), - fConeSize(0.0), - fPtThreshold(0.0), - fDeltaAODFileName(""), - fPhotons(NULL) -{ - // Constructor - // Define input and output slots here - DefineInput(0, TChain::Class()); - // Output slot #0 id reserved by the base class for AOD - - // Output slot #1 writes into a TH1 container - DefineOutput(1, TList::Class()); -} - -//________________________________________________________________________ -void AliAnalysisTaskGammaJet::UserCreateOutputObjects() -{ - //Create histograms add, to outputlist - fOutputList = new TList(); - - fHistPt = new TH1F("fHistPt", "P_{T} distribution", 150, 0.1, 50); - fHistPt->GetXaxis()->SetTitle("P_{T} (GeV/c)"); - fHistPt->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); - fHistPt->SetMarkerStyle(kFullCircle); - fOutputList->Add(fHistPt); - - fHistPtPhos = new TH1F("fHistPtPhos", "P_{T} distribution", 150, 0.1, 50); - fHistPtPhos->GetXaxis()->SetTitle("P_{T} (GeV/c)"); - fHistPtPhos->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); - fHistPtPhos->SetMarkerStyle(kFullCircle); - fOutputList->Add(fHistPtPhos); - - fHistPtEmcal = new TH1F("fHistPtEmcal", "P_{T} distribution", 150, 0.1, 50); - fHistPtEmcal->GetXaxis()->SetTitle("P_{T} (GeV/c)"); - fHistPtEmcal->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); - fHistPtEmcal->SetMarkerStyle(kFullCircle); - fOutputList->Add(fHistPtEmcal); - - fHistPhotPhi = new TH1F("phi gamma", "phi gamma", 120, -6.3, 6.3); - fOutputList->Add(fHistPhotPhi); - fHistHadPhi = new TH1F("phi track", "phi track", 120, -6.3, 6.3); - fOutputList->Add(fHistHadPhi); - fHistJetPhi = new TH1F("phi jet", "phi jet", 120, -6.3, 6.3); - fOutputList->Add(fHistJetPhi); - - - fHistPtJets = new TH1F("fHistPtJets", "P_{T} distribution", 150, 0.1, 50); - fHistPtJets->GetXaxis()->SetTitle("P_{T} (GeV/c)"); - fHistPtJets->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); - fHistPtJets->SetMarkerStyle(kFullCircle); - fOutputList->Add(fHistPtJets); - - fHistGammaJets = new TH1F("fHistGammaJets", "fHistGammaJets", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHistGammaJets); - - fHistGammaJetsIso = new TH1F("fHistGammaJetsIso", "fHistGammaJetsIso", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHistGammaJetsIso); - - - fHistMaxdPhi = new TH1F("fHistMaxdPhi", "fHistMaxdPhi", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHistMaxdPhi); - - fHistMaxdPhiIso = new TH1F("fHistMaxdPhiIso", "fHistMaxdPhiIso", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHistMaxdPhiIso); - - fHistMaxdPhiIsoPt = new TH1F("fHistMaxdPhiIsoPt", "fHistMaxdPhiIsoPt", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHistMaxdPhiIsoPt); - - - - - fHadHistPt = new TH1F("fHadHistPt", "P_{T} distribution", 150, 0.1, 50); - fHadHistPt->GetXaxis()->SetTitle("P_{T} (GeV/c)"); - fHadHistPt->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); - fHadHistPt->SetMarkerStyle(kFullCircle); - fOutputList->Add(fHadHistPt); - - - fHadHistdPhi = new TH1F("fHadHistdPhi", "fHadHistdPhi", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHadHistdPhi); - - fHadHistdPhiIso = new TH1F("fHadHistdPhiIso", "fHadHistdPhiIso", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHadHistdPhiIso); - - - fHadHistMaxdPhi = new TH1F("fHadHistMaxdPhi", "fHadHistMaxdPhi", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHadHistMaxdPhi); - - fHadHistMaxdPhiIso = new TH1F("fHadHistMaxdPhiIso", "fHadHistMaxdPhiIso", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHadHistMaxdPhiIso); - - fHadHistMaxdPhiIsoPt = new TH1F("fHadHistMaxdPhiIsoPt", "fHadHistMaxdPhiIsoPt", 200, -2*TMath::Pi(), 2*TMath::Pi()); - fOutputList->Add(fHadHistMaxdPhiIsoPt); - - - - - - //TNtuple * tuple = new TNtuple("fNtuple", "fNtuple", dPhi, - - - ///Create AOD branch - fPhotons = new TClonesArray("AliAODPWG4ParticleCorrelation", 0); - fPhotons->SetName("ConversionGamma"); - AddAODBranch("TClonesArray", &fPhotons); - - -} - -//________________________________________________________________________ -void AliAnalysisTaskGammaJet::UserExec(Option_t *) -{ - - - //BALLE BALLE not do always - AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE); - - - //Clear stuff for new event - CleanUp(); - - - - - - ///Get AOD event - AliAODEvent * aodEvent = GetAODEvent(); - if(!aodEvent) { - AliError("No AOD event!!"); - return; - } - - ProcessConvGamma(aodEvent); - //ProcessCalorimeters(aodEvent); - - - PostData(1, fOutputList); - -} -//_____________________________________________________________________ -void AliAnalysisTaskGammaJet::Terminate(Option_t *) { - // Draw result to the screen - // Called once at the end of the query -} - -//_____________________________________________________________________ -AliAODEvent * AliAnalysisTaskGammaJet::GetAODEvent() { - //Get the AOD event from whereever it might be - AliAODEvent * aodEvent = dynamic_cast(InputEvent()); - if(!aodEvent) { - aodEvent = AODEvent(); - } - - return aodEvent; - -} - - -//_____________________________________________________________________ -TClonesArray * AliAnalysisTaskGammaJet::GetConversionGammas(const AliAODEvent * aodEvent) { - - //Get Conversion gamma branch of AOD. First try standard AOD - TClonesArray * convGamma = dynamic_cast(aodEvent->FindListObject("GammaConv_gamma")); - - //If it's there, send it back - if(convGamma) return convGamma; - - - //If AOD not in standard file have to locate it in delta AOD - if( !(fDeltaAODFileName.Length() > 0) ) return NULL; - - AliAODHandler * aodHandler = dynamic_cast(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); - if(aodHandler) { - AliAODExtension * gExt = dynamic_cast(aodHandler->GetExtensions()->FindObject(fDeltaAODFileName)); - if(gExt) { - AliAODEvent * gcEvent = gExt->GetAOD(); - return dynamic_cast(gcEvent->FindListObject("GammaConv_gamma")); - } - } - return NULL; -} - - -// //_____________________________________________________________________ -// void AliAnalysisTaskGammaJet::FillPWG4PartCorrBranch( TClonesArray * gcBranch, TClonesArray * partCorrBranch , TString detector ) { - -// for(int i = 0; i < gcBranch->GetEntriesFast(); i++) { -// AliGammaConversionAODObject * gcObject = dynamic_cast(gcBranch->At(i)); -// if ( gcObject ) { -// AliAODPWG4ParticleCorrelation pc(gcObject->Px(), gcObject->Py(), gcObject->Pz(), gcObject->E()); -// pc.SetTagged(gcObject->IsTagged()); -// pc.SetTrackLabel(gcObject->GetLabel1(), gcObject->GetLabel2()); -// pc.SetDetector(detector); -// new((*partCorrBranch)[i]) AliAODPWG4ParticleCorrelation(pc); - -// } else { -// AliError(Form("Couldn't get gamma conversion aod object")); -// } - -// } -// } - - -// //_____________________________________________________________________ -// AliAODPWG4ParticleCorrelation * AliAnalysisTaskGammaJet::PWG4PartFromGammaConvAODObject(AliGammaConversionAODObject * gcObject, TString detector ) { - -// AliAODPWG4ParticleCorrelation * pc = new AliAODPWG4ParticleCorrelation(gcObject->Px(), gcObject->Py(), gcObject->Pz(), gcObject->E()); -// pc->SetTagged(gcObject->IsTagged()); -// pc->SetTrackLabel(gcObject->GetLabel1(), gcObject->GetLabel2()); -// pc->SetDetector(detector); -// return pc; -// } - - -//_________________________________________________________________________ -void AliAnalysisTaskGammaJet::CleanUp() { - fPhotons->Delete(); -} - -//_________________________________________________________________________ -Bool_t AliAnalysisTaskGammaJet::IsIsolated( AliAODPWG4Particle * particle, TClonesArray * tracks, Float_t coneSize, Float_t ptThreshold ) { - //See header file for documentation - for(int it = 0; it < tracks->GetEntriesFast(); it++) { - if ( (it == particle->GetTrackLabel(0)) || it == particle->GetTrackLabel(1) ) - continue; - - //BALLE Svein:How are you checking the calorimeters for whether they are decay particles ? - - AliAODTrack * track = dynamic_cast(tracks->At(it)); - if (track) { - if ( IsInCone(particle->Eta() - track->Eta(), particle->Phi() - track->Phi(), coneSize) ) { - if (track->Pt() > ptThreshold) { - return kFALSE; - } - } - } else { - AliError(Form("Bad track!!!! ")); - } - } - - //No particle above threshold, it's isolated - return kTRUE; -} - - -//______________________________________________________________________________________________ -void AliAnalysisTaskGammaJet::ProcessCalorimeters( const AliAODEvent * const aodEvent ) { - - TClonesArray * clusters = aodEvent->GetCaloClusters(); - - - for(int ic = 0; ic < clusters->GetEntriesFast(); ic++) { - AliAODCaloCluster * cluster = dynamic_cast(clusters->At(ic)); - if (!cluster) { - AliError(Form("Error getting cluster")); - continue; - } - - - if (cluster->GetNCells() < 6) continue; - if (cluster->GetEmcCpvDistance() < 15) continue; - - TLorentzVector tlvec; - - AliAODVertex * vertex = aodEvent->GetPrimaryVertex(); - Double_t vertexPosition[3]; - vertex->GetXYZ(vertexPosition); - cluster->GetMomentum(tlvec, vertexPosition); - if (tlvec.Pt() < GetMinPt()) continue; - - } - -} - -// // ///____________________________________________________________________________________ -// // void AddToAOD(AliAODConversionParticle * photon, TClonesArray * branch) { - - -// // } - - -// //__________________________________________________________________________________________ -// void AddToOutputAOD(AliGammaConversionAODObject * photon, TClonesArray * branch) { - -// cout <<"BALLE BALLE BALLE AddToOutputAOD"<Px(), photon->Py(), photon->Pz(), photon->E()); -// particle.SetTrackLabel(photon->GetLabel1(), photon->GetLabel2()); -// particle.SetDetector("CTS"); -// //particle.SetPdg(AliPID::kElecon); - -// Int_t i = branch->GetEntriesFast(); -// // if(! (branch.GetClass("Correlation")) ) { -// // new((*branch)[i]) AliAODPWG4Particle(particle); -// // } else { -// TList * list = particle.GetObjArrayList(); -// if(list) -// cout <<"BALLE BALLE we have the list"<Dump(); -// new((*branch)[i]) AliAODPWG4ParticleCorrelation(particle); -// //} -// } - - -//___________________________________________________________________________________________ -void AliAnalysisTaskGammaJet::ProcessConvGamma( const AliAODEvent * const aodEvent ) { - - TClonesArray * tracks = aodEvent->GetTracks(); - if(!tracks) { - cout << "No tracks!!!"<(aodEvent->FindListObject("GammaConversionTask_900356200010031")); - - - if(!convGamma) { - - convGamma = GetConversionGammas(aodEvent); - if(!convGamma) { - AliError(Form("No convgamma")); - return; - } - } - - - - for (Int_t iPhot = 0; iPhot < convGamma->GetEntriesFast(); iPhot++) { - AliAODPWG4Particle * photon = dynamic_cast(convGamma->At(iPhot)); - - - if(!photon) { - AliGammaConversionAODObject * aodO = dynamic_cast(convGamma->At(iPhot)); - if (!aodO) { - AliError(Form("ERROR: Could not receive ga %d\n", iPhot)); - continue; - } - - if(aodO->Pt() < GetMinPt()) continue; - photon = AddToAOD(aodO, fPhotons, "ConvGamma"); - } - - if(photon) { - Bool_t isolated = IsIsolated(photon, tracks, GetConeSize(), GetPtThreshold() ); - - - CorrelateWithJets(photon, aodEvent->GetJets(), isolated); - CorrelateWithHadrons(photon, aodEvent->GetTracks(), isolated); - - fHistPt->Fill(photon->Pt()); - fHistPhotPhi->Fill(photon->Phi()); - } - } -} - - -AliAODPWG4ParticleCorrelation * AliAnalysisTaskGammaJet::AddToAOD(AliGammaConversionAODObject * aodO, TClonesArray * branch, TString detector) { - new((*branch)[branch->GetEntriesFast()]) AliAODPWG4ParticleCorrelation(aodO->Px(), aodO->Py(), aodO->Pz(), aodO->E()); - AliAODPWG4ParticleCorrelation * photon = dynamic_cast(branch->Last()); - if(photon) { - photon->SetTagged(aodO->IsTagged()); - photon->SetTrackLabel(aodO->GetLabel1(), aodO->GetLabel2()); - photon->SetDetector(detector); - } - - return photon; -} - -AliAODPWG4ParticleCorrelation * AliAnalysisTaskGammaJet::AddToAOD(AliAODConversionParticle * aodO, TClonesArray * branch, TString detector) { - new((*branch)[branch->GetEntriesFast()]) AliAODPWG4ParticleCorrelation(aodO->Px(), aodO->Py(), aodO->Pz(), aodO->E()); - AliAODPWG4ParticleCorrelation * photon = dynamic_cast(branch->Last()); - if(photon) { - photon->SetTrackLabel(aodO->GetLabel1(), aodO->GetLabel2()); - photon->SetDetector(detector); - } - - return photon; -} - -///____________________________________________________________________________________________________ -void AliAnalysisTaskGammaJet::CorrelateWithHadrons(AliAODPWG4Particle * photon, const TClonesArray * tracks, Bool_t const isolated) { - - //See header file for documentation - if (tracks) { - - Float_t maxdPhi = 0.0; - Float_t maxdPhiPt = 0.0; - - for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { - AliAODTrack * track = dynamic_cast(tracks->At(ij)); - if(track) { - if (track->Pt() < 2.0 ) continue; - - fHadHistPt->Fill(track->Pt()); - fHistHadPhi->Fill(track->Phi()); - Float_t dPhi = TMath::Abs(photon->Phi() - track->Phi()); - - fHadHistdPhi->Fill(dPhi); - if (isolated) { - fHadHistdPhiIso->Fill(dPhi, track->Pt()/photon->Pt()); - } - - - if(photon->Phi() < 0) - cout << "BALLE"<Phi() < 0 ) - cout << "KUKKK"<Pt(); - //cout << dPhi << " " << maxdPhi << endl; - - } - - } - } - - - if(tracks->GetEntriesFast() > 0) { - //cout << maxdPhi << endl; - fHadHistMaxdPhi->Fill(maxdPhi); - if(isolated) { - fHadHistMaxdPhiIso->Fill(maxdPhi); - fHadHistMaxdPhiIsoPt->Fill(maxdPhi, maxdPhiPt/photon->Pt()); - } - } - } - - - -} - - -///________________________________________________________________________________________________________________ -void AliAnalysisTaskGammaJet::CorrelateWithJets(AliAODPWG4ParticleCorrelation * photon, const TClonesArray * const jets) { - //See header file for documentation - if (jets) { - for(int ij = 0; ij < jets->GetEntriesFast(); ij++) { - AliAODJet * jet = dynamic_cast(jets->At(ij)); - if(jet) { - fHistPtJets->Fill(jet->Pt()); - - Float_t dPhi = TMath::Abs(photon->Phi() - jet->Phi()); - if (photon->IsIsolated()) - fHistGammaJetsIso->Fill(dPhi, jet->Pt()/photon->Pt()); - else - fHistGammaJets->Fill(dPhi); - - } - } - } -} - - - -///________________________________________________________________________________________________________________ -void AliAnalysisTaskGammaJet::CorrelateWithJets(AliAODPWG4Particle * photon, const TClonesArray * const jets, Bool_t const isolated ) { - //See header file for documentation - if (jets) { - - Float_t maxdPhi = 0.0; - Float_t maxdPhiPt = 0.0; - - for(int ij = 0; ij < jets->GetEntriesFast(); ij++) { - AliAODJet * jet = dynamic_cast(jets->At(ij)); - if(jet) { - fHistPtJets->Fill(jet->Pt()); - fHistJetPhi->Fill(jet->Phi()); - Float_t dPhi = TMath::Abs(photon->Phi() - jet->Phi()); - - fHistGammaJets->Fill(dPhi); - if (isolated) { - fHistGammaJetsIso->Fill(dPhi, jet->Pt()/photon->Pt()); - } - - - - if ( TMath::Abs( dPhi - TMath::Pi() ) < TMath::Abs( maxdPhi - TMath::Pi()) ){ - maxdPhi = dPhi; - - maxdPhiPt = jet->Pt(); - //cout << dPhi << " " << maxdPhi << endl; - - } - - } - } - - - if(jets->GetEntriesFast() > 0) { - //cout << maxdPhi << endl; - fHistMaxdPhi->Fill(maxdPhi); - if(isolated) { - fHistMaxdPhiIso->Fill(maxdPhi); - fHistMaxdPhiIsoPt->Fill(maxdPhi, maxdPhiPt/photon->Pt()); - } - } - } -} diff --git a/PWG4/GammaConv/AliAnalysisTaskGammaJet.h b/PWG4/GammaConv/AliAnalysisTaskGammaJet.h deleted file mode 100644 index 70d606b192b..00000000000 --- a/PWG4/GammaConv/AliAnalysisTaskGammaJet.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef AliAnalysisTaskGammaJet_cxx -#define AliAnalysisTaskGammaJet_cxx - -// example of an analysis task creating a p_t spectrum -// Authors: Panos Cristakoglou, Jan Fiete Grosse-Oetringhaus, Christian Klein-Boesing - -class TH1F; -class AliESDEvent; -class AliGammaConversionAODObject; -class AliAODConversionParticle; -class AliAODPWG4ParticleCorrelation; -class AliAODPWG4Particle; -class TClonesArray; -class TString; - -#include "AliAnalysisTaskSE.h" - -class AliAnalysisTaskGammaJet : public AliAnalysisTaskSE { - -public: - - AliAnalysisTaskGammaJet(); - AliAnalysisTaskGammaJet(const char *name); - virtual ~AliAnalysisTaskGammaJet(); - - virtual void UserCreateOutputObjects(); - virtual void UserExec(Option_t *option); - virtual void Terminate(Option_t *); - - void SetDeltaAODFileName(TString string) { fDeltaAODFileName = string;} - - inline Float_t GetMinPt() const { return fMinPt;} - void SetMinPt( const Float_t pt ) { fMinPt = pt; } - inline Float_t GetConeSize () const { return fConeSize; } - void SetConeSize ( const Float_t cs ) { fConeSize = cs; } - inline Float_t GetPtThreshold () const { return fPtThreshold; } - void SetPtThreshold ( Float_t ptt ) { fPtThreshold = ptt; } - - - private: - - //Clean up - void CleanUp(); - - //Get the AOD event from whereever it might be accessible - AliAODEvent * GetAODEvent(); - - //Get Conversion gammas branch - TClonesArray * GetConversionGammas(const AliAODEvent * aodEvent); - - //Create PWG4 particles from the aod objects - AliAODPWG4ParticleCorrelation * PWG4PartFromGammaConvAODObject(AliGammaConversionAODObject * gcObject, TString detector); - - //Fill AOD tree with PWG4 particles - AliAODPWG4ParticleCorrelation * AddToAOD(AliGammaConversionAODObject * aodO, TClonesArray * branch, TString detector); - AliAODPWG4ParticleCorrelation * AddToAOD(AliAODConversionParticle * aodO, TClonesArray * branch, TString detector); - - //Is particle isolated - Bool_t IsIsolated( AliAODPWG4Particle * particle, TClonesArray * tracks, Float_t coneSize, Float_t ptThreshold); - - //Process conv gamma - void ProcessConvGamma( const AliAODEvent * const aodEvent ); - - //Process calorimeters - void ProcessCalorimeters( const AliAODEvent * const aodEvent ); - - //Correlate particle with jets - void CorrelateWithJets(AliAODPWG4ParticleCorrelation * photon, const TClonesArray * const jets); - void CorrelateWithJets(AliAODPWG4Particle * photon, const TClonesArray * const jets, Bool_t const isolated); - void CorrelateWithHadrons(AliAODPWG4Particle * photon, const TClonesArray * tracks, Bool_t const isolated); - - //Is eta - phi distance smaller than conesize ? - inline Bool_t IsInCone(Float_t dEta, Float_t dPhi, Float_t coneSize) { - return ( (dEta*dEta + dPhi*dPhi) < coneSize*coneSize); - } - - TList *fOutputList; //! Output list - TH1F *fHistPt; //! Pt spectrum - TH1F *fHistPtPhos; //! Pt spectrum - TH1F *fHistPtEmcal; //! Pt spectrum - - TH1F *fHistPhotPhi; - TH1F *fHistHadPhi; - TH1F *fHistJetPhi; - - - TH1F *fHistPtJets; //! Pt spectrum - TH1F *fHistGammaJets; //!Phi correlations - TH1F *fHistGammaJetsIso; //!Phi correlations - TH1F *fHistMaxdPhi; //!Phi correlations - TH1F *fHistMaxdPhiIso; //!Phi correlations - TH1F *fHistMaxdPhiIsoPt; //!Phi correlations - - TH1F *fHadHistPt; //! Pt spectrum - TH1F *fHadHistdPhi; //!Phi correlations - TH1F *fHadHistdPhiIso; //!Phi correlations - TH1F *fHadHistMaxdPhi; //!Phi correlations - TH1F *fHadHistMaxdPhiIso; //!Phi correlations - TH1F *fHadHistMaxdPhiIsoPt; //!Phi correlations - - - Float_t fMinPt; //Minimum pt for correlation - Float_t fConeSize; //cone size for isolation - Float_t fPtThreshold; //Threshold pt for isolation - - TString fDeltaAODFileName;//! File where Gamma Conv AOD is located, if not in default AOD - - TClonesArray * fPhotons; - - AliAnalysisTaskGammaJet(const AliAnalysisTaskGammaJet&); // not implemented - AliAnalysisTaskGammaJet& operator=(const AliAnalysisTaskGammaJet&); // not implemented - - ClassDef(AliAnalysisTaskGammaJet, 2); // example of analysis -}; - -#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.cxx new file mode 100644 index 00000000000..0e17055a760 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.cxx @@ -0,0 +1,216 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnaConvCorrBase.cxx +/// @author Svein Lindal +/// @brief Base class for analysation of conversion particle - track correlations + + +#include "AliAnaConvCorrBase.h" +#include "AliAODTrack.h" + +#include "TClonesArray.h" +#include "TH1F.h" +#include "TH1I.h" +#include "TH2F.h" +#include "TList.h" +#include "TNtuple.h" +#include "AliAODConversionParticle.h" + + +#include + +// Gamma - jet correlation analysis task +// Authors: Svein Lindal + + +using namespace std; +ClassImp(AliAnaConvCorrBase) + +//________________________________________________________________________ +AliAnaConvCorrBase::AliAnaConvCorrBase(TString name) : TObject(), + fName(name), + fHistograms(NULL), + fTriggerPt(0), + fCorrelatedPt(0), + fNPhiBins(32) +{ + //Constructor + fTBins[0] = 7.0; + fTBins[1] = 5.0; + fTBins[2] = 3.0; + + fCBins[0] = 5.0; + fCBins[1] = 3.0; + fCBins[2] = 1.5; + +} + + +//________________________________________________________________________________ +AliAnaConvCorrBase::~AliAnaConvCorrBase() { + + ///destructor + // delete[] fCBins; + // delete[] fTBins; + +} + + +//________________________________________________________________________ +void AliAnaConvCorrBase::CreateHistograms() { + //Create histograms add, to outputlis + + fHistograms = new TList(); + fHistograms->SetOwner(kFALSE); + fHistograms->SetName(fName); + + + + for(int iIso = 0; iIso < 2; iIso++) { + fHEtaPhiPt[iIso] = new TH2F( + Form("%s_deta_dphi_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + Form("%s_deta_dphi_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + 200, -2., 2., fNPhiBins, -TMath::PiOver2(), 3*TMath::PiOver2()); + fHistograms->Add(fHEtaPhiPt[iIso]); + } + + for(int iIso = 0; iIso < 2; iIso++) { + fHdEta[iIso] = new TH1F(Form("%s_deta_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + Form("%s_deta_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + 200, -2, 2); + fHistograms->Add(fHdEta[iIso]); + } + + for(int iIso = 0; iIso < 2; iIso++) { + fHdPhi[iIso] = new TH1F(Form("%s_dphi_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + Form("%s_dphi_corr_%s", fName.Data(), (iIso==0)?"nonIso":"isolated"), + fNPhiBins, -TMath::PiOver2(), 3*TMath::PiOver2()); + fHistograms->Add(fHdPhi[iIso]); + } + + for(int iIso = 0; iIso < 2; iIso++) { + fHNTriggers[iIso] = new TH1I(Form("%s_%s_fNTriggers", fName.Data(), (iIso==0)?"nonIso":"isolated"), + Form("%s_%s_fNTriggers", fName.Data(), (iIso==0)?"nonIso":"isolated"), + fNTBins, 0, fNTBins ); + fHistograms->Add(fHNTriggers[iIso]); + } + + + for(int iIso = 0; iIso < 2; iIso++) { + for(Int_t tBin = 0; tBin < fNTBins; tBin++) { + for(Int_t cBin = 0; cBin < fNCBins; cBin++) { + fHdPhiBins[iIso][tBin][cBin] = new TH1F(Form("%s_%s_phi_corr_tBin_%d_cBin_%d", fName.Data(), (iIso==0)?"nonIso":"isolated", tBin, cBin), + Form("%s particles dPhi %fAdd(fHdPhiBins[iIso][tBin][cBin]); + } + } + } +} + + +///____________________________________________________________________________ +void AliAnaConvCorrBase::FillTriggerCounters(Float_t tPt, Bool_t isolated){ + //Fill histogram with trigger counters + fHNTriggers[0]->Fill(GetTriggerBin(tPt)); + if(isolated) fHNTriggers[isolated]->Fill(GetTriggerBin(tPt)); + + +} + +///_____________________________________________________________________________ +void AliAnaConvCorrBase::FillHistograms(Float_t tPt, Float_t cPt, Float_t dPhi, Float_t dEta, Bool_t isolated) { + //Fill histograms + Float_t ptFrac = cPt/tPt; + + Int_t triggerBin = GetTriggerBin(tPt); + Int_t corrBin = GetCorrBin(cPt); + + if(triggerBin < 0 ||corrBin < 0) return; + + fHEtaPhiPt[0]->Fill(dEta, dPhi, cPt); + fHdEta[0]->Fill(dEta, cPt); + fHdPhi[0]->Fill(dPhi, cPt); + fHdPhiBins[0][triggerBin][corrBin]->Fill(dPhi); + + + if(isolated) { + fHEtaPhiPt[isolated]->Fill(dEta, dPhi, cPt); + fHdEta[isolated]->Fill(dEta, ptFrac); + fHdPhi[isolated]->Fill(dPhi, ptFrac); + fHdPhiBins[isolated][triggerBin][corrBin]->Fill(dPhi); + + } +} + +///____________________________________________________________________________ +Int_t AliAnaConvCorrBase::GetTriggerBin(Float_t pt) const { + //Get trigger bin + for(Int_t i = 0; i < fNTBins; i++) { + if(pt > fTBins[i]) return i; + } + + return -1; +} + +///____________________________________________________________________________ +Int_t AliAnaConvCorrBase::GetCorrBin(Float_t pt) const { + //Get correlation particle bin + for(Int_t i = 0; i < fNCBins; i++) { + if(pt > fCBins[i]) return i; + } + + return -1; +} + + + +///______________________________________________________________________________ +Float_t AliAnaConvCorrBase::GetLowerBinLimit(const Int_t bin, const Float_t * const bins) const { + //Get lower bin limit for bin + return bins[bin]; +} + +///______________________________________________________________________________ +Float_t AliAnaConvCorrBase::GetUpperBinLimit(const Int_t bin, const Float_t * const bins) const { + //Get upper bin limit for bin + + Float_t limit = -999; + if(bin < 1) + limit = 999; + else + limit = bins[bin -1]; + + return limit; + +} + + +//_______________________________________________________________________________ + +void AliAnaConvCorrBase::PrintStatistics() { + //Print some statistics between each file + + for(int i = 0; i < fNTBins; i++) { + Int_t nTrig = fHNTriggers[0]->GetBinContent(i+1); + cout << "triggers: " << nTrig << endl; + for(int j = 0; j < fNCBins; j++) { + cout << fHdPhiBins[0][i][j]->GetEntries() << "/" << ((nTrig>0)? fHdPhiBins[0][i][j]->GetEntries()/nTrig : 0) << "; "; + } + cout << endl; + } +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.h b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.h new file mode 100644 index 00000000000..1de58bbd594 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrBase.h @@ -0,0 +1,116 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnaConvCorrPhoton.h +/// @author Svein Lindal +/// @brief Base class for analysis of correlations between conversion particles and charged tracks + +#ifndef ALIANACONVCORRBASE_CXX +#define ALIANACONVCORRBASE_CXX + +#include "Rtypes.h" +#include "TMath.h" +#include "TList.h" +#include "TH1.h" + +class TH1F; +class TH1I; +class TH2F; +class AliAODConversionParticle; +class TClonesArray; +class TNtuple; +class TString; + + +class AliAnaConvCorrBase : public TObject { + +public: + + + + //Constructor / desctructor + AliAnaConvCorrBase(TString name); + virtual ~AliAnaConvCorrBase(); + + //Set and get min pt for triggers + void SetTriggerPt(Float_t pt) { fTriggerPt = pt; } + inline Float_t GetTriggerPt() const {return fTriggerPt; } + + + //Set and get min pt for correlation particles + void SetCorrelatedPt(Float_t pt) { fCorrelatedPt = pt; } + inline Float_t GetCorrelatedPt() const {return fCorrelatedPt; } + + //CreateHistograms + void CreateHistograms(); + + //Get list of histograms + TList * GetHistograms() const { return fHistograms;} + + //Add histogram to list + void AddHistogram(TH1 * histogram) { fHistograms->Add(dynamic_cast(histogram));} + + //Set and get number of bins in phi direction + void SetNPhiBins(Int_t bins) { fNPhiBins = bins; } + Int_t GetNPhiBins() const { return fNPhiBins;} + + ///Get the distance in phi between trigger particle and correlated particle + Float_t GetDPhi(Float_t dPhi) { + if ( dPhi < 3*TMath::PiOver2() && dPhi > - TMath::PiOver2() ) return dPhi; + else return ( (dPhi>0)? dPhi - TMath::TwoPi() : dPhi + TMath::TwoPi() ); + } + + ///Get bin limits of various pt bins + Float_t GetLowerBinLimit(const Int_t bin, const Float_t * const bins) const; + Float_t GetUpperBinLimit(const Int_t bin, const Float_t * const bins) const; + + //Get trigger bin for particle carrying given pt + Int_t GetTriggerBin(Float_t pt) const; + //Get correlation particle pt bin for particle carrying given pt + Int_t GetCorrBin(Float_t pt) const; + + + //Print statistics for histograms + void PrintStatistics(); + + +protected: + + //Fill histograms + void FillHistograms(Float_t tPt, Float_t cPt, Float_t dPhi, Float_t dEta, Bool_t isolated); + //Fill trigger counter histograms + void FillTriggerCounters(Float_t tPt, Bool_t isolated); + + private: + + TString fName; //name of analysis + + static const Int_t fNTBins = 3; //Number of trigger pt bins + static const Int_t fNCBins = 3; //Number of corr particles pt bins + + TList * fHistograms; //List of histograms + + TH2F * fHEtaPhiPt[2]; //2D eta phi correlations histogram + TH1F * fHdEta[2]; //Eta correlations histogram + TH1F * fHdPhi[2]; //Phi correlations histogram + + TH1F * fHdPhiBins[2][fNTBins][fNCBins]; //dPhi correlations histograms in several bins + TH1I * fHNTriggers[2]; //Histograms containing number of triggers in various bins + + Float_t fTBins[fNTBins]; ///Array of trigger bin limits + Float_t fCBins[fNCBins];///Array of corr particle pt bin limits + + Float_t fTriggerPt; //Min trigger particle pt + Float_t fCorrelatedPt; // Min correlation particle pt + + Int_t fNPhiBins; //Number of bins in phi + + //Default constructor prohibited + AliAnaConvCorrBase(); //not implemented + AliAnaConvCorrBase(const AliAnaConvCorrBase&); // not implemented + AliAnaConvCorrBase& operator=(const AliAnaConvCorrBase&); // not implemented + ClassDef(AliAnaConvCorrBase, 2); // example of analysis +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx new file mode 100644 index 00000000000..4d24b43247d --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.cxx @@ -0,0 +1,77 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnaConvCorrPhoton.cxx +/// @author Svein Lindal +/// @brief Class used to fill calculate correlation between photons - tracks + +#include "AliAnaConvCorrPhoton.h" +#include "AliAODTrack.h" +#include "TClonesArray.h" +#include "AliAODConversionParticle.h" + +#include +// Gamma - jet correlation analysis task +// Authors: Svein Lindal + + +using namespace std; +ClassImp(AliAnaConvCorrPhoton) + +//________________________________________________________________________ +AliAnaConvCorrPhoton::AliAnaConvCorrPhoton() : +AliAnaConvCorrBase("photon_hadron_corr"), + fSkipDecayParticles(kFALSE) +{ + //consctructor +} +//________________________________________________________________________ +AliAnaConvCorrPhoton::AliAnaConvCorrPhoton(TString name) : +AliAnaConvCorrBase(name), +fSkipDecayParticles(kFALSE) +{ + //consctructor +} + + +//________________________________________________________________________________ +AliAnaConvCorrPhoton::~AliAnaConvCorrPhoton() { + //destructor +} + +///__________________________________________________________________________ +void AliAnaConvCorrPhoton::CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const tracks, const Bool_t isolated, const Bool_t decayParticle) { + + + if( decayParticle && fSkipDecayParticles ) return; + + FillTriggerCounters(photon->Pt(), isolated); + //See header file for documentation + if (tracks) { + + for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { + AliAODTrack * track = dynamic_cast(tracks->At(ij)); + if(track) { + + if ( (track->GetID() == photon->GetTrackLabel(0)) || track->GetID() == photon->GetTrackLabel(1) ) continue; + + //if (track->Pt() < GetCorrelatedPt() ) continue; + + FillHistograms(photon->Pt(), track->Pt(), GetDPhi(photon->Phi() - track->Phi()), photon->Eta() - track->Eta(), isolated); + + } + } + } +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.h b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.h new file mode 100644 index 00000000000..ceec7b1d41e --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhoton.h @@ -0,0 +1,43 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnaConvCorrPhoton.h +/// @author Svein Lindal +/// @brief Class used to find correlations between photons and charged tracks + +#ifndef ALIANACONVCORRPHOTON_CXX +#define ALIANACONVCORRPHOTON_CXX + +#include "AliAnaConvCorrBase.h" + +class AliAODConversionParticle; +class TClonesArray; + +class AliAnaConvCorrPhoton : public AliAnaConvCorrBase { + +public: + + AliAnaConvCorrPhoton(); + AliAnaConvCorrPhoton(TString name); + virtual ~AliAnaConvCorrPhoton(); + + ///Correlation photon with tracks + virtual void CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const tracks, const Bool_t isolated, const Bool_t decayParticle); + + //Process particles identified as pion / eta decay + void SkipDecayParticles() { fSkipDecayParticles = kTRUE; } + void DoDecayParticles() { fSkipDecayParticles = kFALSE; } + + private: + + + Bool_t fSkipDecayParticles; //Process particles identified as pion / eta decay particles + + AliAnaConvCorrPhoton(const AliAnaConvCorrPhoton&); // not implemented + AliAnaConvCorrPhoton& operator=(const AliAnaConvCorrPhoton&); // not implemented + ClassDef(AliAnaConvCorrPhoton, 1); // example of analysis + +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.cxx new file mode 100644 index 00000000000..11626e90a98 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.cxx @@ -0,0 +1,64 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnaConvCorrPhoton.cxx +/// @author Svein Lindal +/// @brief Class used to fill calculate correlation between photons - jets + +#include "AliAnaConvCorrPhotonJet.h" +#include "AliAODTrack.h" +#include "TClonesArray.h" +#include "AliAODConversionParticle.h" +#include "AliAODJet.h" + +#include +// Gamma - jet correlation analysis task +// Authors: Svein Lindal + + +using namespace std; +ClassImp(AliAnaConvCorrPhotonJet) + +//________________________________________________________________________________ +AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet() : +AliAnaConvCorrBase("photonJet") { + //consctructor +} +//________________________________________________________________________________ +AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet(TString name) : +AliAnaConvCorrBase(name) { + //consctructor +} + + +//________________________________________________________________________________ +AliAnaConvCorrPhotonJet::~AliAnaConvCorrPhotonJet() { + //destructor +} + +///_______________________________________________________________________________ +void AliAnaConvCorrPhotonJet::CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const tracks, const Bool_t isolated) { + + //See header file for documentation + if (tracks) { + + for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { + AliAODJet * jet = dynamic_cast(tracks->At(ij)); + if(jet) { + FillHistograms(photon->Pt(), jet->Pt(), GetDPhi(photon->Phi() - jet->Phi()), photon->Eta() - jet->Eta(), isolated); + } + } + } +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.h b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.h new file mode 100644 index 00000000000..ae570ff3f34 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPhotonJet.h @@ -0,0 +1,36 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnaConvCorrPhoton.h +/// @author Svein Lindal +/// @brief Class used to find correlations between photons and jets + +#ifndef ALIANACONVCORRPHOTONJET_CXX +#define ALIANACONVCORRPHOTONJET_CXX + +#include "AliAnaConvCorrBase.h" + +class AliAODConversionParticle; +class TClonesArray; + +class AliAnaConvCorrPhotonJet : public AliAnaConvCorrBase { + +public: + + AliAnaConvCorrPhotonJet(); + AliAnaConvCorrPhotonJet(TString name); + virtual ~AliAnaConvCorrPhotonJet(); + + //Correlate photon with jets + virtual void CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const jets, const Bool_t isolated); + + private: + + AliAnaConvCorrPhotonJet(const AliAnaConvCorrPhotonJet&); // not implemented + AliAnaConvCorrPhotonJet& operator=(const AliAnaConvCorrPhotonJet&); // not implemented + ClassDef(AliAnaConvCorrPhotonJet, 1); // + +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx new file mode 100644 index 00000000000..5bc7eca9661 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.cxx @@ -0,0 +1,97 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnaConvCorrPion.cxx +/// @author Svein Lindal +/// @brief Class used to run conversion gamma/pion - hadron/jet analysis + + + +#include "AliAnaConvCorrPion.h" +#include "AliAODTrack.h" +#include "TClonesArray.h" +#include "AliAODConversionParticle.h" + +#include + + +using namespace std; +ClassImp(AliAnaConvCorrPion) + +//________________________________________________________________________ +AliAnaConvCorrPion::AliAnaConvCorrPion() : +AliAnaConvCorrBase("pion_hadron_corr") { + //consctructor +} +//________________________________________________________________________ +AliAnaConvCorrPion::AliAnaConvCorrPion(TString name) : +AliAnaConvCorrBase(name) { + //consctructor +} + + +//________________________________________________________________________________ +AliAnaConvCorrPion::~AliAnaConvCorrPion() { + //destructor +} + + +///_______________________________________________________________________________ +void AliAnaConvCorrPion::GetTrackLabels(const AliAODConversionParticle * pion, const TClonesArray * photons, Int_t* trackLabels) { + ///Get the track labels of the electrons reconstructed as gamma forming the pion + + for(Int_t i = 0; i< 2; i++) { + AliAODConversionParticle * gamma = dynamic_cast(photons->At(pion->GetTrackLabel(i))); + + if(gamma) { + for(Int_t j = 0; j< 2; j++) { + cout << "index " << i + j + ((i>=j)?1:0) << " " << gamma->GetTrackLabel(j) << endl; + trackLabels[ i*2+ j] = gamma->GetTrackLabel(j); + } + + } else { + AliGammaConversionAODObject * aodO = dynamic_cast(photons->At(pion->GetTrackLabel(i))); + if(aodO) { + trackLabels[i*2] = aodO->GetLabel1(); + trackLabels[i*2 + 1] = aodO->GetLabel2(); + } else { + cout << "AliAnaConvCorrPion::GetTrackLabels() :: Not good!!!"<Pt(), isolated); + + + if (tracks) { + for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { + AliAODTrack * track = dynamic_cast(tracks->At(ij)); + if(track) { + if(pion->IsMySpawn(track->GetID(), nSpawn, spawn)) continue; + + if (track->Pt() < GetCorrelatedPt() ) continue; + + FillHistograms(pion->Pt(), track->Pt(), GetDPhi(pion->Phi() - track->Phi()), pion->Eta() - track->Eta(), isolated); + + } + } + } +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.h b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.h new file mode 100644 index 00000000000..6cec4d34a0b --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvCorrPion.h @@ -0,0 +1,40 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnaConvCorrPion.h +/// @author Svein Lindal +/// @brief Class used to find correlations between pions and charged tracks + + +#ifndef ALIANACONVCORRPION_CXX +#define ALIANACONVCORRPION_CXX + +#include "AliAnaConvCorrBase.h" + +class AliAODConversionParticle; +class TClonesArray; + +class AliAnaConvCorrPion : public AliAnaConvCorrBase { + +public: + + AliAnaConvCorrPion(); + AliAnaConvCorrPion(TString name); + virtual ~AliAnaConvCorrPion(); + + //Correlate pions with charged tracks + virtual void CorrelateWithHadrons(AliAODConversionParticle * pion, const TClonesArray * tracks, const Bool_t isolated, const Int_t nSpawn, const Int_t * const spawn ); + + private: + + //Get array of track labels of the 4 decay electrons (2gamma * 2 electrons) + void GetTrackLabels(const AliAODConversionParticle * pion, const TClonesArray * photons, Int_t* trackLabels); + + AliAnaConvCorrPion(const AliAnaConvCorrPion&); // not implemented + AliAnaConvCorrPion& operator=(const AliAnaConvCorrPion&); // not implemented + ClassDef(AliAnaConvCorrPion, 1); // example of analysis + +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.cxx new file mode 100644 index 00000000000..75a6dc04eb2 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.cxx @@ -0,0 +1,257 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnalysisTaskGammaJet.cxx +/// @author Svein Lindal +/// @brief Class used to run isolation studies of conversion gamma/pions + + +#include "AliAnaConvIsolation.h" +#include "AliAODTrack.h" + +#include "TObject.h" +#include "TClonesArray.h" +#include "TH2F.h" +#include "TList.h" +#include "AliAODConversionParticle.h" + + +#include + +// Gamma - jet correlation analysis task +// Author: Svein Lindal + + +using namespace std; +ClassImp(AliAnaConvIsolation) + +//________________________________________________________________________ +AliAnaConvIsolation::AliAnaConvIsolation () : TObject(), + fIsoCurve(NULL), + fCurveFunction("0.1*x"), + fConeSize(0), + fMinPt(0.1), + fMaxPtThreshold(0), + fSumPtThreshold(0), + fMaxPtFraction(0), + fSumPtFraction(0), + fHistograms(NULL), + fHistogramMaxPt(50) +{ + fHistograms = new TList(); + fHistograms->SetName("Isolation_histo"); +} + +//________________________________________________________________________ +AliAnaConvIsolation::AliAnaConvIsolation(Float_t coneSize, Float_t maxPtThreshold, Float_t sumPtThreshold, Float_t maxPtFraction, Float_t sumPtFraction) : + TObject(), + fIsoCurve(NULL), + fCurveFunction("0.1*x"), + fConeSize(coneSize), + fMinPt(0.1), + fMaxPtThreshold(maxPtThreshold), + fSumPtThreshold(sumPtThreshold), + fMaxPtFraction(maxPtFraction), + fSumPtFraction(sumPtFraction), + fHistograms(NULL), + fHistogramMaxPt(50) +{ + +} + + +//________________________________________________________________________________ +AliAnaConvIsolation::~AliAnaConvIsolation() { + + +} + + +//________________________________________________________________________ +void AliAnaConvIsolation::CreateHistograms() +{ + + fHistograms = new TList(); + fHistograms->SetName(Form("Isolation_histo_cone_%f_maxPt_%f_sumPt_%f", fConeSize, fSumPtThreshold, fMaxPtThreshold)); + + fIsoCurve = new TF1("Isolation_curve", fCurveFunction.Data(), 0, 100); + fHistograms->Add(fIsoCurve); + + cout << "Creatin isolation histograms conesize :" << fConeSize << endl; + + //Create histograms add, to outputlis + for(Int_t i = 0; i < 2; i++){ + fhMaxPtInCone[i] = new TH2F(Form("fhMaxPtInCone_%s_%f", (i==0)? "nonIso" : "isolated", fConeSize), + Form("Max pt nonIso particle in cone %f vs candidate pt", fConeSize), + 200, 0, fHistogramMaxPt, 200, 0, fHistogramMaxPt); + fHistograms->Add(fhMaxPtInCone[i]); + + fhSumPtInCone[i] = new TH2F(Form("fhSumPtInCone_%s_%f", (i==0)? "nonIso" : "isolated", fConeSize), + Form("Sum pt in cone %f vs candidate pt %s", fConeSize, (i==0)? "nonIsoay" : "isolated"), + 200, 0, fHistogramMaxPt, 200, 0, fHistogramMaxPt); + fHistograms->Add(fhSumPtInCone[i]); + + fhSumPtVsMaxPt[i] = new TH2F(Form("fhSumPtVsMaxPt_%s_%f", (i==0)? "nonIso" : "isolated", fConeSize), + Form("fhSumPtVsMaxPt_%s_%f", (i==0)? "nonIso" : "isolated", fConeSize), + 200, 0, fHistogramMaxPt, 200, 0, fHistogramMaxPt); + fHistograms->Add(fhSumPtVsMaxPt[i]); + } + + for(Int_t iIso = 0; iIso < 2; iIso++){ + fhPtCandidates[iIso] = new TH1F(Form("fhPtCandidates_%s_%f", (iIso==0)? "nonIso" : "isolated", fConeSize), + Form("Pt of %s candidates, cone size %f", (iIso==0)? "nonIsolated" : "isolated", fConeSize), + 200, 0 , fHistogramMaxPt); + fhPtCandidates[iIso]->GetXaxis()->SetTitle("P_{T} (GeV/c)"); + fhPtCandidates[iIso]->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); + fhPtCandidates[iIso]->SetMarkerStyle(kFullCircle); + fHistograms->Add(fhPtCandidates[iIso]); + } + + // for(int iDec = 0; iDec < 2; iDec++) { + // for(int iIso = 0; iIso < 2; iIso++) { + + // fHistSumPt[iIso][iDec] = new TH1F(Form("fHistSumPt_%f_%s_%s", fConeSize, (iIso==0)?"nonIso":"isolated" , (iDec==0)?"noDec":"decay" ), + // Form("P_{T} distribution cone %f %s %s", fConeSize, (iIso==0)?"nonIso":"isolated" , (iDec==0)?"noDec":"decay" ), + // 150, 0.1, 50); + // fHistSumPt[iIso][iDec]->GetXaxis()->SetTitle("P_{T} (GeV/c)"); + // fHistSumPt[iIso][iDec]->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); + // fHistSumPt[iIso][iDec]->SetMarkerStyle(kFullCircle); + // fHistograms->Add(fHistSumPt[iIso][iDec]); + + + // fHistMaxPt[iIso][iDec] = new TH1F(Form("fHistMaxPt_%f_%s_%s", fConeSize, (iIso==0)?"nonIso":"isolated" , (iDec==0)?"noDec":"decay" ), + // Form("P_{T} distribution cone %f %s %s", fConeSize, (iIso==0)?"nonIso":"isolated" , (iDec==0)?"noDec":"decay" ), + // 150, 0.1, 50); + // fHistMaxPt[iIso][iDec]->GetXaxis()->SetTitle("P_{T} (GeV/c)"); + // fHistMaxPt[iIso][iDec]->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)"); + // fHistMaxPt[iIso][iDec]->SetMarkerStyle(kFullCircle); + // fHistograms->Add(fHistMaxPt[iIso][iDec]); + + + // } + // } + + + for(Int_t iIso = 0; iIso < 2; iIso++){ + fhTrackMult[iIso] = new TH1F(Form("fhTrackMult_%s_%f", (iIso==0)? "nonIso" : "isolated", fConeSize), + Form("Pt of %s candidates, cone size %f", (iIso==0)? "nonIsolated" : "isolated", fConeSize), + 150, 0 , 150); + fhTrackMult[iIso]->GetXaxis()->SetTitle("n tracks in event"); + fhTrackMult[iIso]->GetYaxis()->SetTitle("dN/dNTracks"); + fhTrackMult[iIso]->SetMarkerStyle(kFullCircle); + fHistograms->Add(fhTrackMult[iIso]); + } + +} + + +//_________________________________________________________________________ +Bool_t AliAnaConvIsolation::IsIsolated(AliAODConversionParticle * particle, const TClonesArray * const tracks, const Int_t nSpawn, const Int_t * const spawn, Bool_t &leading) { + //See header file for documentation + + leading = kTRUE; + + Float_t ptSum = 0.0; + Float_t ptMax = 0.0; + + for(int it = 0; it < tracks->GetEntriesFast(); it++) { + AliAODTrack * track = dynamic_cast(tracks->At(it)); + + if (track) { + + if(track->Pt() < fMinPt) continue; + + ///Ignore tracks that are grandchildren of pion + if ( particle->IsMySpawn(track->GetID(), nSpawn, spawn)) + continue; + + + if ( IsInCone(particle->Eta() - track->Eta(), particle->Phi() - track->Phi(), fConeSize) ) { + ptSum += track->Pt(); + if(track->Pt() > ptMax) ptMax = track->Pt(); + if(track->Pt() > particle->Pt()) leading = kFALSE; + } + } else { + cout << "Bad track"<Pt()); + + FillHistograms(particle->Pt(), ptMax, ptSum, isolated, tracks->GetEntriesFast()); + + return isolated; + +} + + +//_________________________________________________________________________ +Bool_t AliAnaConvIsolation::IsIsolated(const AliAODConversionParticle * const particle, const TClonesArray * const tracks, Bool_t &leading ) { + //See header file for documentation + + leading = kTRUE; + + Float_t ptSum = 0.0; + Float_t ptMax = 0.0; + + for(int it = 0; it < tracks->GetEntriesFast(); it++) { + + AliAODTrack * track = dynamic_cast(tracks->At(it)); + + if (track) { + + if(track->Pt() < fMinPt) continue; + + if ( (track->GetID() == particle->GetTrackLabel(0)) || track->GetID() == particle->GetTrackLabel(1) ) + continue; + + if ( IsInCone(particle->Eta() - track->Eta(), particle->Phi() - track->Phi(), fConeSize) ) { + ptSum += track->Pt(); + if(track->Pt() > ptMax) ptMax = track->Pt(); + if(track->Pt() > particle->Pt()) leading = kFALSE; + } + } else { + cout << "Bad track"<Pt()); + + FillHistograms(particle->Pt(), ptMax, ptSum, isolated, tracks->GetEntriesFast()); + + + return isolated; + +} + +///___________________________________________________________________________ +void AliAnaConvIsolation::FillHistograms(Float_t pt, Float_t ptMax, Float_t ptSum, Bool_t isolated, Int_t nTracks) { + + fhMaxPtInCone[isolated]->Fill(pt, ptMax); + fhSumPtInCone[isolated]->Fill(pt, ptSum); + fhSumPtVsMaxPt[isolated]->Fill(ptMax, ptSum); + fhPtCandidates[isolated]->Fill(pt); + fhTrackMult[isolated]->Fill(nTracks); +} + + +///_____________________________________________________________________________ +Bool_t AliAnaConvIsolation::EvaluateIsolationCriteria(Float_t ptSum, Float_t pt) const { + + return (ptSum < fIsoCurve->Eval(pt)); + +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.h b/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.h new file mode 100644 index 00000000000..af29e4b0679 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnaConvIsolation.h @@ -0,0 +1,118 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnalysisTaskGammaJet.h +/// @author Svein Lindal +/// @brief Class used to run isolation studies of conversion gamma/pions + + +#ifndef ALIANACONVISOLATION_CXX +#define ALIANACONVISOLATION_CXX + +#include "TObject.h" +#include "Rtypes.h" +#include "TF1.h" +class TH2F; +class TH1F; +class AliAODConversionParticle; +class TClonesArray; +class TList; + +class AliAnaConvIsolation : public TObject { + +public: + + AliAnaConvIsolation(); + AliAnaConvIsolation(Float_t coneSize, Float_t maxPtThreshold, Float_t sumPtThreshold, Float_t maxPtFraction, Float_t sumPtFraction); + virtual ~AliAnaConvIsolation(); + + + void CreateHistograms(); + + + ///Set And get cone size + void SetConeSize(Float_t cs) {fConeSize = cs;} + Float_t GetConeSize() const {return fConeSize;} + + + //Set and get max pt threshold + void SetMaxPtThreshold(Float_t cs) {fMaxPtThreshold = cs;} + Float_t GetPtThreshold() const {return fMaxPtThreshold;} + + + //Set and get sum pt threshold + void SetSumPtThreshold(Float_t cs) {fSumPtThreshold = cs;} + Float_t GetPtSumThreshold() const {return fSumPtThreshold;} + + //Set and get max Pt fraction threshold + void SetMaxPtFraction(Float_t cs) {fMaxPtFraction = cs;} + Float_t GetPtFraction() const {return fMaxPtFraction;} + + //Set and get sum pt fraction threshold + void SetSumPtFraction(Float_t cs) {fSumPtFraction = cs;} + Float_t GetPtSumFraction() const {return fSumPtFraction;} + + //Set min pt for a particle to be counted in bg + void SetMinPt( Float_t minpt) {fMinPt = minpt; } + + //Get isolation curve + TF1 * GetIsolationCurve() const { return fIsoCurve; } + + //Set function of isolation curve + void SetIsolationCurve(TString curve) { + fCurveFunction = curve; + } + + //Fill histograms + void FillHistograms(Float_t pt, Float_t ptMax, Float_t ptSum, Bool_t isolated, Int_t nTracks); + + //Get list of histograms + TList * GetHistograms() const { return fHistograms;} + + //Is particle isolated + Bool_t IsIsolated( const AliAODConversionParticle * const particle, const TClonesArray * const tracks, Bool_t &leading); + Bool_t IsIsolated( AliAODConversionParticle * const particle, const TClonesArray * const tracks, const Int_t nSpawn, const Int_t * const spawn, Bool_t &leading ); + + private: + + //Is eta - phi distance smaller than conesize ? + Bool_t IsInCone(Float_t dEta, Float_t dPhi, Float_t coneSize) const { + return ( (dEta*dEta + dPhi*dPhi) < coneSize*coneSize); + } + + ///Evaluate whether particle is isolated according to criterie + Bool_t EvaluateIsolationCriteria(Float_t ptSum, Float_t pt) const; + + TF1 * fIsoCurve; ///Curve defining if particle is isolated or not + TString fCurveFunction; ///Funtion defining curve + + Float_t fConeSize; //Size of isolation cone + Float_t fMinPt; //min pt for bg particles + Float_t fMaxPtThreshold; //max pt threshold + Float_t fSumPtThreshold; //sum pt threhold + Float_t fMaxPtFraction; //max pt fraction threshold + Float_t fSumPtFraction; //sum pt fraction threshold + + TList * fHistograms; //list of histograms + + TH2F * fhMaxPtInCone[2]; //histogram of max pt in cone + TH2F * fhSumPtInCone[2]; //histogram of sum pt in cone + TH2F * fhSumPtVsMaxPt[2];//sum pt vs max pt + + // TH1F * fHistSumPt[2][2]; + // TH1F * fHistMaxPt[2][2]; + + TH1F * fhPtCandidates[2]; //pt distribution of isolation candidates + TH1F * fhTrackMult[2]; //Track multiplicity of events with / wo isolated particles + + + Float_t fHistogramMaxPt; //Upper pt limit in histograms + + + AliAnaConvIsolation(const AliAnaConvIsolation&); // not implemented + AliAnaConvIsolation& operator=(const AliAnaConvIsolation&); // not implemented + ClassDef(AliAnaConvIsolation, 2); // example of analysis +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.cxx b/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.cxx new file mode 100644 index 00000000000..3ca941de359 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.cxx @@ -0,0 +1,503 @@ +/************************************************************************** + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * + * * + * Primary Author: Svein Lindal * + * * + * 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 * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/// @file AliAnalysisTaskGammaJet.cxx +/// @author Svein Lindal +/// @brief Class used to run conversion gamma/pion - hadron/jet analysis + + +#include +#include "TChain.h" +#include "TTree.h" +#include "TH1F.h" +#include "TCanvas.h" +#include "TString.h" +#include "TObjArray.h" + + +#include "AliAnalysisTask.h" +#include "AliAnalysisManager.h" +#include "AliAnalysisTaskGammaJet.h" + +#include "AliESDEvent.h" +#include "AliESDCaloCluster.h" +#include "AliESDInputHandler.h" + +#include "AliAODPWG4ParticleCorrelation.h" +#include "AliAODEvent.h" +#include "AliAODHandler.h" +#include "AliAODCaloCluster.h" +#include "AliGammaConversionAODObject.h" +#include "AliAODConversionParticle.h" +#include "AliAODJet.h" + +#include "AliAODInputHandler.h" + +#include "AliAnaConvIsolation.h" + +#include "AliAnaConvCorrPhoton.h" +#include "AliAnaConvCorrPhotonJet.h" +#include "AliAnaConvCorrPion.h" +// Gamma - jet correlation analysis task +// Authors: Svein Lindal + + +using namespace std; + +ClassImp(AliAnalysisTaskGammaJet) + +//________________________________________________________________________ +AliAnalysisTaskGammaJet::AliAnalysisTaskGammaJet() : +AliAnalysisTaskSE(), + fOutputList(NULL), + fDeltaAODFileName("AliAODGammaConversion.root"), + fConversionCutString("GammaConv"), + fAnaIsolation(NULL), + fAnaIsolationArray(NULL), + fAnaPionArray(NULL), + fAnaPhotonArray(NULL), + fAnaPhotonJetArray(NULL), + fMinPt(3.0), + fMinNTracks(20) +{ + // Dummy Constructor +} + +//________________________________________________________________________________ +AliAnalysisTaskGammaJet::~AliAnalysisTaskGammaJet() { + //Destructor +} + + +//________________________________________________________________________ +AliAnalysisTaskGammaJet::AliAnalysisTaskGammaJet(const char *name) : + AliAnalysisTaskSE(name), + fOutputList(0), + fDeltaAODFileName("AliAODGammaConversion.root"), + fConversionCutString("GammaConv"), + fAnaIsolation(NULL), + fAnaIsolationArray(NULL), + fAnaPionArray(NULL), + fAnaPhotonArray(NULL), + fAnaPhotonJetArray(NULL), + fMinPt(3.0), + fMinNTracks(20) +{ + // Constructor + // Output slot #1 writes into a TList container + DefineOutput(1, TList::Class()); + + fAnaIsolation = new AliAnaConvIsolation(); + + fAnaPionArray = new TObjArray(); + fAnaPionArray->SetOwner(kTRUE); + + fAnaPhotonArray = new TObjArray(); + fAnaPhotonArray->SetOwner(kTRUE); + + fAnaPhotonJetArray = new TObjArray(); + fAnaPhotonJetArray->SetOwner(kTRUE); + + fAnaIsolationArray = new TObjArray(); + fAnaIsolationArray->SetOwner(kTRUE); + +} + +//________________________________________________________________________ +void AliAnalysisTaskGammaJet::UserCreateOutputObjects() +{ + //Create histograms add, to outputlist + fOutputList = new TList(); + fOutputList->SetOwner(kTRUE); + + fAnaIsolation->CreateHistograms(); + fOutputList->Add(fAnaIsolation->GetHistograms()); + + for(int i = 0; i < fAnaIsolationArray->GetEntriesFast(); i++) { + AliAnaConvIsolation * isoAna = dynamic_cast(fAnaIsolationArray->At(i)); + if(isoAna) { + isoAna->CreateHistograms(); + fOutputList->Add(isoAna->GetHistograms()); + } else { + AliError("problem getting ana pointer!!!"); + cout << i << endl; + } + } + + for(int i = 0; i < fAnaPhotonArray->GetEntriesFast(); i++) { + AliAnaConvCorrPhoton * photonAna = dynamic_cast(fAnaPhotonArray->At(i)); + if(photonAna) { + photonAna->CreateHistograms(); + fOutputList->Add(photonAna->GetHistograms()); + } else { + AliError("problem getting ana pointer!!!"); + } + } + + + for(int i = 0; i < fAnaPionArray->GetEntriesFast(); i++) { + AliAnaConvCorrPion * pionAna = dynamic_cast(fAnaPionArray->At(i)); + if(pionAna) { + pionAna->CreateHistograms(); + fOutputList->Add(pionAna->GetHistograms()); + } else { + AliError("problem getting ana pointer!!!"); + } + } + + for(int i = 0; i < fAnaPhotonJetArray->GetEntriesFast(); i++) { + AliAnaConvCorrPhotonJet * jetAna = dynamic_cast(fAnaPhotonJetArray->At(i)); + if(jetAna) { + jetAna->CreateHistograms(); + fOutputList->Add(jetAna->GetHistograms()); + } else { + AliError("problem getting jet ana pointer!!!"); + } + } + + + PostData(1, fOutputList); + + +} + +//________________________________________________________________________ +void AliAnalysisTaskGammaJet::UserExec(Option_t *) +{ + //Inherited from AliAnalysisTaskSE + + ///Get AOD event + AliAODEvent * aodEvent = GetAODEvent(); + if(!aodEvent) { + AliError("No AOD event!!"); + return; + } + + TClonesArray * photons = GetConversionGammas(aodEvent); + if(!photons) { + AliError("No Conversion gamma!!"); + return; + } + + TClonesArray * pions = GetConversionPions(aodEvent); + if(!pions) { + AliError("No Conversion gamma!!"); + return; + } + + if(!((Entry() )%10000)) { + AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry())); + AliInfo(Form("%d %d", photons->GetEntriesFast(), pions->GetEntriesFast())); + } + + + if(aodEvent->GetNumberOfTracks() < fMinNTracks) return; + + if(photons->GetEntriesFast() > aodEvent->GetNumberOfTracks()) { + AliError(Form("more conv gamma than tracks, ntracks %d, nconvGamma %d: ", aodEvent->GetNumberOfTracks(), photons->GetEntriesFast())); + return; + } else if(photons->GetEntriesFast() > 0) { + + ProcessConvGamma(photons, pions, aodEvent->GetTracks()); + ProcessPions(pions, photons, aodEvent->GetTracks()); + } + + + + PostData(1, fOutputList); + + + +} + + + + +//______________________________________________________________________________________________ +void AliAnalysisTaskGammaJet::ProcessCalorimeters( const AliAODEvent * const aodEvent ) { + //See header file for documentation + TClonesArray * clusters = aodEvent->GetCaloClusters(); + + + for(int ic = 0; ic < clusters->GetEntriesFast(); ic++) { + AliAODCaloCluster * cluster = dynamic_cast(clusters->At(ic)); + if (!cluster) { + AliError(Form("Error getting cluster")); + continue; + } + + + if (cluster->GetNCells() < 6) continue; + if (cluster->GetEmcCpvDistance() < 15) continue; + + TLorentzVector tlvec; + + AliAODVertex * vertex = aodEvent->GetPrimaryVertex(); + Double_t vertexPosition[3]; + vertex->GetXYZ(vertexPosition); + cluster->GetMomentum(tlvec, vertexPosition); + //if (tlvec.Pt() < GetMinPt()) continue; + + } + +} + +//___________________________________________________________________________________________ +void AliAnalysisTaskGammaJet::ProcessConvGamma( const TClonesArray * convGamma, const TClonesArray * const pions, const TClonesArray * tracks ) { + //See header file for documentation + + + for (Int_t iPhot = 0; iPhot < convGamma->GetEntriesFast(); iPhot++) { + Bool_t delP = kFALSE; + AliAODConversionParticle * photon = dynamic_cast(convGamma->At(iPhot)); + if(!photon) { + AliGammaConversionAODObject * aodO = dynamic_cast(convGamma->At(iPhot)); + if (!aodO) { + AliError(Form("ERROR: Could not receive ga %d\n", iPhot)); + continue; + } + + photon = new AliAODConversionParticle(aodO); + delP = kTRUE; + } + + if(photon->Pt() < fMinPt) { + if(delP) delete photon; + continue; + } + + Bool_t leading = kTRUE; + Bool_t decayPion = IsDecayPion(iPhot, pions); + + for(Int_t i = 0; i < fAnaIsolationArray->GetEntriesFast(); i ++) { + AliAnaConvIsolation * isoAna = dynamic_cast(fAnaIsolationArray->At(i)); + isoAna->IsIsolated(photon, tracks, leading); + } + + Bool_t isolated = fAnaIsolation->IsIsolated(photon, tracks, leading); + if(leading) { + for(Int_t i = 0; i < fAnaPhotonArray->GetEntriesFast(); i ++) { + AliAnaConvCorrPhoton * ana = static_cast(fAnaPhotonArray->At(i)); + if(ana && tracks) { + ana->CorrelateWithHadrons(photon, tracks, isolated, decayPion); + } + } + + TClonesArray * jets = GetAODEvent()->GetJets(); + if(jets) { + for(Int_t i = 0; i < fAnaPhotonJetArray->GetEntriesFast(); i ++) { + AliAnaConvCorrPhotonJet * ana = static_cast(fAnaPhotonJetArray->At(i)); + if(ana && tracks) { + ana->CorrelateWithHadrons(photon, jets, isolated); + } + } + } else { + cout << "No jets "<GetEntriesFast(); iPi++) { + Bool_t delP = kFALSE; + AliAODConversionParticle * pion = dynamic_cast(pions->At(iPi)); + if(!pion) { + AliGammaConversionAODObject * aodO = dynamic_cast(pions->At(iPi)); + if (!aodO) { + AliError(Form("ERROR: Could not receive ga %d\n", iPi)); + continue; + } + + pion = new AliAODConversionParticle(aodO); + delP = kTRUE; + } + + + if(pion->Pt() < fMinPt) { + if(delP) delete pion; + continue; + } + + + Int_t trackLabels[4] = {-1, -1, -1, -1}; + GetPionGrandChildren(pion, photons, trackLabels); + Bool_t leading = kTRUE; + + for(Int_t i = 0; i < fAnaIsolationArray->GetEntriesFast(); i ++) { + AliAnaConvIsolation * isoAna = dynamic_cast(fAnaIsolationArray->At(i)); + isoAna->IsIsolated(pion, tracks, 4, trackLabels, leading); + } + + Bool_t isolated = fAnaIsolation->IsIsolated(pion, tracks, 4, trackLabels, leading); + if(leading) { + for(Int_t i = 0; i < fAnaPionArray->GetEntriesFast(); i ++) { + AliAnaConvCorrPion * ana = dynamic_cast(fAnaPionArray->At(i)); + ana->CorrelateWithHadrons(pion, tracks, isolated, 4, trackLabels ); + } + } + if (delP) delete pion; + } // + + +} + +///_______________________________________________________________________________________________ +Bool_t AliAnalysisTaskGammaJet::IsDecayPion(Int_t iPhot, const TClonesArray * const pions) { + //See header file for documentation + + for(int ip = 0; ip < pions->GetEntriesFast(); ip++) { + AliAODConversionParticle * pion = dynamic_cast(pions->At(ip)); + if(pion) { + if(pion->GetLabel1() == iPhot || pion->GetLabel2() == iPhot) + + return kTRUE; + } else { + AliGammaConversionAODObject * aodPion = dynamic_cast(pions->At(ip)); + if(aodPion) { + if(aodPion->GetLabel1() == iPhot || aodPion->GetLabel2() == iPhot) + return kTRUE; + } else { + AliError("pion corrupted!"); + } + } + } + + return kFALSE; +} + + +///_______________________________________________________________________________ +Bool_t AliAnalysisTaskGammaJet::UserNotify() { + //See header file for documentation + + AliInfo(Form("%s ----> Processing event # %lld", CurrentFileName(), Entry())); + + AliAnaConvCorrPhoton * phJetAna = dynamic_cast(fAnaPhotonArray->At(0)); + phJetAna->PrintStatistics(); + + return kTRUE; + +} + +///_______________________________________________________________________________ +void AliAnalysisTaskGammaJet::NotifyRun() { + //See header file for documentation + + AliInfo(Form("we have a new run: %d", fCurrentRunNumber)); + cout << Form("we have a new run: %d", fCurrentRunNumber) << endl; + +} + +///_______________________________________________________________________________ +void AliAnalysisTaskGammaJet::GetPionGrandChildren(const AliAODConversionParticle * pion, const TClonesArray * photons, Int_t* trackLabels) { + ///Get the track labels of the electrons reconstructed as gamma forming the pion + + for(Int_t i = 0; i< 2; i++) { + AliAODConversionParticle * gamma = dynamic_cast(photons->At(pion->GetTrackLabel(i))); + + if(gamma) { + for(Int_t j = 0; j< 2; j++) { + trackLabels[ i*2+ j] = gamma->GetTrackLabel(j); + } + + } else { + AliGammaConversionAODObject * aodO = dynamic_cast(photons->At(pion->GetTrackLabel(i))); + if(aodO) { + trackLabels[i*2] = aodO->GetLabel1(); + trackLabels[i*2 + 1] = aodO->GetLabel2(); + } else { + cout << "AliAnaConvCorrPion::GetTrackLabels() :: Not good!!!"<(InputEvent()); + if(!aodEvent) { + aodEvent = AODEvent(); + } + + return aodEvent; + +} + +//_____________________________________________________________________ +TClonesArray * AliAnalysisTaskGammaJet::GetConversionGammas(const AliAODEvent * aodEvent) { + + //Get Conversion gamma branch of AOD. First try standard AOD + TClonesArray * convGamma = dynamic_cast(aodEvent->FindListObject(Form("%s_gamma", fConversionCutString.Data()))); + + //If it's there, send it back + if(convGamma) return convGamma; + + + //If AOD not in standard file have to locate it in delta AOD + if( !(fDeltaAODFileName.Length() > 0) ) return NULL; + + AliAODHandler * aodHandler = dynamic_cast(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); + if(aodHandler) { + AliAODExtension * gExt = dynamic_cast(aodHandler->GetExtensions()->FindObject(fDeltaAODFileName)); + if(gExt) { + AliAODEvent * gcEvent = gExt->GetAOD(); + return dynamic_cast(gcEvent->FindListObject(Form("%s_gamma", fConversionCutString.Data()))); + } + } + + cout << "could not find branch " << Form("%s_gamma", fConversionCutString.Data()) << endl; + return NULL; +} + + + +///_____________________________________________________________________ +TClonesArray * AliAnalysisTaskGammaJet::GetConversionPions(const AliAODEvent * aodEvent) { + + //Get Conversion pion branch of AOD. First try standard AOD + TClonesArray * convGamma = dynamic_cast(aodEvent->FindListObject(Form("%s_Pi0", fConversionCutString.Data()) )); + + //If it's there, send it back + if(convGamma) return convGamma; + + + //If AOD not in standard file have to locate it in delta AOD + if( !(fDeltaAODFileName.Length() > 0) ) return NULL; + + AliAODHandler * aodHandler = dynamic_cast(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); + if(aodHandler) { + AliAODExtension * gExt = dynamic_cast(aodHandler->GetExtensions()->FindObject(fDeltaAODFileName)); + if(gExt) { + AliAODEvent * gcEvent = gExt->GetAOD(); + return dynamic_cast(gcEvent->FindListObject(Form("%s_Pi0", fConversionCutString.Data()))); + } + } + return NULL; +} diff --git a/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.h b/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.h new file mode 100644 index 00000000000..9203e9c3bb3 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/AliAnalysisTaskGammaJet.h @@ -0,0 +1,105 @@ +/* This file is property of and copyright * + * ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/// @file AliAnalysisTaskGammaJet.h +/// @author Svein Lindal +/// @brief Class used to run isolation studies of conversion gamma / pions + + + +#ifndef ALIANALYSISTASKGAMMAJET_H +#define ALIANALYSISTASKGAMMAJET_H + + + +class TH1F; +class AliESDEvent; +class AliGammaConversionAODObject; +class AliAODConversionParticle; +class AliAODPWG4ParticleCorrelation; +class AliAODPWG4Particle; +class TObjArray; +class TString; +class TClonesArray; + + +#include "AliAnaConvIsolation.h" +#include "AliAnalysisTaskSE.h" + +class AliAnalysisTaskGammaJet : public AliAnalysisTaskSE { + +public: + + AliAnalysisTaskGammaJet(); + AliAnalysisTaskGammaJet(const char *name); + virtual ~AliAnalysisTaskGammaJet(); + + virtual void UserCreateOutputObjects(); + virtual void UserExec(Option_t *option); + virtual void Terminate(Option_t *); + + void SetDeltaAODFileName(TString string) { fDeltaAODFileName = string;} + + AliAnaConvIsolation * GetIsolation() const {return fAnaIsolation;} + void SetIsolation( AliAnaConvIsolation * isolation) { fAnaIsolation = isolation; } + + void SetConversionCutId(TString cut) { fConversionCutString = Form("GammaConv_%s", cut.Data());} + + void SetMinPt(Float_t minpt) { fMinPt = minpt;} + void SetMinNTracks(Int_t nTracks) { fMinNTracks = nTracks; } + + void AddIsolationAna(TObject * isoAna) { fAnaIsolationArray->Add(isoAna);} + void AddPhotonHadronAna(TObject * ana) { fAnaPhotonArray->Add(ana);} + void AddPhotonJetAna(TObject * ana) { fAnaPhotonJetArray->Add(ana);} + void AddPionHadronAna(TObject * ana) { fAnaPionArray->Add(ana);} + + void GetPionGrandChildren(const AliAODConversionParticle * const pion, const TClonesArray * photons, Int_t* trackLabels); + + private: + + void NotifyRun(); + Bool_t UserNotify(); + + + //Get the AOD event from whereever it might be accessible + AliAODEvent * GetAODEvent(); + + //Get Conversion gammas branch + TClonesArray * GetConversionGammas(const AliAODEvent * aodEvent); + TClonesArray * GetConversionPions(const AliAODEvent * aodEvent); + + //Process conv gamma + void ProcessConvGamma( const TClonesArray * const convGamma, const TClonesArray * const pions, const TClonesArray * const tracks); + void ProcessPions( const TClonesArray * const pions, const TClonesArray * const photons, const TClonesArray * const tracks); + + //Process calorimeters + void ProcessCalorimeters( const AliAODEvent * const aodEvent ); + + + //Does any pions have given photon (iPhot) index listed as daughter + Bool_t IsDecayPion(Int_t iPhot, const TClonesArray * const pions); //see above + + + TList *fOutputList; //! Output list + TString fDeltaAODFileName; //! File where Gamma Conv AOD is located, if not in default AOD + TString fConversionCutString; //! The cut string of the conversion analysis used to produce input AOD + + + AliAnaConvIsolation * fAnaIsolation; + + TObjArray * fAnaIsolationArray; //!Array of isolation analysis objects + TObjArray * fAnaPionArray; //!Array of pion - hadron ana objects + TObjArray * fAnaPhotonArray; //!Array of photon - hadron ana objects + TObjArray * fAnaPhotonJetArray; //!Array of photon - jet ana objects + + Float_t fMinPt; //Minimum pt for leading particles + Int_t fMinNTracks; //Minimum number of tracks in event + + AliAnalysisTaskGammaJet(const AliAnalysisTaskGammaJet&); // not implemented + AliAnalysisTaskGammaJet& operator=(const AliAnalysisTaskGammaJet&); // not implemented + + ClassDef(AliAnalysisTaskGammaJet, 4); // example of analysis +}; + +#endif diff --git a/PWG4/GammaConv/ConvCorrelations/macros/ConfigGammaJet.C b/PWG4/GammaConv/ConvCorrelations/macros/ConfigGammaJet.C new file mode 100644 index 00000000000..deaec9fd000 --- /dev/null +++ b/PWG4/GammaConv/ConvCorrelations/macros/ConfigGammaJet.C @@ -0,0 +1,102 @@ + +void ConfigGammaJet (TString inputfile = "files.txt" ) { + + Int_t debugLevel = 0; + + gSystem->Load("libTree.so"); + gSystem->Load("libPhysics.so"); + gSystem->Load("libGeom.so"); + gSystem->Load("libVMC.so"); + gSystem->Load("libSTEERBase.so"); + gSystem->Load("libESD.so"); + gSystem->Load("libAOD.so"); + gSystem->Load("libANALYSIS"); + gSystem->Load("libANALYSISalice"); + gSystem->Load("libJETAN.so"); + gSystem->Load("libPWG4GammaConv.so"); + gSystem->AddIncludePath("-I$ALICE_ROOT/include"); + + + TChain * chain = createAODChain (inputfile); + if(!chain) { + cout << "Errror in chain cration"<AddFriend("AliAODGammaConversion.root"); + + AliAnalysisManager *mgr = new AliAnalysisManager("GammaJet Manager", "GammaJet Manager"); + mgr->SetInputEventHandler (inpHandler); + mgr->SetDebugLevel(debugLevel); + + AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); + AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(), AliAnalysisManager::kOutputContainer, "histos.root"); + + // AliAnaConvIsolation * iso3 = new AliAnaConvIsolation(0.7, 0.5, 0.5, 0.5, 0.5); + // gammaJetAna->AddIsolationAna(dynamic_cast(iso3)); + + + AliAnalysisTaskGammaJet * gammaJetAna = new AliAnalysisTaskGammaJet("gamma jet analysis"); + gammaJetAna->SetDebugLevel(0); + gammaJetAna->SetConversionCutId("90022670901120321036000000090"); + gammaJetAna->SetMinNTracks(0); + mgr->AddTask(gammaJetAna); + + AliAnaConvIsolation * isolation = gammaJetAna->GetIsolation(); + isolation->SetMaxPtThreshold(0.7); + isolation->SetSumPtThreshold(2.5); + isolation->SetSumPtFraction(0.1); + isolation->SetConeSize(0.4); + + AliAnaConvCorrPhoton * ghAna = new AliAnaConvCorrPhoton("photon_wDec"); + ghAna->DoDecayParticles(); + gammaJetAna->AddPhotonHadronAna(dynamic_cast(ghAna)); + + AliAnaConvCorrPhoton * ghAna2 = new AliAnaConvCorrPhoton("photon_noDec"); + ghAna2->SkipDecayParticles(); + gammaJetAna->AddPhotonHadronAna(dynamic_cast(ghAna2)); + + AliAnaConvCorrPion * gPiAna = new AliAnaConvCorrPion("pionHadron"); + gammaJetAna->AddPionHadronAna(dynamic_cast(gPiAna)); + + inpHandler->AddFriend("AliAODs.pwg4jets.root"); + AliAnaConvCorrPhotonJet* gJetAna = new AliAnaConvCorrPhotonJet("photonJet"); + gJetAna->SetTriggerPt(0.0); + gJetAna->SetCorrelatedPt(0.0); + gammaJetAna->AddPhotonJetAna(gJetAna); + + // gROOT->LoadMacro("AddTaskGammaJet.C"); + // AliAnalysisTaskGammaJet * gj2 = AddTaskGammaJet("test", 3.0, 40, 0.4); + // isolation = gj2->GetIsolation(); + // isolation->SetMinPt(0.3); + + + mgr->ConnectInput (gammaJetAna, 0, cinput1 ); + mgr->ConnectOutput (gammaJetAna, 1, coutput2 ); + + mgr->InitAnalysis(); + mgr->PrintStatus(); + mgr->StartAnalysis("local",chain); + //mgr->StartAnalysis("local",chain, 10000); + +} + + +///_________________________________________________________________________________________ +TChain * createAODChain (TString inputfile = "allfiles.txt") { + + chain = new TChain("aodTree"); + + TString line; + ifstream in; + in.open(inputfile.Data()); + while (in.good()) { + in >> line; + if (line.Length() == 0) continue; + chain->Add(line.Data()); + } + + return chain; + +} diff --git a/PWG4/PWG4GammaConvLinkDef.h b/PWG4/PWG4GammaConvLinkDef.h index 8e43bc9c722..ca31e4cf45b 100644 --- a/PWG4/PWG4GammaConvLinkDef.h +++ b/PWG4/PWG4GammaConvLinkDef.h @@ -11,7 +11,13 @@ #pragma link C++ class AliGammaConversionAODObject+; #pragma link C++ class AliAODConversionParticle+; #pragma link C++ class AliGammaConversionBGHandler+; -#pragma link C++ class AliAnalysisTaskGammaJet+; #pragma link C++ class AliAnalysisTaskGammaConvDalitz+; #pragma link C++ class AliAnalysisTaskGCPartToPWG4Part+; +#pragma link C++ class AliAnalysisTaskGammaJet+; +#pragma link C++ class AliAnaConvIsolation+; +#pragma link C++ class AliAnaConvCorrBase++; +#pragma link C++ class AliAnaConvCorrPion++; +#pragma link C++ class AliAnaConvCorrPhoton++; +#pragma link C++ class AliAnaConvCorrPhotonJet++; + #endif -- 2.43.0