AliPhysics  5eaf189 (5eaf189)
AliAnalysisTaskEmcalClustersRef.cxx
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #include <array>
28 #include <bitset>
29 #include <iostream>
30 #include <map>
31 #include <set>
32 #include <vector>
33 
34 #include <TArrayD.h>
35 #include <TClonesArray.h>
36 #include <TGrid.h>
37 #include <THashList.h>
38 #include <THistManager.h>
39 #include <TLinearBinning.h>
40 #include <TLorentzVector.h>
41 #include <TMath.h>
42 #include <TObjArray.h>
43 #include <TObjString.h>
44 #include <TParameter.h>
45 
46 #include "AliAnalysisManager.h"
47 #include "AliAnalysisUtils.h"
48 #include "AliClusterContainer.h"
50 #include "AliEMCALGeometry.h"
51 #include "AliEmcalList.h"
52 #include "AliEMCALTriggerPatchInfo.h"
58 #include "AliESDEvent.h"
59 #include "AliInputEventHandler.h"
60 #include "AliLog.h"
61 #include "AliMultSelection.h"
62 #include "AliMultEstimator.h"
63 #include "AliVCluster.h"
64 #include "AliVEvent.h"
65 #include "AliVEventHandler.h"
66 #include "AliVVertex.h"
67 
69 
73 
74 namespace EMCalTriggerPtAnalysis {
75 
76 AliAnalysisTaskEmcalClustersRef::AliAnalysisTaskEmcalClustersRef() :
78  fCentralityRange(-999., 999.),
79  fRequestCentrality(false),
80  fEventCentrality(-1),
81  fCentralityEstimator("V0M"),
82  fBunchCrossingIndex(-1),
83  fEnergyDefinition(kDefaultEnergy),
84  fEnableSumw2(false),
85  fDoFillMultiplicityHistograms(false),
86  fUseExclusiveTriggers(true),
87  fClusterTimeRange(-50e-6, 50e-6),
88  fTriggerClusters(),
89  fRequiredOverlaps(),
90  fExcludedOverlaps()
91 {
92 }
93 
96  fCentralityRange(-999., 999.),
97  fRequestCentrality(false),
98  fEventCentrality(-1),
99  fCentralityEstimator("V0M"),
102  fEnableSumw2(false),
104  fUseExclusiveTriggers(true),
105  fClusterTimeRange(-50e-6, 50e-6),
109 {
110 }
111 
113 }
114 
115 
117 
118  EnergyBinning energybinning;
119  TLinearBinning smbinning(21, -0.5, 20.5), etabinning(100, -0.7, 0.7), phibinning(200, 0., TMath::TwoPi()), timebinning(1000, -500e-9, 500e-9), ncellbinning(101, -0.5, 100.5);
120  TLinearBinning trgclustbinning(kTrgClusterN, -0.5, kTrgClusterN - 0.5);
121  TString optionstring = fEnableSumw2 ? "s" : "";
122 
123  /*
124  * Exclusive classes are defined as triggered events
125  * in a class without lower threshold classes firing.
126  * This is needed to make the triggers statistically
127  * independent.
128  */
129 
130  // Binnings for Multiplicity correlation
131  TLinearBinning v0abinning(1000, 0., 1000.), trackletbinning(500, 0., 500.), itsclustbinning(500, 0., 500.), emcclustbinning(100, 0., 100.), emccellbinning(3000, 0., 3000.), adcbinning(2000, 0., 2000.);
132  const TBinning *multbinning[6] = {&v0abinning, &trackletbinning, &trackletbinning, &itsclustbinning, &emcclustbinning, &emccellbinning};
133  const TBinning *clustallbinning[6] = {&smbinning, &energybinning, &energybinning, &etabinning, &phibinning, &trgclustbinning};
134  AliDebugStream(1) << "Using exclusive triggers: " << (fUseExclusiveTriggers ? "yes" : "no") << std::endl;
136  AliDebugStream(1) << "Creating histograms for trigger " << trg << std::endl;
137  fHistos->CreateTH1("hTrgClustCounter" + trg, "Event counter in trigger cluster " + trg, trgclustbinning);
138  fHistos->CreateTH1("hEventCentrality" + trg, "Event centrality for trigger class " + trg, 103, -2., 101., optionstring);
139  fHistos->CreateTH1("hVertexZ" + trg, "z-position of the primary vertex for trigger class " + trg, 200, -40., 40., optionstring);
140  if(this->fDoFillMultiplicityHistograms) fHistos->CreateTHnSparse("hMultiplicityCorrelation" + trg, "Multiplicity correlation for trigger" + trg, 6, multbinning);
141  fHistos->CreateTHnSparse("hClusterTHnSparseAll" + trg, "Cluster THnSparse (all) for trigger" + trg, 6, clustallbinning);
142  fHistos->CreateTHnSparse("hClusterTHnSparseFired" + trg, "Cluster THnSparse (firing) for trigger" + trg, 6, clustallbinning);
143  fHistos->CreateTH2("hTimeEnergy" + trg, "Cluster time vs. energy for trigger class " + trg, timebinning, energybinning, optionstring);
144  fHistos->CreateTH2("hNCellEnergy" + trg, "Cluster number of cells vs energy for trigger class " + trg, ncellbinning, energybinning, optionstring);
145  fHistos->CreateTH2("hNCellET" + trg, "Cluster number of cells vs transverse energy for trigger class " + trg, ncellbinning, energybinning, optionstring);
146  fHistos->CreateTH2("hCorrClusterEPatchADC" + trg, "Correlation between cluster E and patch ADC for trigger " + trg, energybinning, adcbinning);
147  fHistos->CreateTH2("hCorrClusterEPatchE" + trg, "Correlation between cluster E and patch E for trigger " + trg, energybinning, energybinning);
148  }
149 }
150 
152  fEventCentrality = -1;
153  if(fRequestCentrality){
154  AliMultSelection *mult = dynamic_cast<AliMultSelection *>(InputEvent()->FindListObject("MultSelection"));
155  if(!mult){
156  AliErrorStream() << GetName() << ": Centrality selection enabled but no centrality estimator found" << std::endl;
157  return false;
158  }
159  if(mult->IsEventSelected()) return false;
160  fEventCentrality = mult->GetEstimator(fCentralityEstimator)->GetPercentile();
161  AliDebugStream(1) << GetName() << ": Centrality " << fEventCentrality << std::endl;
163  AliDebugStream(1) << GetName() << ": reject centrality: " << fEventCentrality << std::endl;
164  return false;
165  } else {
166  AliDebugStream(1) << GetName() << ": select centrality " << fEventCentrality << std::endl;
167  }
168  } else {
169  AliDebugStream(1) << GetName() << ": No centrality selection applied" << std::endl;
170  }
171 
172  if(fBunchCrossingIndex > -1){
173  int bcindex = fInputEvent->GetHeader()->GetBunchCrossNumber() % 4;
174  if(bcindex != fBunchCrossingIndex) return false;
175  }
176 
177  // handle overlaps
178  if(fRequiredOverlaps.GetEntries() || fExcludedOverlaps.GetEntries()){
179  if(fRequiredOverlaps.GetEntries()){
180  Bool_t allFound(true);
181  for(auto t : fRequiredOverlaps){
182  auto trgstr = static_cast<TObjString *>(t)->String();
183  if(std::find_if(fSelectedTriggers.begin(), fSelectedTriggers.end(), [&trgstr](const TString &seltrigger) -> bool { return seltrigger.Contains(trgstr); }) == fSelectedTriggers.end()) {
184  allFound = false;
185  break;
186  }
187  }
188  if(!allFound) return false;
189  }
190 
191  if(fExcludedOverlaps.GetEntries()){
192  Bool_t oneFound(false);
193  for(auto t : fExcludedOverlaps){
194  auto trgstr = static_cast<TObjString *>(t)->String();
195  if(std::find_if(fSelectedTriggers.begin(), fSelectedTriggers.end(), [&trgstr](const TString &seltrigger) -> bool { return seltrigger.Contains(trgstr); }) != fSelectedTriggers.end()) {
196  oneFound = true;
197  break;
198  }
199  }
200  if(oneFound) return false;
201  }
202  }
203 
204  // determine trigger clusters (ANY - 0 always included)
205  // Only meaningfull in data
206  fTriggerClusters.clear();
207  fTriggerClusters.emplace_back(kTrgClusterANY);
208  Bool_t isCENT(false), isCENTNOTRD(false), isCALO(false), isCALOFAST(false);
209  for(auto trg : PWG::EMCAL::Triggerinfo::DecodeTriggerString(fInputEvent->GetFiredTriggerClasses().Data())){
210  auto trgclust = trg.Triggercluster();
211  if(trgclust == "CENT" && !isCENT){
212  isCENT = true;
213  fTriggerClusters.emplace_back(kTrgClusterCENT);
214  }
215  if(trgclust == "CENTNOTRD" && ! isCENTNOTRD){
216  isCENTNOTRD = true;
218  }
219  if(trgclust == "CALO" && !isCALO){
220  isCALO = true;
221  fTriggerClusters.emplace_back(kTrgClusterCALO);
222  }
223  if(trgclust == "CALOFAST" && ! isCALOFAST) {
224  isCALOFAST = true;
225  fTriggerClusters.emplace_back();
226  }
227  }
228  // Mixed clusters
229  if(isCENT || isCENTNOTRD) {
230  if(isCENT) {
231  if(isCENTNOTRD) fTriggerClusters.emplace_back(kTrgClusterCENTBOTH);
232  else fTriggerClusters.emplace_back(kTrgClusterOnlyCENT);
233  } else fTriggerClusters.emplace_back(kTrgClusterOnlyCENTNOTRD);
234  }
235  if(isCALO || isCALOFAST){
236  if(isCALO) {
237  if(isCALOFAST) fTriggerClusters.emplace_back(kTrgClusterCALOBOTH);
238  else fTriggerClusters.emplace_back(kTrgClusterOnlyCALO);
239  } else fTriggerClusters.emplace_back(kTrgClusterOnlyCALOFAST);
240  }
241 
242  return true;
243 }
244 
246  AliDebugStream(1) << GetName() << ": UserExec start" << std::endl;
247 
248  std::map<TString, const TList *> patchhandlers;
249  const std::vector<TString> l1triggers = {"EJ1", "EJ2", "EG1", "EG2", "DJ1", "DJ2", "DG1", "DG2"};
250  int energycomp = -1;
251  // get fired trigger patches from the trigger selection task
252  if(auto trgsel = static_cast<PWG::EMCAL::AliEmcalTriggerDecisionContainer *>(fInputEvent->FindListObject("EmcalTriggerDecision"))){
253  /*
254  for(auto t : *(trgsel->GetListOfTriggerDecisions())){
255  auto dec = static_cast<PWG::EMCAL::AliEmcalTriggerDecision *>(t);
256  std::cout << "Found trigger decision " << dec->GetName() << std::endl;
257  }
258  */
259  for(auto t : l1triggers){
260  auto decision = trgsel->FindTriggerDecision(t.Data());
261  if(decision){
262  patchhandlers[t] = decision->GetAcceptedPatches();
263  if(energycomp < 0) {
264  switch(decision->GetSelectionCuts()->GetSelectionMethod()){
265  case PWG::EMCAL::AliEmcalTriggerSelectionCuts::kADC: energycomp = 0; break;
268  }
269  }
270  }
271  }
272  }
273 
274  auto supportedTriggers = GetSupportedTriggers(fUseExclusiveTriggers);
275  Double_t energy, et, eta, phi;
276  const TList *selpatches(nullptr);
277  for(auto clust : GetClusterContainer(fNameClusterContainer.Data())->all()){
278  //AliVCluster *clust = static_cast<AliVCluster *>(*clustIter);
279  if(!clust->IsEMCAL()) continue;
280  if(clust->GetIsExotic()) continue;
281  if(!fClusterTimeRange.IsInRange(clust->GetTOF())) continue;
282 
283  // Distinguish energy definition
284  switch(fEnergyDefinition){
285  case kDefaultEnergy:
286  AliDebugStream(2) << GetName() << ": Using cluster energy definition: default" << std::endl;
287  energy = clust->E();
288  break;
289  case kNonLinCorrEnergy:
290  AliDebugStream(2) << GetName() << ": Using cluster energy definition: corrected for non-linearity" << std::endl;
291  energy = clust->GetNonLinCorrEnergy();
292  break;
293  case kHadCorrEnergy:
294  AliDebugStream(2) << GetName() << ": Using cluster energy definition: corrected for hadronic contribution" << std::endl;
295  energy = clust->GetHadCorrEnergy();
296  break;
297  };
298 
299  AliDebugStream(2) << GetName() << ": Using energy " << energy << " (def: " << clust->E()
300  << " | NL: " << clust->GetNonLinCorrEnergy()
301  << " | HD: " << clust->GetHadCorrEnergy()
302  << ")" << std::endl;
303 
304  TLorentzVector posvec;
305  clust->GetMomentum(posvec, fVertex);
306  posvec.SetE(energy); // use energy definition as selected in the task
307  et = posvec.Et();
308  eta = posvec.Eta();
309  phi = posvec.Phi();
310  if(phi < 0) phi += TMath::TwoPi();
311 
312  // fill histograms allEta
313  for(const auto & trg : fSelectedTriggers){
314  if(std::find(supportedTriggers.begin(), supportedTriggers.end(), trg) == supportedTriggers.end()) continue;
315  selpatches = nullptr;
316  for(auto t : l1triggers) {
317  if(trg.Contains(t)) {
318  auto patchdata = patchhandlers.find(t);
319  if(patchdata != patchhandlers.end()){
320  selpatches = patchdata->second;
321  }
322  }
323  }
324  for(auto trgclust : fTriggerClusters) {
325  FillClusterHistograms(trg.Data(), energy, et, eta, phi, clust->GetTOF(), clust->GetNCells(), trgclust, selpatches, energycomp);
326  }
327  }
328  }
329  return true;
330 }
331 
332 void AliAnalysisTaskEmcalClustersRef::FillClusterHistograms(const TString &triggerclass, double energy, double transverseenergy, double eta, double phi, double clustertime, int ncell, int trgcluster, const TList *triggerPatches, int energycomp){
333  std::vector<AliEMCALTriggerPatchInfo *> matchedPatches;
334  if(triggerPatches) {
335  matchedPatches = CorrelateToTrigger(eta, phi, *triggerPatches);
336  }
337  auto hasTriggerPatch = matchedPatches.size() > 0;
338  Int_t supermoduleID = -1;
339  Double_t weight = GetTriggerWeight(triggerclass);
340  AliDebugStream(1) << GetName() << ": Using weight " << weight << " for trigger " << triggerclass << std::endl;
341 
342  fGeom->SuperModuleNumberFromEtaPhi(eta, phi, supermoduleID);
343  double point[6] = {static_cast<double>(supermoduleID), energy, transverseenergy, eta, phi, static_cast<double>(trgcluster)};
344  fHistos->FillTHnSparse("hClusterTHnSparseAll" + triggerclass, point, weight);
345 
346  fHistos->FillTH2("hTimeEnergy" + triggerclass, clustertime, energy, weight);
347  fHistos->FillTH2("hNCellEnergy" + triggerclass, ncell, energy, weight);
348  fHistos->FillTH2("hNCellET" + triggerclass, ncell, transverseenergy, weight);
349  if(hasTriggerPatch){
350  // find maximum trigger patch
351  AliEMCALTriggerPatchInfo *maxpatch(nullptr);
352  double maxenergy = 0;
353  for(auto patch : matchedPatches) {
354  double patche = 0;
355  switch(energycomp){
356  case 0: patche = patch->GetADCAmp(); break;
357  case 1: patche = patch->GetPatchE(); break;
358  case 2: patche = patch->GetSmearedEnergy(); break;
359  };
360  if(patche > maxenergy) {
361  maxpatch = patch;
362  maxenergy = patche;
363  }
364  }
365  fHistos->FillTH2("hCorrClusterEPatchADC" + triggerclass, energy, maxpatch->GetADCAmp());
366  fHistos->FillTH2("hCorrClusterEPatchE" + triggerclass, energy, maxpatch->GetPatchE());
367  fHistos->FillTHnSparse("hClusterTHnSparseFired" + triggerclass, point, weight);
368  }
369 }
370 
372  double v0amult = fInputEvent->GetVZEROData()->GetMTotV0A(),
373  trackletmult = static_cast<double>(CountTracklets(-0.8, 0.8, 0., TMath::TwoPi())),
374  emctrackletmult = static_cast<double>(CountTracklets(-0.8, 0.8, 1.4, TMath::Pi())),
375  itsclustermult = fInputEvent->GetMultiplicity()->GetNumberOfSPDClusters(),
376  emcclustermult = static_cast<double>(CountEmcalClusters(0.5)),
377  emccellocc = static_cast<double>(this->GetEMCALCellOccupancy(0.1));
378 
379  auto supportedTriggers = GetSupportedTriggers(fUseExclusiveTriggers);
380 
381  for(const auto &t : fSelectedTriggers){
382  if(std::find(supportedTriggers.begin(), supportedTriggers.end(), t) == supportedTriggers.end()) continue;
383  Double_t weight = GetTriggerWeight(t);
384  fHistos->FillTH1("hEventCentrality" + t, fEventCentrality, weight);
385  fHistos->FillTH1("hVertexZ" + t, fVertex[2], weight);
386 
387  for(auto trgclust : fTriggerClusters){
388  fHistos->FillTH1("hTrgClustCounter" + t, static_cast<double>(trgclust), weight);
389  }
390 
391  // Multiplicity correlation (no correction for downscaling)
393  double data[6] = {v0amult, trackletmult, emctrackletmult, itsclustermult, emcclustermult, emccellocc};
394  fHistos->FillTHnSparse("hMultiplicityCorrelation" + t, data);
395  }
396  }
397 }
398 
399 std::vector<AliEMCALTriggerPatchInfo *> AliAnalysisTaskEmcalClustersRef::CorrelateToTrigger(Double_t etaclust, Double_t phiclust, const TList &triggerPatches) const {
400  std::vector<AliEMCALTriggerPatchInfo *> foundpatches;
401  for(auto patchIter : triggerPatches){
402  Double_t boundaries[4];
403  auto testpatch = static_cast<AliEMCALTriggerPatchInfo *>(patchIter);
404  GetPatchBoundaries(*testpatch, boundaries);
405  Double_t etamin = TMath::Min(boundaries[0], boundaries[1]),
406  etamax = TMath::Max(boundaries[0], boundaries[1]),
407  phimin = TMath::Min(boundaries[2], boundaries[3]),
408  phimax = TMath::Max(boundaries[2], boundaries[3]);
409  if(etaclust > etamin && etaclust < etamax && phiclust > phimin && phiclust < phimax){
410  foundpatches.push_back(testpatch);
411  break;
412  }
413  }
414  return foundpatches;
415 }
416 
417 void AliAnalysisTaskEmcalClustersRef::GetPatchBoundaries(AliEMCALTriggerPatchInfo &patch, Double_t *boundaries) const {
418  boundaries[0] = patch.GetEtaMin();
419  boundaries[1] = patch.GetEtaMax();
420  boundaries[2] = patch.GetPhiMin();
421  boundaries[3] = patch.GetPhiMax();
422 }
423 
425  int nclusters = 0;
426  for(auto clust : GetClusterContainer(fNameClusterContainer.Data())->all()){
427  if(!clust->IsEMCAL()) continue;
428  if(clust->GetIsExotic()) continue;
429  if(clust->E() > ecut) nclusters++;
430  nclusters++;
431  }
432  return nclusters;
433 }
434 
435 int AliAnalysisTaskEmcalClustersRef::CountTracklets(double etamin, double etamax, double phimin, double phimax){
436  int ntracklets = 0;
437  AliVMultiplicity *mult = fInputEvent->GetMultiplicity();
438  for(int itl = 0; itl < mult->GetNumberOfTracklets(); itl++){
439  double eta = mult->GetEta(itl), phi = mult->GetPhi(itl);
440  if(!(eta > etamin && eta < etamax)) continue;
441  if(!(phi > phimin && phi < phimax)) continue;
442  ntracklets++;
443  }
444  return ntracklets;
445 }
446 
448  std::set<int> cellIDs;
449  AliVCaloCells *emccells = fInputEvent->GetEMCALCells();
450  for(short icell = 0; icell < emccells->GetNumberOfCells(); icell++){
451  if(emccells->GetAmplitude(icell) > ecut){
452  int cellID = emccells->GetCellNumber(icell);
453  if(cellIDs.find(cellID) == cellIDs.end()) cellIDs.insert(cellID);
454  }
455  }
456  return cellIDs.size();
457 }
458 
460  if(fRequiredOverlaps.FindObject(trigger)) return;
461  fRequiredOverlaps.Add(new TObjString(trigger));
462 }
463 
465  if(fExcludedOverlaps.FindObject(trigger)) return;
466  fExcludedOverlaps.Add(new TObjString(trigger));
467 }
468 
470  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
471 
472  //-------------------------------------------------------
473  // Init the task and do settings
474  //-------------------------------------------------------
475 
476  TString clusName(nclusters == "usedefault" ? AliEmcalAnalysisFactory::ClusterContainerNameFactory(mgr->GetInputEventHandler()->InheritsFrom("AliAODInputHandler")) : nclusters);
477 
478  TString taskname = "emcalClusterQA_" + suffix;
479 
481  task->AddClusterContainer(clusName);
482  task->SetClusterContainer(clusName);
483  mgr->AddTask(task);
484 
485  TString outfile(mgr->GetCommonFileName());
486  outfile += ":ClusterQA_" + TString(suffix);
487  TString containername = "ClusterResults_" + TString(suffix);
488  printf("Outfile: %s, container: %s\n", outfile.Data(), containername.Data());
489 
490  task->ConnectInput(0, mgr->GetCommonInputContainer());
491  mgr->ConnectOutput(task, 1, mgr->CreateContainer(containername.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, outfile.Data()));
492 
493  return task;
494 }
495 
497  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
498 
500  mgr->AddTask(task);
501 
502  // Adding cluster container
503  TString clusName(nClusters == "usedefault" ? AliEmcalAnalysisFactory::ClusterContainerNameFactory(mgr->GetInputEventHandler()->InheritsFrom("AliAODInputHandler")) : nClusters);
504  task->AddClusterContainer(clusName.Data());
505  task->SetClusterContainer(clusName);
506 
507  // Set Energy thresholds for additional patch selection:
508  // These are events with offline patches of a given type where the trigger reached already the plateau
509  // These numers are determined as:
510  // EMC7: 3.5 GeV
511  // EG1: 14 GeV
512  // EG2: 8 GeV
513  // EJ1: 22 GeV
514  // EJ2: 12 GeV
517  );
518 
519  TString outfile(mgr->GetCommonFileName());
520  outfile += ":ClusterQA";
521 
522  task->ConnectInput(0, mgr->GetCommonInputContainer());
523  mgr->ConnectOutput(task, 1, mgr->CreateContainer("ClusterResults", AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, outfile.Data()));
524 
525  return task;
526 }
527 
528 
534 {
535  this->SetMinimum(0.);
536  this->AddStep(1, 0.05);
537  this->AddStep(2, 0.1);
538  this->AddStep(4, 0.2);
539  this->AddStep(7, 0.5);
540  this->AddStep(16, 1);
541  this->AddStep(32, 2);
542  this->AddStep(40, 4);
543  this->AddStep(50, 5);
544  this->AddStep(100, 10);
545  this->AddStep(200, 20);
546 }
547 
548 
549 } /* namespace EMCalTriggerPtAnalysis */
AliCutValueRange< double > fClusterTimeRange
Selected range on cluster time.
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
double Double_t
Definition: External.C:58
Class creating a linear binning, used in the histogram manager.
TObjArray fRequiredOverlaps
Add option to require overlap with certain triggers.
void AddExcludedTriggerOverlap(const char *trigger)
Add trigger for which overlap is excluded.
energy
Definition: HFPtSpectrum.C:44
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
TObjArray fExcludedOverlaps
Add option to exclude overlap with certain triggers.
virtual bool IsUserEventSelected()
User event selection: Select event in maching centrality range (if requested)
Simple monitoring task for cluster-related quantities in EMCAL-triggered events.
Bool_t fRequestCentrality
Switch on request for centrality range.
void AddStep(Double_t max, Double_t binwidth)
Interface for binnings used by the histogram handler.
Definition: TBinning.h:21
static std::vector< PWG::EMCAL::Triggerinfo > DecodeTriggerString(const std::string &triggerstring)
Decoding trigger string.
void SetOfflineTriggerSelection(AliEmcalTriggerOfflineSelection *sel)
Set an offline trigger selection.
void AddRequiredTriggerOverlap(const char *trigger)
Add trigger for which overlap is required.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
Bool_t fDoFillMultiplicityHistograms
Swich for multiplcity histograms.
std::vector< TriggerCluster_t > fTriggerClusters
! Detected trigger clusters for event
std::vector< AliEMCALTriggerPatchInfo * > CorrelateToTrigger(Double_t etaclust, Double_t phiclust, const TList &triggerpatches) const
Check whether cluster is inside a trigger patch which has fired the trigger.
const Double_t etamin
void FillClusterHistograms(const TString &triggerclass, double energy, double transversenergy, double eta, double phi, double clustertime, int ncell, int trgcluster, const TList *triggerpatches, int energycomp)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
int Int_t
Definition: External.C:63
TString fNameClusterContainer
Name of the cluster container in the event.
AliEMCALGeometry * fGeom
!emcal geometry
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Helper class creating user defined custom binning.
static AliAnalysisTaskEmcalClustersRef * AddTaskEmcalClustersRef(const TString &nClusters="usedefault", const TString &suffix="")
Preconfigure task so that it can be used in subwagons.
int CountTracklets(double etamin, double etamax, double phimin, double phimax)
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TString fCentralityEstimator
Centrality estimator (default: V0M for PbPb)
Bool_t fUseExclusiveTriggers
Include exclusive triggers (without lower threshold triggers)
static AliAnalysisTaskEmcalClustersRef * AddTaskEmcalClustersRefDefault(const TString &nClusters="usedefault")
Preconfigure task and add it to the analysis manager.
Analysis of high- tracks in triggered events.
Double_t fVertex[3]
!event vertex
AliCutValueRange< double > fCentralityRange
Selected centrality range.
const Double_t etamax
EnergyDefinition_t fEnergyDefinition
Energy definition used for a given cluster.
bool Bool_t
Definition: External.C:53
virtual void CreateUserHistos()
Creating histograms for the distributions monitored by the task.
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
std::vector< TString > GetSupportedTriggers(Bool_t useExclusiveTriggers=true) const
void GetPatchBoundaries(AliEMCALTriggerPatchInfo &o, Double_t *boundaries) const
Get the boundaries of the trigger patch.
static AliEmcalTriggerOfflineSelection * TriggerSelectionFactory(Double_t el0, Double_t eg1, Double_t eg2, Double_t ej1, Double_t ej2, AliEmcalTriggerOfflineSelection::EmcalEnergyDefinition_t endef=AliEmcalTriggerOfflineSelection::kFEEEnergy)
Configures EMCAL trigger offline selection used to restrict EMCAL triggered sample.
const Double_t phimin
void SetMinimum(Double_t min)
static TString ClusterContainerNameFactory(Bool_t isAOD)
Get name of the default cluster container.