]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/totEt/AliAnalysisEtReconstructed.cxx
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtReconstructed.cxx
CommitLineData
cf6522d1 1//_________________________________________________________________________
2// Utility Class for transverse energy studies
3// Base class for ESD analysis
4// - reconstruction output
5// implementation file
6//
7//*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
8//_________________________________________________________________________
2fbf38ac 9
10#include "AliAnalysisEtReconstructed.h"
11#include "AliAnalysisEtCuts.h"
12#include "AliESDtrack.h"
ba136eb4 13#include "AliEMCALTrack.h"
2fbf38ac 14#include "AliESDCaloCluster.h"
15#include "TVector3.h"
ba136eb4 16#include "TGeoGlobalMagField.h"
17#include "AliMagF.h"
2fbf38ac 18#include "AliVEvent.h"
19#include "AliESDEvent.h"
b5821c13 20#include "AliESDtrackCuts.h"
2fbf38ac 21#include "AliVParticle.h"
87efb15c 22#include "TDatabasePDG.h"
23#include "TList.h"
b5821c13 24#include "AliESDpid.h"
2fbf38ac 25#include <iostream>
09fcb185 26#include "TH3F.h"
2fbf38ac 27#include "TH2F.h"
ef647350 28#include "TH2I.h"
29#include "TH1I.h"
30#include "TFile.h"
964c8159 31#include "AliAnalysisHadEtCorrections.h"
ef647350 32#include "AliAnalysisEtSelector.h"
0f6416f3 33#include "AliLog.h"
e9da35da 34#include "AliCentrality.h"
ef647350 35#include "AliPHOSGeoUtils.h"
36#include "AliPHOSGeometry.h"
d3ce32b8 37#include "AliAnalysisEtRecEffCorrection.h"
9a365626 38#include "AliESDpid.h"
0f6416f3 39
2fbf38ac 40
16abb579 41using namespace std;
42
43ClassImp(AliAnalysisEtReconstructed);
44
45
2fbf38ac 46AliAnalysisEtReconstructed::AliAnalysisEtReconstructed() :
f61cec2f 47 AliAnalysisEt()
48 ,fCorrections(0)
49 ,fPidCut(0)
50 ,fHistChargedPionEnergyDeposit(0)
51 ,fHistProtonEnergyDeposit(0)
52 ,fHistAntiProtonEnergyDeposit(0)
53 ,fHistChargedKaonEnergyDeposit(0)
54 ,fHistMuonEnergyDeposit(0)
55 ,fHistRemovedEnergy(0)
56 ,fGeomCorrection(1.0)
b2c10007 57 ,fEMinCorrection(1.0/0.687)
f61cec2f 58 ,fRecEffCorrection(1.0)
43dd5a38 59 ,fClusterPositionAccepted(0)
60 ,fClusterPositionAll(0)
61 ,fClusterPositionAcceptedEnergy(0)
62 ,fClusterPositionAllEnergy(0)
53302bfe 63 ,fClusterEnergy(0)
9a365626 64 ,fClusterEnergyCent(0)
65 ,fClusterEnergyCentMatched(0)
66 ,fClusterEnergyCentNotMatched(0)
53302bfe 67 ,fClusterEt(0)
f61cec2f 68 ,fHistChargedEnergyRemoved(0)
69 ,fHistNeutralEnergyRemoved(0)
70 ,fHistGammaEnergyAdded(0)
ac610b08 71 ,fHistMatchedTracksEvspTvsCent(0)
72 ,fHistMatchedTracksEvspTvsCentEffCorr(0)
459e9c44 73 ,fHistMatchedTracksEvspTvsCentEffTMCorr(0)
5881f036 74 ,fHistMatchedTracksEvspTvsCentEffTMCorr500MeV(0)
6a152780 75 ,fHistFoundHadronsvsCent(0)
76 ,fHistNotFoundHadronsvsCent(0)
77 ,fHistFoundHadronsEtvsCent(0)
78 ,fHistNotFoundHadronsEtvsCent(0)
43dd5a38 79 ,fHistFoundHadronsvsCent500MeV(0)
80 ,fHistNotFoundHadronsvsCent500MeV(0)
81 ,fHistFoundHadronsEtvsCent500MeV(0)
82 ,fHistNotFoundHadronsEtvsCent500MeV(0)
d3ce32b8 83 ,fHistNominalRawEt(0)
84 ,fHistNominalNonLinHighEt(0)
85 ,fHistNominalNonLinLowEt(0)
86 ,fHistNominalEffHighEt(0)
87 ,fHistNominalEffLowEt(0)
43dd5a38 88 ,fHistTotRawEtEffCorr(0)
3e9c52ca 89 ,fHistTotRawEt(0)
43dd5a38 90 ,fHistTotRawEtEffCorr500MeV(0)
91 ,fHistTotAllRawEt(0)
92 ,fHistTotAllRawEtEffCorr(0)
9a365626 93 ,fHistNClustersPhosVsEmcal(0)
94 ,fHistClusterSizeVsCent(0)
95 ,fHistMatchedClusterSizeVsCent(0)
96 ,fHistTotAllRawEtVsTotalPt(0)
97 ,fHistTotAllRawEtVsTotalPtVsCent(0)
98 ,fHistTotMatchedRawEtVsTotalPtVsCent(0)
99 ,fHistPIDProtonsTrackMatchedDepositedVsNch(0)
100 ,fHistPIDAntiProtonsTrackMatchedDepositedVsNch(0)
0fcbed20 101 ,fHistPIDProtonsTrackMatchedDepositedVsNcl(0)
102 ,fHistPIDAntiProtonsTrackMatchedDepositedVsNcl(0)
9a365626 103 ,fHistPiKPTrackMatchedDepositedVsNch(0)
104 ,fHistCentVsNchVsNclReco(0)
2fbf38ac 105{
106
107}
108
e9da35da 109AliAnalysisEtReconstructed::~AliAnalysisEtReconstructed()
f61cec2f 110{//destructor
e9da35da 111 delete fCorrections;
ef647350 112 delete fHistChargedPionEnergyDeposit; /** Energy deposited in calorimeter by charged pions */
113 delete fHistProtonEnergyDeposit; /** Energy deposited in calorimeter by protons */
114 delete fHistAntiProtonEnergyDeposit; /** Energy deposited in calorimeter by anti-protons */
115 delete fHistChargedKaonEnergyDeposit; /** Energy deposited in calorimeter by charged kaons */
d0c22dcc 116 delete fHistMuonEnergyDeposit; /** Energy deposited in calorimeter by muons */
117
118 delete fHistRemovedEnergy; // removed energy
43dd5a38 119 delete fClusterPositionAccepted;
120 delete fClusterPositionAll;
121 delete fClusterPositionAcceptedEnergy;
122 delete fClusterPositionAllEnergy;
53302bfe 123 delete fClusterEnergy;
9a365626 124 delete fClusterEnergyCent;
125 delete fClusterEnergyCentMatched;
126 delete fClusterEnergyCentNotMatched;
53302bfe 127 delete fClusterEt;
311c6540 128 delete fHistChargedEnergyRemoved;
129 delete fHistNeutralEnergyRemoved;
130 delete fHistGammaEnergyAdded;
ac610b08 131 delete fHistMatchedTracksEvspTvsCent;
132 delete fHistMatchedTracksEvspTvsCentEffCorr;
459e9c44 133 delete fHistMatchedTracksEvspTvsCentEffTMCorr;
5881f036 134 delete fHistMatchedTracksEvspTvsCentEffTMCorr500MeV;
6a152780 135 delete fHistFoundHadronsvsCent;
136 delete fHistNotFoundHadronsvsCent;
137 delete fHistFoundHadronsEtvsCent;
138 delete fHistNotFoundHadronsEtvsCent;
43dd5a38 139 delete fHistFoundHadronsvsCent500MeV;
140 delete fHistNotFoundHadronsvsCent500MeV;
141 delete fHistFoundHadronsEtvsCent500MeV;
142 delete fHistNotFoundHadronsEtvsCent500MeV;
d3ce32b8 143 delete fHistNominalRawEt;
144 delete fHistNominalNonLinHighEt;
145 delete fHistNominalNonLinLowEt;
146 delete fHistNominalEffHighEt;
147 delete fHistNominalEffLowEt;
43dd5a38 148 delete fHistTotRawEtEffCorr;
3e9c52ca 149 delete fHistTotRawEt;
43dd5a38 150 delete fHistTotAllRawEt;
151 delete fHistTotAllRawEtEffCorr;
152 delete fHistTotRawEtEffCorr500MeV;
9a365626 153 delete fHistNClustersPhosVsEmcal;
154 delete fHistClusterSizeVsCent;
155 delete fHistMatchedClusterSizeVsCent;
156 delete fHistTotAllRawEtVsTotalPt;
157 delete fHistTotAllRawEtVsTotalPtVsCent;
158 delete fHistTotMatchedRawEtVsTotalPtVsCent;
159 delete fHistPIDProtonsTrackMatchedDepositedVsNch;
160 delete fHistPIDAntiProtonsTrackMatchedDepositedVsNch;
0fcbed20 161 delete fHistPIDProtonsTrackMatchedDepositedVsNcl;
162 delete fHistPIDAntiProtonsTrackMatchedDepositedVsNcl;
9a365626 163 delete fHistPiKPTrackMatchedDepositedVsNch;
164 delete fHistCentVsNchVsNclReco;
cf6522d1 165}
166
167Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev)
e9da35da 168{
f61cec2f 169
170 //AliAnalysisEt::AnalyseEvent(ev);
e9da35da 171 // analyse ESD event
2fbf38ac 172 ResetEventValues();
e9da35da 173 if (!ev) {
174 AliFatal("ERROR: Event does not exist");
175 return 0;
176 }
177
2fbf38ac 178 AliESDEvent *event = dynamic_cast<AliESDEvent*>(ev);
e9da35da 179 if (!event) {
180 AliFatal("ERROR: ESD Event does not exist");
181 return 0;
ec956c46 182 }
2aab9269 183 if(!fSelector){
184 AliFatal("ERROR: fSelector does not exist");
185 return 0;
186 }
ef647350 187 fSelector->SetEvent(event);
f61cec2f 188
743ce29f 189 Int_t cent = -1;
d3ce32b8 190 fCentrality = event->GetCentrality();
f6b36c54 191 if (fCentrality && cent)
743ce29f 192 {
d3ce32b8 193 cent = fCentrality->GetCentralityClass5("V0M");
194 fCentClass = fCentrality->GetCentralityClass5("V0M");
743ce29f 195 }
196
9a365626 197
198 //for PID
199 AliESDpid *pID = new AliESDpid();
200 pID->MakePID(event);
201 Float_t etPIDProtons = 0.0;
202 Float_t etPIDAntiProtons = 0.0;
203 Float_t etPiKPMatched = 0.0;
204 Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(event,kTRUE);
205
206
207 Float_t totalMatchedPt = 0.0;
208 Float_t totalPt = 0.0;
209 TObjArray* list = fEsdtrackCutsTPC->GetAcceptedTracks(event);
210 Int_t nGoodTracks = list->GetEntries();
211 for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++){
212 AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
213 if (!track)
214 {
215 Printf("ERROR: Could not get track %d", iTrack);
216 continue;
217 }
218 else{
219 totalPt +=track->Pt();
220 pID->MakeITSPID(track);
221
222
223 }
224 }
225
5881f036 226 //TRefArray *caloClusters = fSelector->GetClusters();//just gets the correct set of clusters - does not apply any cuts
227 //Float_t fClusterMult = caloClusters->GetEntries();
09fcb185 228
d3ce32b8 229 Float_t nominalRawEt = 0;
5881f036 230 Float_t totEt500MeV = 0;
d3ce32b8 231 Float_t nonlinHighRawEt = 0;
232 Float_t nonlinLowRawEt = 0;
233 Float_t effHighRawEt = 0;
234 Float_t effLowRawEt = 0;
3e9c52ca 235 Float_t uncorrEt = 0;
d3ce32b8 236
6a152780 237 Float_t nChargedHadronsMeasured = 0.0;
238 Float_t nChargedHadronsTotal = 0.0;
239 Float_t nChargedHadronsEtMeasured = 0.0;
240 Float_t nChargedHadronsEtTotal = 0.0;
43dd5a38 241 Float_t nChargedHadronsMeasured500MeV = 0.0;
242 Float_t nChargedHadronsTotal500MeV = 0.0;
243 Float_t nChargedHadronsEtMeasured500MeV = 0.0;
244 Float_t nChargedHadronsEtTotal500MeV = 0.0;
245 Float_t fTotAllRawEt = 0.0;
246 Float_t fTotRawEt = 0.0;
f809f93b 247 Float_t fTotRawEtEffCorr = 0.0;
43dd5a38 248 Float_t fTotAllRawEtEffCorr = 0.0;
9a365626 249 Int_t nPhosClusters = 0;
250 Int_t nEmcalClusters = 0;
d3ce32b8 251
2fbf38ac 252 for (Int_t iCluster = 0; iCluster < event->GetNumberOfCaloClusters(); iCluster++)
253 {
254 AliESDCaloCluster* cluster = event->GetCaloCluster(iCluster);
255 if (!cluster)
256 {
e9da35da 257 AliError(Form("ERROR: Could not get cluster %d", iCluster));
2fbf38ac 258 continue;
259 }
ef647350 260 int x = 0;
f61cec2f 261 fCutFlow->Fill(x++);
9a365626 262 if(cluster->IsEMCAL()) nEmcalClusters++;
263 else nPhosClusters++;
86e7d5db 264 if(!fSelector->IsDetectorCluster(*cluster)) continue;
f61cec2f 265 fCutFlow->Fill(x++);
86e7d5db 266 if(!fSelector->PassMinEnergyCut(*cluster)) continue;
f61cec2f 267 fCutFlow->Fill(x++);
86e7d5db 268 if (!fSelector->PassDistanceToBadChannelCut(*cluster)) continue;
f61cec2f 269 fCutFlow->Fill(x++);
5881f036 270 if (!fSelector->CutGeometricalAcceptance(*cluster)) continue;
271 //fCutFlow->Fill(x++);
2fbf38ac 272 Float_t pos[3];
e9da35da 273
2fbf38ac 274 cluster->GetPosition(pos);
e9da35da 275 TVector3 cp(pos);
43dd5a38 276 fClusterPositionAll->Fill(cp.Phi(), cp.PseudoRapidity());
277 fClusterPositionAllEnergy->Fill(cp.Phi(), cp.PseudoRapidity(),cluster->E());
87efb15c 278
5881f036 279 //if(TMath::Abs(cp.Eta())> fCuts->fCuts->GetGeometryEmcalEtaAccCut() || cp.Phi() > fCuts->GetGeometryEmcalPhiAccMaxCut()*TMath::Pi()/180. || cp.Phi() > fCuts->GetGeometryEmcalPhiAccMinCut()*TMath::Pi()/180.) continue;//Do not accept if cluster is not in the acceptance
43dd5a38 280 fTotAllRawEt += TMath::Sin(cp.Theta())*cluster->E();
281 fTotAllRawEtEffCorr += CorrectForReconstructionEfficiency(*cluster,cent);
5881f036 282
9a365626 283 fClusterEnergyCent->Fill(cluster->E(),cent);
284
09fcb185 285 Bool_t matched = kTRUE;//default to no track matched
286 Int_t trackMatchedIndex = cluster->GetTrackMatchedIndex();//find the index of the matched track
584f2478 287 matched = !(fSelector->PassTrackMatchingCut(*cluster));//PassTrackMatchingCut is false if there is a matched track
288 if(matched){//if the track match is good (, is the track good?
289 if(trackMatchedIndex < 0) matched=kFALSE;//If the index is bad, don't count it
290 if(matched){
291 AliESDtrack *track = event->GetTrack(trackMatchedIndex);
292 //if this is a good track, accept track will return true. The track matched is good, so not track matched is false
293 matched = fEsdtrackCutsTPC->AcceptTrack(track);//If the track is bad, don't count it
294 }
09fcb185 295 }
e9da35da 296
e9da35da 297
298 if (matched)
299 {
f61cec2f 300
e9da35da 301 if (cluster->GetNTracksMatched() > 0 && trackMatchedIndex>=0)
302 {
303 AliVTrack *track = event->GetTrack(trackMatchedIndex);
304 if (!track) {
305 AliError("Error: track does not exist");
306 }
307 else {
9a365626 308 totalMatchedPt +=track->Pt();
309 fClusterEnergyCentMatched->Fill(cluster->E(),cent);
310 fHistMatchedClusterSizeVsCent->Fill(cluster->GetNCells(),cent);
311
5881f036 312 float eff = fTmCorrections->TrackMatchingEfficiency(track->Pt(),cent);
584f2478 313 if(TMath::Abs(eff)<1e-5) eff = 1.0;
9a365626 314 //cout<<"pt "<<track->Pt()<<" eff "<<eff<<" total "<<nChargedHadronsTotal<<endl;
6a152780 315 nChargedHadronsMeasured++;
584f2478 316 nChargedHadronsTotal += 1/eff;
5881f036 317 Double_t effCorrEt = CorrectForReconstructionEfficiency(*cluster,cent);
9a365626 318 nChargedHadronsEtMeasured+= TMath::Sin(cp.Theta())*cluster->E();
3e9c52ca 319 //One efficiency is the gamma efficiency and the other is the track matching efficiency.
9a365626 320 nChargedHadronsEtTotal+= 1/eff *TMath::Sin(cp.Theta())*cluster->E();
321
322 Float_t nSigmaPion = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion);
323 Float_t nSigmaProton = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton);
324 bool isProton = (nSigmaPion>3.0 && nSigmaProton<3.0 && track->Pt()<0.9);
325 //cout<<"NSigmaProton "<<nSigmaProton<<endl;
326 etPiKPMatched += effCorrEt;
327 if(isProton){
328 if(track->Charge()>0){
329 etPIDProtons += effCorrEt;
330 }
331 else{
332 etPIDAntiProtons += effCorrEt;
333 }
334 }
43dd5a38 335 if(TMath::Sin(cp.Theta())*cluster->E()>0.5){
336 nChargedHadronsMeasured500MeV++;
337 nChargedHadronsTotal500MeV += 1/eff;
9a365626 338 nChargedHadronsEtMeasured500MeV+= TMath::Sin(cp.Theta())*cluster->E();
339 nChargedHadronsEtTotal500MeV+= 1/eff *TMath::Sin(cp.Theta())*cluster->E();
43dd5a38 340 }
ac610b08 341 fHistMatchedTracksEvspTvsCent->Fill(track->P(),TMath::Sin(cp.Theta())*cluster->E(),cent);
5881f036 342 fHistMatchedTracksEvspTvsCentEffCorr->Fill(track->P(),effCorrEt,cent);
459e9c44 343 //Weighed by the number of tracks we didn't find
344 fHistMatchedTracksEvspTvsCentEffTMCorr->Fill(track->P(), effCorrEt,cent, (1/eff-1) );
5881f036 345 cluster->GetPosition(pos);
346 TVector3 p2(pos);
347 uncorrEt += TMath::Sin(p2.Theta())*cluster->E();
348 if(uncorrEt>=0.5) fHistMatchedTracksEvspTvsCentEffTMCorr500MeV->Fill(track->P(), effCorrEt,cent, (1/eff-1) );
e9da35da 349 const Double_t *pidWeights = track->PID();
350
351 Double_t maxpidweight = 0;
352 Int_t maxpid = 0;
353
354 if (pidWeights)
355 {
356 for (Int_t p =0; p < AliPID::kSPECIES; p++)
357 {
358 if (pidWeights[p] > maxpidweight)
359 {
360 maxpidweight = pidWeights[p];
361 maxpid = p;
362 }
363 }
f61cec2f 364 if (fCuts->GetHistMakeTreeDeposit() && fDepositTree)
e9da35da 365 {
366 fEnergyDeposited = cluster->E();
f61cec2f 367 fMomentumTPC = track->P();
e9da35da 368 fCharge = track->Charge();
369 fParticlePid = maxpid;
370 fPidProb = maxpidweight;
371 AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
372 if (!esdTrack) {
373 AliError("Error: track does not exist");
374 }
375 else {
376 if (esdTrack) fTrackPassedCut = fEsdtrackCutsTPC->AcceptTrack(esdTrack);
f61cec2f 377 fDepositTree->Fill();
e9da35da 378 }
379 }
380
381 if (maxpidweight > fPidCut)
382 {
f61cec2f 383 //Float_t dist = TMath::Sqrt(pos[0]*pos[0] + pos[1]*pos[1]);
e9da35da 384
f61cec2f 385 //Float_t theta = TMath::ATan(pos[2]/dist)+TMath::Pi()/2;
e9da35da 386
f61cec2f 387 //Float_t et = cluster->E() * TMath::Sin(theta);
e9da35da 388 if (maxpid == AliPID::kProton)
389 {
390
391 if (track->Charge() == 1)
392 {
e9da35da 393 fHistProtonEnergyDeposit->Fill(cluster->E(), track->E());
394 }
395 else if (track->Charge() == -1)
396 {
e9da35da 397 fHistAntiProtonEnergyDeposit->Fill(cluster->E(), track->E());
398 }
399 }
400 else if (maxpid == AliPID::kPion)
401 {
e9da35da 402 fHistChargedPionEnergyDeposit->Fill(cluster->E(), track->E());
403 }
404 else if (maxpid == AliPID::kKaon)
405 {
e9da35da 406 fHistChargedKaonEnergyDeposit->Fill(cluster->E(), track->E());
407 }
408 else if (maxpid == AliPID::kMuon)
409 {
410 fHistMuonEnergyDeposit->Fill(cluster->E(), track->E());
411 }
412 }
413 }
414 }
415 }
416 //continue;
ba136eb4 417 } // distance
6a152780 418 else{//these are clusters which were not track matched
f61cec2f 419 fCutFlow->Fill(x++);
420 //std::cout << x++ << std::endl;
6a152780 421
422 //if (cluster->E() > fSingleCellEnergyCut && cluster->GetNCells() == fCuts->GetCommonSingleCell()) continue;
423 //if (cluster->E() < fClusterEnergyCut) continue;
424 cluster->GetPosition(pos);
425
f61cec2f 426 TVector3 p2(pos);
427
43dd5a38 428 fClusterPositionAccepted->Fill(p2.Phi(), p2.PseudoRapidity());
429 fClusterPositionAcceptedEnergy->Fill(p2.Phi(), p2.PseudoRapidity(),cluster->E());
53302bfe 430 fClusterEnergy->Fill(cluster->E());
9a365626 431 fClusterEnergyCentNotMatched->Fill(cluster->E(),cent);
432 fHistClusterSizeVsCent->Fill(cluster->GetNCells(),cent);
53302bfe 433 fClusterEt->Fill(TMath::Sin(p2.Theta())*cluster->E());
3e9c52ca 434 uncorrEt += TMath::Sin(p2.Theta())*cluster->E();
5881f036 435 float myuncorrEt = TMath::Sin(p2.Theta())*cluster->E();
43dd5a38 436 fTotRawEt += myuncorrEt;
2fbf38ac 437
5881f036 438 Double_t effCorrEt = CorrectForReconstructionEfficiency(*cluster,cent);
3e9c52ca 439 //cout<<"cluster energy "<<cluster->E()<<" eff corr Et "<<effCorrEt<<endl;
f809f93b 440 fTotRawEtEffCorr += effCorrEt;
d3ce32b8 441 fTotNeutralEt += effCorrEt;
442 nominalRawEt += effCorrEt;
5881f036 443 if(myuncorrEt>=0.5){
444 totEt500MeV += effCorrEt;
445 //cout<<"test "<<myuncorrEt<<"> 0.5"<<endl;
446 }
447 else{
448 //cout<<"test "<<myuncorrEt<<"< 0.5"<<endl;
449 }
450 nonlinHighRawEt += effCorrEt*GetCorrectionModification(*cluster,1,0,cent);
451 nonlinLowRawEt += effCorrEt*GetCorrectionModification(*cluster,-1,0,cent);
452 effHighRawEt += effCorrEt*GetCorrectionModification(*cluster,0,1,cent);
453 effLowRawEt += effCorrEt*GetCorrectionModification(*cluster,0,-1,cent);
e9da35da 454 fNeutralMultiplicity++;
455 }
ef647350 456 fMultiplicity++;
457 }
f61cec2f 458
9a365626 459 fHistNClustersPhosVsEmcal->Fill(nPhosClusters,nEmcalClusters,cent);
ef647350 460 fChargedEnergyRemoved = GetChargedContribution(fNeutralMultiplicity);
461 fNeutralEnergyRemoved = GetNeutralContribution(fNeutralMultiplicity);
462 fHistChargedEnergyRemoved->Fill(fChargedEnergyRemoved, fNeutralMultiplicity);
463 fHistNeutralEnergyRemoved->Fill(fNeutralEnergyRemoved, fNeutralMultiplicity);
f61cec2f 464
ef647350 465 fGammaEnergyAdded = GetGammaContribution(fNeutralMultiplicity);
466 fHistGammaEnergyAdded->Fill(fGammaEnergyAdded, fNeutralMultiplicity);
2fbf38ac 467
b2c10007 468 Double_t removedEnergy = GetChargedContribution(fNeutralMultiplicity) + GetNeutralContribution(fNeutralMultiplicity) + GetGammaContribution(fNeutralMultiplicity) + GetSecondaryContribution(fNeutralMultiplicity);
e9da35da 469 fHistRemovedEnergy->Fill(removedEnergy);
f61cec2f 470
459e9c44 471 fTotNeutralEtAcc = fTotNeutralEt;
f809f93b 472 //fHistTotRawEtEffCorr->Fill(fTotNeutralEt,cent);
473 fHistTotRawEtEffCorr->Fill(fTotRawEtEffCorr,cent);
43dd5a38 474 fHistTotRawEt->Fill(fTotRawEt,cent);
475 fHistTotAllRawEt->Fill(fTotAllRawEt,cent);
9a365626 476 fHistTotAllRawEtVsTotalPt->Fill(fTotAllRawEt,totalPt);
477 fHistTotAllRawEtVsTotalPtVsCent->Fill(fTotAllRawEt,totalPt,cent);
478 fHistTotMatchedRawEtVsTotalPtVsCent->Fill(fTotAllRawEt,totalMatchedPt,cent);
43dd5a38 479 fHistTotAllRawEtEffCorr->Fill(fTotAllRawEtEffCorr,cent);
f809f93b 480 //cout<<"fTotAllRawEtEffCorr "<<fTotAllRawEtEffCorr<<" fTotAllRawEt "<<fTotAllRawEt<<" fTotRawEtEffCorr "<<fTotRawEtEffCorr<<"("<<fTotNeutralEt<<")"<<" fTotRawEt "<<fTotRawEt<<endl;
3e9c52ca 481 //cout<<"uncorr "<<uncorrEt<<" raw "<<nominalRawEt<<" tot raw "<<fTotNeutralEt;
482 fTotNeutralEt = fGeomCorrection * fEMinCorrection * (fTotNeutralEt - removedEnergy);
483 //cout<<" tot corr "<<fTotNeutralEt<<endl;
2fbf38ac 484 fTotEt = fTotChargedEt + fTotNeutralEt;
f61cec2f 485// Fill the histograms...0
2fbf38ac 486 FillHistograms();
b2c10007 487 //std::cout << "fTotNeutralEt: " << fTotNeutralEt << ", Contribution from non-removed charged: " << GetChargedContribution(fNeutralMultiplicity) << ", neutral: " << GetNeutralContribution(fNeutralMultiplicity) << ", gammas: " << GetGammaContribution(fNeutralMultiplicity) << ", multiplicity: " << fNeutralMultiplicity<< std::endl;
d3ce32b8 488 //cout<<"cent "<<cent<<" cluster mult "<<fClusterMult<<" fTotNeutralEt "<<fTotNeutralEt<<" nominalRawEt "<<nominalRawEt<<endl;
489 fHistNominalRawEt->Fill(nominalRawEt,cent);
43dd5a38 490 fHistTotRawEtEffCorr500MeV->Fill(totEt500MeV,cent);
d3ce32b8 491 fHistNominalNonLinHighEt->Fill(nonlinHighRawEt,cent);
492 fHistNominalNonLinLowEt->Fill(nonlinLowRawEt,cent);
493 fHistNominalEffHighEt->Fill(effHighRawEt,cent);
494 fHistNominalEffLowEt->Fill(effLowRawEt,cent);
6a152780 495 fHistFoundHadronsvsCent->Fill(nChargedHadronsMeasured,cent);
496 fHistNotFoundHadronsvsCent->Fill(nChargedHadronsTotal-nChargedHadronsMeasured,cent);
497 fHistFoundHadronsEtvsCent->Fill(nChargedHadronsEtMeasured,cent);
498 fHistNotFoundHadronsEtvsCent->Fill(nChargedHadronsEtTotal-nChargedHadronsEtMeasured,cent);
9a365626 499 //cout<<"found "<<nChargedHadronsMeasured<<" total "<<nChargedHadronsTotal<<" not found "<<nChargedHadronsTotal-nChargedHadronsMeasured<<" found "<< nChargedHadronsMeasured500MeV<<" not found "<< nChargedHadronsTotal500MeV-nChargedHadronsMeasured500MeV <<" total "<<nChargedHadronsTotal500MeV<<endl;
43dd5a38 500 fHistFoundHadronsvsCent500MeV->Fill(nChargedHadronsMeasured500MeV,cent);
501 fHistNotFoundHadronsvsCent500MeV->Fill(nChargedHadronsTotal500MeV-nChargedHadronsMeasured500MeV,cent);
502 fHistFoundHadronsEtvsCent500MeV->Fill(nChargedHadronsEtMeasured500MeV,cent);
503 fHistNotFoundHadronsEtvsCent500MeV->Fill(nChargedHadronsEtTotal500MeV-nChargedHadronsEtMeasured500MeV,cent);
6a152780 504// cout<<"Number of hadrons measured: "<<nChargedHadronsMeasured<<" Estimated total number of hadrons "<<nChargedHadronsTotal<<" ET in track matched hadrons "<<
505// nChargedHadronsEtMeasured;
506// if(nChargedHadronsMeasured>0)cout<<" ("<<nChargedHadronsEtMeasured/nChargedHadronsMeasured<<") ";
507// cout<<" ET in all hadrons ";
508// cout<<nChargedHadronsEtTotal;
509// if(nChargedHadronsTotal>0) cout<<" ("<<nChargedHadronsEtTotal/nChargedHadronsTotal<<") ";
510// cout<<endl;
9a365626 511 fHistPIDProtonsTrackMatchedDepositedVsNch->Fill(etPIDProtons,multiplicity);
512 fHistPIDAntiProtonsTrackMatchedDepositedVsNch->Fill(etPIDAntiProtons,multiplicity);
0fcbed20 513 fHistPIDProtonsTrackMatchedDepositedVsNcl->Fill(etPIDProtons,fMultiplicity);
514 fHistPIDAntiProtonsTrackMatchedDepositedVsNcl->Fill(etPIDAntiProtons,fMultiplicity);
9a365626 515 fHistCentVsNchVsNclReco->Fill(cent,multiplicity,fMultiplicity);
516 fHistPiKPTrackMatchedDepositedVsNch->Fill(etPiKPMatched,multiplicity);
517 delete pID;
2fbf38ac 518 return 0;
519}
520
521bool AliAnalysisEtReconstructed::CheckGoodVertex(AliVParticle* track)
f61cec2f 522{ // check vertex
2fbf38ac 523
524 Float_t bxy = 999.;
525 Float_t bz = 999.;
e9da35da 526 if (!track) {
527 AliError("ERROR: no track");
528 return kFALSE;
ec956c46 529 }
1b8c3d66 530 AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
e9da35da 531 if (!esdTrack) {
532 AliError("ERROR: no track");
533 return kFALSE;
1b8c3d66 534 }
535 esdTrack->GetImpactParametersTPC(bxy,bz);
ec956c46 536
2fbf38ac 537
e9da35da 538 bool status = (TMath::Abs(track->Xv()) < fCuts->GetReconstructedVertexXCut()) &&
539 (TMath::Abs(track->Yv()) < fCuts->GetReconstructedVertexYCut()) &&
540 (TMath::Abs(track->Zv()) < fCuts->GetReconstructedVertexZCut()) &&
541 (TMath::Abs(bxy) < fCuts->GetReconstructedIPxyCut()) &&
542 (TMath::Abs(bz) < fCuts->GetReconstructedIPzCut());
2fbf38ac 543
4998becf 544 return status;
2fbf38ac 545}
546
547void AliAnalysisEtReconstructed::Init()
f61cec2f 548{ // Init
2fbf38ac 549 AliAnalysisEt::Init();
83d0f02c 550 fPidCut = fCuts->GetReconstructedPidCut();
ba136eb4 551 TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG));
e9da35da 552 if (!fCorrections) {
553 cout<<"Warning! You have not set corrections. Your code will crash. You have to set the corrections."<<endl;
0f97be4c 554 }
2fbf38ac 555}
556
557bool AliAnalysisEtReconstructed::TrackHitsCalorimeter(AliVParticle* track, Double_t magField)
f61cec2f 558{ // propagate track to detector radius
e9da35da 559 if (!track) {
560 cout<<"Warning: track empty"<<endl;
561 return kFALSE;
562 }
563 AliESDtrack *esdTrack= dynamic_cast<AliESDtrack*>(track);
564 if (!esdTrack) {
565 AliError("ERROR: no ESD track");
566 return kFALSE;
567 }
568 // Printf("Propagating track: eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
2fbf38ac 569
570 Bool_t prop = esdTrack->PropagateTo(fDetectorRadius, magField);
571
cf6522d1 572 // if (prop) Printf("Track propagated, eta: %f, phi: %f, pt: %f", esdTrack->Eta(), esdTrack->Phi(), esdTrack->Pt());
f61cec2f 573 return prop && fSelector->CutGeometricalAcceptance(*esdTrack);
2fbf38ac 574}
575
87efb15c 576void AliAnalysisEtReconstructed::FillOutputList(TList* list)
f61cec2f 577{ // add some extra histograms to the ones from base class
87efb15c 578 AliAnalysisEt::FillOutputList(list);
579
580 list->Add(fHistChargedPionEnergyDeposit);
581 list->Add(fHistProtonEnergyDeposit);
582 list->Add(fHistAntiProtonEnergyDeposit);
583 list->Add(fHistChargedKaonEnergyDeposit);
584 list->Add(fHistMuonEnergyDeposit);
e9da35da 585
586 list->Add(fHistRemovedEnergy);
43dd5a38 587 list->Add(fClusterPositionAccepted);
588 list->Add(fClusterPositionAll);
589 list->Add(fClusterPositionAcceptedEnergy);
590 list->Add(fClusterPositionAllEnergy);
53302bfe 591 list->Add(fClusterEnergy);
9a365626 592 list->Add(fClusterEnergyCent);
593 list->Add(fClusterEnergyCentMatched);
594 list->Add(fClusterEnergyCentNotMatched);
53302bfe 595 list->Add(fClusterEt);
f61cec2f 596
ef647350 597 list->Add(fHistChargedEnergyRemoved);
598 list->Add(fHistNeutralEnergyRemoved);
599 list->Add(fHistGammaEnergyAdded);
ac610b08 600 list->Add(fHistMatchedTracksEvspTvsCent);
601 list->Add(fHistMatchedTracksEvspTvsCentEffCorr);
459e9c44 602 list->Add(fHistMatchedTracksEvspTvsCentEffTMCorr);
5881f036 603 list->Add(fHistMatchedTracksEvspTvsCentEffTMCorr500MeV);
6a152780 604 list->Add(fHistFoundHadronsvsCent);
605 list->Add(fHistNotFoundHadronsvsCent);
606 list->Add(fHistFoundHadronsEtvsCent);
607 list->Add(fHistNotFoundHadronsEtvsCent);
43dd5a38 608 list->Add(fHistFoundHadronsvsCent500MeV);
609 list->Add(fHistNotFoundHadronsvsCent500MeV);
610 list->Add(fHistFoundHadronsEtvsCent500MeV);
611 list->Add(fHistNotFoundHadronsEtvsCent500MeV);
d3ce32b8 612 list->Add(fHistNominalRawEt);
613 list->Add(fHistNominalNonLinHighEt);
614 list->Add(fHistNominalNonLinLowEt);
615 list->Add(fHistNominalEffHighEt);
616 list->Add(fHistNominalEffLowEt);
43dd5a38 617 list->Add(fHistTotRawEtEffCorr);
618 list->Add(fHistTotRawEtEffCorr500MeV);
619 list->Add(fHistTotAllRawEtEffCorr);
3e9c52ca 620 list->Add(fHistTotRawEt);
43dd5a38 621 list->Add(fHistTotAllRawEt);
9a365626 622 list->Add(fHistNClustersPhosVsEmcal);
623 list->Add(fHistClusterSizeVsCent);
624 list->Add(fHistMatchedClusterSizeVsCent);
625 list->Add(fHistTotAllRawEtVsTotalPt);
626 list->Add(fHistTotAllRawEtVsTotalPtVsCent);
627 list->Add(fHistTotMatchedRawEtVsTotalPtVsCent);
628 list->Add(fHistPIDProtonsTrackMatchedDepositedVsNch);
629 list->Add(fHistPIDAntiProtonsTrackMatchedDepositedVsNch);
0fcbed20 630 list->Add(fHistPIDProtonsTrackMatchedDepositedVsNcl);
631 list->Add(fHistPIDAntiProtonsTrackMatchedDepositedVsNcl);
9a365626 632 list->Add(fHistPiKPTrackMatchedDepositedVsNch);
633 list->Add(fHistCentVsNchVsNclReco);
87efb15c 634}
635
636void AliAnalysisEtReconstructed::CreateHistograms()
f61cec2f 637{ // add some extra histograms to the ones from base class
87efb15c 638 AliAnalysisEt::CreateHistograms();
639
0fa8c632 640 Int_t nbinsEt = 1000;
641 Double_t minEt = 0;
642 Double_t maxEt = 10;
643
644 // possibly change histogram limits
53302bfe 645// if (fCuts) {
646// nbinsEt = fCuts->GetHistNbinsParticleEt();
647// minEt = fCuts->GetHistMinParticleEt();
648// maxEt = fCuts->GetHistMaxParticleEt();
649// }
0fa8c632 650
87efb15c 651 TString histname;
652 histname = "fHistChargedPionEnergyDeposit" + fHistogramNameSuffix;
0fa8c632 653 fHistChargedPionEnergyDeposit = new TH2F(histname.Data(), "Energy deposited by #pi^{+/-}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
87efb15c 654 fHistChargedPionEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
655 fHistChargedPionEnergyDeposit->SetYTitle("Energy of track");
e9da35da 656
87efb15c 657 histname = "fHistProtonEnergyDeposit" + fHistogramNameSuffix;
0fa8c632 658 fHistProtonEnergyDeposit = new TH2F(histname.Data(), "Energy deposited by protons", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
87efb15c 659 fHistProtonEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
660 fHistProtonEnergyDeposit->SetYTitle("Energy of track");
e9da35da 661
87efb15c 662 histname = "fHistAntiProtonEnergyDeposit" + fHistogramNameSuffix;
0fa8c632 663 fHistAntiProtonEnergyDeposit = new TH2F(histname.Data(), "Energy deposited by anti-protons", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
87efb15c 664 fHistAntiProtonEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
665 fHistAntiProtonEnergyDeposit->SetYTitle("Energy of track");
e9da35da 666
87efb15c 667 histname = "fHistChargedKaonEnergyDeposit" + fHistogramNameSuffix;
0fa8c632 668 fHistChargedKaonEnergyDeposit = new TH2F(histname.Data(), "Energy deposited by K^{+/-}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
87efb15c 669 fHistChargedKaonEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
670 fHistChargedKaonEnergyDeposit->SetYTitle("Energy of track");
e9da35da 671
87efb15c 672 histname = "fHistMuonEnergyDeposit" + fHistogramNameSuffix;
0fa8c632 673 fHistMuonEnergyDeposit = new TH2F(histname.Data(), "Energy deposited by #mu^{+/-}", nbinsEt, minEt, maxEt, nbinsEt, minEt, maxEt);
87efb15c 674 fHistMuonEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
675 fHistMuonEnergyDeposit->SetYTitle("Energy of track");
e9da35da 676
677 histname = "fHistRemovedEnergy" + fHistogramNameSuffix;
678 fHistRemovedEnergy = new TH1F(histname.Data(), histname.Data(), 1000, 0, 20);
679 //fHistMuonEnergyDeposit->SetXTitle("Energy deposited in calorimeter");
680 //fHistMuonEnergyDeposit->SetYTitle("Energy of track");
681
43dd5a38 682 histname = "fClusterPositionAccepted" + fHistogramNameSuffix;
683 fClusterPositionAccepted = new TH2D(histname.Data(), "Position of accepted neutral clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
684 fClusterPositionAccepted->SetXTitle("#phi");
685 fClusterPositionAccepted->SetYTitle("#eta");
686
687 histname = "fClusterPositionAll" + fHistogramNameSuffix;
688 fClusterPositionAll = new TH2D(histname.Data(), "Position of accepted neutral clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
689 fClusterPositionAll->SetXTitle("#phi");
690 fClusterPositionAll->SetYTitle("#eta");
691
692 histname = "fClusterPositionAcceptedEnergy" + fHistogramNameSuffix;
693 fClusterPositionAcceptedEnergy = new TH2D(histname.Data(), "Position of accepted neutral clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
694 fClusterPositionAcceptedEnergy->SetXTitle("#phi");
695 fClusterPositionAcceptedEnergy->SetYTitle("#eta");
696
697 histname = "fClusterPositionAllEnergy" + fHistogramNameSuffix;
698 fClusterPositionAllEnergy = new TH2D(histname.Data(), "Position of accepted neutral clusters",300, -TMath::Pi(),TMath::Pi(), 100, -0.7 , 0.7);
699 fClusterPositionAllEnergy->SetXTitle("#phi");
700 fClusterPositionAllEnergy->SetYTitle("#eta");
ef647350 701
53302bfe 702 histname = "fClusterEnergy" + fHistogramNameSuffix;
703 fClusterEnergy = new TH1F(histname.Data(), histname.Data(), 100, 0, 5);
9a365626 704 fClusterEnergy->SetYTitle("Number of clusters");
705 fClusterEnergy->SetXTitle("Energy of cluster");
706
707 histname = "fClusterEnergyCent" + fHistogramNameSuffix;
708 fClusterEnergyCent = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5);
709 fClusterEnergyCent->SetXTitle("Energy of cluster");
710 fClusterEnergyCent->SetYTitle("Centrality Bin");
711 fClusterEnergyCent->SetZTitle("Number of clusters");
712
713 histname = "fClusterEnergyCentMatched" + fHistogramNameSuffix;
714 fClusterEnergyCentMatched = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5);
715 fClusterEnergyCentMatched->SetXTitle("Energy of cluster");
716 fClusterEnergyCentMatched->SetYTitle("Centrality Bin");
717 fClusterEnergyCentMatched->SetZTitle("Number of Clusters");
718
719 histname = "fClusterEnergyCentNotMatched" + fHistogramNameSuffix;
720 fClusterEnergyCentNotMatched = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5);
721 fClusterEnergyCentNotMatched->SetXTitle("Energy of cluster");
722 fClusterEnergyCentNotMatched->SetYTitle("Centrality Bin");
723 fClusterEnergyCentNotMatched->SetZTitle("Number of clusters");
53302bfe 724
725 histname = "fClusterEt" + fHistogramNameSuffix;
726 fClusterEt = new TH1F(histname.Data(), histname.Data(), 100, 0, 5);
727 fClusterEt->SetXTitle("Number of clusters");
728 fClusterEt->SetYTitle("E_{T} of cluster");
ef647350 729
730 histname = "fHistChargedEnergyRemoved" + fHistogramNameSuffix;
731 fHistChargedEnergyRemoved = new TH2D(histname.Data(), histname.Data(), 1000, .0, 30, 100, -0.5 , 99.5);
732
733 histname = "fHistNeutralEnergyRemoved" + fHistogramNameSuffix;
734 fHistNeutralEnergyRemoved = new TH2D(histname.Data(), histname.Data(), 1000, .0, 30, 100, -0.5 , 99.5);
735
736 histname = "fHistGammaEnergyAdded" + fHistogramNameSuffix;
737 fHistGammaEnergyAdded = new TH2D(histname.Data(), histname.Data(), 1000, .0, 30, 100, -0.5 , 99.5);
e9da35da 738
5881f036 739 fHistMatchedTracksEvspTvsCent = new TH3F("fHistMatchedTracksEvspTvsCent", "fHistMatchedTracksEvspTvsCent",100, 0, 3,100,0,3,20,-0.5,19.5);
740 fHistMatchedTracksEvspTvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTvsCentEffCorr", "fHistMatchedTracksEvspTvsCentEffCorr",100, 0, 3,100,0,3,20,-0.5,19.5);
741 fHistMatchedTracksEvspTvsCentEffTMCorr = new TH3F("fHistMatchedTracksEvspTvsCentEffTMCorr", "fHistMatchedTracksEvspTvsCentEffTMCorr",100, 0, 3,100,0,3,20,-0.5,19.5);
742 fHistMatchedTracksEvspTvsCentEffTMCorr500MeV = new TH3F("fHistMatchedTracksEvspTvsCentEffTMCorr500MeV", "fHistMatchedTracksEvspTvsCentEffTMCorr500MeV",100, 0, 3,100,0,3,20,-0.5,19.5);
9a365626 743
744 float max = 200;
745 if(fHistogramNameSuffix.Contains("P")){max = 100;}
746 fHistFoundHadronsvsCent = new TH2F("fHistFoundHadronsvsCent","fHistFoundHadronsvsCent",100,0,max,20,-0.5,19.5);
747 fHistNotFoundHadronsvsCent = new TH2F("fHistNotFoundHadronsvsCent","fHistNotFoundHadronsvsCent",100,0,max,20,-0.5,19.5);
748 fHistFoundHadronsEtvsCent = new TH2F("fHistFoundHadronsEtvsCent","fHistFoundHadronsEtvsCent",100,0,max,20,-0.5,19.5);
749 fHistNotFoundHadronsEtvsCent = new TH2F("fHistNotFoundHadronsEtvsCent","fHistNotFoundHadronsEtvsCent",100,0,max,20,-0.5,19.5);
750 fHistFoundHadronsvsCent500MeV = new TH2F("fHistFoundHadronsvsCent500MeV","fHistFoundHadronsvsCent500MeV",100,0,max,20,-0.5,19.5);
751 fHistNotFoundHadronsvsCent500MeV = new TH2F("fHistNotFoundHadronsvsCent500MeV","fHistNotFoundHadronsvsCent500MeV",100,0,max,20,-0.5,19.5);
752 fHistFoundHadronsEtvsCent500MeV = new TH2F("fHistFoundHadronsEtvsCent500MeV","fHistFoundHadronsEtvsCent500MeV",100,0,max,20,-0.5,19.5);
753 fHistNotFoundHadronsEtvsCent500MeV = new TH2F("fHistNotFoundHadronsEtvsCent500MeV","fHistNotFoundHadronsEtvsCent500MeV",100,0,max,20,-0.5,19.5);
5881f036 754
43dd5a38 755 fHistTotRawEtEffCorr = new TH2F("fHistTotRawEtEffCorr","fHistTotRawEtEffCorr",250,0,250,20,-0.5,19.5);
5881f036 756 fHistTotRawEt = new TH2F("fHistTotRawEt","fHistTotRawEt",250,0,250,20,-0.5,19.5);
43dd5a38 757 fHistTotRawEtEffCorr500MeV = new TH2F("fHistTotRawEtEffCorr500MeV","fHistTotRawEtEffCorr500MeV",250,0,250,20,-0.5,19.5);
758 fHistTotAllRawEt = new TH2F("fHistTotAllRawEt","fHistTotAllRawEt",250,0,250,20,-0.5,19.5);
759 fHistTotAllRawEtEffCorr = new TH2F("fHistTotAllRawEtEffCorr","fHistTotAllRawEtEffCorr",250,0,250,20,-0.5,19.5);
9a365626 760 fHistNClustersPhosVsEmcal = new TH3F("fHistNClustersPhosVsEmcal","fHistNClustersPhosVsEmcal",50,0,50,250,0,250,20,-0.5,19);
761 fHistClusterSizeVsCent = new TH2F("fHistClusterSizeVsCent","fHistClusterSizeVsCent",10,0.5,10.5,20,-0.5,19.5);
762 fHistMatchedClusterSizeVsCent = new TH2F("fHistMatchedClusterSizeVsCent","fHistMatchedClusterSizeVsCent",10,0.5,10.5,20,-0.5,19.5);
763 fHistTotAllRawEtVsTotalPt = new TH2F("fHistTotAllRawEtVsTotalPt","fHistTotAllRawEtVsTotalPt",125,0,250,200,0,2000);
764 fHistTotAllRawEtVsTotalPtVsCent = new TH3F("fHistTotAllRawEtVsTotalPtVsCent","fHistTotAllRawEtVsTotalPtVsCent",125,0,250,200,0,2000,20,-0.5,19.5);
765 fHistTotMatchedRawEtVsTotalPtVsCent = new TH3F("fHistTotMatchedRawEtVsTotalPtVsCent","fHistTotMatchedRawEtVsTotalPtVsCent",250,0,250,100,0,200,20,-0.5,19.5);
d3ce32b8 766
3e9c52ca 767 maxEt = 500;
d3ce32b8 768 histname = "fHistNominalRawEt" + fHistogramNameSuffix;
769 fHistNominalRawEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5);
770 histname = "fHistNominalNonLinHighEt" + fHistogramNameSuffix;
771 fHistNominalNonLinHighEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5);
772 histname = "fHistNominalNonLinLowEt" + fHistogramNameSuffix;
773 fHistNominalNonLinLowEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5);
774 histname = "fHistNominalEffHighEt" + fHistogramNameSuffix;
775 fHistNominalEffHighEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5);
776 histname = "fHistNominalEffLowEt" + fHistogramNameSuffix;
777 fHistNominalEffLowEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5);
778
9a365626 779 Float_t maxEtRange = 25;
780 Float_t maxEtRangeHigh = 125;
781 Float_t minEtRange = 0;
782 Int_t nbinsMult = 100;
783 Float_t maxMult = 3000;
784 Float_t minMult = 0;
785 Int_t nbinsCl = 150;
786 Float_t maxCl = 300;
787 Float_t minCl = 0;
788 fHistPIDProtonsTrackMatchedDepositedVsNch = new TH2F("fHistPIDProtonsTrackMatchedDepositedVsNch","PID'd protons deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
789 fHistPIDAntiProtonsTrackMatchedDepositedVsNch = new TH2F("fHistPIDAntiProtonsTrackMatchedDepositedVsNch","PID'd #bar{p} E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult);
0fcbed20 790 fHistPIDProtonsTrackMatchedDepositedVsNcl = new TH2F("fHistPIDProtonsTrackMatchedDepositedVsNcl","PID'd protons deposited in calorimeter vs cluster multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsCl,minCl,maxCl);
791 fHistPIDAntiProtonsTrackMatchedDepositedVsNcl = new TH2F("fHistPIDAntiProtonsTrackMatchedDepositedVsNcl","PID'd #bar{p} E_{T} deposited in calorimeter vs cluster multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsCl,minCl,maxCl);
9a365626 792 fHistPiKPTrackMatchedDepositedVsNch = new TH2F("fHistPiKPTrackMatchedDepositedVsNch","PiKP track matched",nbinsEt,minEtRange,maxEtRangeHigh,nbinsMult,minMult,maxMult);
793 fHistCentVsNchVsNclReco = new TH3F("fHistCentVsNchVsNclReco","Cent bin vs Nch Vs NCl",20,-0.5,19.5,nbinsMult,minMult,maxMult,nbinsCl,minCl,maxCl);
d3ce32b8 794}
5881f036 795Double_t AliAnalysisEtReconstructed::ApplyModifiedCorrections(const AliESDCaloCluster& cluster,Int_t nonLinCorr, Int_t effCorr, Int_t cent)
d3ce32b8 796{
797 Float_t pos[3];
798 cluster.GetPosition(pos);
799 TVector3 cp(pos);
5881f036 800 Double_t corrEnergy = fReCorrections->CorrectedEnergy(cluster.E(),cent);
d3ce32b8 801
5881f036 802 Double_t factorNonLin = GetCorrectionModification(cluster, nonLinCorr,effCorr,cent);
d3ce32b8 803
43dd5a38 804 cout<<"Warning: This function should not get called!"<<endl;
d3ce32b8 805 //std::cout << "Original energy: " << cluster.E() << ", corrected energy: " << corrEnergy << std::endl;
806 return TMath::Sin(cp.Theta())*corrEnergy*factorNonLin;
807}
87efb15c 808
5881f036 809Double_t AliAnalysisEtReconstructed::GetCorrectionModification(const AliESDCaloCluster& cluster,Int_t nonLinCorr, Int_t effCorr, Int_t cent){//nonLinCorr 0 = nominal 1 = high -1 = low, effCorr 0 = nominal 1 = high -1 = low
d3ce32b8 810 if(nonLinCorr==0){
811 cout<<"Warning: This function should not get called!"<<endl;//this statement is basically here to avoid a compilation warning
812 }
813 if(effCorr==0){
814 cout<<"Warning: This function should not get called!"<<endl;//this statement is basically here to avoid a compilation warning
815 }
5881f036 816 return cluster.E()*cent;
2aab9269 817}