AliPhysics  d2444a6 (d2444a6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalPatchesRef.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include <array>
16 #include <iostream>
17 #include <map>
18 #include <vector>
19 
20 #include <TClonesArray.h>
21 #include <TGrid.h>
22 #include <THistManager.h>
23 #include <THashList.h>
24 #include <TLinearBinning.h>
25 #include <TObjArray.h>
26 #include <TParameter.h>
27 
28 #include "AliAnalysisUtils.h"
29 #include "AliESDEvent.h"
30 #include "AliEMCALTriggerPatchInfo.h"
32 #include "AliInputEventHandler.h"
33 #include "AliLog.h"
34 #include "AliMultSelection.h"
35 #include "AliMultEstimator.h"
36 #include "AliOADBContainer.h"
37 
39 
43 
44 namespace EMCalTriggerPtAnalysis {
45 
49 AliAnalysisTaskEmcalPatchesRef::AliAnalysisTaskEmcalPatchesRef() :
50  AliAnalysisTaskSE(),
51  fAnalysisUtil(nullptr),
52  fTriggerSelection(nullptr),
53  fHistos(nullptr),
54  fTriggerPatches(nullptr),
55  fRequestAnalysisUtil(kTRUE),
56  fTriggerStringFromPatches(kFALSE),
57  fCentralityRange(-999., 999.),
58  fVertexRange(-999., 999.),
59  fRequestCentrality(false),
60  fNameDownscaleOADB(""),
61  fDownscaleOADB(nullptr),
62  fDownscaleFactors(nullptr),
63  fCurrentRun(-1),
64  fInitialized(false)
65 {
66 }
67 
73  AliAnalysisTaskSE(name),
74  fAnalysisUtil(nullptr),
75  fTriggerSelection(nullptr),
76  fHistos(nullptr),
77  fTriggerPatches(nullptr),
78  fRequestAnalysisUtil(kTRUE),
79  fTriggerStringFromPatches(kFALSE),
80  fCentralityRange(-999., 999.),
81  fVertexRange(-999., 999.),
82  fRequestCentrality(false),
83  fNameDownscaleOADB(""),
84  fDownscaleOADB(nullptr),
85  fDownscaleFactors(nullptr),
86  fCurrentRun(-1),
87  fInitialized(false)
88 {
89  DefineOutput(1, TList::Class());
90 }
91 
96 }
97 
104  AliInfoStream() << "Creating histograms for task " << GetName() << std::endl;
105  fAnalysisUtil = new AliAnalysisUtils;
106 
107  EnergyBinning energybinning;
108  TLinearBinning etabinning(100, -0.7, 0.7);
109  fHistos = new THistManager("Ref");
110  std::array<TString, 21> triggers = {"MB", "EMC7", "DMC7",
111  "EJ1", "EJ2", "EG1", "EG2", "DJ1", "DJ2", "DG1", "DG2",
112  "EMC7excl", "DMC7excl", "EG2excl", "EJ2excl", "DG2excl", "DJ2excl",
113  "EG1excl", "EJ1excl", "DG1excl", "DJ1excl"
114  };
115  std::array<TString, 10> patchtypes = {"EG1", "EG2", "EJ1", "EJ2", "EMC7", "DG1", "DG2", "DJ1", "DJ2", "DMC7"};
116  Double_t encuts[5] = {1., 2., 5., 10., 20.};
117  for(auto trg : triggers){
118  fHistos->CreateTH1(Form("hEventCount%s", trg.Data()), Form("Event count for trigger class %s", trg.Data()), 1, 0.5, 1.5);
119  fHistos->CreateTH1(Form("hEventCentrality%s", trg.Data()), Form("Event centrality for trigger class %s", trg.Data()), 103, -2., 101.);
120  fHistos->CreateTH1(Form("hVertexZ%s", trg.Data()), Form("z-position of the primary vertex for trigger class %s", trg.Data()), 200, -40., 40.);
121  for(auto patch : patchtypes){
122  fHistos->CreateTH1(Form("h%sPatchEnergy%s", patch.Data(), trg.Data()), Form("%s-patch energy for trigger class %s", patch.Data(), trg.Data()), energybinning);
123  fHistos->CreateTH1(Form("h%sPatchET%s", patch.Data(), trg.Data()), Form("%s-patch transverse energy for trigger class %s", patch.Data(), trg.Data()), energybinning);
124  fHistos->CreateTH2(Form("h%sPatchEnergyEta%s", patch.Data(), trg.Data()), Form("%s-patch energy for trigger class %s", patch.Data(), trg.Data()), energybinning, etabinning);
125  fHistos->CreateTH2(Form("h%sPatchETEta%s", patch.Data(), trg.Data()), Form("%s-patch transverse energy for trigger class %s", patch.Data(), trg.Data()), energybinning, etabinning);
126  for(int ien = 0; ien < 5; ien++){
127  fHistos->CreateTH2(Form("h%sEtaPhi%dG%s", patch.Data(), static_cast<int>(encuts[ien]), trg.Data()), Form("%s-patch #eta-#phi map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(), encuts[ien], trg.Data()), 100, -0.7, 0.7, 200, 0, TMath::TwoPi());
128  fHistos->CreateTH2(Form("h%sColRow%dG%s", patch.Data(), static_cast<int>(encuts[ien]), trg.Data()), Form("%s-patch col-row map for patches with energy larger than %f GeV/c for trigger class %s", patch.Data(), encuts[ien], trg.Data()), 48, -0.5, 47.5, 104, -0.5, 103.5);
129  }
130  }
131  }
132  PostData(1, fHistos->GetListOfHistograms());
133  AliDebugStream(1) << "Histograms done" << std::endl;
134 }
135 
141  AliDebugStream(1) << GetName() << ": Start function" << std::endl;
142  if(!fInitialized){
143  AliInfoStream() << GetName() << ": Initializing ..." << std::endl;
144  ExecOnce();
145  fInitialized = kTRUE;
146  }
147  if(fCurrentRun != InputEvent()->GetRunNumber()){
148  AliDebugStream(1) << GetName() << ": Changing run from " << fCurrentRun << " to " << InputEvent()->GetRunNumber() << std::endl;
149  RunChanged(InputEvent()->GetRunNumber());
150  fCurrentRun = InputEvent()->GetRunNumber();
151  }
152  TString triggerstring = "";
155  } else {
156  triggerstring = fInputEvent->GetFiredTriggerClasses();
157  }
158  UInt_t selectionstatus = fInputHandler->IsEventSelected();
159  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
160  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("EMC7"),
161  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
162  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
163  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
164  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
165  isDMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("DMC7"),
166  isDJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("DJ1"),
167  isDJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("DJ2"),
168  isDG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("DG1"),
169  isDG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("DG2");
181 
182  }
183  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2 || isDMC7 || isDG1 || isDG2 || isDJ1 || isDJ2)){
184  AliDebugStream(1) << GetName() << ": Reject trigger" << std::endl;
185  return;
186  }
187  AliDebugStream(1) << "Trigger selected" << std::endl;
188  // In case a centrality estimator is used, event selection,
189  // otherwise ignore event selection from multiplicity task
190  double centrality = -1;
191  if(fRequestCentrality){
192  AliMultSelection *mult = dynamic_cast<AliMultSelection *>(InputEvent()->FindListObject("MultSelection"));
193  if(!mult){
194  AliErrorStream() << GetName() << ": Centrality selection enabled but no centrality estimator available" << std::endl;
195  return;
196  }
197  if(!mult->IsEventSelected()) return;
198  centrality = mult->GetEstimator("V0M")->GetPercentile();
199  AliDebugStream(1) << GetName() << ": Centrality " << centrality << std::endl;
200  if(!fCentralityRange.IsInRange(centrality)){
201  AliDebugStream(1) << GetName() << ": reject centrality: " << centrality << std::endl;
202  return;
203  } else {
204  AliDebugStream(1) << GetName() << ": select centrality " << centrality << std::endl;
205  }
206  } else {
207  AliDebugStream(1) << GetName() << ": No centrality selection required" << std::endl;
208  }
209  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
210  if(!vtx) vtx = fInputEvent->GetPrimaryVertexSPD();
211  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
212  if(vtx->GetNContributors() < 1){
213  AliDebug(1, Form("%s: Reject contributor\n", GetName()));
214  return;
215  }
216  // Fill reference distribution for the primary vertex before any z-cut
218  AliDebugStream(1) << GetName() << ": Reject analysis util" << std::endl;
219  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
220  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) return; // Apply new vertex cut
221  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) return; // Apply new vertex cut
222  }
223  // Apply vertex z cut
224  if(!fVertexRange.IsInRange(vtx->GetZ())){
225  AliDebugStream(1) << GetName() << ": Reject Z(" << vtx->GetZ() << ")" << std::endl;
226  return;
227  }
228  AliDebugStream(1) << GetName() << ": Event Selected" << std::endl;
229 
230  // Fill Event counter and reference vertex distributions for the different trigger classes
231  if(isMinBias) FillEventHistograms("MB", centrality, vtx->GetZ());
232 
233  // L0 triggers
234  if(isEMC7){
235  FillEventHistograms("EMC7", centrality, vtx->GetZ());
236  // Check for exclusive classes
237  if(!(isMinBias || isEMC7)) FillEventHistograms("EMC7excl", centrality, vtx->GetZ());
238  }
239  if(isDMC7){
240  FillEventHistograms("DMC7", centrality, vtx->GetZ());
241  // Check for exclusive classes
242  if(!(isMinBias || isDMC7)) FillEventHistograms("DMC7excl", centrality, vtx->GetZ());
243  }
244 
245  // L1 jet triggers
246  if(isEJ1){
247  FillEventHistograms("EJ1", centrality, vtx->GetZ());
248  // Check for exclusive classes
249  if(!(isMinBias || isEMC7 || isEJ2)) FillEventHistograms("EJ1excl", centrality, vtx->GetZ());
250  }
251  if(isDJ1){
252  FillEventHistograms("DJ1", centrality, vtx->GetZ());
253  // Check for exclusive classes
254  if(!(isMinBias || isDMC7 || isDJ2)) FillEventHistograms("DJ1excl", centrality, vtx->GetZ());
255  }
256 
257  if(isEJ2){
258  FillEventHistograms("EJ2", centrality, vtx->GetZ());
259  // Check for exclusive classes
260  if(!(isMinBias || isEMC7)) FillEventHistograms("EJ2excl", centrality, vtx->GetZ());
261  }
262  if(isDJ2){
263  FillEventHistograms("DJ2", centrality, vtx->GetZ());
264  // Check for exclusive classes
265  if(!(isMinBias || isDMC7)) FillEventHistograms("DJ2excl", centrality, vtx->GetZ());
266  }
267 
268  // L1 gamma triggers
269  if(isEG1){
270  FillEventHistograms("EG1", centrality, vtx->GetZ());
271  // Check for exclusive classes
272  if(!(isMinBias || isEMC7 || isEG2)) FillEventHistograms("EG1excl", centrality, vtx->GetZ());
273  }
274  if(isDG1){
275  FillEventHistograms("DG1", centrality, vtx->GetZ());
276  // Check for exclusive classes
277  if(!(isMinBias || isDMC7 || isDG2)) FillEventHistograms("DG1excl", centrality, vtx->GetZ());
278  }
279  if(isEG2){
280  FillEventHistograms("EG2", centrality, vtx->GetZ());
281  // Check for exclusive classes
282  if(!(isMinBias || isEMC7)) FillEventHistograms("EG2excl", centrality, vtx->GetZ());
283  }
284  if(isDG2){
285  FillEventHistograms("DG2", centrality, vtx->GetZ());
286  // Check for exclusive classes
287  if(!(isMinBias || isDMC7)) FillEventHistograms("DG2excl", centrality, vtx->GetZ());
288  }
289 
290  if(!fTriggerPatches){
291  AliErrorStream() << GetName() << ": Trigger patch container not available" << std::endl;
292  return;
293  }
294 
295  AliDebugStream(1) << GetName() << ": Number of trigger patches " << fTriggerPatches->GetEntries() << std::endl;
296 
297  Double_t vertexpos[3];
298  fInputEvent->GetPrimaryVertex()->GetXYZ(vertexpos);
299 
300  Double_t energy, eta, phi, et;
301  Int_t col, row;
302  for(TIter patchIter = TIter(fTriggerPatches).Begin(); patchIter != TIter::End(); ++patchIter){
303  if(!IsOfflineSimplePatch(*patchIter)) continue;
304  AliEMCALTriggerPatchInfo *patch = static_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
305 
306  bool isDCAL = SelectDCALPatch(*patchIter),
307  isSingleShower = SelectSingleShowerPatch(*patchIter),
308  isJetPatch = SelectJetPatch(*patchIter);
309 
310  std::vector<TString> patchnames;
311  if(isJetPatch){
312  if(isDCAL){
313  patchnames.push_back("DJ1");
314  patchnames.push_back("DJ2");
315  } else {
316  patchnames.push_back("EJ1");
317  patchnames.push_back("EJ2");
318  }
319  }
320  if(isSingleShower){
321  if(isDCAL){
322  patchnames.push_back("DMC7");
323  patchnames.push_back("DG1");
324  patchnames.push_back("DG2");
325  } else {
326  patchnames.push_back("EMC7");
327  patchnames.push_back("EG1");
328  patchnames.push_back("EG2");
329  }
330  }
331  if(!patchnames.size()){
332  // Undefined patch type - ignore
333  continue;
334  }
335 
336  TLorentzVector posvec;
337  energy = patch->GetPatchE();
338  eta = patch->GetEtaGeo();
339  phi = patch->GetPhiGeo();
340  col = patch->GetColStart();
341  row = patch->GetRowStart();
342  et = patch->GetLorentzVectorCenterGeo().Et();
343 
344  // fill histograms allEta
345  for(std::vector<TString>::iterator nameit = patchnames.begin(); nameit != patchnames.end(); ++nameit){
346  if(isMinBias){
347  FillPatchHistograms("MB", *nameit, energy, et, eta, phi, col, row);
348  }
349 
350  if(isEMC7){
351  FillPatchHistograms("EMC7", *nameit, energy, et, eta, phi, col, row);
352  // check for exclusive classes
353  if(!isMinBias) FillPatchHistograms("EMC7excl", *nameit, energy, et, eta, phi, col, row);
354  }
355  if(isDMC7){
356  FillPatchHistograms("DMC7", *nameit, energy, et, eta, phi, col, row);
357  // check for exclusive classes
358  if(!isMinBias) FillPatchHistograms("DMC7excl", *nameit, energy, et, eta, phi, col, row);
359  }
360 
361  if(isEJ1){
362  FillPatchHistograms("EJ1", *nameit, energy, et, eta, phi, col, row);
363  // check for exclusive classes
364  if(!(isMinBias || isEMC7 || isEJ2))
365  FillPatchHistograms("EJ1excl", *nameit, energy, et, eta, phi, col, row);
366  }
367  if(isDJ1){
368  FillPatchHistograms("DJ1", *nameit, energy, et, eta, phi, col, row);
369  // check for exclusive classes
370  if(!(isMinBias || isDMC7 || isDJ2))
371  FillPatchHistograms("DJ1excl", *nameit, energy, et, eta, phi, col, row);
372  }
373 
374  if(isEJ2){
375  FillPatchHistograms("EJ2", *nameit, energy, et, eta, phi, col, row);
376  // check for exclusive classes
377  if(!(isMinBias || isEMC7)) FillPatchHistograms("EJ2excl", *nameit, energy, et, eta, phi, col, row);
378  }
379  if(isDJ2){
380  FillPatchHistograms("DJ2", *nameit, energy, et, eta, phi, col, row);
381  // check for exclusive classes
382  if(!(isMinBias || isDMC7)) FillPatchHistograms("DJ2excl", *nameit, energy, et, eta, phi, col, row);
383  }
384 
385  if(isEG1){
386  FillPatchHistograms("EG1", *nameit, energy, et, eta, phi, col, row);
387  // check for exclusive classes
388  if(!(isMinBias || isEMC7 || isEG2)) FillPatchHistograms("EG1excl", *nameit, energy, et, eta, phi, col, row);
389  }
390  if(isDG1){
391  FillPatchHistograms("DG1", *nameit, energy, et, eta, phi, col, row);
392  // check for exclusive classes
393  if(!(isMinBias || isEMC7 || isDG2)) FillPatchHistograms("DG1excl", *nameit, energy, et, eta, phi, col, row);
394  }
395 
396  if(isEG2){
397  FillPatchHistograms("EG2", *nameit, energy, et, eta, phi, col, row);
398  // check for exclusive classes
399  if(!(isMinBias || isEMC7)) FillPatchHistograms("EG2excl", *nameit, energy, et, eta, phi, col, row);
400  }
401  if(isDG2){
402  FillPatchHistograms("DG2", *nameit, energy, et, eta, phi, col, row);
403  // check for exclusive classes
404  if(!(isMinBias || isDMC7)) FillPatchHistograms("DG2excl", *nameit, energy, et, eta, phi, col, row);
405  }
406  }
407  }
408  PostData(1, fHistos->GetListOfHistograms());
409 }
410 
412  fTriggerPatches = dynamic_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
413  // Handle OADB container with downscaling factors
414  if(fNameDownscaleOADB.Length()){
415  if(fNameDownscaleOADB.Contains("alien://") && ! gGrid) TGrid::Connect("alien://");
416  fDownscaleOADB = new AliOADBContainer("AliEmcalDownscaleFactors");
417  fDownscaleOADB->InitFromFile(fNameDownscaleOADB.Data(), "AliEmcalDownscaleFactors");
418  }
419 }
420 
422  if(fDownscaleOADB){
423  fDownscaleFactors = static_cast<TObjArray *>(fDownscaleOADB->GetObject(runnumber));
424  }
425 }
426 
435 Double_t AliAnalysisTaskEmcalPatchesRef::GetTriggerWeight(const TString &triggerclass) const {
436  if(fDownscaleFactors){
437  TParameter<double> *result(nullptr);
438  // Downscaling only done on MB, L0 and the low threshold triggers
439  if(triggerclass.Contains("MB")) result = static_cast<TParameter<double> *>(fDownscaleFactors->FindObject("INT7"));
440  else if(triggerclass.Contains("EMC7")) result = static_cast<TParameter<double> *>(fDownscaleFactors->FindObject("EMC7"));
441  else if(triggerclass.Contains("EJ2")) result = static_cast<TParameter<double> *>(fDownscaleFactors->FindObject("EJ2"));
442  else if(triggerclass.Contains("EG2")) result = static_cast<TParameter<double> *>(fDownscaleFactors->FindObject("EG2"));
443  if(result) return 1./result->GetVal();
444  }
445  return 1.;
446 }
447 
448 
458 void AliAnalysisTaskEmcalPatchesRef::FillPatchHistograms(TString triggerclass, TString patchname, double energy, double transverseenergy, double eta, double phi, int col, int row){
459  Double_t weight = GetTriggerWeight(triggerclass);
460  AliDebugStream(1) << GetName() << ": Using weight " << weight << " for trigger " << triggerclass << " in patch histograms." << std::endl;
461  fHistos->FillTH1(Form("h%sPatchEnergy%s", patchname.Data(), triggerclass.Data()), energy, weight);
462  fHistos->FillTH1(Form("h%sPatchET%s", patchname.Data(), triggerclass.Data()), transverseenergy, weight);
463  fHistos->FillTH2(Form("h%sPatchEnergyEta%s", patchname.Data(), triggerclass.Data()), energy, eta, weight);
464  fHistos->FillTH2(Form("h%sPatchETEta%s", patchname.Data(), triggerclass.Data()), transverseenergy, eta, weight);
465  Double_t encuts[5] = {1., 2., 5., 10., 20.};
466  for(int ien = 0; ien < 5; ien++){
467  if(energy > encuts[ien]){
468  fHistos->FillTH2(Form("h%sEtaPhi%dG%s", patchname.Data(), static_cast<int>(encuts[ien]), triggerclass.Data()), eta, phi, weight);
469  fHistos->FillTH2(Form("h%sColRow%dG%s", patchname.Data(), static_cast<int>(encuts[ien]), triggerclass.Data()), col, row, weight);
470  }
471  }
472 }
473 
485 void AliAnalysisTaskEmcalPatchesRef::FillEventHistograms(const TString &triggerclass, double centrality, double vertexz){
486  Double_t weight = GetTriggerWeight(triggerclass);
487  AliDebugStream(1) << GetName() << ": Using weight " << weight << " for trigger " << triggerclass << " in event histograms." << std::endl;
488  fHistos->FillTH1(Form("hEventCount%s", triggerclass.Data()), 1, weight);
489  fHistos->FillTH1(Form("hEventCentrality%s", triggerclass.Data()), centrality, weight);
490  fHistos->FillTH1(Form("hVertexZ%s", triggerclass.Data()), vertexz, weight);
491 }
492 
498 TString AliAnalysisTaskEmcalPatchesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
499  TString triggerstring = "";
500  if(!triggerpatches) return triggerstring;
501  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0, nDJ1 = 0, nDJ2 = 0, nDG1 = 0, nDG2 = 0;
502  double minADC_J1 = 260.,
503  minADC_J2 = 127.,
504  minADC_G1 = 140.,
505  minADC_G2 = 89.;
506  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
507  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
508  if(!patch->IsOfflineSimple()) continue;
509  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_J1){
510  if(patch->IsDCalPHOS()) nDJ1++;
511  else nEJ1++;
512  }
513  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_J2){
514  if(patch->IsDCalPHOS()) nDJ2++;
515  else nEJ2++;
516  }
517  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_G1){
518  if(patch->IsDCalPHOS()) nDG1++;
519  else nEG1++;
520  }
521  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_G2){
522  if(patch->IsDCalPHOS()) nDG2++;
523  else nEG2++;
524  }
525  }
526  if(nEJ1) triggerstring += "EJ1";
527  if(nEJ2){
528  if(triggerstring.Length()) triggerstring += ",";
529  triggerstring += "EJ2";
530  }
531  if(nEG1){
532  if(triggerstring.Length()) triggerstring += ",";
533  triggerstring += "EG1";
534  }
535  if(nEG2){
536  if(triggerstring.Length()) triggerstring += ",";
537  triggerstring += "EG2";
538  }
539  if(nDJ1){
540  if(triggerstring.Length()) triggerstring += ",";
541  triggerstring += "DJ1";
542  }
543  if(nEJ2){
544  if(triggerstring.Length()) triggerstring += ",";
545  triggerstring += "DJ2";
546  }
547  if(nDG1){
548  if(triggerstring.Length()) triggerstring += ",";
549  triggerstring += "DG1";
550  }
551  if(nDG2){
552  if(triggerstring.Length()) triggerstring += ",";
553  triggerstring += "DG2";
554  }
555  return triggerstring;
556 }
557 
558 void AliAnalysisTaskEmcalPatchesRef::GetPatchBoundaries(TObject *o, Double_t *boundaries) const {
559  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
560  boundaries[0] = patch->GetEtaMin();
561  boundaries[1] = patch->GetEtaMax();
562  boundaries[2] = patch->GetPhiMin();
563  boundaries[3] = patch->GetPhiMax();
564 }
565 
567  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
568  return patch->IsOfflineSimple();
569 }
570 
572  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
573  return patch->GetRowStart() >= 64;
574 }
575 
577  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
578  if(!patch->IsOfflineSimple()) return false;
579  return patch->IsGammaLowSimple();
580 }
581 
583  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
584  if(!patch->IsOfflineSimple()) return false;
585  return patch->IsJetLowSimple();
586 }
587 
589  double energy = 0.;
590  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
591  energy = patch->GetPatchE();
592  return energy;
593 }
594 
597 {
598  this->SetMinimum(0.);
599  this->AddStep(1., 0.05);
600  this->AddStep(2., 0.1);
601  this->AddStep(4, 0.2);
602  this->AddStep(7, 0.5);
603  this->AddStep(16, 1);
604  this->AddStep(32, 2);
605  this->AddStep(40, 4);
606  this->AddStep(50, 5);
607  this->AddStep(100, 10);
608  this->AddStep(200, 20);
609 }
610 
611 
612 } /* namespace EMCalTriggerPtAnalysis */
void FillPatchHistograms(TString triggerclass, TString patchname, double energy, double transverseenergy, double eta, double phi, int col, int row)
Class creating a linear binning, used in the histogram manager.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
centrality
Bool_t fTriggerStringFromPatches
Switch on building a trigger string based on available trigger patches.
void AddStep(Double_t max, Double_t binwidth)
AliCutValueRange< double > fVertexRange
Range of the z-position in order to accept a primary vertex.
Bool_t fRequestCentrality
Switch for request of centrality selection.
AliEmcalTriggerOfflineSelection * fTriggerSelection
Offline trigger selection tool.
void FillEventHistograms(const TString &triggerclass, double centrality, double vertexz)
Bool_t fRequestAnalysisUtil
Switch on request for analysis util.
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
void GetPatchBoundaries(TObject *o, Double_t *boundaries) const
THashList * GetListOfHistograms() const
Definition: THistManager.h:504
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Helper class creating user defined custom binning.
TObjArray * fDownscaleFactors
! Downscalefactors for given run
Int_t fCurrentRun
Current run number (for RunChange method)
TString fNameDownscaleOADB
Name of the downscale OADB container.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
energy
Bool_t IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray *const triggerpatches) const
AliAnalysisUtils * fAnalysisUtil
Analysis utils for event selection.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
AliOADBContainer * fDownscaleOADB
! Container with downscale factors for different triggers
AliCutValueRange< double > fCentralityRange
Range of accepted event centralities.
Container class for histograms for the high- charged particle analysis.
Definition: THistManager.h:43
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
TClonesArray * fTriggerPatches
! Container with trigger patches
void SetMinimum(Double_t min)