AliPhysics  abafffd (abafffd)
AliAnalysisTaskEA.cxx
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSE_H
2 
3 #include <Riostream.h>
4 #include <TROOT.h>
5 #include <TFile.h>
6 #include <TChain.h>
7 #include <TTree.h>
8 #include <TKey.h>
9 #include <TProfile.h>
10 #include <TProfile2D.h>
11 #include <TH1.h>
12 #include <TH1F.h>
13 #include <TF1.h>
14 #include <TH2F.h>
15 #include <TH1D.h>
16 #include <TH1I.h>
17 #include <TArrayF.h>
18 #include <TArrayD.h>
19 #include <THnSparse.h>
20 #include <TCanvas.h>
21 #include <TList.h>
22 #include <TClonesArray.h>
23 #include <TObject.h>
24 #include <TMath.h>
25 #include <TSystem.h>
26 #include <TInterpreter.h>
27 #include "AliAnalysisTask.h"
28 #include "AliCentrality.h"
29 #include "AliStack.h"
30 #include "AliESDEvent.h"
31 #include "AliESDInputHandler.h"
32 #include "AliAODEvent.h"
33 #include "AliAODHandler.h"
34 #include "AliAnalysisManager.h"
35 #include "AliAnalysisTaskSE.h"
37 #include "AliParticleContainer.h"
38 #include "AliInputEventHandler.h"
39 #include "AliEMCALGeometry.h"
40 #include "AliEMCALGeoParams.h"
41 #endif
42 
43 #include <time.h>
44 #include <TRandom3.h>
45 #include "AliGenEventHeader.h"
46 #include "AliGenPythiaEventHeader.h"
47 #include "AliGenHijingEventHeader.h"
48 #include "AliAODMCHeader.h"
49 #include "AliMCEvent.h"
50 #include "AliLog.h"
51 #include <AliEmcalJet.h>
52 #include <AliPicoTrack.h>
53 #include "AliVEventHandler.h"
54 #include "AliVParticle.h"
55 #include "AliAODMCParticle.h"
56 #include "AliAnalysisUtils.h"
57 #include "AliRhoParameter.h"
58 #include "TVector3.h"
59 #include "AliVVertex.h"
60 #include "AliExternalTrackParam.h"
61 
62 #include <stdio.h>
63 #include <stdlib.h>
64 #include <vector>
65 
66 #include "AliGenDPMjetEventHeader.h"
67 #include "AliJetContainer.h"
68 #include "AliAnalysisTaskEmcal.h"
70 #include "AliAnalysisTaskEA.h"
71 #include "AliHeader.h"
72 #include "AliRunLoader.h"
73 #include "AliVVZERO.h"
74 #include "AliAODZDC.h"
75 #include "AliVZDC.h"
76 #include "AliMultSelection.h"
77 
78 using namespace std;
79 
80 // ANALYSIS OF HIGH PT HADRON TRIGGER ASSOCIATED SPECTRUM OF RECOIL JETS IN P+PB
81 // Author Filip Krizek (7.Oct. 2015)
82 
83 ClassImp(AliAnalysisTaskEA)
84 //________________________________________________________________________________________
85 
88 fUseDefaultVertexCut(1),
89 fUsePileUpCut(1),
90 fMyTrackContainerName(""),
91 fMyParticleContainerName(""),
92 fMyJetContainerName(""),
93 fMyJetParticleContainerName(""),
94 fMyClusterContainerName(""),
95 fTrkContainerDetLevel(0x0),
96 fParticleContainerPartLevel(0x0),
97 fJetContainerDetLevel(0x0),
98 fJetContainerPartLevel(0x0),
99 fClusterContainerDetLevel(0x0),
100 fRhoTaskName(""),
101 fRhoTaskNameMC(""),
102 fCentralityTree(0x0),
103 fMultSelection(0x0),
104 fIsMinBiasTrig(1),
105 fIsEmcalTrig(0),
106 fCentralityV0A(-1),
107 fCentralityV0C(-1),
108 fCentralityCL1(-1),
109 fCentralityZNA(-1),
110 fCentralityZNC(-1),
111 fxVertex(-1),
112 fyVertex(-1),
113 fzVertex(-1),
114 fVertexer3d(1),
115 fNTracklets(-1),
116 fIsV0ATriggered(0),
117 fIsV0CTriggered(0),
118 fMultV0A(1),
119 fMultV0C(1),
120 fZEM1Energy(0),
121 fZEM2Energy(0),
122 fTrackEtaWindow(0.9),
123 fMinTrackPt(0.150),
124 fMC(0),
125 fHelperClass(0), fInitializedLocal(0),
126 fHistEvtSelection(0x0),
127 fhVertexZ(0x0),
128 fhTrackPhiIncl(0x0), fhTrackEtaIncl(0x0),
129 fhJetPhiIncl(0x0), fhJetEtaIncl(0x0),
130 fhClusterPhiInclMB(0x0), fhClusterEtaInclMB(0x0),
131 fhClusterPhiInclGA(0x0), fhClusterEtaInclGA(0x0),
132 fhRhoIncl(0x0),
133 fZVertexCut(10.0),
134 fnHadronTTBins(0),
135 fnJetChTTBins(0),
136 fnClusterTTBins(0),
137 fFillTTree(0),
138 fFiducialCellCut(0x0)
139 {
140  //default constructor
141 
142  for(Int_t i=0; i<2; i++) fNClusters[i] = 0;
143  for(Int_t i=0; i<8; i++) fRingMultV0[i] = 0;
144 
145  for(Int_t i=0; i<5; i++){
146  fZNCtower[i] = 0;
147  fZPCtower[i] = 0;
148  fZNAtower[i] = 0;
149  fZPAtower[i] = 0;
150  fZNCtowerLG[i] = 0;
151  fZPCtowerLG[i] = 0;
152  fZNAtowerLG[i] = 0;
153  fZPAtowerLG[i] = 0;
154  }
155 
156  for(Int_t i=0; i<fkTTbins; i++){
157  fHadronTT[i] = 0;
158  fJetChTT[i] = 0;
159  fClusterTT[i] = 0;
160 
161  fhMultTTHinMB[i] = 0x0;
162  fhMultTTJinMB[i] = 0x0;
163  fhMultTTCinMB[i] = 0x0;
164  fhMultTTCinGA[i] = 0x0;
165  }
166 
167  for(Int_t i=0; i<fkTTbins;i++){
168  fHadronTTLowPt[i]=-1;
169  fHadronTTHighPt[i]=-1;
170  fJetChTTLowPt[i]=-1;
171  fJetChTTHighPt[i]=-1;
172  fClusterTTLowPt[i]=-1;
173  fClusterTTHighPt[i]=-1;
174 
175  }
176 
177  for(Int_t iv=0; iv<fkVtx;iv++){
178  fhVertex[iv]=0x0;
179  for(Int_t i=0; i<fkTTbins;i++){
180  fhVertexTTH[iv][i]=0x0;
181  }
182  }
183 
184  for(Int_t ic=0; ic<fkCE;ic++){
185  fhCentralityMB[ic] = 0x0;
186  fhSignalMB[ic] = 0x0;
187 
188  for(Int_t i=0; i<fkTTbins;i++){
189  fhCentralityTTH[ic][i] = 0x0;
190  fhCentralityTTJ[ic][i] = 0x0;
191  fhCentralityTTCinMB[ic][i] = 0x0;
192  fhCentralityTTCinGA[ic][i] = 0x0;
193 
194  fhSignalTTH[ic][i] = 0x0;
195  fhSignalTTJ[ic][i] = 0x0;
196  fhSignalTTCinMB[ic][i] = 0x0;
197  fhSignalTTCinGA[ic][i] = 0x0;
198  }
199  }
200 
201  fFiducialCellCut = new AliEMCALRecoUtils();
202 
203  sprintf(fTrigClass,"%s","");
204 }
205 
206 //________________________________________________________________________
208 AliAnalysisTaskEmcalJet(name,kTRUE),
209 fUseDefaultVertexCut(1),
210 fUsePileUpCut(1),
211 fMyTrackContainerName(""),
212 fMyParticleContainerName(""),
213 fMyJetContainerName(""),
214 fMyJetParticleContainerName(""),
215 fMyClusterContainerName(""),
216 fTrkContainerDetLevel(0x0),
217 fParticleContainerPartLevel(0x0),
218 fJetContainerDetLevel(0x0),
219 fJetContainerPartLevel(0x0),
220 fClusterContainerDetLevel(0x0),
221 fRhoTaskName(""),
222 fRhoTaskNameMC(""),
223 fCentralityTree(0x0),
224 fMultSelection(0x0),
225 fIsMinBiasTrig(1),
226 fIsEmcalTrig(0),
227 fCentralityV0A(-1),
228 fCentralityV0C(-1),
229 fCentralityCL1(-1),
230 fCentralityZNA(-1),
231 fCentralityZNC(-1),
232 fxVertex(-1),
233 fyVertex(-1),
234 fzVertex(-1),
235 fVertexer3d(1),
236 fNTracklets(-1),
237 fIsV0ATriggered(0),
238 fIsV0CTriggered(0),
239 fMultV0A(1),
240 fMultV0C(1),
241 fZEM1Energy(0),
242 fZEM2Energy(0),
243 fTrackEtaWindow(0.9),
244 fMinTrackPt(0.150),
245 fMC(0),
246 fHelperClass(0), fInitializedLocal(0),
247 fHistEvtSelection(0x0),
248 fhVertexZ(0x0),
249 fhTrackPhiIncl(0x0), fhTrackEtaIncl(0x0),
250 fhJetPhiIncl(0x0), fhJetEtaIncl(0x0),
251 fhClusterPhiInclMB(0x0), fhClusterEtaInclMB(0x0),
252 fhClusterPhiInclGA(0x0), fhClusterEtaInclGA(0x0),
253 fhRhoIncl(0x0),
254 fZVertexCut(10.0),
255 fnHadronTTBins(0),
256 fnJetChTTBins(0),
257 fnClusterTTBins(0),
258 fFillTTree(0),
259 fFiducialCellCut(0x0)
260 {
261  //Constructor
262 
263  for(Int_t i=0; i<2; i++) fNClusters[i] = 0;
264  for(Int_t i=0; i<8; i++) fRingMultV0[i] = 0;
265 
266  for(Int_t i=0; i<5; i++){
267  fZNCtower[i] = 0;
268  fZPCtower[i] = 0;
269  fZNAtower[i] = 0;
270  fZPAtower[i] = 0;
271  fZNCtowerLG[i] = 0;
272  fZPCtowerLG[i] = 0;
273  fZNAtowerLG[i] = 0;
274  fZPAtowerLG[i] = 0;
275  }
276 
277  //arrays number of triggers
278  for(Int_t i=0; i<fkTTbins; i++){
279  fHadronTT[i] = 0;
280  fJetChTT[i] = 0;
281  fClusterTT[i] = 0;
282 
283  fhMultTTHinMB[i] = 0x0;
284  fhMultTTJinMB[i] = 0x0;
285  fhMultTTCinMB[i] = 0x0;
286  fhMultTTCinGA[i] = 0x0;
287  }
288 
289  for(Int_t i=0; i<fkTTbins;i++){
290  fHadronTTLowPt[i]=-1;
291  fHadronTTHighPt[i]=-1;
292  fJetChTTLowPt[i]=-1;
293  fJetChTTHighPt[i]=-1;
294  fClusterTTLowPt[i]=-1;
295  fClusterTTHighPt[i]=-1;
296  }
297 
298  for(Int_t iv=0; iv<fkVtx;iv++){
299  fhVertex[iv]=0x0;
300  for(Int_t i=0; i<fkTTbins;i++){
301  fhVertexTTH[iv][i]=0x0;
302  }
303  }
304 
305  for(Int_t ic=0; ic<fkCE;ic++){
306  fhCentralityMB[ic] = 0x0;
307  fhSignalMB[ic] = 0x0;
308 
309  for(Int_t i=0; i<fkTTbins;i++){
310  fhCentralityTTH[ic][i] = 0x0;
311  fhCentralityTTJ[ic][i] = 0x0;
312  fhCentralityTTCinMB[ic][i] = 0x0;
313  fhCentralityTTCinGA[ic][i] = 0x0;
314 
315  fhSignalTTH[ic][i] = 0x0;
316  fhSignalTTJ[ic][i] = 0x0;
317  fhSignalTTCinMB[ic][i] = 0x0;
318  fhSignalTTCinGA[ic][i] = 0x0;
319  }
320  }
321 
322 
323  sprintf(fTrigClass,"%s","");
324  //inclusive pT spectrum times the boost function
325 
327 
328  DefineOutput(1, TList::Class());
329 }
330 
337 //_____________________________________________________________________________________
339  const char* jetarrayname,
340  const char* jetarraynameMC,
341  const char* trackarrayname,
342  const char* mcpariclearrayname,
343  const char* clusterarrayname,
344  const char* rhoname,
345  const char* mcrhoname,
346  Double_t jetRadius,
347  UInt_t trigger,
348  Int_t isMC,
349  Double_t trackEtaWindow,
350  Bool_t useVertexCut,
351  Bool_t usePileUpCut,
352  Double_t acut,
353  const char* suffix
354 ){
355  // Get the pointer to the existing analysis manager via the static access method.
356  //==============================================================================
357 
358  Double_t jetEtaRange = TMath::Abs(trackEtaWindow - jetRadius);
359 
360 
361  // #### DEFINE MANAGER AND DATA CONTAINER NAMES
362  AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
363  if(!manager){
364  ::Error("AliAnalysisTaskEA.cxx", "No analysis manager to connect to.");
365  return NULL;
366  }
367 
368  //__________________________________________________________________________________
369  // #### DEFINE MY ANALYSIS TASK
370 
371  TString myContName("");
372  myContName = Form("JetAnalysisR%02d", TMath::Nint(jetRadius*10));
373  myContName.Append(suffix);
374 
375 
376  AliAnalysisTaskEA *task = new AliAnalysisTaskEA(myContName.Data());
377 
378  if(isMC){ //for PYTHIA
379  task->SetIsPythia(kTRUE); //NECESSARY IN ORDER TO FILL XSEC AND TRIALS
380  task->SetMakeGeneralHistograms(kTRUE); //NECESSARY IN ORDER TO FILL XSEC AND TRIALS
381  }
382 
383  //inspired by AliAnalysisTaskEmcalQGTagging
384  //_____________________________________________
385  //TRACK/PARTICLE CONTAINTERS
386  AliTrackContainer *trackCont = 0x0; //detector level track container
387  AliParticleContainer *trackContTrue = 0x0; //mc particle container
388  AliClusterContainer *clusterCont = 0x0; //detector level track container
389 
390  trackCont = task->AddTrackContainer(trackarrayname); //detector level tracks
391  trackCont->SetMinPt(0.15);
392  trackCont->SetEtaLimits(-trackEtaWindow, trackEtaWindow);
393 
394  if(isMC){
395  trackContTrue = task->AddMCParticleContainer(mcpariclearrayname); //particle level MC particles
396  trackContTrue->SetClassName("AliAODMCParticle");
397  trackContTrue->SetMinPt(0.15);
398  trackContTrue->SetEtaLimits(-trackEtaWindow,trackEtaWindow);
399  }
400 
401  clusterCont = task->AddClusterContainer(clusterarrayname); //detector level tracks
402  clusterCont->SetMinPt(0.3);
403  clusterCont->SetExoticCut(1);
404  clusterCont->SetClusTimeCut(0, 30e-9);
405 
406  // clusterCont->SetEtaLimits(-trackEtaWindow, trackEtaWindow);
407 
408  //_____________________________________________
409  //JET CONTAINERS
410  AliJetContainer *jetContRec = 0x0; //jet container with detector level tracks
411  AliJetContainer *jetContTrue = 0x0; //jet container with mc particles
412 
413  jetContRec = task->AddJetContainer(jetarrayname,"TPC",jetRadius);
414 
415  if(jetContRec) { //DETECTOR LEVEL JET
416  jetContRec->ConnectParticleContainer(trackCont);
417  jetContRec->SetPercAreaCut(acut);
418  jetContRec->SetMinPt(0.150);
419  jetContRec->SetMaxTrackPt(1000);
421  jetContRec->SetJetEtaLimits(-jetEtaRange,jetEtaRange);
422  }
423 
424  if(isMC){
425  //AKT JETS PARTICLE LEVEL
426  jetContTrue = task->AddJetContainer(jetarraynameMC,"TPC",jetRadius);
427  if(jetContTrue){
428  jetContTrue->ConnectParticleContainer(trackContTrue);
429  jetContTrue->SetPercAreaCut(acut);
430  jetContTrue->SetMinPt(0.15);
431  jetContTrue->SetMaxTrackPt(1000);
433  jetContTrue->SetJetEtaLimits(-jetEtaRange,jetEtaRange);
434  }
435  }
436 
437  // #### Task configuration
438  task->SetMC(isMC);
439  task->SetUsePileUpCut(usePileUpCut);
440  task->SetUseDefaultVertexCut(useVertexCut);
441  task->SetAcceptanceWindows(trackEtaWindow);
442  task->SelectCollisionCandidates(trigger);
443  task->SetExternalRhoTaskName(rhoname);
444  task->SetExternalRhoTaskNameMC(mcrhoname);
445  task->SetTrackContainerName(trackarrayname);
446 
447 
448  task->SetMCParticleContainerName(mcpariclearrayname);
449  task->SetClusterContainerName(clusterarrayname);
450  task->SetJetContainerName(jetarrayname);
451  task->SetMCJetContainerName(jetarraynameMC);
452  task->SetUseNewCentralityEstimation(kTRUE); //CENTRALITY
453 
454  task->SetDebugLevel(0); //No debug messages 0
455 
456  // output container
457  AliAnalysisDataContainer *contHistos = manager->CreateContainer(myContName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:ChJetSpectra%s", AliAnalysisManager::GetCommonFileName(), myContName.Data()));
458 
459 
460  // #### ADD ANALYSIS TASK
461  manager->AddTask(task);
462  manager->ConnectInput(task, 0, manager->GetCommonInputContainer());
463  manager->ConnectOutput(task, 1, contHistos);
464 
465  return task;
466 }
467 //_____________________________________________________________________________________
469 
470  TString trigger = fInputEvent->GetFiredTriggerClasses();
471  bool passedGammaTrigger = kFALSE;
472 
473  if(trigger.Contains("EG1") || trigger.Contains("EG2") || trigger.Contains("DG1") || trigger.Contains("DG2")){
474  passedGammaTrigger = kTRUE;
475  }
476  return passedGammaTrigger;
477 
478 }
479 //_____________________________________________________________________________________
481 
482  TString trigger = fInputEvent->GetFiredTriggerClasses();
483  bool passedTrigger = kFALSE;
484  if(trigger.Contains("INT7")){
485  passedTrigger = kTRUE;
486  }
487  return passedTrigger;
488 
489 }
490 
491 //_____________________________________________________________________________________
493 
494  // Get rho from event using CMS approach
495  AliRhoParameter* rho = NULL;
496  TString rhoname = (!isMC) ? fRhoTaskName : fRhoTaskNameMC;
497  if(!rhoname.IsNull()){
498  rho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(rhoname.Data()));
499  if (!rho) {
500  //AliWarningF(MSGWARNING("%s: Could not retrieve rho with name %s!"), GetName(), rhoname.Data());
501  return 0.;
502  }
503  }else{
504  //AliWarningF(MSGWARNING("No %s Rho task name provided"), (!isMC ? "DATA" : "MC"));
505  return 0.;
506  }
507 
508  return rho->GetVal();
509 }
510 //________________________________________________________________________
511 
513  //EVENT SELECTION RECONSTRUCTED DATA
514 
515 
516  if(!event) return kFALSE;
517 
518  //___________________________________________________
519  //TEST PILE UP
520  if(fUsePileUpCut){
521  if(!fHelperClass || fHelperClass->IsPileUpEvent(event)){
522  fHistEvtSelection->Fill(1.5); //count events rejected by pileup
523  return kFALSE;
524  }
525  }
526  //___________________________________________________
527  //VERTEX CUT
528 
530  if(!fHelperClass || !fHelperClass->IsVertexSelected2013pA(event)){ //??? USE THIS OR SOMETHING ELSE
531  fHistEvtSelection->Fill(2.5); //count events rejected by vertex cut
532  return kFALSE;
533  }
534  }else{
535  if(TMath::Abs(event->GetPrimaryVertex()->GetZ()) > fZVertexCut){
536  fHistEvtSelection->Fill(2.5); //count events rejected by vertex cut
537  return kFALSE;
538  }
539  }
540  //___________________________________________________
541  //AFTER VERTEX CUT
542  fhVertexZ->Fill(event->GetPrimaryVertex()->GetZ());
543 
544 
545  return kTRUE;
546 }
547 
548 //________________________________________________________________________
550  // Check if the track pt and eta range
551  if(!track) return kFALSE;
552 
553  if(isGen){ //particle level MC: select charged physical primary tracks
554  //Apply only for kine level or MC containers
555  if(!track->Charge()) return kFALSE;
556  if(fMC == kPartLevel){
557  if(!(static_cast<AliAODMCParticle*>(track))->IsPhysicalPrimary()) return kFALSE;
558  }
559  }
560  if(TMath::Abs(track->Eta()) < fTrackEtaWindow){ //APPLY TRACK ETA CUT
561  if(track->Pt() > fMinTrackPt){ //APPLY TRACK PT CUT
562  return kTRUE;
563  }
564  }
565  return kFALSE;
566 }
567 //________________________________________________________________________
569  // Initialization of jet containers done in AliAnalysisTaskEmcalJet::ExecOnce()
570  //Read arrays of jets and tracks
571  fInitializedLocal = kTRUE;
572 
573  // Initialize helper class (for vertex selection & pile up correction)
574  fHelperClass = new AliAnalysisUtils();
575  fHelperClass->SetCutOnZVertexSPD(kFALSE); // kFALSE: no cut; kTRUE: |zvtx-SPD - zvtx-TPC|<0.5cm
576 
577 
578  return;
579 }
580 
581 //________________________________________________________________________
583  //Distance o
584  Int_t max = 0;
585 
586  for(Int_t n=0; n<6; n++){
589  max = n;
590  }else{
591  break;
592  }
593  }
594 
595  return max;
596 }
597 
598 
599 //________________________________________________________________________
601 
602  //General QA.
603  if( cluster->GetNCells() < 1) return kFALSE;
604 
605  Int_t disToBad = cluster->GetDistanceToBadChannel();
606  if(-1<disToBad && disToBad<2) return kFALSE;
607 
608  Int_t disToBorder = GetMaxDistanceFromBorder(cluster);
609  if(-1<disToBorder && disToBorder<1) return kFALSE;
610 
611  Double_t lambda0 = cluster->GetM02(); //avoid merged clusters
612  if(lambda0 > 0.4) return kFALSE;
613 
614  return kTRUE;
615 }
616 
617 //________________________________________________________________________
619  // executed in each event
620  //called in AliAnalysisTaskEmcal::UserExec(Option_t *)
621  // Analyze the event and Fill histograms
622 
623  if(!InputEvent()){
624  AliError("??? Event pointer == 0 ???");
625  return kFALSE;
626  }
627 
628  //Execute only once: Get tracks, jets from arrays if not already given
630 
631 
632  //_________________________________________________________________
633  // EVENT SELECTION
634  fHistEvtSelection->Fill(0.5); //Count input event
635 
636  //Check Reconstructed event vertex and pileup
637  if(!IsEventInAcceptance(InputEvent())) return kFALSE; //post data is in UserExec
638 
639 
640  fIsMinBiasTrig = kFALSE; //Minimum bias event flag
641  if(PassedMinBiasTrigger()){
642  fIsMinBiasTrig = kTRUE;
643  fHistEvtSelection->Fill(3.5); //Count Accepted input event
644  }
645 
646  fIsEmcalTrig = kFALSE; //EMCAL triggered event flag
647  if(PassedGATrigger()){
648  fIsEmcalTrig = kTRUE;
649  fHistEvtSelection->Fill(4.5); //Count Accepted input event
650  }
651 
652 
653  if(!fIsEmcalTrig && !fIsMinBiasTrig) return kFALSE; //post data is in UserExec
654 
655 
656  // END EVENT SELECTION
657  //_________________________________________________________________
658  // EVENT PROPERTIES
659 
660  for(int ir=0; ir<8; ir++) fRingMultV0[ir]=0.;
661 
662  // ***** Trigger selection
663  TString triggerClass = InputEvent()->GetFiredTriggerClasses();
664  sprintf(fTrigClass,"%s",triggerClass.Data());
665 
666 
667  fMultSelection = (AliMultSelection*) InputEvent()->FindListObject("MultSelection");
668  if(fMultSelection){
669  fCentralityV0A = fMultSelection->GetMultiplicityPercentile("V0A");
670  fCentralityV0C = fMultSelection->GetMultiplicityPercentile("V0C");
671  fCentralityCL1 = fMultSelection->GetMultiplicityPercentile("CL1");
672  fCentralityZNA = fMultSelection->GetMultiplicityPercentile("ZNA");
673  fCentralityZNC = fMultSelection->GetMultiplicityPercentile("ZNC");
674  }else{
675  fCentralityV0A = -1;
676  fCentralityV0C = -1;
677  fCentralityCL1 = -1;
678  fCentralityZNA = -1;
679  fCentralityZNC = -1;
680  }
681 
682  const AliVVertex *vertex = InputEvent()->GetPrimaryVertexSPD();
683  if(vertex){
684  fxVertex = vertex->GetX();
685  fyVertex = vertex->GetY();
686  fzVertex = vertex->GetZ();
687  if(vertex->IsFromVertexer3D()) fVertexer3d = kTRUE;
688  else fVertexer3d = kFALSE;
689  }else{
690  fxVertex = 9999.;
691  fyVertex = 9999.;
692  fzVertex = 9999.;
693  fVertexer3d = kFALSE;
694  }
695 
696  const AliVMultiplicity *mult = InputEvent()->GetMultiplicity();
697  if(mult){
698  fNTracklets = mult->GetNumberOfTracklets();
699 
700  for(Int_t ilay=0; ilay<2; ilay++){
701  fNClusters[ilay] = mult->GetNumberOfITSClusters(ilay);
702  }
703  }else{
704  fNTracklets = -9999;
705  for(Int_t ilay=0; ilay<2; ilay++){
706  fNClusters[ilay] = -9999;
707  }
708  }
709 
710 
711 
712  AliVVZERO *vzeroAOD = InputEvent()->GetVZEROData();
713  if(vzeroAOD){
714  fMultV0A = vzeroAOD->GetMTotV0A();
715  fMultV0C = vzeroAOD->GetMTotV0C();
716  fIsV0ATriggered = vzeroAOD->GetV0ADecision();
717  fIsV0CTriggered = vzeroAOD->GetV0CDecision();
718 
719  for(Int_t iRing = 0; iRing < 8; ++iRing){
720  for(Int_t i = 0; i < 8; ++i){
721  fRingMultV0[iRing] += vzeroAOD->GetMultiplicity(8*iRing+i);
722  }
723  }
724  }else{
725  fMultV0A = -1;
726  fMultV0C = -1;
727  fIsV0ATriggered = kFALSE;
728  fIsV0CTriggered = kFALSE;
729 
730  for(Int_t iRing = 0; iRing < 8; ++iRing){
731  for(Int_t i = 0; i < 8; ++i){
732  fRingMultV0[iRing] += 0;
733  }
734  }
735  }
736 
737 
738  AliAODZDC *aodZDC =dynamic_cast<AliAODZDC*> (InputEvent()->GetZDCData());
739  if(aodZDC){
740 
741  fZEM1Energy = (Float_t) (aodZDC->GetZEM1Energy());
742  fZEM2Energy = (Float_t) (aodZDC->GetZEM2Energy());
743 
744  const Double_t* towZNC = aodZDC->GetZNCTowerEnergy();
745  const Double_t* towZPC = aodZDC->GetZPCTowerEnergy();
746  const Double_t* towZNA = aodZDC->GetZNATowerEnergy();
747  const Double_t* towZPA = aodZDC->GetZPATowerEnergy();
748  //
749  const Double_t* towZNCLG = aodZDC->GetZNCTowerEnergyLR();
750  const Double_t* towZPCLG = aodZDC->GetZPCTowerEnergyLR();
751  const Double_t* towZNALG = aodZDC->GetZNATowerEnergyLR();
752  const Double_t* towZPALG = aodZDC->GetZPATowerEnergyLR();
753  //
754  for(Int_t it=0; it<5; it++){
755  fZNCtower[it] = (Float_t) (towZNC[it]);
756  fZPCtower[it] = (Float_t) (towZPC[it]);
757  fZNAtower[it] = (Float_t) (towZNA[it]);
758  fZPAtower[it] = (Float_t) (towZPA[it]);
759  fZNCtowerLG[it] = (Float_t) (towZNCLG[it]);
760  fZPCtowerLG[it] = (Float_t) (towZPCLG[it]);
761  fZNAtowerLG[it] = (Float_t) (towZNALG[it]);
762  fZPAtowerLG[it] = (Float_t) (towZPALG[it]);
763  }
764  }else{
765  fZEM1Energy = -1;
766  fZEM2Energy = -1;
767  for(Int_t it=0; it<5; it++){
768  fZNCtower[it] = -1;
769  fZPCtower[it] = -1;
770  fZNAtower[it] = -1;
771  fZPAtower[it] = -1;
772  fZNCtowerLG[it] = -1;
773  fZPCtowerLG[it] = -1;
774  fZNAtowerLG[it] = -1;
775  fZPAtowerLG[it] = -1;
776  }
777  }
778 
779 
780 
781 
782 
783 
784  //_________________________________________________________________
785  // JET+TRACK CONTAINERS
786 
787  AliEmcalJet *jet = NULL; //jet pointer real jet
788  AliEmcalJet *jetMC = NULL; //jet pointer real jet
789  AliVParticle *track = NULL; //jet constituent
790 
791  //_________________________________________________________
792  //READ TRACK AND JET CONTAINERS
793  //Container operations http://alidoc.cern.ch/AliPhysics/master/READMEcontainers.html#emcalContainerIterateTechniques
794 
795  fTrkContainerDetLevel = static_cast<AliTrackContainer*> (GetTrackContainer(fMyTrackContainerName.Data())); //reconstructed particle container
796  fJetContainerDetLevel = static_cast<AliJetContainer*> (GetJetContainer(fMyJetContainerName.Data())); //AKT jet
797 
798 
799 
800  if(fMC){
801  fParticleContainerPartLevel = GetParticleContainer(fMyParticleContainerName.Data()); //reconstructed particle container
802  fJetContainerPartLevel = GetJetContainer(fMyJetParticleContainerName.Data()); //reconstructed particle container
803  }
804 
805  if(fIsMinBiasTrig){
806  fhVertex[0]->Fill(fxVertex);
807  fhVertex[1]->Fill(fyVertex);
808  fhVertex[2]->Fill(fzVertex);
809 
810 
811  fhCentralityMB[0]->Fill(fCentralityV0A);
812  fhCentralityMB[1]->Fill(fCentralityV0C);
813  fhCentralityMB[2]->Fill(fCentralityCL1);
814  fhCentralityMB[3]->Fill(fCentralityZNA);
815  fhCentralityMB[4]->Fill(fCentralityZNC);
816 
817  fhSignalMB[0]->Fill(fMultV0A);
818  fhSignalMB[1]->Fill(fMultV0C);
819  fhSignalMB[2]->Fill(fNTracklets);
820  fhSignalMB[3]->Fill(fZNAtower[0]);
821  fhSignalMB[4]->Fill(fZNCtower[0]);
822  }
823 
824 
825 
826  //_________________________________________________________
827  //LOOP OVER EMCAL CLUSTERS
828  TLorentzVector ph;
829  for(Int_t i=0; i<fnClusterTTBins; i++){
830  fClusterTT[i] = 0;
831  }
832 
833  if(fMyClusterContainerName.Data()){
835 
836 
837  for(auto cluster: fClusterContainerDetLevel->accepted()){
838 
840 
841  if(!FinalClusterCuts(cluster)) continue;
842 
843  if(fIsMinBiasTrig){
844  //fill some histograms for detector level tracks
845  fhClusterPhiInclMB->Fill(ph.Pt(), ph.Phi());
846  fhClusterEtaInclMB->Fill(ph.Pt(), ph.Eta());
847  }else if(fIsEmcalTrig){
848  fhClusterPhiInclGA->Fill(ph.Pt(), ph.Phi());
849  fhClusterEtaInclGA->Fill(ph.Pt(), ph.Eta());
850  }
851 
852  for(Int_t igg=0; igg<fnClusterTTBins; igg++){
853  if(fClusterTTLowPt[igg] < ph.Pt() && ph.Pt() < fClusterTTHighPt[igg]){
854  fClusterTT[igg]++; // there was a high pt
855  }
856  }
857  }
858 
859  if(fIsMinBiasTrig){
860  for(Int_t igg=0; igg<fnClusterTTBins; igg++){
861 
862  fhMultTTCinMB[igg]->Fill(fClusterTT[igg]);
863 
864  if(!fClusterTT[igg]) continue;
865 
871 
872  fhSignalTTCinMB[fkV0A][igg]->Fill(fMultV0A);
873  fhSignalTTCinMB[fkV0C][igg]->Fill(fMultV0C);
874  fhSignalTTCinMB[fkSPD][igg]->Fill(fNTracklets);
875  fhSignalTTCinMB[fkZNA][igg]->Fill(fZNAtower[0]);
876  fhSignalTTCinMB[fkZNC][igg]->Fill(fZNCtower[0]);
877  }
878  }else if(fIsEmcalTrig){
879 
880  for(Int_t igg=0; igg<fnClusterTTBins; igg++){
881 
882  fhMultTTCinGA[igg]->Fill(fClusterTT[igg]);
883 
884  if(!fClusterTT[igg]) continue;
885 
891 
892  fhSignalTTCinGA[fkV0A][igg]->Fill(fMultV0A);
893  fhSignalTTCinGA[fkV0C][igg]->Fill(fMultV0C);
894  fhSignalTTCinGA[fkSPD][igg]->Fill(fNTracklets);
895  fhSignalTTCinGA[fkZNA][igg]->Fill(fZNAtower[0]);
896  fhSignalTTCinGA[fkZNC][igg]->Fill(fZNCtower[0]);
897  }
898  }
899 
900  }
901 
902 
903 
904 
905 
906  //_________________________________________________________
907  //LOOP OVER TRACKS DETECTOR LEVEL + SEARCH FOR HIGH PT HADRON TRIGGER
908 
909  for(Int_t i=0; i<fnHadronTTBins; i++){
910  fHadronTT[i] = 0;
911  }
912 
913 
914  for(auto trackIterator : fTrkContainerDetLevel->accepted_momentum() ){
915  // trackIterator is a std::map of AliTLorentzVector and AliVTrack
916  track = trackIterator.second; // Get the full track
917 
918  if(IsTrackInAcceptance(track, kDetLevel)){
919 
920 
921  if(fIsMinBiasTrig){
922  //fill some histograms for detector level tracks
923  fhTrackPhiIncl->Fill(track->Pt(), track->Phi());
924  fhTrackEtaIncl->Fill(track->Pt(), track->Eta());
925  }
926 
927  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
928  if(fHadronTTLowPt[itt] < track->Pt() && track->Pt() < fHadronTTHighPt[itt]){
929  fHadronTT[itt]++; // there was a high pt
930  }
931  }
932  }
933  }
934 
935  if(fIsMinBiasTrig){
936  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
937 
938  fhMultTTHinMB[itt]->Fill(fHadronTT[itt]);
939 
940  if(!fHadronTT[itt]) continue;
941  fhVertexTTH[0][itt]->Fill(fxVertex);
942  fhVertexTTH[1][itt]->Fill(fyVertex);
943  fhVertexTTH[2][itt]->Fill(fzVertex);
944 
945 
946  fhCentralityTTH[fkV0A][itt]->Fill(fCentralityV0A);
947  fhCentralityTTH[fkV0C][itt]->Fill(fCentralityV0C);
948  fhCentralityTTH[fkSPD][itt]->Fill(fCentralityCL1);
949  fhCentralityTTH[fkZNA][itt]->Fill(fCentralityZNA);
950  fhCentralityTTH[fkZNC][itt]->Fill(fCentralityZNC);
951 
952  fhSignalTTH[fkV0A][itt]->Fill(fMultV0A);
953  fhSignalTTH[fkV0C][itt]->Fill(fMultV0C);
954  fhSignalTTH[fkSPD][itt]->Fill(fNTracklets);
955  fhSignalTTH[fkZNA][itt]->Fill(fZNAtower[0]);
956  fhSignalTTH[fkZNC][itt]->Fill(fZNCtower[0]);
957 
958  }
959  }
960 
961  //_________________________________________________________
962  //LOOP OVER JETS DETECTOR LEVEL
963 
964  for(Int_t i=0; i<fnJetChTTBins; i++){
965  fJetChTT[i] = 0;
966  }
967 
968  Double_t rho = GetExternalRho(kDetLevel); //estimated backround pt density
969 
970  if(fIsMinBiasTrig){
971  fhRhoIncl->Fill(rho);
972  }
973 
974  for(auto jetIterator : fJetContainerDetLevel->accepted_momentum() ){
975  // trackIterator is a std::map of AliTLorentzVector and AliVTrack
976  jet = jetIterator.second; // Get the pointer to jet object
977  if(!jet) continue;
978 
979  if(fIsMinBiasTrig){
980  //fill some histograms for detector level jets
981  fhJetPhiIncl->Fill(jet->Pt(), jet->Phi());
982  fhJetEtaIncl->Fill(jet->Pt(), jet->Eta());
983  }
984 
985  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
986  if(fJetChTTLowPt[ijj] < jet->Pt() && jet->Pt() < fJetChTTHighPt[ijj]){
987  fJetChTT[ijj]++; // there was a high pt
988  }
989  }
990 
991  //loop over jet constituents
992  //for(Int_t iq=0; iq < jet->GetNumberOfTracks(); iq++) {
993  // track = (AliVParticle*) (jet->TrackAt(iq, fTrkContainerDetLevel->GetArray()));
994  //here one can e.g. analyze jet shapes
995 
996  //}
997 
998 
999  //you can also find the closest particle level jet to given detector level
1000  //the mateching betwe particle and detector level jets is done in Tagger task
1001  //if(fMC){
1002  // jetMC = jet->ClosestJet();
1003  //}
1004  }
1005 
1006  if(fIsMinBiasTrig){
1007  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
1008 
1009  fhMultTTJinMB[ijj]->Fill(fJetChTT[ijj]);
1010 
1011  if(!fJetChTT[ijj]) continue;
1012 
1013  fhCentralityTTJ[fkV0A][ijj]->Fill(fCentralityV0A);
1014  fhCentralityTTJ[fkV0C][ijj]->Fill(fCentralityV0C);
1015  fhCentralityTTJ[fkSPD][ijj]->Fill(fCentralityCL1);
1016  fhCentralityTTJ[fkZNA][ijj]->Fill(fCentralityZNA);
1017  fhCentralityTTJ[fkZNC][ijj]->Fill(fCentralityZNC);
1018 
1019 
1020  fhSignalTTJ[fkV0A][ijj]->Fill(fMultV0A);
1021  fhSignalTTJ[fkV0C][ijj]->Fill(fMultV0C);
1022  fhSignalTTJ[fkSPD][ijj]->Fill(fNTracklets);
1023  fhSignalTTJ[fkZNA][ijj]->Fill(fZNAtower[0]);
1024  fhSignalTTJ[fkZNC][ijj]->Fill(fZNCtower[0]);
1025 
1026  }
1027  }
1028 
1029 
1030  //___________________________________________________________
1031 //
1032 // if(fMC){
1033 //
1034 // //_________________________________________________________
1035 // //LOOP OVER PARTICLE LEVEL
1036 //
1037 // for(auto trackIterator : fParticleContainerPartLevel->accepted_momentum() ){
1038 // // trackIterator is a std::map of AliTLorentzVector and AliVTrack
1039 // track = trackIterator.second; // Get the full track
1040 //
1041 // if(IsTrackInAcceptance(track, kPartLevel)){
1042 // //here fill some histograms for particle level particles
1043 //
1044 // }
1045 // }
1046 //
1047 // //_________________________________________________________
1048 // //LOOP OVER JETS PARTICLE LEVEL
1049 //
1050 //
1051 // Double_t rhoMC = GetExternalRho(kPartLevel); //estimated backround pt density
1052 //
1053 // for(auto jetIterator : fJetContainerPartLevel->accepted_momentum() ){
1054 // // trackIterator is a std::map of AliTLorentzVector and AliVTrack
1055 // jet = jetIterator.second; // Get the pointer to jet object
1056 //
1057 // //fill some histograms for detector level jets
1058 // fhJetPhiIncl->Fill(jet->Pt(), jet->Phi());
1059 // fhJetEtaIncl->Fill(jet->Pt(), jet->Eta());
1060 //
1061 // //loop over jet constituents at particle level
1062 // for(Int_t iq=0; iq < jet->GetNumberOfTracks(); iq++) {
1063 // track = (AliVParticle*) (jet->TrackAt(iq, fParticleContainerPartLevel->GetArray()));
1064 // //here one can e.g. analyze jet shapes
1065 //
1066 // }
1067 //
1068 // }
1069 //
1070 // }
1071 
1072  if(fFillTTree){
1073  fCentralityTree->Fill();
1074  }
1075 
1076 
1077  return kTRUE;
1078 }
1079 
1080 //________________________________________________________________________
1082  //Treminate
1083  PostData(1, fOutput);
1084 
1085  // Mandatory
1086  fOutput = dynamic_cast<AliEmcalList*> (GetOutputData(1)); // '1' refers to the output slot
1087  if(!fOutput) {
1088  printf("ERROR: Output list not available\n");
1089  return;
1090  }
1091 }
1092 
1093 //________________________________________________________________________
1095  // Destructor. Clean-up the output list, but not the histograms that are put inside
1096  // (the list is owner and will clean-up these histograms). Protect in PROOF case.
1097  if(fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
1098  delete fOutput;
1099  }
1100  delete fHelperClass;
1101 
1102 }
1103 //________________________________________________________________________
1105  // called once to create user defined output objects like histograms, plots etc.
1106  // and to put it on the output list.
1107  // Note: Saving to file with e.g. OpenFile(0) is must be before creating other objects.
1108  //fOutput TList defined in the mother class
1110 
1111  Bool_t oldStatus = TH1::AddDirectoryStatus();
1112  TH1::AddDirectory(kFALSE);
1113  TString name, object;
1114 
1115 
1116  //__________________________________________________________
1117  // Event statistics
1118  fHistEvtSelection = new TH1I("fHistEvtSelection", "event selection", 5, 0, 5);
1119  fHistEvtSelection->GetXaxis()->SetBinLabel(1,"events IN");
1120  fHistEvtSelection->GetXaxis()->SetBinLabel(2,"pile up (rejected)");
1121  fHistEvtSelection->GetXaxis()->SetBinLabel(3,"vertex cut (rejected)");
1122  fHistEvtSelection->GetXaxis()->SetBinLabel(4,"MB");
1123  fHistEvtSelection->GetXaxis()->SetBinLabel(5,"EMCAL");
1124 
1125 
1126  fOutput->Add(fHistEvtSelection);
1127 
1128 
1129  //_______________________________________________________________________
1130  //inclusive azimuthal and pseudorapidity histograms
1131 
1132  fhVertexZ = new TH1F("fhVertexZ","z vertex",40,-20,20);
1133  fOutput->Add(fhVertexZ);
1134 
1135  //-------------------------
1136 
1137  fhTrackEtaIncl = new TH2F("fhTrackEtaIncl","Eta dist inclusive track vs pT", 50,0, 100, 40,-0.9,0.9);
1138  fOutput->Add((TH2F*) fhTrackEtaIncl);
1139 
1140  fhTrackPhiIncl = new TH2F("fhTrackPhiIncl","Azim dist tracks vs pT", 50, 0, 100, 50,0,2*TMath::Pi());
1141  fOutput->Add((TH2F*) fhTrackPhiIncl);
1142 
1143  fhJetEtaIncl = new TH2F("fhJetEtaIncl","Eta dist inclusive jets vs pTjet", 150, -20, 130, 40,-0.9,0.9);
1144  fOutput->Add((TH2F*) fhJetEtaIncl);
1145 
1146  fhJetPhiIncl = new TH2F("fhJetPhiIncl","Azim dist jets vs pTjet", 60, -20, 100, 50,0,2*TMath::Pi());
1147  fOutput->Add((TH2F*) fhJetPhiIncl);
1148 
1149  fhClusterEtaInclMB = new TH2F("fhClusterEtaInclMB","Eta dist inclusive clusters vs pT", 100, 0, 100, 40,-0.9,0.9);
1150  fOutput->Add((TH2F*) fhClusterEtaInclMB);
1151 
1152  fhClusterPhiInclMB = new TH2F("fhClusterPhiInclMB","Azim dist clusters vs pT", 50, 0, 100, 50,0,2*TMath::Pi());
1153  fOutput->Add((TH2F*) fhClusterPhiInclMB);
1154 
1155  fhClusterEtaInclGA = new TH2F("fhClusterEtaInclGA","Eta dist inclusive clusters vs pT", 100, 0, 100, 40,-0.9,0.9);
1156  fOutput->Add((TH2F*) fhClusterEtaInclGA);
1157 
1158  fhClusterPhiInclGA = new TH2F("fhClusterPhiInclGA","Azim dist clusters vs pT", 50, 0, 100, 50,0,2*TMath::Pi());
1159  fOutput->Add((TH2F*) fhClusterPhiInclGA);
1160 
1161 
1162 
1163  fhRhoIncl = new TH1F("hRho","Rho",1000,0,100);
1164  fOutput->Add((TH1F*) fhRhoIncl);
1165 
1166 
1167  for(Int_t iv=0; iv<fkVtx;iv++){
1168  if(iv==0) fhVertex[iv] = new TH1D("hVertexX","VertexX",100,-1,1);
1169  else if(iv==1) fhVertex[iv] = new TH1D("hVertexY","VertexY",100,-1,1);
1170  else fhVertex[iv] = new TH1D("hVertexZ","VertexZ",400,-20,20);
1171  fOutput->Add((TH1D*) fhVertex[iv]);
1172  }
1173 
1174  for(Int_t iv=0; iv<fkVtx;iv++){
1175  for(Int_t itt=0; itt<fnHadronTTBins;itt++){
1176  name = Form("%s_TTH%d_%d", fhVertex[iv]->GetName(), fHadronTTLowPt[itt],fHadronTTHighPt[itt]);
1177  fhVertexTTH[iv][itt] = (TH1D*) fhVertex[iv]->Clone(name.Data());
1178  fOutput->Add((TH1D*) fhVertexTTH[iv][itt]);
1179  }
1180  }
1181 
1182 
1183  TString cest[fkCE] = {"V0A", "V0C", "SPD", "ZNA", "ZNC"}; //centrality estimators
1184 
1185  for(Int_t ic=0; ic<fkCE;ic++){
1186  name = Form("hCentrality_MB_%s",cest[ic].Data());
1187  fhCentralityMB[ic] = new TH1D(name.Data(), name.Data(),101,0,101);
1188  fOutput->Add((TH1D*) fhCentralityMB[ic]);
1189  }
1190 
1191  for(Int_t ic=0; ic<fkCE;ic++){
1192  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
1193  name = Form("hCentrality_MB_%s_TTH%d_%d",cest[ic].Data(), fHadronTTLowPt[itt],fHadronTTHighPt[itt]);
1194  fhCentralityTTH[ic][itt] = new TH1D(name.Data(), name.Data(),101,0,101);
1195  fOutput->Add((TH1D*) fhCentralityTTH[ic][itt]);
1196  }
1197  }
1198 
1199  for(Int_t ic=0; ic<fkCE;ic++){
1200  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
1201  name = Form("hCentrality_MB_%s_TTJ%d_%d", cest[ic].Data(), fJetChTTLowPt[ijj],fJetChTTHighPt[ijj]);
1202  fhCentralityTTJ[ic][ijj] = new TH1D(name.Data(), name.Data(),101,0,101);
1203  fOutput->Add((TH1D*) fhCentralityTTJ[ic][ijj]);
1204  }
1205  }
1206 
1207  for(Int_t ic=0; ic<fkCE;ic++){
1208  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1209  name = Form("hCentrality_MB_%s_TTC%d_%d", cest[ic].Data(), fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1210  fhCentralityTTCinMB[ic][ijj] = new TH1D(name.Data(), name.Data(),101,0,101);
1211  fOutput->Add((TH1D*) fhCentralityTTCinMB[ic][ijj]);
1212  }
1213  }
1214 
1215  for(Int_t ic=0; ic<fkCE;ic++){
1216  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1217  name = Form("hCentrality_GA_%s_TTC%d_%d", cest[ic].Data(), fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1218  fhCentralityTTCinGA[ic][ijj] = new TH1D(name.Data(), name.Data(),101,0,101);
1219  fOutput->Add((TH1D*) fhCentralityTTCinGA[ic][ijj]);
1220  }
1221  }
1222 
1223 
1224  TString signal[]={"multV0A", "multV0C", "nTracklets", "znatower0", "znctower0"};
1225  Float_t signalL[]={0,0,0,0,0};
1226  Float_t signalH[]={1000,1000,500,30000,30000};
1227  Int_t signalN[]={100,100,100,100,100};
1228 
1229  for(Int_t ic=0; ic<fkCE;ic++){
1230  name = Form("hSignal_MB_%s", cest[ic].Data());
1231  fhSignalMB[ic] = new TH1D(name.Data(), name.Data(), signalN[ic], signalL[ic], signalH[ic]);
1232  fOutput->Add((TH1D*) fhSignalMB[ic]);
1233  }
1234 
1235 
1236  for(Int_t ic=0; ic<fkCE;ic++){
1237  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
1238  name = Form("hSignal_MB_%s_TTH%d_%d", cest[ic].Data(), fHadronTTLowPt[itt],fHadronTTHighPt[itt]);
1239  fhSignalTTH[ic][itt] = new TH1D(name.Data(),name.Data(),signalN[ic], signalL[ic], signalH[ic]);
1240  fOutput->Add((TH1D*) fhSignalTTH[ic][itt]);
1241  }
1242  }
1243 
1244  for(Int_t ic=0; ic<fkCE;ic++){
1245  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
1246  name = Form("hSignal_MB_%s_TTJ%d_%d", cest[ic].Data(), fJetChTTLowPt[ijj],fJetChTTHighPt[ijj]);
1247  fhSignalTTJ[ic][ijj] = new TH1D(name.Data(),name.Data(),signalN[ic], signalL[ic], signalH[ic]);
1248  fOutput->Add((TH1D*) fhSignalTTJ[ic][ijj]);
1249  }
1250  }
1251 
1252  for(Int_t ic=0; ic<fkCE;ic++){
1253  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1254  name = Form("hSignal_MB_%s_TTC%d_%d", cest[ic].Data(), fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1255  fhSignalTTCinMB[ic][ijj] = new TH1D(name.Data(),name.Data(),signalN[ic], signalL[ic], signalH[ic]);
1256  fOutput->Add((TH1D*) fhSignalTTCinMB[ic][ijj]);
1257  }
1258  }
1259 
1260  for(Int_t ic=0; ic<fkCE;ic++){
1261  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1262  name = Form("hSignal_GA_%s_TTC%d_%d", cest[ic].Data(), fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1263  fhSignalTTCinGA[ic][ijj] = new TH1D(name.Data(),name.Data(),signalN[ic], signalL[ic], signalH[ic]);
1264  fOutput->Add((TH1D*) fhSignalTTCinGA[ic][ijj]);
1265  }
1266  }
1267 
1268 
1269 
1270 
1271  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
1272  name = Form("hMultTTHinMB_TTH%d_%d", fHadronTTLowPt[itt],fHadronTTHighPt[itt]);
1273  fhMultTTHinMB[itt] = new TH1D(name.Data(),name.Data(),100,0,100);
1274  fOutput->Add((TH1D*) fhMultTTHinMB[itt]);
1275  }
1276 
1277  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
1278  name = Form("hMultTTJinMB_TTJ%d_%d", fJetChTTLowPt[ijj],fJetChTTHighPt[ijj]);
1279  fhMultTTJinMB[ijj] = new TH1D(name.Data(),name.Data(),100,0,100);
1280  fOutput->Add((TH1D*) fhMultTTJinMB[ijj]);
1281  }
1282 
1283  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1284  name = Form("hMultTTCinMB_TTC%d_%d", fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1285  fhMultTTCinMB[ijj] = new TH1D(name.Data(),name.Data(),100,0,100);
1286  fOutput->Add((TH1D*) fhMultTTCinMB[ijj]);
1287  }
1288 
1289  for(Int_t ijj=0; ijj<fnClusterTTBins; ijj++){
1290  name = Form("hMultTTCinGA_TTC%d_%d", fClusterTTLowPt[ijj],fClusterTTHighPt[ijj]);
1291  fhMultTTCinGA[ijj] = new TH1D(name.Data(),name.Data(),100,0,100);
1292  fOutput->Add((TH1D*) fhMultTTCinGA[ijj]);
1293  }
1294 
1295 
1296 
1297  // OUTPUT TREE
1298  if(fFillTTree){
1299  fCentralityTree = new TTree("fCentralityTree", "Centrality vs. multiplicity tree");
1300  //
1301  fCentralityTree->Branch("trigClass",fTrigClass,"trigClass/C");
1302  fCentralityTree->Branch("xVertex", &fxVertex,"xVertex/D");
1303  fCentralityTree->Branch("yVertex", &fyVertex,"yVertex/D");
1304  fCentralityTree->Branch("zVertex", &fzVertex,"zVertex/D");
1305  fCentralityTree->Branch("vertexer3d", &fVertexer3d,"vertexer3d/O");
1306  fCentralityTree->Branch("nTracklets", &fNTracklets,"nTracklets/I");
1307  fCentralityTree->Branch("nClusters", fNClusters,"nClusters[2]/I");
1308  //
1309  fCentralityTree->Branch("isV0ATriggered", &fIsV0ATriggered,"isV0ATriggered/I");
1310  fCentralityTree->Branch("isV0CTriggered", &fIsV0CTriggered,"isV0CTriggered/I");
1311  fCentralityTree->Branch("multV0A", &fMultV0A,"multV0A/F");
1312  fCentralityTree->Branch("multV0C", &fMultV0C,"multV0C/F");
1313  fCentralityTree->Branch("ringmultV0", fRingMultV0,"ringmultV0[8]/F");
1314 
1315  fCentralityTree->Branch("znctower", fZNCtower, "znctower[5]/F");
1316  fCentralityTree->Branch("zpctower", fZPCtower, "zpctower[5]/F");
1317  fCentralityTree->Branch("znatower", fZNAtower, "znatower[5]/F");
1318  fCentralityTree->Branch("zpatower", fZPAtower, "zpatower[5]/F");
1319  fCentralityTree->Branch("znctowerLG", fZNCtowerLG, "znctowerLG[5]/F");
1320  fCentralityTree->Branch("zpctowerLG", fZPCtowerLG, "zpctowerLG[5]/F");
1321  fCentralityTree->Branch("znatowerLG", fZNAtowerLG, "znatowerLG[5]/F");
1322  fCentralityTree->Branch("zpatowerLG", fZPAtowerLG, "zpatowerLG[5]/F");
1323 
1324  //fCentralityTree->Branch("tdc", fTDCvalues, "tdc[32][4]/I");
1325  //fCentralityTree->Branch("tdcSum", &fTDCSum, "tdcSum/F");
1326  //fCentralityTree->Branch("tdcDiff", &fTDCDiff, "tdcDiff/F");
1327 
1328  fCentralityTree->Branch("centrV0Amult", &fCentralityV0A, "centrV0Amult/F");
1329  fCentralityTree->Branch("centrV0Cmult", &fCentralityV0C, "centrV0Cmult/F");
1330  fCentralityTree->Branch("centrSPDclu1", &fCentralityCL1, "centrSPDclu1/F");
1331  fCentralityTree->Branch("centrZNA", &fCentralityZNA, "centrZNA/F");
1332  fCentralityTree->Branch("centrZNC", &fCentralityZNC, "centrZNC/F");
1333 
1334  for(Int_t itt=0; itt<fnHadronTTBins; itt++){
1335  name = Form("hadronTTbin_%d_%d",fHadronTTLowPt[itt],fHadronTTHighPt[itt]);
1336  object = name;
1337  object.Append("/I"); //Number of tracks in given bin
1338 
1339  fCentralityTree->Branch(name.Data(), &(fHadronTT[itt]), object.Data());
1340  }
1341 
1342  for(Int_t ijj=0; ijj<fnJetChTTBins; ijj++){
1343  name = Form("jetchTTbin_%d_%d",fJetChTTLowPt[ijj],fJetChTTHighPt[ijj]);
1344  object = name;
1345  object.Append("/I"); //Number of jets in given bin
1346 
1347  fCentralityTree->Branch(name.Data(), &(fJetChTT[ijj]), object.Data());
1348  }
1349 
1350  fOutput->Add(fCentralityTree);
1351  }
1352 
1353 
1354 
1355  // =========== Switch on Sumw2 for all histos ===========
1356  for(Int_t i=0; i<fOutput->GetEntries(); i++){
1357  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
1358  if(h1){
1359  h1->Sumw2();
1360  continue;
1361  }
1362  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
1363  if(hn){
1364  hn->Sumw2();
1365  }
1366  }
1367  TH1::AddDirectory(oldStatus);
1368 
1369 
1370  PostData(1, fOutput);
1371 }
1372 //________________________________________________________________________
1374  //
1375  // retrieve event objects
1376  //
1377  if(!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) return kFALSE;
1378 
1379  return kTRUE;
1380 }
1381 //________________________________________________________________________
1383  // Run analysis code here, if needed. It will be executed before FillHistograms().
1384 
1385  if(!fCaloCells){
1386  if(fCaloCellsName.IsNull()){
1387  fCaloCells = InputEvent()->GetEMCALCells();
1388  }else{
1389  fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCaloCellsName));
1390  if(!fCaloCells) AliError(Form("%s: Could not retrieve cells %s!", GetName(), fCaloCellsName.Data()));
1391  }
1392  cout<<"load calo cells"<<endl;
1393  }
1394 
1395 
1396 
1397  return kTRUE;
1398 }
1399 
1400 //________________________________________________________________________
1401 
AliAnalysisUtils * fHelperClass
AliClusterContainer * fClusterContainerDetLevel
particle level jet container
TH1D * fhMultTTHinMB[fkTTbins]
distributions of centrality estimators biased with cluster TT in Gamma trigger
Bool_t FillHistograms()
Function filling histograms.
Float_t fCentralityZNC
Centrality from ZNA.
Bool_t fVertexer3d
Z vertex from ITS.
TH2F * fhClusterEtaInclMB
minimum bias phi inclusive cluster
TH2F * fhTrackEtaIncl
minimum bias phi inclusive ch hadron
Int_t fJetChTTHighPt[fkTTbins]
double Double_t
Definition: External.C:58
Bool_t CheckCellFiducialRegion(const AliEMCALGeometry *geom, const AliVCluster *cluster, AliVCaloCells *cells)
Definition: External.C:236
AliJetContainer * GetJetContainer(Int_t i=0) const
void SetNumberOfCellsFromEMCALBorder(Int_t n)
Double_t Eta() const
Definition: AliEmcalJet.h:121
void SetMCParticleContainerName(const char *name)
Int_t fNClusters[2]
no. tracklets
Double_t Phi() const
Definition: AliEmcalJet.h:117
Float_t fZPCtowerLG[5]
ZNC 5 tower signals.
Float_t fCentralityV0C
Centrality from V0A.
Container with name, TClonesArray and cuts for particles.
void SetExternalRhoTaskNameMC(const char *name)
TString fMyParticleContainerName
Float_t fZNCtower[5]
ZEM2 Energy.
Bool_t fIsEmcalTrig
triggered by Min Bias Trig
TH2F * fhTrackPhiIncl
gc vertexZ inclusive
void SetExternalRhoTaskName(const char *name)
static AliAnalysisTaskEA * AddTaskEA(const char *jetarrayname="Jet_AKTChargedR040_tracks_pT0150_pt_scheme", const char *jetarraynameMC="Jet_AKTChargedR040_mcparticles_pT0150_pt_scheme", const char *trackarrayname="tracks", const char *mcpariclearrayname="mcparticles", const char *clusterarrayname="caloClusters", const char *rhoname="", const char *mcrhoname="", Double_t jetRadius=0.4, UInt_t trigger=AliVEvent::kAny, Int_t isMC=0, Double_t trackEtaWindow=0.9, Bool_t useVertexCut=kTRUE, Bool_t usePileUpCut=kTRUE, Double_t acut=0.6, const char *suffix="")
TH1I * fHistEvtSelection
trigger if tracks/jets are loaded initiates calling ExecOnce
void SetUseNewCentralityEstimation(Bool_t b)
void SetAcceptanceWindows(Double_t trackEta)
TH1F * fhVertexZ
gc event statistics
TH1D * fhCentralityTTH[fkCE][fkTTbins]
estimated centrality based on mult V0, mult VC, tracklets, znatower0, znctower0
Full acceptance, i.e. no acceptance cut applied – left to user.
Definition: AliEmcalJet.h:77
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
void SetPercAreaCut(Float_t p)
TH1D * fhMultTTCinGA[fkTTbins]
multiplicity of cluster TT in MB event
Float_t fMultV0A
V0C decision.
TH2F * fhJetEtaIncl
minimum bias phi inclusive ch jet
Int_t fJetChTT[fkTTbins]
array which stores the number of triggers in given event
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
Some utilities for cluster and cell treatment.
Int_t fHadronTTHighPt[fkTTbins]
Container for particles within the EMCAL framework.
Float_t fZPAtower[5]
ZNA 5 tower signals.
Float_t fMultV0C
mult. V0A
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Int_t fClusterTTHighPt[fkTTbins]
Float_t fZPCtower[5]
ZNC 5 tower signals.
TH1D * fhSignalTTJ[fkCE][fkTTbins]
distributions of centrality estimators biased with hadron TT
const AliJetIterableMomentumContainer accepted_momentum() const
int Int_t
Definition: External.C:63
Int_t GetMaxDistanceFromBorder(AliVCluster *cluster)
TH1D * fhMultTTJinMB[fkTTbins]
multiplicity of hadron TT in MB event
Definition: External.C:204
Bool_t fFillTTree
array which stores the number of jets in given event
unsigned int UInt_t
Definition: External.C:33
Int_t fNTracklets
Is vertex from 3d vertexer?
float Float_t
Definition: External.C:68
AliEMCALGeometry * fGeom
!emcal geometry
TH1D * fhVertex[fkVtx]
minimum bias rho inclusive
AliParticleContainer * fParticleContainerPartLevel
detector level track container
void SetUsePileUpCut(Bool_t val)
TH2F * fhClusterPhiInclGA
minimum bias eta inclusive
Float_t fCentralityV0A
triggered by EMCAL
TH1D * fhSignalTTCinGA[fkCE][fkTTbins]
distributions of centrality estimators biased with cluster TT in min bias
Double_t fxVertex
Centrality from ZNC.
Float_t fZPAtowerLG[5]
ZNA 5 tower signals.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Definition: External.C:212
Int_t fIsV0CTriggered
VOA decision.
Int_t fHadronTT[fkTTbins]
TString fMyJetParticleContainerName
void SetClusterContainerName(const char *name)
Float_t fCentralityZNA
Centrality from Clusters in layer 1.
const AliClusterIterableContainer accepted() const
TH1D * fhSignalMB[fkCE]
estimated centrality in GA events biased with cluster TT
Bool_t fIsMinBiasTrig
fired trigger classes
TString fCaloCellsName
name of calo cell collection
void SetJetContainerName(const char *name)
char fTrigClass[1000]
object which handels centrality
Float_t fZNAtowerLG[5]
ZPC 5 tower signals.
Bool_t FinalClusterCuts(AliVCluster *cluster)
Float_t fZEM2Energy
ZEM1 Energy.
TH1D * fhCentralityMB[fkCE]
vertex distribution in events biased with hadron TT
Int_t fClusterTTLowPt[fkTTbins]
Double_t fTrackEtaWindow
ZPA 5 tower signals.
Float_t fZEM1Energy
V0 ring mult.
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
Double_t fZVertexCut
multiplicity of cluster TT in Gamma trigger event
void SetTrackContainerName(const char *name)
Bool_t RetrieveEventObjects()
Retrieve common objects from event.
TH2F * fhJetPhiIncl
minimum bias eta inclusive
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH2F * fhClusterEtaInclGA
minimum bias phi inclusive cluster
TH1D * fhCentralityTTCinGA[fkCE][fkTTbins]
estimated centrality in MB events biased with cluster TT
TH1D * fhSignalTTH[fkCE][fkTTbins]
distributions of centrality estimators: mult V0, mult VC, tracklets, znatower0, znctower0 ...
AliVCaloCells * fCaloCells
!cells
void ConnectParticleContainer(AliParticleContainer *c)
Double_t Pt() const
Definition: AliEmcalJet.h:109
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
Definition: AliEmcalList.h:25
Bool_t isMC
void SetMC(Int_t bMC)
AliEmcalList * fOutput
!output list
void Terminate(Option_t *)
Double_t fyVertex
X vertex from ITS.
TH1D * fhVertexTTH[fkVtx][fkTTbins]
vertex distribution
AliEMCALRecoUtils * fFiducialCellCut
!
TH1F * fhRhoIncl
minimum bias eta inclusive
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
Int_t fClusterTT[fkTTbins]
array which stores the number of jets in given event
AliTrackContainer * GetTrackContainer(Int_t i=0) const
Int_t fJetChTTLowPt[fkTTbins]
void SetMakeGeneralHistograms(Bool_t g)
Float_t fZNAtower[5]
ZPC 5 tower signals.
TH2F * fhClusterPhiInclMB
minimum bias eta inclusive
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Base task in the EMCAL jet framework.
Double_t fzVertex
Y vertex from ITS.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
AliJetContainer * fJetContainerPartLevel
detector level jet container
const AliTrackIterableMomentumContainer accepted_momentum() const
Float_t fCentralityCL1
Centrality from V0C.
AliJetContainer * fJetContainerDetLevel
particle level container with particles
Bool_t IsTrackInAcceptance(AliVParticle *track, Bool_t isGen=0)
const char Option_t
Definition: External.C:48
TH1D * fhCentralityTTJ[fkCE][fkTTbins]
estimated centrality in events biased with hadron TT
AliTrackContainer * fTrkContainerDetLevel
void UserCreateOutputObjects()
Main initialization function on the worker.
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
void SetJetAcceptanceType(UInt_t type)
bool Bool_t
Definition: External.C:53
Bool_t fInitializedLocal
Vertex selection helper.
TH1D * fhSignalTTCinMB[fkCE][fkTTbins]
distributions of centrality estimators biased with ch jet TT
void SetMaxTrackPt(Float_t b)
TString fRhoTaskName
detector level EMCAL cluster container
void SetClusTimeCut(Double_t min, Double_t max)
TH1D * fhMultTTCinMB[fkTTbins]
multiplicity of charged jet TT in MB event
void SetJetEtaLimits(Float_t min, Float_t max)
Int_t fHadronTTLowPt[fkTTbins]
Bool_t IsEventInAcceptance(AliVEvent *event)
Container structure for EMCAL clusters.
TH1D * fhCentralityTTCinMB[fkCE][fkTTbins]
estimated centrality in events biased with ch jet TT
Int_t fIsV0ATriggered
no. clusters on SPD layers
Float_t fZNCtowerLG[5]
ZPA 5 tower signals.
void SetExoticCut(Bool_t e)
Container for jet within the EMCAL jet framework.
Definition: External.C:196
Double_t GetExternalRho(Bool_t isMC)
Float_t fRingMultV0[8]
mult. V0C
void SetMCJetContainerName(const char *name)
AliMultSelection * fMultSelection
output tree
void SetUseDefaultVertexCut(Bool_t val)