updates for Effective C++ compiler flags
[u/mrichter/AliRoot.git] / EMCAL / jetfinder / AliEMCALJetFinderPlots.cxx
CommitLineData
45a58699 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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
17/* $Id$ */
18
19
20//_________________________________________________________________________
21// Class for Filling JetFinder Plots
22// --
23//*-- Author: Mark Horner (LBL/UCT)
24// --
25// --
26
27
28#include "TMath.h"
29#include "AliEMCALJetFinderPlots.h"
30
31ClassImp(AliEMCALJetFinderPlots)
32
18a21c7c 33AliEMCALJetFinderPlots::AliEMCALJetFinderPlots() :
34 fDebug(0),fConeRadius(0.),fNominalEnergy(0.),fOutput(0),
35 fhFragmFcn(0),fhPartonFragmFcn(0),fhPartonJT(0),fhPartonPL(0),
36 fhJetJT(0),fhJetPL(0),fhJetEt(0),fhJetEtDiff(0),fhJetEta(0),fhJetPhi(0),
37 fhPartonEta(0),fhPartonPhi(0),fhEtaDiff(0),fhPhiDiff(0),fhEtaPhiSpread(0),
38 fhNJets(0),fhFragmFcn2(0),fhPartonFragmFcn2(0),fhPartonJT2(0),fhPartonPL2(0),
39 fhJetJT2(0),fhJetPL2(0),fhJetEt2(0),fhJetEtDiff2(0),fhJetEta2(0),fhJetPhi2(0),
40 fhPartonEta2(0),fhPartonPhi2(0),fhEtaDiff2(0),fhPhiDiff2(0),fhEtaPhiSpread2(0),
41 fhNJets2(0),fhJetEtSecond2(0),fhJetEtRatio2(0),fhEtaPhiDist2(0),fhInputOutput(0),
42 fhRecoBinPt(0),fhRecoBinPtNoBg(0),fhRecoBinPartonPt(0),fhRecoBinJetEt(0),fhRecoBinInputJetEt(0),
43 fhJetPT(0),fhPartonPT(0),fhJetPT2(0),fhPartonPT2(0),fhRecoBinFragmFcn(0),fhRecoBinFragmFcnNoBg(0),
44 fhRecoBinPartonFragmFcn(0),fhJetInvE(0),fhJetInvE2(0),fhBackHisto(0),fScaleFactor(0),fInitialised(0)
45a58699 45{
46 // Constructor to initialise variables
47 fInitialised = kFALSE;
48 fNominalEnergy = 0.0;
49 fConeRadius = 0.3;
50 fDebug = 0;
51 fOutput=0;
52 fhFragmFcn=0;// = new TH1F("hFragmFcn","Fragmentation Function",100,0,1);
53 fhPartonFragmFcn=0;// = new TH1F("hPartonFragmFcn","Fragmentation Function",100,0,1);
54 fhPartonJT=0;// = new TH1F("hPartonJT","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
55 fhPartonPL=0;// = new TH1F("hPartonPL","Track Momentum Parallel to Parton Axis ",100,0.,100.);
56 fhJetJT=0;// = new TH1F("hJetJT","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
57 fhJetPL=0;// = new TH1F("hJetPL","Track Momentum Parallel to Jet Axis ",100,0.,100.);
58 fhJetEt=0;// = new TH1F("hJetEt","E_{T}^{reco}",250,0.,250.);
59 fhJetEta=0;// = new TH1F("hJetEta","#eta_{jet}^{reco}",180,-0.9,0.9);
60 fhJetPhi=0;// = new TH1F("hJetPhi","#phi_{jet}^{reco}",62,0.,3.1);
61 fhPartonEta=0;// = new TH1F("hPartonEta","#eta_{Parton}",180,-0.9,0.9);
62 fhPartonPhi=0;// = new TH1F("hPartonPhi","#phi_{Parton}",62,0.,3.1);
63 fhEtaDiff=0;// = new TH1F("hEtaDiff","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
64 fhPhiDiff=0;// = new TH1F("hPhiDiff","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
65 fhNJets=0;// = new TH1F("hNJets","N Reconstructed jets",11,-0.5,10.5);
66 fhEtaPhiSpread=0;
67
68fhFragmFcn2=0; // ("hFragmFcn2","Fragmentation Function",100,0,1);
69fhPartonFragmFcn2=0;// ("hFragmFcn2","Parton Fragmentation Function",100,0,1);
70fhPartonJT2=0; // ("hPartonJT2","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
71fhPartonPL2=0; // ("hPartonPL2","Track Momentum Parallel to Parton Axis ",100,0.,100.);
72fhJetJT2=0; // ("hJetJT2","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
73fhJetPL2=0; // ("hJetPL2","Track Momentum Parallel to Jet Axis ",100,0.,100.);
74fhJetEt2=0; // ("hJetEt2","E_{T}^{reco}",250,0.,250.);
75fhJetEta2=0; // ("hJetEta2","#eta_{jet}^{reco}",180,-0.9,0.9);
76fhJetPhi2=0; // ("hJetPhi2","#phi_{jet}^{reco}",62,0.,3.1);
77fhPartonEta2=0; // ("hPartonEta2","#eta_{Parton}",180,-0.9,0.9);
78fhPartonPhi2=0; // ("hPartonPhi2","#phi_{Parton}",62,0.,3.1);
79fhEtaDiff2=0; // ("hEtaDiff2","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
80fhPhiDiff2=0; // ("hPhiDiff2","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
81fhEtaPhiSpread2=0; // ("hEtaPhiSpread2","#eta - #phi Distribution
82 //of Reconstructed Jets",192,-0.7,0.7,288,pi/3,pi);
83fhNJets2=0; // ("hNJets2","N Reconstructed jets",11,-0.5,10.5);
84fhJetEtSecond2=0; //("hJetEtSecond2","E_{T}^{reco}",250,0.,250.);
85fhJetEtRatio2=0; //("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
86fhEtaPhiDist2=0; //("hEtaPhiDist2","Angular Distance Between First and Second",100,0,3);
87fhInputOutput=0;
88// TH2F *fhInputOutput; //("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
89
90fhRecoBinPt=0; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
91fhRecoBinPtNoBg=0; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
92fhRecoBinPartonPt=0; // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
93fhRecoBinJetEt=0; // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
94fhRecoBinInputJetEt=0; // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
95fhJetPT =0;// new TH1F("hJetPT","P_{T} Distribution",200,0,200);
96fhPartonPT =0;// new TH1F("hPartonPT","Parton P_{T} Distribution",200,0,1);
97fhJetPT2 =0;// new TH1F("hJetPT","P_{T} Distribution",200,0,200);
98fhPartonPT2 =0;// new TH1F("hPartonPT","Parton P_{T} Distribution",200,0,1);
99fhRecoBinFragmFcn =0;//new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",100,0,1);
100fhRecoBinFragmFcnNoBg =0;//new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",100,0,1);
101fhRecoBinPartonFragmFcn =0;// new TH1F("fhRecoBinPartonFragmFcn","Input Bin Fragm Fcn Distribution",100,0,1);
102fhJetInvE=0;// = new TH1F("fhJetInvE","#frac{1}{E_{R}}",100,0,1);
103fhJetInvE2=0;// = new TH1F("fhJetInvE","#frac{1}{E_{R}}",100,0,1);
104fScaleFactor = 1.0/0.6731;
105fhBackHisto=0;
106
107}
108
18a21c7c 109AliEMCALJetFinderPlots::AliEMCALJetFinderPlots(const AliEMCALJetFinderPlots& jfp)
110 : TObject(jfp), fDebug(jfp.fDebug),fConeRadius(jfp.fConeRadius),fNominalEnergy(jfp.fNominalEnergy),
111 fOutput(jfp.fOutput),fhFragmFcn(jfp.fhFragmFcn),fhPartonFragmFcn(jfp.fhPartonFragmFcn),
112 fhPartonJT(jfp.fhPartonJT),fhPartonPL(jfp.fhPartonPL),fhJetJT(jfp.fhJetJT),fhJetPL(jfp.fhJetPL),
113 fhJetEt(jfp.fhJetEt),fhJetEtDiff(jfp.fhJetEtDiff),fhJetEta(jfp.fhJetEta),fhJetPhi(jfp.fhJetPhi),
114 fhPartonEta(jfp.fhPartonEta),fhPartonPhi(jfp.fhPartonPhi),fhEtaDiff(jfp.fhEtaDiff),
115 fhPhiDiff(jfp.fhPhiDiff),fhEtaPhiSpread(jfp.fhEtaPhiSpread),fhNJets(jfp.fhNJets),
116 fhFragmFcn2(jfp.fhFragmFcn2),fhPartonFragmFcn2(jfp.fhPartonFragmFcn2),fhPartonJT2(jfp.fhPartonJT2),
117 fhPartonPL2(jfp.fhPartonPL2),fhJetJT2(jfp.fhJetJT2),fhJetPL2(jfp.fhJetPL2),fhJetEt2(jfp.fhJetEt2),
118 fhJetEtDiff2(jfp.fhJetEtDiff2),fhJetEta2(jfp.fhJetEta2),fhJetPhi2(jfp.fhJetPhi2), fhPartonEta2(jfp.fhPartonEta2),
119 fhPartonPhi2(jfp.fhPartonPhi2),fhEtaDiff2(jfp.fhEtaDiff2),fhPhiDiff2(jfp.fhPhiDiff2),
120 fhEtaPhiSpread2(jfp.fhEtaPhiSpread2),fhNJets2(jfp.fhNJets2),fhJetEtSecond2(jfp.fhJetEtSecond2),
121 fhJetEtRatio2(jfp.fhJetEtRatio2),fhEtaPhiDist2(jfp.fhEtaPhiDist2),fhInputOutput(jfp.fhInputOutput),
122 fhRecoBinPt(jfp.fhRecoBinPt),fhRecoBinPtNoBg(jfp.fhRecoBinPtNoBg),fhRecoBinPartonPt(jfp.fhRecoBinPartonPt),
123 fhRecoBinJetEt(jfp.fhRecoBinJetEt),fhRecoBinInputJetEt(jfp.fhRecoBinInputJetEt),fhJetPT(jfp.fhJetPT),
124 fhPartonPT(jfp.fhPartonPT),fhJetPT2(jfp.fhJetPT2),fhPartonPT2(jfp.fhPartonPT2),fhRecoBinFragmFcn(jfp.fhRecoBinFragmFcn),
125 fhRecoBinFragmFcnNoBg(jfp.fhRecoBinFragmFcnNoBg),fhRecoBinPartonFragmFcn(jfp.fhRecoBinPartonFragmFcn),
126 fhJetInvE(jfp.fhJetInvE),fhJetInvE2(jfp.fhJetInvE2),fhBackHisto(jfp.fhBackHisto),fScaleFactor(jfp.fScaleFactor),
127 fInitialised(jfp.fInitialised)
128{
129 //copy ctor
130}
131
45a58699 132void AliEMCALJetFinderPlots::InitPlots()
133{
134//========================= CASE 1 =======================================
135 fhFragmFcn = new TH1F("hFragmFcn","Fragmentation Function",200,0,2);
136 fhFragmFcn->Sumw2();
137 fhJetPT = new TH1F("hJetPT","P_{T} Distribution",200,0,200);
138 fhJetPT->Sumw2();
139 fhPartonPT = new TH1F("hPartonPT","Parton P_{T} Distribution",200,0,200);
140 fhPartonPT->Sumw2();
141 fhPartonFragmFcn = new TH1F("hPartonFragmFcn","Parton Fragmentation Function",200,0,2);
142 fhPartonFragmFcn->Sumw2();
143 fhPartonJT = new TH1F("hPartonJT","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
144 fhPartonJT->Sumw2();
145 fhPartonPL = new TH1F("hPartonPL","Track Momentum Parallel to Parton Axis ",100,0.,100.);
146 fhPartonPL->Sumw2();
147 fhJetJT = new TH1F("hJetJT","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
148 fhJetJT->Sumw2();
149 fhJetPL = new TH1F("hJetPL","Track Momentum Parallel to Jet Axis ",100,0.,100.);
150 fhJetPL->Sumw2();
151 fhJetEt = new TH1F("hJetEt","E_{T}^{reco}",250,0.,250.);
152 fhJetEt->Sumw2();
153 fhJetEtDiff = new TH1F("hJetEtDiff","E_{T}^{reco}-E_{T}^{Parton}",250,-124.,125.);
154 fhJetEtDiff->Sumw2();
155 fhJetEta = new TH1F("hJetEta","#eta_{jet}^{reco}",180,-0.9,0.9);
156 fhJetEta->Sumw2();
157 fhJetPhi = new TH1F("hJetPhi","#phi_{jet}^{reco}",62,0.,3.1);
158 fhJetPhi->Sumw2();
159 fhPartonEta = new TH1F("hPartonEta","#eta_{Parton}",180,-0.9,0.9);
160 fhPartonEta->Sumw2();
161 fhPartonPhi = new TH1F("hPartonPhi","#phi_{Parton}",62,0.,3.1);
162 fhPartonPhi->Sumw2();
163 fhEtaDiff = new TH1F("hEtaDiff","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
164 fhEtaDiff->Sumw2();
165 fhPhiDiff = new TH1F("hPhiDiff","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
166 fhPhiDiff->Sumw2();
167 fhNJets = new TH1F("hNJets","N Reconstructed jets",11,-0.5,10.5);
168 fhNJets->Sumw2();
169 fhEtaPhiSpread = new TH2F("hEtaPhiSpread","#eta - #phi Distribution of Reconstructed Jets",100,-0.5,0.5,100,-0.5,0.5);
170 fhEtaPhiSpread->Sumw2();
171 fhNJets->SetXTitle("N_{jets}^{reco}/event");
172 fhNJets->SetYTitle("N_{events}");
173
174 //Jet properties
175 fhJetEt->SetFillColor(16);
176 fhJetEt->SetXTitle("E_{T}^{reco}");
177
178 fhJetEta->SetFillColor(16);
179 fhJetEta->SetXTitle("#eta_{jet}^{reco}");
180
181 fhJetPhi->SetFillColor(16);
182 fhJetPhi->SetXTitle("#phi_{jet}^{reco}");
183
184 fhPartonEta->SetFillColor(16);
185 fhPartonEta->SetXTitle("#eta_{parton}");
186
187 fhPartonPhi->SetFillColor(16);
188 fhPartonPhi->SetXTitle("#phi_{parton}");
189
190 fhPartonPL->SetXTitle("p (GeV/c)");
191 fhPartonJT->SetXTitle("p (GeV/c)");
192
193 fhPartonFragmFcn->SetXTitle("Z = p_{T}^{Chg}/E_{T}^{parton}");
194
195 //Jet component properties
196
197 fhJetPL->SetXTitle("p (GeV/c)");
198 fhJetJT->SetXTitle("p (GeV/c)");
199 fhFragmFcn->SetXTitle("Z = p_{T}^{Chg}/E_{T}^{reco}");
200 fhPartonFragmFcn->SetXTitle("Z = p_{T}^{Chg}/E_{T}^{reco}");
201
202 fhEtaDiff->SetXTitle("#eta_{jet}^{reco}-#eta_{jet}^{input}");
203 fhPhiDiff->SetXTitle("#phi_{jet}^{reco}-#phi_{jet}^{input}");
204 fhEtaPhiSpread->SetXTitle("#eta");
205 fhEtaPhiSpread->SetYTitle("#phi");
206
207//======================= CASE 2 ======================================
208
209
210fhFragmFcn2 = new TH1F("hFragmFcn2","Fragmentation Function",200,0,2);
211fhFragmFcn2->Sumw2();
212 fhJetPT2 = new TH1F("hJetPT2","P_{T} Distribution",200,0,200);
213 fhJetPT2->Sumw2();
214 fhPartonPT2 = new TH1F("hPartonPT2","Parton P_{T} Distribution",200,0,1);
215 fhPartonPT2->Sumw2();
216fhPartonFragmFcn2 = new TH1F("hPartonFragmFcn2","Parton Fragmentation Function",200,0,2);
217fhPartonFragmFcn2->Sumw2();
218fhPartonJT2 = new TH1F("hPartonJT2","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
219fhPartonJT2->Sumw2();
220fhPartonPL2 = new TH1F("hPartonPL2","Track Momentum Parallel to Parton Axis ",100,0.,100.);
221fhPartonPL2->Sumw2();
222fhJetJT2 = new TH1F("hJetJT2","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
223fhJetJT2->Sumw2();
224fhJetPL2 = new TH1F("hJetPL2","Track Momentum Parallel to Jet Axis ",100,0.,100.);
225fhJetPL2->Sumw2();
226fhJetEt2 = new TH1F("hJetEt2","E_{T}^{reco}",250,0.,250.);
227fhJetEt2->Sumw2();
228 fhJetEtDiff2 = new TH1F("hJetEtDiff2","E_{T}^{reco}-E_{T}^{Parton}",250,-124.,125.);
229 fhJetEtDiff2->Sumw2();
230fhJetEta2 = new TH1F("hJetEta2","#eta_{jet}^{reco}",180,-0.9,0.9);
231fhJetEta2->Sumw2();
232fhJetPhi2 = new TH1F("hJetPhi2","#phi_{jet}^{reco}",62,0.,3.1);
233fhJetPhi2->Sumw2();
234fhPartonEta2 = new TH1F("hPartonEta2","#eta_{Parton}",180,-0.9,0.9);
235fhPartonEta2->Sumw2();
236fhPartonPhi2 = new TH1F("hPartonPhi2","#phi_{Parton}",62,0.,3.1);
237fhPartonPhi2->Sumw2();
238fhEtaDiff2 = new TH1F("hEtaDiff2","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
239fhEtaDiff2->Sumw2();
240fhPhiDiff2 = new TH1F("hPhiDiff2","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
241fhPhiDiff2->Sumw2();
242fhEtaPhiSpread2 = new TH2F("hEtaPhiSpread2","#eta - #phi Distribution of Reconstructed Jets",100,-0.5,0.5,100,-0.5,0.5);
243fhEtaPhiSpread2->Sumw2();
244fhNJets2 = new TH1F("hNJets2","N Reconstructed jets",11,-0.5,10.5);
245fhNJets2->Sumw2();
246fhJetEtSecond2 = new TH1F("hJetEtSecond2","E_{T}^{reco}",250,0.,250.);
247fhJetEtSecond2->Sumw2();
248fhJetEtRatio2 = new TH1F("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
249fhJetEtRatio2->Sumw2();
250fhEtaPhiDist2 = new TH1F("hEtaPhiDist2","Angular Distance Between First and Second",100,0,3);
251fhEtaPhiDist2->Sumw2();
252
253fhInputOutput= new TH2F("hInputOutput","Input and Reconstruction Correlations;Input;Output",200,0,200,200,0,200); //("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
254
255//============================== Reconstruction Bin Comparison ============================================
256
257fhRecoBinPt =new TH1F("fhRecoBinPt","Reconstructed Pt Distribution",200,0,200);
258fhRecoBinPt->Sumw2();
259fhRecoBinPtNoBg =new TH1F("fhRecoBinPtNoBg","Reconstructed Pt Distribution Background Subtracted",200,0,200);
260fhRecoBinPtNoBg->Sumw2();
261fhRecoBinPartonPt = new TH1F("fhRecoBinPartonPt","Input Pt Distribution",200,0,200);
262fhRecoBinPartonPt->Sumw2();
263fhRecoBinFragmFcn =new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",200,0,2);
264fhRecoBinFragmFcn->Sumw2();
265fhRecoBinFragmFcnNoBg =new TH1F("fhRecoBinFragmFcnNoBg","Reconstructed Frag. Fcn With Background Removed",200,0,2);
266fhRecoBinFragmFcnNoBg->Sumw2();
267fhRecoBinPartonFragmFcn = new TH1F("fhRecoBinPartonFragmFcn","Input Bin Fragm Fcn Distribution",200,0,2);
268fhRecoBinPartonFragmFcn->Sumw2();
269fhRecoBinJetEt = new TH1F("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
270fhRecoBinJetEt->Sumw2();
271fhRecoBinInputJetEt = new TH1F("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
272fhRecoBinInputJetEt->Sumw2();
273
274
275fhJetInvE = new TH1F("fhJetInvE","#frac{1}{E_{R}}",100,0,1);
276fhJetInvE->Sumw2();
277fhJetInvE2 = new TH1F("fhJetInvE2","#frac{1}{E_{R}}",100,0,1);
278fhJetInvE2->Sumw2();
279
280
281
282 fInitialised = kTRUE;
283
284}
285
286AliEMCALJetFinderPlots::~AliEMCALJetFinderPlots()
287{
288 // To ensure that all requested memory is returned
289delete fhFragmFcn;// = new TH1F("hFragmFcn","Fragmentation Function",100,0,1);
290delete fhPartonFragmFcn;// = new TH1F("hFragmFcn","Fragmentation Function",100,0,1);
291delete fhPartonJT;// = new TH1F("hPartonJT","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
292delete fhPartonPL;// = new TH1F("hPartonPL","Track Momentum Parallel to Parton Axis ",100,0.,100.);
293delete fhJetJT;// = new TH1F("hJetJT","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
294delete fhJetPL;// = new TH1F("hJetPL","Track Momentum Parallel to Jet Axis ",100,0.,100.);
295delete fhJetEt;// = new TH1F("hJetEt","E_{T}^{reco}",250,0.,250.);
296delete fhJetEtDiff; // ("hJetEt2","E_{T}^{reco}",250,0.,250.);
297delete fhJetEta;// = new TH1F("hJetEta","#eta_{jet}^{reco}",180,-0.9,0.9);
298delete fhJetPhi;// = new TH1F("hJetPhi","#phi_{jet}^{reco}",62,0.,3.1);
299delete fhPartonEta;// = new TH1F("hPartonEta","#eta_{Parton}",180,-0.9,0.9);
300delete fhPartonPhi;// = new TH1F("hPartonPhi","#phi_{Parton}",62,0.,3.1);
301delete fhEtaDiff;// = new TH1F("hEtaDiff","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
302delete fhPhiDiff;// = new TH1F("hPhiDiff","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
303delete fhNJets;// = new TH1F("hNJets","N Reconstructed jets",11,-0.5,10.5);
304delete fhEtaPhiSpread;
305
306 delete fhFragmFcn2; // ("hFragmFcn2","Fragmentation Function",100,0,1);
307 delete fhPartonFragmFcn2;// ("hFragmFcn2","Parton Fragmentation Function",100,0,1);
308 delete fhPartonJT2; // ("hPartonJT2","Track Momentum Perpendicular to Parton Axis",100,0.,10.);
309 delete fhPartonPL2; // ("hPartonPL2","Track Momentum Parallel to Parton Axis ",100,0.,100.);
310 delete fhJetJT2; // ("hJetJT2","Track Momentum Perpendicular to Jet Axis",100,0.,10.);
311 delete fhJetPL2; // ("hJetPL2","Track Momentum Parallel to Jet Axis ",100,0.,100.);
312 delete fhJetEt2; // ("hJetEt2","E_{T}^{reco}",250,0.,250.);
313 delete fhJetEtDiff2; // ("hJetEt2","E_{T}^{reco}",250,0.,250.);
314 delete fhJetEta2; // ("hJetEta2","#eta_{jet}^{reco}",180,-0.9,0.9);
315 delete fhJetPhi2; // ("hJetPhi2","#phi_{jet}^{reco}",62,0.,3.1);
316 delete fhPartonEta2; // ("hPartonEta2","#eta_{Parton}",180,-0.9,0.9);
317 delete fhPartonPhi2; // ("hPartonPhi2","#phi_{Parton}",62,0.,3.1);
318 delete fhEtaDiff2; // ("hEtaDiff2","#eta_{jet}^{reco}-#eta_{jet}^{input}",100,-0.5,0.5);
319 delete fhPhiDiff2; // ("hPhiDiff2","#phi_{jet}^{reco}-#phi_{jet}^{input}",100,-0.5,0.5);
320 delete fhEtaPhiSpread2; // ("hEtaPhiSpread2","#eta - #phi Distribution
321 //of Reconstructed Jets",192,-0.7,0.7,288,pi/3,pi);
322 delete fhNJets2; // ("hNJets2","N Reconstructed jets",11,-0.5,10.5);
323 delete fhJetEtSecond2; //("hJetEtSecond2","E_{T}^{reco}",250,0.,250.);
324 delete fhJetEtRatio2; //("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
325 delete fhEtaPhiDist2; //("hEtaPhiDist2","Angular Distance Between First and Second",100,0,3);
326
327 delete fhRecoBinPt; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
328 delete fhRecoBinPtNoBg; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
329 delete fhRecoBinPartonPt; // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
330 delete fhRecoBinJetEt; // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
331 delete fhRecoBinInputJetEt; // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
332
333 delete fhJetPT ;// new TH1F("hJetPT","P_{T} Distribution",200,0,200);
334 delete fhPartonPT ;// new TH1F("hPartonPT","Parton P_{T} Distribution",200,0,1);
335 delete fhJetPT2 ;// new TH1F("hJetPT","P_{T} Distribution",200,0,200);
336 delete fhPartonPT2 ;// new TH1F("hPartonPT","Parton P_{T} Distribution",200,0,1);
337 delete fhRecoBinFragmFcn;//new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",100,0,1);
338 delete fhRecoBinFragmFcnNoBg;//new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",100,0,1);
339 delete fhRecoBinPartonFragmFcn;// new TH1F("fhRecoBinPartonFragmFcn","Input Bin Fragm Fcn Distribution",100,0,1);
340 delete fhJetInvE;// = new TH1F("fhJetInvE","#frac{1}{E_{R}}",100,0,1);
341 delete fhJetInvE2;// = new TH1F("fhJetInvE","#frac{1}{E_{R}}",100,0,1);
342
343}
344
345void AliEMCALJetFinderPlots::FillFromOutput(AliEMCALJetFinderOutput* output, Float_t weight)
346{
347 // Fill histograms from an output object
348if (!fInitialised) InitPlots();
349 fOutput = output;
350 if (!fOutput) return;
351// Make some temporary histograms to make sure we subtract
352 // background properly
353/*
354tempFragmFcnNoBg =new TH1F("tempFragmFcnNoBg","Reconstructed Frag. Fcn With Background Removed",200,0,2);
355tempPtNoBg =new TH1F("tempPtNoBg","Reconstructed Frag. Fcn With Background Removed",200,0,200);
356tempFragmFcnNoBg->Fill(count/(jethighest->Energy()*fScaleFactor),-fhBackHisto->GetBinContent(count));
357tempPtNoBg->AddBinContent(count,-fhBackHisto->GetBinContent(count));
358*/
359
360 fhNJets->Fill(fOutput->GetNJets());
361 Bool_t doesJetMeetBinCriteria = 0;
362 AliEMCALJet* jethighest=0;
363 AliEMCALJet* jetsecond=0;
364 // Find Highest and Second Highest Jet
365 // (NB!!!!!!!) Pointing into the EMCAL!!!!!!
366
367// =========================== All cases ===================================
368
369
370 // I will make a little array of jet indices for which jets are in
371 // the EMCAL then my counter can loop from 0 below - but it will
372 // be the index of the array of applicable jets
373
374 Int_t appjet[4];
375 Int_t numappjet=0;
376
377 for (Int_t appc=0;appc<fOutput->GetNJets();appc++)
378 { // Check all jets for applicability
379 Float_t eta = fOutput->GetJet(appc)->Eta();
380 Float_t phi = fOutput->GetJet(appc)->Phi();
381 if (eta > -0.7 && eta < 0.7 && phi > 1./3.*TMath::Pi() && phi < TMath::Pi())
382 { // Then jet is applicable
383 appjet[numappjet]=appc;
384 numappjet++;
385 }
386 }
387
388
389Float_t et=0;
390if (numappjet >=1)
391{
392 Float_t theta = 2.0*atan(exp(-fOutput->GetParton(0)->Eta()));
393 et = fOutput->GetParton(0)->Energy() * TMath::Sin(theta);
394 if (fOutput->GetNJets()>1)
395 {
396 for (Int_t counter = 0; counter<numappjet;counter++)
397 {
398 if (counter==0)
399 {
400 jethighest = fOutput->GetJet(appjet[0]);
401 jetsecond = fOutput->GetJet(appjet[1]);
402 }
403 if (counter>0)
404 {
405 Float_t energyhighest = jethighest->Energy();
406 Float_t energysecond = jetsecond->Energy();
407
408 if ((fOutput->GetJet(appjet[counter]))->Energy()>energyhighest)
409 {
410 jetsecond=jethighest;
411 jethighest=fOutput->GetJet(appjet[counter]);
412 }else if ((fOutput->GetJet(appjet[counter]))->Energy()>energysecond)
413 {
414 jetsecond=fOutput->GetJet(appjet[counter]);
415 }
416
417 }
418 }
419 }else
420 {
421 Float_t eta = fOutput->GetJet(0)->Eta();
422 Float_t phi = fOutput->GetJet(0)->Phi();
423 if (eta > -0.7 && eta < 0.7 && phi > 1./3.*TMath::Pi() && phi < TMath::Pi())
424 { // Then jet is applicable
425 jethighest=fOutput->GetJet(0);
426 jetsecond=0;
427 }else
428 {
429 Error("FillFromOutput","There is only one jet and it isn't in the area of applicability");
430 }
431
432 }
433 if ( 95.0 < jethighest->Energy()*fScaleFactor && jethighest->Energy()*fScaleFactor < 105.0 )
434 {
435 doesJetMeetBinCriteria = 1;
436 fhRecoBinJetEt->Fill(jethighest->Energy()*fScaleFactor,weight);
437 fhRecoBinInputJetEt->Fill(et,weight);
438 }
439 fhInputOutput->Fill(et,jethighest->Energy());
440
441}
442
443if (numappjet > 1)
444{
445//========================= CASE 2 ===========================
446 Int_t nPartons = fOutput->GetNPartons();
447 fhNJets2->Fill(fOutput->GetNJets());
448 AliEMCALParton* parton;
449
450 // End finding highest and second highest and continue
451 fhJetEt2->Fill(jethighest->Energy()*fScaleFactor,weight);
452 fhJetEtDiff2->Fill(jethighest->Energy()*fScaleFactor-et,weight);
453 fhJetInvE2->Fill(1.0/(jethighest->Energy()*fScaleFactor),weight);
454 fhJetEta2->Fill(jethighest->Eta(),weight );
455 fhJetPhi2->Fill(jethighest->Phi(),weight );
456 if (nPartons ==0) return;
457 parton = fOutput->GetParton(0);
458
459 fhPartonEta2->Fill( parton->Eta(),weight );
460 fhPartonPhi2->Fill( parton->Phi(),weight );
461
462 //hJetEtDiff->Fill( jet->Energy() - parton->Energy() );
463 fhEtaDiff2->Fill( jethighest->Eta() - parton->Eta(),weight );
464 fhPhiDiff2->Fill( jethighest->Phi() - parton->Phi(),weight );
465 fhEtaPhiSpread2->Fill(jethighest->Eta()-parton->Eta(),jethighest->Phi() - parton->Phi());
466 fhJetEtSecond2->Fill(jetsecond->Energy()*fScaleFactor,weight);
467 fhJetEtRatio2->Fill(jetsecond->Energy()/jethighest->Energy(),weight);
468 fhEtaPhiDist2->Fill( TMath::Sqrt((jethighest->Eta() - jetsecond->Eta())*(jethighest->Eta() - jetsecond->Eta())
469 + (jethighest->Phi() - jetsecond->Phi())*(jethighest->Phi() - jetsecond->Phi()) ),weight);
470 /*
471 Float_t *pt,*phi,*eta;
472 Int_t *pdg;
473 pt = new Float_t[parton->GetNTracks()];
474 eta = new Float_t[parton->GetNTracks()];
475 phi = new Float_t[parton->GetNTracks()];
476 pdg = new Int_t[parton->GetNTracks()];*/
477
478
479
480 Float_t pt[2000];
481 Float_t eta[2000];
482 Float_t phi[2000];
483 Int_t pdg[2000];
484
485 parton->GetTrackList(pt,eta,phi,pdg);
486 for(Int_t iT=0; iT< parton->GetNTracks() ; iT++ )
487 {
488 if ( (eta[iT]-parton->Eta())*(eta[iT]-parton->Eta())+
489 (phi[iT]-parton->Phi())*(phi[iT]-parton->Phi()) >fConeRadius * fConeRadius ) continue;
490 Double_t tt = 2.0*atan(exp(-eta[iT])); // These names are short to make the equation manageable
491 Double_t rt = 2.0*atan(exp(-parton->Eta()));
492 Double_t ctt = cos(tt);
493 Double_t crt = cos(rt);
494 Double_t stt = sin(tt);
495 Double_t srt = sin(rt);
496 Double_t ctp = cos(phi[iT]);
497 Double_t crp = cos(parton->Phi());
498 Double_t stp = sin(phi[iT]);
499 Double_t srp = sin(parton->Phi());
500 //Double_t alpha = acos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
501 Double_t alpha;
502 if (TMath::Abs(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt) > 0.9990)
503 {
504 alpha = 0.0;
505 }else
506 {
507 alpha = TMath::ACos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
508 }
509 Double_t correctp = pt[iT]/stt;
510 fhPartonPL2->Fill( correctp*cos(alpha),weight);
511 if ( (parton->Eta()-eta[iT])*(parton->Eta()-eta[iT]) +
512 (parton->Phi()-phi[iT])*(parton->Phi()-phi[iT]) < 0.2*0.2 )
513 fhPartonJT2->Fill( correctp*sin(alpha),weight);
514 fhPartonPT2->Fill(correctp*sin(tt),weight);
515 if (fNominalEnergy == 0.0) {
516 fhPartonFragmFcn2->Fill( correctp*sin(tt)/parton->Energy(),weight );
517 }else
518 {
519 fhPartonFragmFcn2->Fill(correctp*sin(tt)/fNominalEnergy,weight);
520 }
521 if (doesJetMeetBinCriteria)
522 {
523 fhRecoBinPartonPt->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
524 }
525 }// loop over tracks
526
527/*
528 pt = new Float_t[jet->NTracks()];
529 eta = new Float_t[jet->NTracks()];
530 phi = new Float_t[jet->NTracks()];
531 pdg = new Int_t[jet->NTracks()];*/
532 jethighest->TrackList(pt,eta,phi,pdg);
533 for(Int_t iT=0; iT< jethighest->NTracks() ; iT++ )
534 {
535 Double_t tt = 2.0*atan(exp(-eta[iT])); // These names are short to make the equation manageable
536 Double_t rt = 2.0*atan(exp(-jethighest->Eta()));
537 Double_t ctt = cos(tt);
538 Double_t crt = cos(rt);
539 Double_t stt = sin(tt);
540 Double_t srt = sin(rt);
541 Double_t ctp = cos(phi[iT]);
542 Double_t crp = cos(jethighest->Phi());
543 Double_t stp = sin(phi[iT]);
544 Double_t srp = sin(jethighest->Phi());
545 // Double_t alpha = acos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
546 Double_t alpha;
547 if (TMath::Abs(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt) > 0.9990)
548 {
549 alpha = 0.0;
550 }else
551 {
552 alpha = TMath::ACos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
553 }
554 Double_t correctp = pt[iT]/stt;
555 fhJetPL2->Fill( correctp*cos(alpha),weight);
556 if ( (jethighest->Eta()-eta[iT])*(jethighest->Eta()-eta[iT]) +
557 (jethighest->Phi()-phi[iT])*(jethighest->Phi()-phi[iT]) < 0.2*0.2 )
558 fhJetJT2->Fill( correctp*sin(alpha),weight);
559 fhJetPT2->Fill(correctp*sin(tt),weight);
560 if (fNominalEnergy==0.0){
561 fhFragmFcn2->Fill( correctp*sin(tt)/(jethighest->Energy()*fScaleFactor),weight );
562 } else
563 {
564 fhFragmFcn2->Fill( correctp*sin(tt)/fNominalEnergy,weight );
565 }
566 if (doesJetMeetBinCriteria)
567 {
568 fhRecoBinPt->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
569 fhRecoBinPtNoBg->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
570 fhRecoBinFragmFcn->Fill( correctp*sin(tt)/(jethighest->Energy()*fScaleFactor),weight ); // This is the jet fragmentation function
571 fhRecoBinFragmFcnNoBg->Fill( correctp*sin(tt)/(jethighest->Energy()*fScaleFactor),weight ); // This is the jet fragmentation function
572 }
573 }// loop over tracks
574 }
575
576 if (numappjet == 1)
577 {
578
579//========================= CASE 1 ===========================
580 Int_t nPartons = fOutput->GetNPartons();
581 if (fOutput->GetNJets()!=1) return;
582 AliEMCALParton* parton;
583 AliEMCALJet* jet;
584 jet = jethighest;//fOutput->GetJet(0);
585 fhJetEt->Fill(jet->Energy()*fScaleFactor,weight);
586 fhJetEtDiff->Fill(jethighest->Energy()*fScaleFactor-et,weight);
587 fhJetInvE->Fill(1.0/(jethighest->Energy()*fScaleFactor),weight);
588 fhJetEta->Fill(jet->Eta(),weight );
589 fhJetPhi->Fill(jet->Phi(),weight );
590 if (nPartons ==0) return;
591 parton = fOutput->GetParton(0);
592
593 fhPartonEta->Fill( parton->Eta(),weight );
594 fhPartonPhi->Fill( parton->Phi(),weight );
595
596 //hJetEtDiff->Fill( jet->Energy() - parton->Energy() );
597 fhEtaDiff->Fill( jet->Eta() - parton->Eta(),weight );
598 fhPhiDiff->Fill( jet->Phi() - parton->Phi(),weight );
599 fhEtaPhiSpread->Fill(jet->Eta()-parton->Eta(),jet->Phi() - parton->Phi());
600 /*
601 Float_t *pt,*phi,*eta;
602 Int_t *pdg;
603 pt = new Float_t[parton->GetNTracks()];
604 eta = new Float_t[parton->GetNTracks()];
605 phi = new Float_t[parton->GetNTracks()];
606 pdg = new Int_t[parton->GetNTracks()];*/
607
608
609
610 Float_t pt[2000];
611 Float_t eta[2000];
612 Float_t phi[2000];
613 Int_t pdg[2000];
614
615 parton->GetTrackList(pt,eta,phi,pdg);
616 for(Int_t iT=0; iT< parton->GetNTracks() ; iT++ )
617 {
618 if ( (eta[iT]-parton->Eta())*(eta[iT]-parton->Eta())+
619 (phi[iT]-parton->Phi())*(phi[iT]-parton->Phi()) >fConeRadius * fConeRadius ) continue;
620 Double_t tt = 2.0*atan(exp(-eta[iT])); // These names are short to make the equation manageable
621 Double_t rt = 2.0*atan(exp(-parton->Eta()));
622 Double_t ctt = cos(tt);
623 Double_t crt = cos(rt);
624 Double_t stt = sin(tt);
625 Double_t srt = sin(rt);
626 Double_t ctp = cos(phi[iT]);
627 Double_t crp = cos(parton->Phi());
628 Double_t stp = sin(phi[iT]);
629 Double_t srp = sin(parton->Phi());
630 // Double_t alpha = acos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
631 Double_t alpha;
632 if (TMath::Abs(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt) > 0.9990)
633 {
634 alpha = 0.0;
635 }else
636 {
637 alpha = TMath::ACos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt); }
638 Double_t correctp = pt[iT]/stt;
639 fhPartonPL->Fill( correctp*cos(alpha),weight);
640 if ( (parton->Eta()-eta[iT])*(parton->Eta()-eta[iT]) +
641 (parton->Phi()-phi[iT])*(parton->Phi()-phi[iT]) < 0.2*0.2 )
642 fhPartonJT->Fill( correctp*sin(alpha),weight);
643 if (fNominalEnergy == 0.0) {
644 fhPartonFragmFcn->Fill( correctp*sin(tt)/parton->Energy(),weight );
645 fhPartonPT->Fill(correctp*sin(tt),weight);
646 }else
647 {
648 fhPartonFragmFcn->Fill(correctp*sin(tt)/fNominalEnergy,weight);
649 }
650 if (doesJetMeetBinCriteria)
651 {
652 fhRecoBinPartonPt->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
653 }
654 }// loop over tracks
655
656/*
657 pt = new Float_t[jet->NTracks()];
658 eta = new Float_t[jet->NTracks()];
659 phi = new Float_t[jet->NTracks()];
660 pdg = new Int_t[jet->NTracks()];*/
661 jet->TrackList(pt,eta,phi,pdg);
662 for(Int_t iT=0; iT< jet->NTracks() ; iT++ )
663 {
664 Double_t tt = 2.0*atan(exp(-eta[iT])); // These names are short to make the equation manageable
665 Double_t rt = 2.0*atan(exp(-jet->Eta()));
666 Double_t ctt = cos(tt);
667 Double_t crt = cos(rt);
668 Double_t stt = sin(tt);
669 Double_t srt = sin(rt);
670 Double_t ctp = cos(phi[iT]);
671 Double_t crp = cos(jet->Phi());
672 Double_t stp = sin(phi[iT]);
673 Double_t srp = sin(jet->Phi());
674 //Info("plots","acos(%1.16f)\nstt=%f\npt=%f",crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt,stt,pt[iT]);
675 //Info("plots","diff to 1 %f",1.0-crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
676 Double_t alpha;
677 if (TMath::Abs(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt) > 0.9990)
678 {
679 alpha = 0.0;
680 }else
681 {
682 alpha = TMath::ACos(crp*ctp*srt*stt+srp*stp*srt*stt+crt*ctt);
683 }
684 Double_t correctp = pt[iT]/stt;
685 fhJetPL->Fill( correctp*cos(alpha),weight);
686 if ( (jet->Eta()-eta[iT])*(jet->Eta()-eta[iT]) +
687 (jet->Phi()-phi[iT])*(jet->Phi()-phi[iT]) < 0.2*0.2 )
688 fhJetJT->Fill( correctp*sin(alpha),weight);
689 fhJetPT->Fill(correctp*sin(tt),weight);
690 if (fNominalEnergy==0.0){
691 fhFragmFcn->Fill( correctp*sin(tt)/(jet->Energy()*fScaleFactor),weight ); // This is the jet fragmentation function
692 } else
693 {
694 fhFragmFcn->Fill( correctp*sin(tt)/fNominalEnergy,weight );
695 }
696 if (doesJetMeetBinCriteria)
697 {
698 fhRecoBinPt->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
699 fhRecoBinPtNoBg->Fill(correctp*sin(tt),weight); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
700 fhRecoBinFragmFcn->Fill( correctp*sin(tt)/(jet->Energy()*fScaleFactor),weight ); // This is the jet fragmentation function
701 fhRecoBinFragmFcnNoBg->Fill( correctp*sin(tt)/(jet->Energy()*fScaleFactor),weight ); // This is the jet fragmentation function
702 }
703 }// loop over tracks
704 }
705
706if (numappjet>=1 && fhBackHisto != 0 && doesJetMeetBinCriteria)
707 {
708 for (Int_t count=1;count<=100;count++)
709 {
710 fhRecoBinFragmFcnNoBg->Fill( ((Float_t)count)/(jethighest->Energy()*fScaleFactor),-fhBackHisto->GetBinContent(count)*weight);
711 fhRecoBinPtNoBg->AddBinContent(count,-fhBackHisto->GetBinContent(count)*weight);
712 }
713 }
714
715
716}
717
718