AliPhysics  e59a9ba (e59a9ba)
 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 <map>
16 #include <vector>
17 
18 #include <TArrayD.h>
19 #include <TClonesArray.h>
20 #include <THistManager.h>
21 #include <THashList.h>
22 #include <TString.h>
23 
24 #include "AliAnalysisUtils.h"
25 #include "AliESDEvent.h"
26 #include "AliEMCALTriggerPatchInfo.h"
28 #include "AliInputEventHandler.h"
29 #include "AliLog.h"
30 #include "AliMultSelection.h"
31 #include "AliMultEstimator.h"
32 
34 
36 
37 namespace EMCalTriggerPtAnalysis {
38 
42 AliAnalysisTaskEmcalPatchesRef::AliAnalysisTaskEmcalPatchesRef() :
43  AliAnalysisTaskSE(),
44  fAnalysisUtil(NULL),
45  fTriggerSelection(NULL),
46  fHistos(NULL),
47  fRequestAnalysisUtil(kTRUE),
48  fTriggerStringFromPatches(kFALSE),
49  fCentralityRange(-999., 999.),
50  fVertexRange(-999., 999.),
51  fRequestCentrality(false)
52 {
53 }
54 
59 AliAnalysisTaskEmcalPatchesRef::AliAnalysisTaskEmcalPatchesRef(const char *name):
60  AliAnalysisTaskSE(name),
61  fAnalysisUtil(NULL),
62  fTriggerSelection(NULL),
63  fHistos(NULL),
64  fRequestAnalysisUtil(kTRUE),
65  fTriggerStringFromPatches(kFALSE),
66  fCentralityRange(-999., 999.),
67  fVertexRange(-999., 999.),
68  fRequestCentrality(false)
69 {
70  DefineOutput(1, TList::Class());
71 }
72 
76 AliAnalysisTaskEmcalPatchesRef::~AliAnalysisTaskEmcalPatchesRef() {
77 }
78 
84 void AliAnalysisTaskEmcalPatchesRef::UserCreateOutputObjects(){
85  AliInfo(Form("Creating histograms for task %s\n", GetName()));
86  fAnalysisUtil = new AliAnalysisUtils;
87 
88  TArrayD energybinning, etabinning;
89  CreateEnergyBinning(energybinning);
90  CreateLinearBinning(etabinning, 100, -0.7, 0.7);
91  fHistos = new THistManager("Ref");
92  TString triggers[18] = {"MB", "EMC7", "DMC7",
93  "EJ1", "EJ2", "EG1", "EG2", "DJ1", "DJ2", "DG1", "DG2",
94  "MBexcl", "EMC7excl", "DMC7excl", "EG2excl", "EJ2excl", "DG2excl", "DJ2excl"
95  };
96  TString patchtype[10] = {"EG1", "EG2", "EJ1", "EJ2", "EMC7", "DG1", "DG2", "DJ1", "DJ2", "DMC7"};
97  Double_t encuts[5] = {1., 2., 5., 10., 20.};
98  for(TString *trg = triggers; trg < triggers+18; trg++){
99  fHistos->CreateTH1(Form("hEventCount%s", trg->Data()), Form("Event count for trigger class %s", trg->Data()), 1, 0.5, 1.5);
100  fHistos->CreateTH1(Form("hEventCentrality%s", trg->Data()), Form("Event centrality for trigger class %s", trg->Data()), 103, -2., 101.);
101  for(int ipatch = 0; ipatch < 10; ipatch++){
102  fHistos->CreateTH1(Form("h%sPatchEnergy%s", patchtype[ipatch].Data(), trg->Data()), Form("%s-patch energy for trigger class %s", patchtype[ipatch].Data(), trg->Data()), energybinning);
103  fHistos->CreateTH1(Form("h%sPatchET%s", patchtype[ipatch].Data(), trg->Data()), Form("%s-patch transverse energy for trigger class %s", patchtype[ipatch].Data(), trg->Data()), energybinning);
104  fHistos->CreateTH2(Form("h%sPatchEnergyEta%s", patchtype[ipatch].Data(), trg->Data()), Form("%s-patch energy for trigger class %s", patchtype[ipatch].Data(), trg->Data()), energybinning, etabinning);
105  fHistos->CreateTH2(Form("h%sPatchETEta%s", patchtype[ipatch].Data(), trg->Data()), Form("%s-patch transverse energy for trigger class %s", patchtype[ipatch].Data(), trg->Data()), energybinning, etabinning);
106  for(int ien = 0; ien < 5; ien++){
107  fHistos->CreateTH2(Form("h%sEtaPhi%dG%s", patchtype[ipatch].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", patchtype[ipatch].Data(), encuts[ien], trg->Data()), 100, -0.7, 0.7, 200, 0, TMath::TwoPi());
108  fHistos->CreateTH2(Form("h%sColRow%dG%s", patchtype[ipatch].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", patchtype[ipatch].Data(), encuts[ien], trg->Data()), 48, -0.5, 47.5, 104, -0.5, 103.5);
109  }
110  }
111  }
112  PostData(1, fHistos->GetListOfHistograms());
113  AliDebug(1, "Histograms done");
114 }
115 
120 void AliAnalysisTaskEmcalPatchesRef::UserExec(Option_t *){
121  AliDebug(1, Form("%s: Start function\n", GetName()));
122  TClonesArray *patches = dynamic_cast<TClonesArray *>(fInputEvent->FindListObject("EmcalTriggers"));
123  TString triggerstring = "";
124  if(fTriggerStringFromPatches){
125  triggerstring = GetFiredTriggerClassesFromPatches(patches);
126  } else {
127  triggerstring = fInputEvent->GetFiredTriggerClasses();
128  }
129  UInt_t selectionstatus = fInputHandler->IsEventSelected();
130  Bool_t isMinBias = selectionstatus & AliVEvent::kINT7,
131  isEMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("EMC7"),
132  isEJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ1"),
133  isEJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("EJ2"),
134  isEG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG1"),
135  isEG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("EG2"),
136  isDMC7 = (selectionstatus & AliVEvent::kEMC7) && triggerstring.Contains("DMC7"),
137  isDJ1 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("DJ1"),
138  isDJ2 = (selectionstatus & AliVEvent::kEMCEJE) && triggerstring.Contains("DJ2"),
139  isDG1 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("DG1"),
140  isDG2 = (selectionstatus & AliVEvent::kEMCEGA) && triggerstring.Contains("DG2");
141  if(patches && fTriggerSelection){
142  isEMC7 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgEL0, patches);
143  isEJ1 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgEJ1, patches);
144  isEJ2 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgEJ2, patches);
145  isEG1 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgEG1, patches);
146  isEG2 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgEG2, patches);
147  isDMC7 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgDL0, patches);
148  isDJ1 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgDJ1, patches);
149  isDJ2 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgDJ2, patches);
150  isDG1 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgDG1, patches);
151  isDG2 &= fTriggerSelection->IsOfflineSelected(AliEmcalTriggerOfflineSelection::kTrgDG2, patches);
152 
153  }
154  if(!(isMinBias || isEMC7 || isEG1 || isEG2 || isEJ1 || isEJ2 || isDMC7 || isDG1 || isDG2 || isDJ1 || isDJ2)){
155  AliDebug(1, Form("%s: Reject trigger\n", GetName()));
156  return;
157  }
158  AliDebug(1, "Event selected");
159  AliMultSelection *mult = dynamic_cast<AliMultSelection *>(InputEvent()->FindListObject("MultSelection"));
160  // In case a centrality estimator is used, event selection,
161  // otherwise ignore event selection from multiplicity task
162  if(fRequestCentrality){
163  if(mult && !mult->IsEventSelected()) return;
164  }
165  double centrality = mult ? mult->GetEstimator("V0M")->GetPercentile() : -1;
166  AliDebug(1, Form("%s: Centrality %f\n", GetName(), centrality));
167  if(!fCentralityRange.IsInRange(centrality)){
168  AliDebug(1, Form("%s: reject centrality: %f\n", GetName(), centrality));
169  return;
170  } else {
171  AliDebug(1, Form("%s: select centrality %f\n", GetName(), centrality));
172  }
173  const AliVVertex *vtx = fInputEvent->GetPrimaryVertex();
174  if(!vtx) vtx = fInputEvent->GetPrimaryVertexSPD();
175  //if(!fInputEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return; // reject pileup event
176  if(vtx->GetNContributors() < 1){
177  AliDebug(1, Form("%s: Reject contributor\n", GetName()));
178  return;
179  }
180  // Fill reference distribution for the primary vertex before any z-cut
181  if(fRequestAnalysisUtil){
182  AliDebug(1, Form("%s: Reject analysis util\n", GetName()));
183  if(fInputEvent->IsA() == AliESDEvent::Class() && fAnalysisUtil->IsFirstEventInChunk(fInputEvent)) return;
184  if(!fAnalysisUtil->IsVertexSelected2013pA(fInputEvent)) return; // Apply new vertex cut
185  if(fAnalysisUtil->IsPileUpEvent(fInputEvent)) return; // Apply new vertex cut
186  }
187  // Apply vertex z cut
188  if(!fVertexRange.IsInRange(vtx->GetZ())){
189  AliDebug(1, Form("%s: Reject Z\n", GetName()));
190  return;
191  }
192  AliDebug(1, Form("%s: Event Selected\n", GetName()));
193 
194  // Fill Event counter and reference vertex distributions for the different trigger classes
195  if(isMinBias){
196  fHistos->FillTH1("hEventCountMB", 1);
197  fHistos->FillTH1("hEventCentralityMB", centrality);
198  // Check for exclusive classes
199  if(!(isEMC7 || isDMC7 || isEJ1 || isEJ2 || isEG1 || isEG2 || isDJ1 || isDJ2 || isDG1 || isDG2)){
200  fHistos->FillTH1("hEventCountMBexcl", 1);
201  fHistos->FillTH1("hEventCentralityMBexcl", centrality);
202  }
203  }
204 
205  // L0 triggers
206  if(isEMC7){
207  fHistos->FillTH1("hEventCountEMC7", 1);
208  fHistos->FillTH1("hEventCentralityEMC7", centrality);
209  if(!(isEJ1 || isEJ2 || isEG1 || isEG2)){
210  fHistos->FillTH1("hEventCountEMC7excl", 1);
211  fHistos->FillTH1("hEventCentralityEMC7excl", centrality);
212  }
213  }
214  if(isDMC7){
215  fHistos->FillTH1("hEventCountDMC7", 1);
216  fHistos->FillTH1("hEventCentralityDMC7", centrality);
217  if(!(isDJ1 || isDJ2 || isDG1 || isDG2)){
218  fHistos->FillTH1("hEventCountDMC7excl", 1);
219  fHistos->FillTH1("hEventCentralityDMC7excl", centrality);
220  }
221  }
222 
223  // L1 jet triggers
224  if(isEJ1){
225  fHistos->FillTH1("hEventCountEJ1", 1);
226  fHistos->FillTH1("hEventCentralityEJ1", centrality);
227  }
228  if(isDJ1){
229  fHistos->FillTH1("hEventCountEJ1", 1);
230  fHistos->FillTH1("hEventCentralityDJ1", centrality);
231  }
232 
233  if(isEJ2){
234  fHistos->FillTH1("hEventCountEJ2", 1);
235  fHistos->FillTH1("hEventCentralityEJ2", centrality);
236  // Check for exclusive classes
237  if(!isEJ1){
238  fHistos->FillTH1("hEventCountEJ2excl", 1);
239  fHistos->FillTH1("hEventCentralityEJ2excl", centrality);
240  }
241  }
242  if(isDJ2){
243  fHistos->FillTH1("hEventCountDJ2", 1);
244  fHistos->FillTH1("hEventCentralityDJ2", centrality);
245  // Check for exclusive classes
246  if(!isDJ1){
247  fHistos->FillTH1("hEventCountDJ2excl", 1);
248  fHistos->FillTH1("hEventCentralityDJ2excl", centrality);
249  }
250  }
251 
252  // L1 gamma triggers
253  if(isEG1){
254  fHistos->FillTH1("hEventCountEG1", 1);
255  fHistos->FillTH1("hEventCentralityEG1", centrality);
256  }
257  if(isDG1){
258  fHistos->FillTH1("hEventCountDG1", 1);
259  fHistos->FillTH1("hEventCentralityDG1", centrality);
260  }
261  if(isEG2){
262  fHistos->FillTH1("hEventCountEG2", 1);
263  fHistos->FillTH1("hEventCentralityEG2", centrality);
264  // Check for exclusive classes
265  if(!isEG1){
266  fHistos->FillTH1("hEventCountEG2excl", 1);
267  fHistos->FillTH1("hEventCentralityEG2excl", centrality);
268  }
269  }
270  if(isDG2){
271  fHistos->FillTH1("hEventCountDG2", 1);
272  fHistos->FillTH1("hEventCentralityDG2", centrality);
273  // Check for exclusive classes
274  if(!isEG1){
275  fHistos->FillTH1("hEventCountDG2excl", 1);
276  fHistos->FillTH1("hEventCentralityDG2excl", centrality);
277  }
278  }
279 
280  if(!patches){
281  AliError("Trigger patch container not available");
282  return;
283  }
284 
285  AliDebug(1, Form("%s: Number of trigger patches %d\n", GetName(), patches->GetEntries()));
286 
287  Double_t vertexpos[3];
288  fInputEvent->GetPrimaryVertex()->GetXYZ(vertexpos);
289 
290  Double_t energy, eta, phi, et;
291  Int_t col, row;
292  for(TIter patchIter = TIter(patches).Begin(); patchIter != TIter::End(); ++patchIter){
293  if(!IsOfflineSimplePatch(*patchIter)) continue;
294  AliEMCALTriggerPatchInfo *patch = static_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
295 
296  bool isDCAL = SelectDCALPatch(*patchIter),
297  isSingleShower = SelectSingleShowerPatch(*patchIter),
298  isJetPatch = SelectJetPatch(*patchIter);
299 
300  std::vector<TString> patchnames;
301  if(isJetPatch){
302  if(isDCAL){
303  patchnames.push_back("DJ1");
304  patchnames.push_back("DJ2");
305  } else {
306  patchnames.push_back("EJ1");
307  patchnames.push_back("EJ2");
308  }
309  }
310  if(isSingleShower){
311  if(isDCAL){
312  patchnames.push_back("DMC7");
313  patchnames.push_back("DG1");
314  patchnames.push_back("DG2");
315  } else {
316  patchnames.push_back("EMC7");
317  patchnames.push_back("EG1");
318  patchnames.push_back("EG2");
319  }
320  }
321  if(!patchnames.size()){
322  // Undefined patch type - ignore
323  continue;
324  }
325 
326  TLorentzVector posvec;
327  energy = patch->GetPatchE();
328  eta = patch->GetEtaGeo();
329  phi = patch->GetPhiGeo();
330  col = patch->GetColStart();
331  row = patch->GetRowStart();
332  et = patch->GetLorentzVectorCenterGeo().Et();
333 
334  // fill histograms allEta
335  for(std::vector<TString>::iterator nameit = patchnames.begin(); nameit != patchnames.end(); ++nameit){
336  if(isMinBias){
337  FillPatchHistograms("MB", *nameit, energy, et, eta, phi, col, row);
338  // check for exclusive classes
339  if(!(isEMC7 || isDMC7 || isEJ1 || isEJ2 || isEG1 || isEG2 || isDJ1 || isDJ2 || isDG1 || isDG2)){
340  FillPatchHistograms("MBexcl", *nameit, energy, et, eta, phi, col, row);
341  }
342  }
343 
344  if(isEMC7){
345  FillPatchHistograms("EMC7", *nameit, energy, et, eta, phi, col, row);
346  if(!(isEJ1 || isEJ2 || isEG1 || isEG2)){
347  FillPatchHistograms("EMC7excl", *nameit, energy, et, eta, phi, col, row);
348  }
349  }
350  if(isDMC7){
351  FillPatchHistograms("DMC7", *nameit, energy, et, eta, phi, col, row);
352  if(!(isDJ1 || isDJ2 || isDG1 || isDG2)){
353  FillPatchHistograms("DMC7excl", *nameit, energy, et, eta, phi, col, row);
354  }
355  }
356 
357  if(isEJ1){
358  FillPatchHistograms("EJ1", *nameit, energy, et, eta, phi, col, row);
359  }
360  if(isDJ1){
361  FillPatchHistograms("DJ1", *nameit, energy, et, eta, phi, col, row);
362  }
363 
364 
365  if(isEJ2){
366  FillPatchHistograms("EJ2", *nameit, energy, et, eta, phi, col, row);
367  // check for exclusive classes
368  if(!isEJ1){
369  FillPatchHistograms("EJ2excl", *nameit, energy, et, eta, phi, col, row);
370  }
371  }
372  if(isDJ2){
373  FillPatchHistograms("DJ2", *nameit, energy, et, eta, phi, col, row);
374  // check for exclusive classes
375  if(!isDJ1){
376  FillPatchHistograms("DJ2excl", *nameit, energy, et, eta, phi, col, row);
377  }
378  }
379 
380  if(isEG1){
381  FillPatchHistograms("EG1", *nameit, energy, et, eta, phi, col, row);
382  }
383  if(isDG1){
384  FillPatchHistograms("DG1", *nameit, energy, et, eta, phi, col, row);
385  }
386 
387  if(isEG2){
388  FillPatchHistograms("EG2", *nameit, energy, et, eta, phi, col, row);
389  // check for exclusive classes
390  if(!isEG1){
391  FillPatchHistograms("EG2excl", *nameit, energy, et, eta, phi, col, row);
392  }
393  }
394  if(isDG2){
395  FillPatchHistograms("DG2", *nameit, energy, et, eta, phi, col, row);
396  // check for exclusive classes
397  if(!isDG1){
398  FillPatchHistograms("DG2excl", *nameit, energy, et, eta, phi, col, row);
399  }
400  }
401  }
402  }
403  PostData(1, fHistos->GetListOfHistograms());
404 }
405 
414 void AliAnalysisTaskEmcalPatchesRef::FillPatchHistograms(TString triggerclass, TString patchname, double energy, double transverseenergy, double eta, double phi, int col, int row){
415  fHistos->FillTH1(Form("h%sPatchEnergy%s", patchname.Data(), triggerclass.Data()), energy);
416  fHistos->FillTH1(Form("h%sPatchET%s", patchname.Data(), triggerclass.Data()), transverseenergy);
417  fHistos->FillTH2(Form("h%sPatchEnergyEta%s", patchname.Data(), triggerclass.Data()), energy, eta);
418  fHistos->FillTH2(Form("h%sPatchETEta%s", patchname.Data(), triggerclass.Data()), transverseenergy, eta);
419  Double_t encuts[5] = {1., 2., 5., 10., 20.};
420  for(int ien = 0; ien < 5; ien++){
421  if(energy > encuts[ien]){
422  fHistos->FillTH2(Form("h%sEtaPhi%dG%s", patchname.Data(), static_cast<int>(encuts[ien]), triggerclass.Data()), eta, phi);
423  fHistos->FillTH2(Form("h%sColRow%dG%s", patchname.Data(), static_cast<int>(encuts[ien]), triggerclass.Data()), col, row);
424  }
425  }
426 }
427 
432 void AliAnalysisTaskEmcalPatchesRef::CreateEnergyBinning(TArrayD& binning) const {
433  std::vector<double> mybinning;
434  std::map<double,double> definitions;
435  definitions.insert(std::pair<double, double>(1, 0.05));
436  definitions.insert(std::pair<double, double>(2, 0.1));
437  definitions.insert(std::pair<double, double>(4, 0.2));
438  definitions.insert(std::pair<double, double>(7, 0.5));
439  definitions.insert(std::pair<double, double>(16, 1));
440  definitions.insert(std::pair<double, double>(32, 2));
441  definitions.insert(std::pair<double, double>(40, 4));
442  definitions.insert(std::pair<double, double>(50, 5));
443  definitions.insert(std::pair<double, double>(100, 10));
444  definitions.insert(std::pair<double, double>(200, 20));
445  double currentval = 0.;
446  mybinning.push_back(currentval);
447  for(std::map<double,double>::iterator id = definitions.begin(); id != definitions.end(); ++id){
448  double limit = id->first, binwidth = id->second;
449  while(currentval < limit){
450  currentval += binwidth;
451  mybinning.push_back(currentval);
452  }
453  }
454  binning.Set(mybinning.size());
455  int ib = 0;
456  for(std::vector<double>::iterator it = mybinning.begin(); it != mybinning.end(); ++it)
457  binning[ib++] = *it;
458 }
459 
467 void AliAnalysisTaskEmcalPatchesRef::CreateLinearBinning(TArrayD& binning, int nbins, double min, double max) const {
468  double binwidth = (max-min)/static_cast<double>(nbins);
469  binning.Set(nbins+1);
470  binning[0] = min;
471  double currentlimit = min + binwidth;
472  for(int ibin = 0; ibin < nbins; ibin++){
473  binning[ibin+1] = currentlimit;
474  currentlimit += binwidth;
475  }
476 }
477 
483 TString AliAnalysisTaskEmcalPatchesRef::GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const {
484  TString triggerstring = "";
485  if(!triggerpatches) return triggerstring;
486  Int_t nEJ1 = 0, nEJ2 = 0, nEG1 = 0, nEG2 = 0, nDJ1 = 0, nDJ2 = 0, nDG1 = 0, nDG2 = 0;
487  double minADC_J1 = 260.,
488  minADC_J2 = 127.,
489  minADC_G1 = 140.,
490  minADC_G2 = 89.;
491  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
492  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
493  if(!patch->IsOfflineSimple()) continue;
494  if(patch->IsJetHighSimple() && patch->GetADCOfflineAmp() > minADC_J1){
495  if(patch->IsDCalPHOS()) nDJ1++;
496  else nEJ1++;
497  }
498  if(patch->IsJetLowSimple() && patch->GetADCOfflineAmp() > minADC_J2){
499  if(patch->IsDCalPHOS()) nDJ2++;
500  else nEJ2++;
501  }
502  if(patch->IsGammaHighSimple() && patch->GetADCOfflineAmp() > minADC_G1){
503  if(patch->IsDCalPHOS()) nDG1++;
504  else nEG1++;
505  }
506  if(patch->IsGammaLowSimple() && patch->GetADCOfflineAmp() > minADC_G2){
507  if(patch->IsDCalPHOS()) nDG2++;
508  else nEG2++;
509  }
510  }
511  if(nEJ1) triggerstring += "EJ1";
512  if(nEJ2){
513  if(triggerstring.Length()) triggerstring += ",";
514  triggerstring += "EJ2";
515  }
516  if(nEG1){
517  if(triggerstring.Length()) triggerstring += ",";
518  triggerstring += "EG1";
519  }
520  if(nEG2){
521  if(triggerstring.Length()) triggerstring += ",";
522  triggerstring += "EG2";
523  }
524  if(nDJ1){
525  if(triggerstring.Length()) triggerstring += ",";
526  triggerstring += "DJ1";
527  }
528  if(nEJ2){
529  if(triggerstring.Length()) triggerstring += ",";
530  triggerstring += "DJ2";
531  }
532  if(nDG1){
533  if(triggerstring.Length()) triggerstring += ",";
534  triggerstring += "DG1";
535  }
536  if(nDG2){
537  if(triggerstring.Length()) triggerstring += ",";
538  triggerstring += "DG2";
539  }
540  return triggerstring;
541 }
542 
543 void AliAnalysisTaskEmcalPatchesRef::GetPatchBoundaries(TObject *o, Double_t *boundaries) const {
544  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
545  boundaries[0] = patch->GetEtaMin();
546  boundaries[1] = patch->GetEtaMax();
547  boundaries[2] = patch->GetPhiMin();
548  boundaries[3] = patch->GetPhiMax();
549 }
550 
551 bool AliAnalysisTaskEmcalPatchesRef::IsOfflineSimplePatch(TObject *o) const {
552  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
553  return patch->IsOfflineSimple();
554 }
555 
556 bool AliAnalysisTaskEmcalPatchesRef::SelectDCALPatch(TObject *o) const {
557  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
558  return patch->GetRowStart() >= 64;
559 }
560 
561 bool AliAnalysisTaskEmcalPatchesRef::SelectSingleShowerPatch(TObject *o) const{
562  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
563  if(!patch->IsOfflineSimple()) return false;
564  return patch->IsGammaLowSimple();
565 }
566 
567 bool AliAnalysisTaskEmcalPatchesRef::SelectJetPatch(TObject *o) const{
568  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
569  if(!patch->IsOfflineSimple()) return false;
570  return patch->IsJetLowSimple();
571 }
572 
573 double AliAnalysisTaskEmcalPatchesRef::GetPatchEnergy(TObject *o) const {
574  double energy = 0.;
575  AliEMCALTriggerPatchInfo *patch = dynamic_cast<AliEMCALTriggerPatchInfo *>(o);
576  energy = patch->GetPatchE();
577  return energy;
578 }
579 
580 
581 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(EMCalTriggerPtAnalysis::AliAnalysisTaskEmcalPatchesRef) namespace EMCalTriggerPtAnalysis
centrality
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)
energy
Container class for histograms for the high- charged particle analysis.
Definition: THistManager.h:43
const Int_t nbins