]>
Commit | Line | Data |
---|---|---|
fc7e3b59 | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * ALICE Experiment at CERN, All rights reserved. * | |
4 | * * | |
5 | * Primary Author: Svein Lindal <slindal@fys.uio.no> * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /// @file AliAnaConvCorrPhoton.cxx | |
17 | /// @author Svein Lindal | |
18 | /// @brief Class used to fill calculate correlation between photons - jets | |
19 | ||
20 | #include "AliAnaConvCorrPhotonJet.h" | |
21 | #include "AliAODTrack.h" | |
22 | #include "TClonesArray.h" | |
23 | #include "AliAODConversionParticle.h" | |
24 | #include "AliAODJet.h" | |
25 | ||
811b0806 | 26 | #include "TRefArray.h" |
27 | #include "TH1F.h" | |
fc7e3b59 | 28 | #include <iostream> |
29 | // Gamma - jet correlation analysis task | |
30 | // Authors: Svein Lindal | |
31 | ||
32 | ||
33 | using namespace std; | |
34 | ClassImp(AliAnaConvCorrPhotonJet) | |
35 | ||
36 | //________________________________________________________________________________ | |
37 | AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet() : | |
e0875dfc | 38 | AliAnaConvCorrBase("photonJet"), |
39 | fhPtFracGamma(NULL), | |
40 | fhPtFracPion(NULL) | |
41 | { | |
fc7e3b59 | 42 | //consctructor |
43 | } | |
44 | //________________________________________________________________________________ | |
45 | AliAnaConvCorrPhotonJet::AliAnaConvCorrPhotonJet(TString name) : | |
e0875dfc | 46 | AliAnaConvCorrBase(name), |
47 | fhPtFracGamma(NULL), | |
48 | fhPtFracPion(NULL) | |
49 | { | |
fc7e3b59 | 50 | //consctructor |
51 | } | |
52 | ||
53 | ||
54 | //________________________________________________________________________________ | |
55 | AliAnaConvCorrPhotonJet::~AliAnaConvCorrPhotonJet() { | |
56 | //destructor | |
57 | } | |
58 | ||
fc7e3b59 | 59 | |
811b0806 | 60 | void AliAnaConvCorrPhotonJet::CreateHistograms() { |
61 | ||
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); | |
67 | ||
68 | } | |
69 | ||
70 | void AliAnaConvCorrPhotonJet::DoJetAnalysisGamma(AliAODJet * jet, const TClonesArray * const photons, const TClonesArray *const pions ) const{ | |
71 | ||
b6d192fe | 72 | Int_t trackIDs[4] = {-9, -9, -9, -9}; |
811b0806 | 73 | |
74 | for(Int_t i = 0; i < photons->GetEntriesFast(); i++) { | |
75 | AliAODConversionParticle * photon = dynamic_cast<AliAODConversionParticle*>(photons->At(i)); | |
76 | if(photon) { | |
77 | trackIDs[0] = photon->GetLabel1(); | |
78 | trackIDs[1] = photon->GetLabel2(); | |
e0875dfc | 79 | if(IsParticleInJet(jet, 2, trackIDs)){ |
811b0806 | 80 | fhPtFracGamma->Fill(photon->Pt()/jet->Pt()); |
81 | } | |
82 | } | |
83 | } | |
84 | ||
85 | ||
86 | ||
87 | for(Int_t i = 0; i < pions->GetEntriesFast(); i++) { | |
88 | AliAODConversionParticle * pion = dynamic_cast<AliAODConversionParticle*>(pions->At(i)); | |
89 | if(pion) { | |
2eedd4ed | 90 | //pion->GetGrandChildren(photons, trackIDs); |
e0875dfc | 91 | if(IsParticleInJet(jet, 4, trackIDs)){ |
811b0806 | 92 | fhPtFracPion->Fill(pion->Pt()/jet->Pt()); |
93 | } | |
94 | } | |
95 | } | |
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | } | |
102 | ||
103 | //________________________________________________________________________________ | |
e0875dfc | 104 | Bool_t AliAnaConvCorrPhotonJet::IsParticleInJet(AliAODJet * jet, Int_t nTracks, Int_t * trackIds) const { |
811b0806 | 105 | |
106 | Int_t mTracks = 0; | |
107 | TRefArray * refTracks = jet->GetRefTracks(); | |
108 | for(Int_t jRef = 0; jRef < refTracks->GetEntriesFast(); jRef++) { | |
109 | AliAODTrack * track = dynamic_cast<AliAODTrack*>(refTracks->At(jRef)); | |
110 | if(track) { | |
111 | for(Int_t it = 0; it < nTracks; it++) { | |
112 | if (track->GetID() == trackIds[it]) { | |
113 | mTracks++; | |
114 | } | |
115 | } | |
116 | } | |
117 | } | |
118 | ||
119 | //cout <<mTracks << " " << (mTracks > 1) << endl; | |
120 | return (mTracks > 1); | |
121 | } | |
122 | ||
123 | ||
124 | //________________________________________________________________________________ | |
125 | Double_t AliAnaConvCorrPhotonJet::ExtractFromJet(AliAODJet * jet, const AliAODConversionParticle * const particle) const { | |
126 | ||
127 | Float_t jetPt = jet->Pt(); | |
128 | cout << "Jet pt before and after: " << jetPt << " "; | |
129 | ||
130 | TRefArray * refTracks = jet->GetRefTracks(); | |
131 | for(Int_t jRef = 0; jRef < refTracks->GetEntriesFast(); jRef++) { | |
132 | AliAODTrack * track = dynamic_cast<AliAODTrack*>(refTracks->At(jRef)); | |
133 | if(track) { | |
134 | if (track->GetID() == particle->GetLabel1() || track->GetID() == particle->GetLabel2()) { | |
135 | cout << " - " << track->Pt() << " "; | |
136 | jetPt = jetPt - track->Pt(); | |
137 | } else { | |
138 | //cout << track->Pt() << endl; | |
139 | } | |
140 | } else { | |
141 | cout <<"FUUUUUUUUUUUUUUUUUCJK"<<endl; | |
142 | } | |
143 | } | |
144 | ||
145 | cout << jetPt << endl; | |
146 | return jetPt; | |
147 | } | |
148 | ||
149 | ||
150 | ||
151 | ///_______________________________________________________________________________ | |
152 | void AliAnaConvCorrPhotonJet::CorrelateWithHadrons(const AliAODConversionParticle * const photon, const TClonesArray * const jets, const Bool_t isolated) { | |
153 | FillTriggerCounters(photon->Pt(), isolated); | |
fc7e3b59 | 154 | //See header file for documentation |
811b0806 | 155 | if (jets) { |
156 | for(int ij = 0; ij < jets->GetEntriesFast(); ij++) { | |
157 | AliAODJet * jet = dynamic_cast<AliAODJet*>(jets->At(ij)); | |
fc7e3b59 | 158 | if(jet) { |
811b0806 | 159 | Double_t jetPt = ExtractFromJet(jet, photon); |
160 | FillHistograms(photon->Pt(), jetPt, GetDPhi(photon->Phi() - jet->Phi()), photon->Eta() - jet->Eta(), isolated); | |
fc7e3b59 | 161 | } |
162 | } | |
163 | } | |
164 | } |