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