1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Author: Svein Lindal <slindal@fys.uio.no> *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /// @file AliAnaConvCorrPhoton.cxx
17 /// @author Svein Lindal
18 /// @brief Class used to fill calculate correlation between photons - jets
20 #include "AliAnaConvCorrPhotonJet.h"
21 #include "AliAODTrack.h"
22 #include "TClonesArray.h"
23 #include "AliAODConversionParticle.h"
24 #include "AliAODJet.h"
26 #include "TRefArray.h"
29 // Gamma - jet correlation analysis task
30 // Authors: Svein Lindal
34 ClassImp(AliAnaConvCorrPhotonJet)
36 //________________________________________________________________________________
37 AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet() :
38 AliAnaConvCorrBase("photonJet", "Photon Jet"),
44 //________________________________________________________________________________
45 AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet(TString name) :
46 AliAnaConvCorrBase(name, "Photon Jet"),
54 //________________________________________________________________________________
55 AliAnaConvCorrPhotonJet::~AliAnaConvCorrPhotonJet() {
60 void AliAnaConvCorrPhotonJet::CreateHistograms() {
62 CreateBaseHistograms();
63 fhPtFracGamma = new TH1F("fhPtFracGamma", "fhPtFracGamma", 100, 0, 10);
64 GetHistograms()->Add(fhPtFracGamma);
65 fhPtFracPion = new TH1F("fhPtFracPion", "fhPtFracPion", 100, 0, 10);
66 GetHistograms()->Add(fhPtFracPion);
70 void AliAnaConvCorrPhotonJet::DoJetAnalysisGamma(AliAODJet * jet, const TClonesArray * const photons, const TClonesArray *const pions ) const{
71 //See header file for documetation
74 for(Int_t i = 0; i < photons->GetEntriesFast(); i++) {
75 AliAODConversionParticle * photon = dynamic_cast<AliAODConversionParticle*>(photons->At(i));
77 trackIDs[0] = photon->GetLabel1();
78 trackIDs[1] = photon->GetLabel2();
79 if(IsParticleInJet(jet, 2, trackIDs)){
80 fhPtFracGamma->Fill(photon->Pt()/jet->Pt());
87 for(Int_t i = 0; i < pions->GetEntriesFast(); i++) {
88 AliAODConversionParticle * pion = dynamic_cast<AliAODConversionParticle*>(pions->At(i));
90 //pion->GetGrandChildren(photons, trackIDs);
91 if(IsParticleInJet(jet, 4, trackIDs)){
92 fhPtFracPion->Fill(pion->Pt()/jet->Pt());
103 //________________________________________________________________________________
104 Bool_t AliAnaConvCorrPhotonJet::IsParticleInJet(AliAODJet * jet, Int_t nTracks, Int_t * trackIds) const {
105 //See header file for documetation
108 TRefArray * refTracks = jet->GetRefTracks();
109 for(Int_t jRef = 0; jRef < refTracks->GetEntriesFast(); jRef++) {
110 AliAODTrack * track = dynamic_cast<AliAODTrack*>(refTracks->At(jRef));
112 for(Int_t it = 0; it < nTracks; it++) {
113 if (track->GetID() == trackIds[it]) {
120 //cout <<mTracks << " " << (mTracks > 1) << endl;
121 return (mTracks > 1);
125 //________________________________________________________________________________
126 Double_t AliAnaConvCorrPhotonJet::ExtractFromJet(AliAODJet * jet, const AliAODConversionParticle * const particle) const {
127 //See header file for documetation
129 Float_t jetPt = jet->Pt();
130 cout << "Jet pt before and after: " << jetPt << " ";
132 TRefArray * refTracks = jet->GetRefTracks();
133 for(Int_t jRef = 0; jRef < refTracks->GetEntriesFast(); jRef++) {
134 AliAODTrack * track = dynamic_cast<AliAODTrack*>(refTracks->At(jRef));
136 if (track->GetID() == particle->GetLabel1() || track->GetID() == particle->GetLabel2()) {
137 cout << " - " << track->Pt() << " ";
138 jetPt = jetPt - track->Pt();
140 //cout << track->Pt() << endl;
143 cout <<"FUUUUUUUUUUUUUUUUUCJK"<<endl;
147 cout << jetPt << endl;
153 ///_______________________________________________________________________________
154 void AliAnaConvCorrPhotonJet::CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const jets, const Bool_t isolated) {
155 FillTriggerCounters(photon, isolated);
156 //See header file for documentation
158 for(int ij = 0; ij < jets->GetEntriesFast(); ij++) {
159 AliAODJet * jet = dynamic_cast<AliAODJet*>(jets->At(ij));
161 //Double_t jetPt = ExtractFromJet(jet, photon);
162 //FillHistograms(photon->Pt(), jetPt, GetDPhi(photon->Phi() - jet->Phi()), photon->Eta() - jet->Eta(), isolated);