AliPhysics  7f1bdba (7f1bdba)
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  fUseFiredTriggers(false),
87  fUseExclusiveTriggers(true),
88  fClusterTimeRange(-50e-6, 50e-6),
89  fTriggerClusters(),
90  fRequiredOverlaps(),
91  fExcludedOverlaps()
92 {
93 }
94 
97  fCentralityRange(-999., 999.),
98  fRequestCentrality(false),
99  fEventCentrality(-1),
100  fCentralityEstimator("V0M"),
103  fEnableSumw2(false),
105  fUseFiredTriggers(false),
106  fUseExclusiveTriggers(true),
107  fClusterTimeRange(-50e-6, 50e-6),
111 {
112 }
113 
115 }
116 
117 
119 
120  EnergyBinning energybinning;
121  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);
122  TLinearBinning trgclustbinning(kTrgClusterN, -0.5, kTrgClusterN - 0.5);
123  TString optionstring = fEnableSumw2 ? "s" : "";
124 
125  /*
126  * Exclusive classes are defined as triggered events
127  * in a class without lower threshold classes firing.
128  * This is needed to make the triggers statistically
129  * independent.
130  */
131 
132  // Binnings for Multiplicity correlation
133  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.);
134  const TBinning *multbinning[6] = {&v0abinning, &trackletbinning, &trackletbinning, &itsclustbinning, &emcclustbinning, &emccellbinning};
135  const TBinning *clustallbinning[6] = {&smbinning, &energybinning, &energybinning, &etabinning, &phibinning, &trgclustbinning};
136  AliDebugStream(1) << "Using exclusive triggers: " << (fUseExclusiveTriggers ? "yes" : "no") << std::endl;
138  AliDebugStream(1) << "Creating histograms for trigger " << trg << std::endl;
139  fHistos->CreateTH1("hTrgClustCounter" + trg, "Event counter in trigger cluster " + trg, trgclustbinning);
140  fHistos->CreateTH1("hEventCentrality" + trg, "Event centrality for trigger class " + trg, 103, -2., 101., optionstring);
141  fHistos->CreateTH1("hVertexZ" + trg, "z-position of the primary vertex for trigger class " + trg, 200, -40., 40., optionstring);
142  if(this->fDoFillMultiplicityHistograms) fHistos->CreateTHnSparse("hMultiplicityCorrelation" + trg, "Multiplicity correlation for trigger" + trg, 6, multbinning);
143  fHistos->CreateTHnSparse("hClusterTHnSparseAll" + trg, "Cluster THnSparse (all) for trigger" + trg, 6, clustallbinning);
144  if(fUseFiredTriggers) fHistos->CreateTHnSparse("hClusterTHnSparseFired" + trg, "Cluster THnSparse (firing) for trigger" + trg, 6, clustallbinning);
145  fHistos->CreateTH2("hTimeEnergy" + trg, "Cluster time vs. energy for trigger class " + trg, timebinning, energybinning, optionstring);
146  fHistos->CreateTH2("hNCellEnergy" + trg, "Cluster number of cells vs energy for trigger class " + trg, ncellbinning, energybinning, optionstring);
147  fHistos->CreateTH2("hNCellET" + trg, "Cluster number of cells vs transverse energy for trigger class " + trg, ncellbinning, energybinning, optionstring);
148  if(fUseFiredTriggers){
149  fHistos->CreateTH2("hCorrClusterEPatchADC" + trg, "Correlation between cluster E and patch ADC for trigger " + trg, energybinning, adcbinning);
150  fHistos->CreateTH2("hCorrClusterEPatchE" + trg, "Correlation between cluster E and patch E for trigger " + trg, energybinning, energybinning);
151  }
152  }
153 }
154 
156  fEventCentrality = -1;
157  if(fRequestCentrality){
158  AliMultSelection *mult = dynamic_cast<AliMultSelection *>(InputEvent()->FindListObject("MultSelection"));
159  if(!mult){
160  AliErrorStream() << GetName() << ": Centrality selection enabled but no centrality estimator found" << std::endl;
161  return false;
162  }
163  if(mult->IsEventSelected()) return false;
164  fEventCentrality = mult->GetEstimator(fCentralityEstimator)->GetPercentile();
165  AliDebugStream(1) << GetName() << ": Centrality " << fEventCentrality << std::endl;
167  AliDebugStream(1) << GetName() << ": reject centrality: " << fEventCentrality << std::endl;
168  return false;
169  } else {
170  AliDebugStream(1) << GetName() << ": select centrality " << fEventCentrality << std::endl;
171  }
172  } else {
173  AliDebugStream(1) << GetName() << ": No centrality selection applied" << std::endl;
174  }
175 
176  if(fBunchCrossingIndex > -1){
177  int bcindex = fInputEvent->GetHeader()->GetBunchCrossNumber() % 4;
178  if(bcindex != fBunchCrossingIndex) return false;
179  }
180 
181  // handle overlaps
182  if(fRequiredOverlaps.GetEntries() || fExcludedOverlaps.GetEntries()){
183  if(fRequiredOverlaps.GetEntries()){
184  Bool_t allFound(true);
185  for(auto t : fRequiredOverlaps){
186  auto trgstr = static_cast<TObjString *>(t)->String();
187  if(std::find_if(fSelectedTriggers.begin(), fSelectedTriggers.end(), [&trgstr](const TString &seltrigger) -> bool { return seltrigger.Contains(trgstr); }) == fSelectedTriggers.end()) {
188  allFound = false;
189  break;
190  }
191  }
192  if(!allFound) return false;
193  }
194 
195  if(fExcludedOverlaps.GetEntries()){
196  Bool_t oneFound(false);
197  for(auto t : fExcludedOverlaps){
198  auto trgstr = static_cast<TObjString *>(t)->String();
199  if(std::find_if(fSelectedTriggers.begin(), fSelectedTriggers.end(), [&trgstr](const TString &seltrigger) -> bool { return seltrigger.Contains(trgstr); }) != fSelectedTriggers.end()) {
200  oneFound = true;
201  break;
202  }
203  }
204  if(oneFound) return false;
205  }
206  }
207 
208  // determine trigger clusters (ANY - 0 always included)
209  // Only meaningfull in data
210  fTriggerClusters.clear();
211  fTriggerClusters.emplace_back(kTrgClusterANY);
212  Bool_t isCENT(false), isCENTNOTRD(false), isCALO(false), isCALOFAST(false);
213  for(auto trg : PWG::EMCAL::Triggerinfo::DecodeTriggerString(fInputEvent->GetFiredTriggerClasses().Data())){
214  auto trgclust = trg.Triggercluster();
215  if(trgclust == "CENT" && !isCENT){
216  isCENT = true;
217  fTriggerClusters.emplace_back(kTrgClusterCENT);
218  }
219  if(trgclust == "CENTNOTRD" && ! isCENTNOTRD){
220  isCENTNOTRD = true;
222  }
223  if(trgclust == "CALO" && !isCALO){
224  isCALO = true;
225  fTriggerClusters.emplace_back(kTrgClusterCALO);
226  }
227  if(trgclust == "CALOFAST" && ! isCALOFAST) {
228  isCALOFAST = true;
229  fTriggerClusters.emplace_back();
230  }
231  }
232  // Mixed clusters
233  if(isCENT || isCENTNOTRD) {
234  if(isCENT) {
235  if(isCENTNOTRD) fTriggerClusters.emplace_back(kTrgClusterCENTBOTH);
236  else fTriggerClusters.emplace_back(kTrgClusterOnlyCENT);
237  } else fTriggerClusters.emplace_back(kTrgClusterOnlyCENTNOTRD);
238  }
239  if(isCALO || isCALOFAST){
240  if(isCALO) {
241  if(isCALOFAST) fTriggerClusters.emplace_back(kTrgClusterCALOBOTH);
242  else fTriggerClusters.emplace_back(kTrgClusterOnlyCALO);
243  } else fTriggerClusters.emplace_back(kTrgClusterOnlyCALOFAST);
244  }
245 
246  return true;
247 }
248 
250  AliDebugStream(1) << GetName() << ": UserExec start" << std::endl;
251 
252  std::map<TString, const TList *> patchhandlers;
253  const std::vector<TString> l1triggers = {"EJ1", "EJ2", "EG1", "EG2", "DJ1", "DJ2", "DG1", "DG2"};
254  int energycomp = -1;
255  // get fired trigger patches from the trigger selection task
256  if(auto trgsel = static_cast<PWG::EMCAL::AliEmcalTriggerDecisionContainer *>(fInputEvent->FindListObject("EmcalTriggerDecision"))){
257  /*
258  for(auto t : *(trgsel->GetListOfTriggerDecisions())){
259  auto dec = static_cast<PWG::EMCAL::AliEmcalTriggerDecision *>(t);
260  std::cout << "Found trigger decision " << dec->GetName() << std::endl;
261  }
262  */
263  for(auto t : l1triggers){
264  auto decision = trgsel->FindTriggerDecision(t.Data());
265  if(decision){
266  patchhandlers[t] = decision->GetAcceptedPatches();
267  if(energycomp < 0) {
268  switch(decision->GetSelectionCuts()->GetSelectionMethod()){
269  case PWG::EMCAL::AliEmcalTriggerSelectionCuts::kADC: energycomp = 0; break;
272  }
273  }
274  }
275  }
276  }
277 
278  auto supportedTriggers = GetSupportedTriggers(fUseExclusiveTriggers);
279  Double_t energy, et, eta, phi;
280  const TList *selpatches(nullptr);
281  for(auto clust : GetClusterContainer(fNameClusterContainer.Data())->all()){
282  //AliVCluster *clust = static_cast<AliVCluster *>(*clustIter);
283  if(!clust->IsEMCAL()) continue;
284  if(clust->GetIsExotic()) continue;
285  if(!fClusterTimeRange.IsInRange(clust->GetTOF())) continue;
286 
287  // Distinguish energy definition
288  switch(fEnergyDefinition){
289  case kDefaultEnergy:
290  AliDebugStream(2) << GetName() << ": Using cluster energy definition: default" << std::endl;
291  energy = clust->E();
292  break;
293  case kNonLinCorrEnergy:
294  AliDebugStream(2) << GetName() << ": Using cluster energy definition: corrected for non-linearity" << std::endl;
295  energy = clust->GetNonLinCorrEnergy();
296  break;
297  case kHadCorrEnergy:
298  AliDebugStream(2) << GetName() << ": Using cluster energy definition: corrected for hadronic contribution" << std::endl;
299  energy = clust->GetHadCorrEnergy();
300  break;
301  };
302 
303  AliDebugStream(2) << GetName() << ": Using energy " << energy << " (def: " << clust->E()
304  << " | NL: " << clust->GetNonLinCorrEnergy()
305  << " | HD: " << clust->GetHadCorrEnergy()
306  << ")" << std::endl;
307 
308  TLorentzVector posvec;
309  clust->GetMomentum(posvec, fVertex);
310  posvec.SetE(energy); // use energy definition as selected in the task
311  et = posvec.Et();
312  eta = posvec.Eta();
313  phi = posvec.Phi();
314  if(phi < 0) phi += TMath::TwoPi();
315 
316  // fill histograms allEta
317  for(const auto & trg : fSelectedTriggers){
318  if(std::find(supportedTriggers.begin(), supportedTriggers.end(), trg) == supportedTriggers.end()) continue;
319  selpatches = nullptr;
320  for(auto t : l1triggers) {
321  if(trg.Contains(t)) {
322  auto patchdata = patchhandlers.find(t);
323  if(patchdata != patchhandlers.end()){
324  selpatches = patchdata->second;
325  }
326  }
327  }
328  for(auto trgclust : fTriggerClusters) {
329  FillClusterHistograms(trg.Data(), energy, et, eta, phi, clust->GetTOF(), clust->GetNCells(), trgclust, selpatches, energycomp);
330  }
331  }
332  }
333  return true;
334 }
335 
336 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){
337  std::vector<AliEMCALTriggerPatchInfo *> matchedPatches;
338  if(fUseFiredTriggers && triggerPatches) {
339  matchedPatches = CorrelateToTrigger(eta, phi, *triggerPatches);
340  }
341  auto hasTriggerPatch = matchedPatches.size() > 0;
342  Int_t supermoduleID = -1;
343  Double_t weight = GetTriggerWeight(triggerclass);
344  AliDebugStream(1) << GetName() << ": Using weight " << weight << " for trigger " << triggerclass << std::endl;
345 
346  fGeom->SuperModuleNumberFromEtaPhi(eta, phi, supermoduleID);
347  double point[6] = {static_cast<double>(supermoduleID), energy, transverseenergy, eta, phi, static_cast<double>(trgcluster)};
348  fHistos->FillTHnSparse("hClusterTHnSparseAll" + triggerclass, point, weight);
349 
350  fHistos->FillTH2("hTimeEnergy" + triggerclass, clustertime, energy, weight);
351  fHistos->FillTH2("hNCellEnergy" + triggerclass, ncell, energy, weight);
352  fHistos->FillTH2("hNCellET" + triggerclass, ncell, transverseenergy, weight);
353  if(fUseFiredTriggers && hasTriggerPatch){
354  // find maximum trigger patch
355  AliEMCALTriggerPatchInfo *maxpatch(nullptr);
356  double maxenergy = 0;
357  for(auto patch : matchedPatches) {
358  double patche = 0;
359  switch(energycomp){
360  case 0: patche = patch->GetADCAmp(); break;
361  case 1: patche = patch->GetPatchE(); break;
362  case 2: patche = patch->GetSmearedEnergy(); break;
363  };
364  if(patche > maxenergy) {
365  maxpatch = patch;
366  maxenergy = patche;
367  }
368  }
369  fHistos->FillTH2("hCorrClusterEPatchADC" + triggerclass, energy, maxpatch->GetADCAmp());
370  fHistos->FillTH2("hCorrClusterEPatchE" + triggerclass, energy, maxpatch->GetPatchE());
371  fHistos->FillTHnSparse("hClusterTHnSparseFired" + triggerclass, point, weight);
372  }
373 }
374 
376  double v0amult = fInputEvent->GetVZEROData()->GetMTotV0A(),
377  trackletmult = static_cast<double>(CountTracklets(-0.8, 0.8, 0., TMath::TwoPi())),
378  emctrackletmult = static_cast<double>(CountTracklets(-0.8, 0.8, 1.4, TMath::Pi())),
379  itsclustermult = fInputEvent->GetMultiplicity()->GetNumberOfSPDClusters(),
380  emcclustermult = static_cast<double>(CountEmcalClusters(0.5)),
381  emccellocc = static_cast<double>(this->GetEMCALCellOccupancy(0.1));
382 
383  auto supportedTriggers = GetSupportedTriggers(fUseExclusiveTriggers);
384 
385  for(const auto &t : fSelectedTriggers){
386  if(std::find(supportedTriggers.begin(), supportedTriggers.end(), t) == supportedTriggers.end()) continue;
387  Double_t weight = GetTriggerWeight(t);
388  fHistos->FillTH1("hEventCentrality" + t, fEventCentrality, weight);
389  fHistos->FillTH1("hVertexZ" + t, fVertex[2], weight);
390 
391  for(auto trgclust : fTriggerClusters){
392  fHistos->FillTH1("hTrgClustCounter" + t, static_cast<double>(trgclust), weight);
393  }
394 
395  // Multiplicity correlation (no correction for downscaling)
397  double data[6] = {v0amult, trackletmult, emctrackletmult, itsclustermult, emcclustermult, emccellocc};
398  fHistos->FillTHnSparse("hMultiplicityCorrelation" + t, data);
399  }
400  }
401 }
402 
403 std::vector<AliEMCALTriggerPatchInfo *> AliAnalysisTaskEmcalClustersRef::CorrelateToTrigger(Double_t etaclust, Double_t phiclust, const TList &triggerPatches) const {
404  std::vector<AliEMCALTriggerPatchInfo *> foundpatches;
405  for(auto patchIter : triggerPatches){
406  Double_t boundaries[4];
407  auto testpatch = static_cast<AliEMCALTriggerPatchInfo *>(patchIter);
408  GetPatchBoundaries(*testpatch, boundaries);
409  Double_t etamin = TMath::Min(boundaries[0], boundaries[1]),
410  etamax = TMath::Max(boundaries[0], boundaries[1]),
411  phimin = TMath::Min(boundaries[2], boundaries[3]),
412  phimax = TMath::Max(boundaries[2], boundaries[3]);
413  if(etaclust > etamin && etaclust < etamax && phiclust > phimin && phiclust < phimax){
414  foundpatches.push_back(testpatch);
415  break;
416  }
417  }
418  return foundpatches;
419 }
420 
421 void AliAnalysisTaskEmcalClustersRef::GetPatchBoundaries(AliEMCALTriggerPatchInfo &patch, Double_t *boundaries) const {
422  boundaries[0] = patch.GetEtaMin();
423  boundaries[1] = patch.GetEtaMax();
424  boundaries[2] = patch.GetPhiMin();
425  boundaries[3] = patch.GetPhiMax();
426 }
427 
429  int nclusters = 0;
430  for(auto clust : GetClusterContainer(fNameClusterContainer.Data())->all()){
431  if(!clust->IsEMCAL()) continue;
432  if(clust->GetIsExotic()) continue;
433  if(clust->E() > ecut) nclusters++;
434  nclusters++;
435  }
436  return nclusters;
437 }
438 
439 int AliAnalysisTaskEmcalClustersRef::CountTracklets(double etamin, double etamax, double phimin, double phimax){
440  int ntracklets = 0;
441  AliVMultiplicity *mult = fInputEvent->GetMultiplicity();
442  for(int itl = 0; itl < mult->GetNumberOfTracklets(); itl++){
443  double eta = mult->GetEta(itl), phi = mult->GetPhi(itl);
444  if(!(eta > etamin && eta < etamax)) continue;
445  if(!(phi > phimin && phi < phimax)) continue;
446  ntracklets++;
447  }
448  return ntracklets;
449 }
450 
452  std::set<int> cellIDs;
453  AliVCaloCells *emccells = fInputEvent->GetEMCALCells();
454  for(short icell = 0; icell < emccells->GetNumberOfCells(); icell++){
455  if(emccells->GetAmplitude(icell) > ecut){
456  int cellID = emccells->GetCellNumber(icell);
457  if(cellIDs.find(cellID) == cellIDs.end()) cellIDs.insert(cellID);
458  }
459  }
460  return cellIDs.size();
461 }
462 
464  if(fRequiredOverlaps.FindObject(trigger)) return;
465  fRequiredOverlaps.Add(new TObjString(trigger));
466 }
467 
469  if(fExcludedOverlaps.FindObject(trigger)) return;
470  fExcludedOverlaps.Add(new TObjString(trigger));
471 }
472 
474  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
475 
476  //-------------------------------------------------------
477  // Init the task and do settings
478  //-------------------------------------------------------
479 
480  TString clusName(nclusters == "usedefault" ? AliEmcalAnalysisFactory::ClusterContainerNameFactory(mgr->GetInputEventHandler()->InheritsFrom("AliAODInputHandler")) : nclusters);
481 
482  TString taskname = "emcalClusterQA_" + suffix;
483 
485  task->AddClusterContainer(clusName);
486  task->SetClusterContainer(clusName);
487  mgr->AddTask(task);
488 
489  TString outfile(mgr->GetCommonFileName());
490  outfile += ":ClusterQA_" + TString(suffix);
491  TString containername = "ClusterResults_" + TString(suffix);
492  printf("Outfile: %s, container: %s\n", outfile.Data(), containername.Data());
493 
494  task->ConnectInput(0, mgr->GetCommonInputContainer());
495  mgr->ConnectOutput(task, 1, mgr->CreateContainer(containername.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, outfile.Data()));
496 
497  return task;
498 }
499 
501  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
502 
504  mgr->AddTask(task);
505 
506  // Adding cluster container
507  TString clusName(nClusters == "usedefault" ? AliEmcalAnalysisFactory::ClusterContainerNameFactory(mgr->GetInputEventHandler()->InheritsFrom("AliAODInputHandler")) : nClusters);
508  task->AddClusterContainer(clusName.Data());
509  task->SetClusterContainer(clusName);
510 
511  // Set Energy thresholds for additional patch selection:
512  // These are events with offline patches of a given type where the trigger reached already the plateau
513  // These numers are determined as:
514  // EMC7: 3.5 GeV
515  // EG1: 14 GeV
516  // EG2: 8 GeV
517  // EJ1: 22 GeV
518  // EJ2: 12 GeV
521  );
522 
523  TString outfile(mgr->GetCommonFileName());
524  outfile += ":ClusterQA";
525 
526  task->ConnectInput(0, mgr->GetCommonInputContainer());
527  mgr->ConnectOutput(task, 1, mgr->CreateContainer("ClusterResults", AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, outfile.Data()));
528 
529  return task;
530 }
531 
532 
538 {
539  this->SetMinimum(0.);
540  this->AddStep(1, 0.05);
541  this->AddStep(2, 0.1);
542  this->AddStep(4, 0.2);
543  this->AddStep(7, 0.5);
544  this->AddStep(16, 1);
545  this->AddStep(32, 2);
546  this->AddStep(40, 4);
547  this->AddStep(50, 5);
548  this->AddStep(100, 10);
549  this->AddStep(200, 20);
550 }
551 
552 
553 } /* 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.
Bool_t fUseFiredTriggers
Study clusters connected with patches.
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.