AliPhysics  master (3d17d9d)
AliEmcalTriggerMakerTask.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2013, 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 <TClonesArray.h>
16 #include <TGrid.h>
17 #include <THashList.h>
18 #include <THistManager.h>
19 #include <TObjArray.h>
20 #include <TParameter.h>
21 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,8,0)
22 #include <ROOT/TSeq.hxx>
23 #endif
24 
25 #include "AliCDBEntry.h"
26 #include "AliCDBManager.h"
27 #include "AliEMCALGeometry.h"
28 #include "AliEMCALTriggerBitConfig.h"
29 #include "AliEMCALTriggerDCSConfig.h"
30 #include "AliEMCALTriggerTRUDCSConfig.h"
31 #include "AliEMCALTriggerPatchInfo.h"
34 #include "AliEMCALTriggerMapping.h"
35 #include "AliLog.h"
36 #include "AliOADBContainer.h"
37 
38 #include <array>
39 #include <bitset>
40 #include <cfloat>
41 #include <iostream>
42 #include <memory>
43 #include <sstream>
44 #include <string>
45 
49 
52  fTriggerMaker(NULL),
53  fV0(NULL),
54  fCaloTriggersOutName("EmcalTriggers"),
55  fV0InName("AliAODVZERO"),
56  fBadFEEChannelOADB(""),
57  fMaskedFastorOADB(""),
58  fUseL0Amplitudes(kFALSE),
59  fLoadFastORMaskingFromOCDB(kFALSE),
60  fCaloTriggersOut(0),
61  fRunSmearing(kTRUE),
62  fDoQA(kFALSE),
63  fQAHistos(NULL)
64 {
65 
66 }
67 
69  AliAnalysisTaskEmcal("AliEmcalTriggerMakerTask", doQA),
70  fTriggerMaker(NULL),
71  fV0(NULL),
72  fCaloTriggersOutName("EmcalTriggers"),
73  fV0InName("AliAODVZERO"),
74  fBadFEEChannelOADB(""),
75  fMaskedFastorOADB(""),
76  fUseL0Amplitudes(kFALSE),
77  fLoadFastORMaskingFromOCDB(kFALSE),
78  fCaloTriggersOut(NULL),
79  fRunSmearing(kTRUE),
80  fDoQA(doQA),
81  fQAHistos(NULL)
82 {
84 }
85 
87  if(fTriggerMaker) delete fTriggerMaker;
88  if(fQAHistos) delete fQAHistos;
90 }
91 
97  const std::array<const TString, 3> kTriggerTypeNames = {{"EJE", "EGA", "EL0"}},
98  kPatchTypes = {{"Online", "Offline", "Recalc"}};
99 
100  if(fDoQA) AliInfoStream() << "Trigger maker - QA requested" << std::endl;
101  else AliInfoStream() << "Trigger maker - no QA requested" << std::endl;
102  if(!fOutput) AliErrorStream() << "No output container initialized" << std::endl;
103 
104  if(fDoQA){
105  if(fOutput){
106  AliInfoStream() << "Enabling QA for trigger maker" << std::endl;
107  fQAHistos = new THistManager("TriggerQA");
108 
109  for(const auto &triggertype : kTriggerTypeNames){
110  for(const auto &patchtype : kPatchTypes){
112  "RCPos" + triggertype + patchtype,
113  "Lower edge position of " + patchtype + " " + triggertype + " patches (col-row);iEta;iPhi",
114  48, -0.5, 47.5, 104, -0.5, 103.5
115  );
117  "EPCentPos" + triggertype + patchtype,
118  "Center position of the " + patchtype + " " + triggertype + " trigger patches;#eta;#phi",
119  20, -0.8, 0.8, 700, 0., 7.
120  );
122  "PatchADCvsE" + triggertype + patchtype,
123  "Patch ADC value for trigger type " + patchtype + " " + triggertype + "; Trigger ADC; FEE patch energy (GeV)",
124  2000, 0., 2000, 200, 0., 200
125  );
127  "PatchEvsEsmear" + triggertype + patchtype,
128  "Patch energy vs. smeared energy for " + patchtype + " " + triggertype +"; FEE patch energy (GeV); smeared FEE energy (GeV)",
129  200, 0., 200, 200, 0., 200
130  );
132  "PatchADCvsEsmear" + triggertype + patchtype,
133  "Patch ADC vs. smeared energy for " + patchtype + " " + triggertype + "; Trigger ADC; smeared FEE energy (GeV)",
134  2000, 0., 2000, 200, 0., 200
135  );
137  "PatchADCOffvsE" + triggertype + patchtype,
138  "Patch offline ADC value for trigger type " + patchtype + " " + triggertype + "; Trigger ADC; FEE patch energy (GeV)",
139  2000, 0., 2000, 200, 0., 200
140  );
142  "PatchEvsADCrough" + triggertype + patchtype,
143  "Patch Energy vs. ADC rough for trigger type " + patchtype + " " + triggertype + "; FEE patch energy (GeV); ADC rough (GeV)",
144  2000, 0., 2000, 200, 0., 200
145  );
146  }
147  }
148  fQAHistos->CreateTH1("triggerBitsAll", "Trigger bits for all incoming patches;bit nr", 64, -0.5, 63.5);
149  fQAHistos->CreateTH1("triggerBitsSel", "Trigger bits for reconstructed patches;bit nr", 64, -0.5, 63.5);
150  fQAHistos->CreateTH2("FastORMaskOnline", "Masked FastORs at online level; col; row", 48, -0.5, 47.5, 104, -0.5, 103.5);
151 
152  // Monitoring of FastOR raw signals:
153  fQAHistos->CreateTH2("FastORCorrEnergyADCrough", "FastOR cell energy vs. ADC energy", 200, 0., 20., 200, 0., 20.);
154  fQAHistos->CreateTH2("FastORCorrEnergyESmear", "FastOR cell energy vs. smeared energy", 200, 0., 20., 200, 0., 20.);
155  fQAHistos->CreateTH2("FastORCorrADCroughEsmear", "FastOR ADC rough vs. smeared energy", 200, 0., 20., 200, 0., 20.);
156  fQAHistos->CreateTH2("FastORDiffEnergyADCrough", "FastOR ADCrough - cell energy", 4994, -0.5, 4993.5, 200, -10., 10);
157  fQAHistos->CreateTH2("FastORDiffEnergyEsmear", "FastOR smeared energy - cell energy", 4994, -0.5, 4993.5, 200, -10., 10);
158  fQAHistos->CreateTH2("FastORDiffEsmearADCrough", "FastOR ADC rough - smeared energy", 4994, -0.5, 4993.5, 200, -10., 10);
159 
160  for(auto h : *(fQAHistos->GetListOfHistograms())) fOutput->Add(h);
161  fQAHistos->GetListOfHistograms()->SetOwner(false);
162  PostData(1, fOutput);
163  } else {
164  AliWarningStream() << "QA requested but no output container initialized - QA needs to be disabled" << std::endl;
165  fDoQA = kFALSE;
166  }
167  }
168 }
169 
171 {
172  AliEMCALTriggerBitConfig *triggerBitConfig(NULL);
173  switch(bitConfig){
174  case kNewConfig:
175  triggerBitConfig = new AliEMCALTriggerBitConfigNew();
176  break;
177  case kOldConfig:
178  triggerBitConfig = new AliEMCALTriggerBitConfigOld();
179  break;
180  }
181  fTriggerMaker->SetTriggerBitConfig(triggerBitConfig);
182 }
183 
186 
187  if (!fLocalInitialized) return;
188 
189  if (!fCaloTriggersOutName.IsNull()) {
190  fCaloTriggersOut = new TClonesArray("AliEMCALTriggerPatchInfo");
192 
193  if (!(InputEvent()->FindListObject(fCaloTriggersOutName))) {
194  InputEvent()->AddObject(fCaloTriggersOut);
195  } else {
196  fLocalInitialized = kFALSE;
197  AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fCaloTriggersOutName.Data()));
198  return;
199  }
200  }
201 
202  if (!fV0InName.IsNull()) {
203  fV0 = (AliVVZERO*)InputEvent()->FindListObject(fV0InName);
204  }
205 
206  // Configure trigger maker
207  if(!fTriggerMaker->IsConfigured()){
208  AliInfoStream() << "Trigger maker not yet configure - automatically configuring ..." << std::endl;
209  int runnumber = InputEvent()->GetRunNumber();
210  std::string dataset = "";
211  if(runnumber >= 145144 && runnumber <= 165746){
213  dataset = "pp 2011";
214  } else if(runnumber >= 167806 && runnumber <= 170593){
216  dataset = "Pb-Pb 2011";
217  } else if(runnumber >= 176326 && runnumber <= 193766){
219  dataset = "pp 2012";
220  } else if(runnumber >= 195344 && runnumber <= 197692){
221  // dataset contains also the setup for pp 2.76 TeV
223  dataset = "p-Pb 2013";
224  } else if((runnumber >= 224891 && runnumber <= 244628) || (runnumber >= 252235 && runnumber <= 294960)){
225  // Configuration starting with LHC15f
227  dataset = "pp 2015-2016";
228  } else if((runnumber >= 244824 && runnumber <= 246994) || (runnumber >= 295581)){
230  dataset = "Pb-Pb 2015";
231  }
232 
234  AliInfoStream() << "Applying configuration for " << dataset << std::endl;
235  } else {
236  AliErrorStream() << "No valid configuration found for the given dataset - trigger maker run loop disabled" << std::endl;
237  }
238 
240  InitializeSmearModel(); // Initialize smear model if not yet set from outside
242  }
243  }
244 
246  fTriggerMaker->Init();
247 }
248 
256  if(!fTriggerMaker->IsConfigured()){
257  AliErrorStream() << "Trigger maker not configured" << std::endl;
258  return false; // only run trigger maker in case it is configured
259  }
260  AliDebugStream(1) << "Looking for trigger patches ..." << std::endl;
261  fCaloTriggersOut->Delete(); // Needed to avoid memory leak
262  // prepare trigger maker
263  fTriggerMaker->Reset();
267  fTriggerMaker->SetIsMC(MCEvent());
268 
269  // QA on FastOR level (if enabled)
270  if(fDoQA){
271  double ecell, eadc, esmear;
272  int fastORAbsID;
273 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,8,0)
274  // beautiful ROOT6 version - with generators
275  for(auto icol : ROOT::TSeqI(0, 48)){
276  for(auto irow : ROOT::TSeqI(0, fTriggerMaker->GetDataGridDimensionRows())){
277 #else
278  // stupid ROOT5-compatible version
279  for(int icol = 0; icol < 48; icol++){
280  for(int irow = 0; irow < fTriggerMaker->GetDataGridDimensionRows(); irow++){
281 #endif
282  ecell = fTriggerMaker->GetTriggerChannelEnergy(icol, irow);
283  eadc = fTriggerMaker->GetTriggerChannelEnergyRough(icol, irow);
284  esmear = fTriggerMaker->GetTriggerChannelEnergySmeared(icol, irow);
285  fGeom->GetTriggerMapping()->GetAbsFastORIndexFromPositionInEMCAL(icol, irow, fastORAbsID);
286  // suppress pairs at (0,0)
287  if(TMath::Abs(ecell) > DBL_EPSILON || TMath::Abs(eadc) > DBL_EPSILON){
288  fQAHistos->FillTH2("FastORCorrEnergyADCrough", ecell, eadc);
289  fQAHistos->FillTH2("FastORDiffEnergyADCrough", fastORAbsID, eadc - ecell);
290  }
291  if(TMath::Abs(ecell) > DBL_EPSILON || TMath::Abs(esmear) > DBL_EPSILON){
292  fQAHistos->FillTH2("FastORCorrEnergyESmear", ecell, esmear);
293  fQAHistos->FillTH2("FastORDiffEnergyEsmear", fastORAbsID, esmear - ecell);
294  }
295  if(TMath::Abs(eadc) > DBL_EPSILON || TMath::Abs(esmear) > DBL_EPSILON){
296  fQAHistos->FillTH2("FastORCorrADCroughEsmear", eadc, esmear);
297  fQAHistos->FillTH2("FastORDiffEsmearADCrough", fastORAbsID, esmear - eadc);
298  }
299  }
300  }
301  }
302 
303  std::vector<AliEMCALTriggerPatchInfo> patches;
304  fTriggerMaker->CreateTriggerPatches(InputEvent(), patches, fUseL0Amplitudes);
305  Int_t patchcounter = 0;
306  TString triggerstring;
307  AliDebugStream(2) << GetName() << ": Found " << patches.size() << " patches" << std::endl;
308  for(const auto &patchIter : patches){
309  if(fDoQA){
310  AliDebugStream(3) << GetName() << ": Next patch: size " << patchIter.GetPatchSize() << " , trigger bits " << std::bitset<sizeof(Int_t)*8>(patchIter.GetTriggerBits()) << std::endl;
311  // Handle types different - online - offline - re
312  if(patchIter.IsJetHigh() || patchIter.IsJetLow()) FillQAHistos("EJEOnline", patchIter);
313  if(patchIter.IsGammaHigh() || patchIter.IsGammaLow()) FillQAHistos("EGAOnline", patchIter);
314  if(patchIter.IsJetHighSimple() || patchIter.IsJetLowSimple()) FillQAHistos("EJEOffline", patchIter);
315  if(patchIter.IsGammaHighSimple() || patchIter.IsGammaLowSimple()) FillQAHistos("EGAOffline", patchIter);
316  if(patchIter.IsLevel0()) FillQAHistos("EL0Online", patchIter);
317  if(patchIter.IsLevel0Simple()) FillQAHistos("EL0Offline", patchIter);
318  if(patchIter.IsLevel0Recalc()) FillQAHistos("EL0Recalc", patchIter);
319  if(patchIter.IsRecalcJet()) FillQAHistos("EJERecalc", patchIter);
320  if(patchIter.IsRecalcGamma()) FillQAHistos("EGARecalc", patchIter);
321  // Redo checking of found trigger bits after masking of unwanted triggers
322  int tBits = patchIter.GetTriggerBits();
323  for(unsigned int ibit = 0; ibit < sizeof(tBits)*8; ibit++) {
324  if(tBits & (1 << ibit)){
325  fQAHistos->FillTH1("triggerBitsSel", ibit);
326  }
327  }
328  }
329  new((*fCaloTriggersOut)[patchcounter++]) AliEMCALTriggerPatchInfo(patchIter);
330  }
331  return true;
332 }
333 
335  AliDebugStream(1) << "Run changed, new run " << newrun << std::endl;
341  // QA: Monitor all channels which are masked in the current run
342  if(fDoQA && fQAHistos){
343  Int_t globCol(-1), globRow(-1) ;
344  for(const auto &ifastOrID : fTriggerMaker->GetListOfBadFastORAbsIDs()){
345  fGeom->GetTriggerMapping()->GetPositionInEMCALFromAbsFastORIndex(ifastOrID, globCol, globRow);
346  fQAHistos->FillTH2("FastORMaskOnline", globCol, globRow);
347  }
348  }
349 }
350 
352  AliInfoStream() << "Loading additional bad FEE channels from OADB container " << fBadFEEChannelOADB << std::endl;
354  if(fBadFEEChannelOADB.Contains("alien://") && !gGrid) TGrid::Connect("alien");
355  AliOADBContainer badchannelDB("EmcalBadChannelsAdditional");
356  badchannelDB.InitFromFile(fBadFEEChannelOADB.Data(), "EmcalBadChannelsAdditional");
357  TObjArray *badchannelmap = static_cast<TObjArray *>(badchannelDB.GetObject(InputEvent()->GetRunNumber()));
358  if(!badchannelmap || !badchannelmap->GetEntries()) return;
359  for(TIter citer = TIter(badchannelmap).Begin(); citer != TIter::End(); ++citer){
360  TParameter<int> *channelID = static_cast<TParameter<int> *>(*citer);
361  fTriggerMaker->AddOfflineBadChannel(channelID->GetVal());
362  }
363 }
364 
366  AliInfoStream() << "Loading masked fastors from OCDB" << std::endl;
367  AliCDBManager *cdb = AliCDBManager::Instance();
368 
369  AliCDBEntry *en = cdb->Get("EMCAL/Calib/Trigger");
370  if(!en){
371  AliErrorStream() << GetName() << ": FastOR masking from CDB required, but OCDB entry is not available. No masking will be applied." << std::endl;
372  return;
373  }
374 
375  AliEMCALTriggerDCSConfig *trgconf = dynamic_cast<AliEMCALTriggerDCSConfig *>(en->GetObject());
376  if(!trgconf){
377  AliErrorStream() << GetName() << ": Failed decoding OCDB entry: Object is not of type AliEMCALTriggerDCSConfig." << std::endl;
378  return;
379  }
380 
381  // In run 1 the small supermodules were not contributing to triggers.
382  // Still the TRUs are counted. As access to the TRU config is not properly
383  // protected the loop over NTRU from the geometry will produce a segfault.
384  // As temporary workaround the loop limits are obtained from the DCS data itself.
385  Int_t fastOrAbsID(-1), ic(-1);
386  for(int itru = 0; itru < trgconf->GetTRUArr()->GetEntries(); itru++){
387  AliEMCALTriggerTRUDCSConfig *truconf = trgconf->GetTRUDCSConfig(itru);
388  // Test for each channel whether it is masked. The calculation is
389  // done reversely as the channel mapping is different between run1
390  // and run2: The loop is done over all masks and all bits inside the
391  // mask, and a handler matching to the correct mapping converts them
392  // into the channel ID. In case a masked channel is found, the absolute
393  // ID is calculated. For this the function GetAbsFastORIndexFromTRU
394  // is used - it is assumed that parameter 1 (iADC) corresponds to the
395  // channel ID.
396  for(unsigned int ifield = 0; ifield < 6; ifield++){
397  for(unsigned int ibit = 0; ibit < 16; ibit ++){
398  if((truconf->GetMaskReg(ifield) >> ibit) & 0x1){
399  try{
400  fGeom->GetTriggerMapping()->GetAbsFastORIndexFromTRU(RemapTRUIndex(itru), (ic = GetMaskHandler(itru)(ifield, ibit)), fastOrAbsID);
401  AliDebugStream(1) << GetName() << "Channel " << ic << " in TRU " << itru << " ( abs fastor " << fastOrAbsID << ") masked." << std::endl;
402  fTriggerMaker->AddFastORBadChannel(fastOrAbsID);
403  } catch (int exept){
404  AliErrorStream() << GetName() << "Invalid mask: (" << ifield << "|" << ibit << "), exception " << exept << " thrown. Mask will not be recognized" << std::endl;
405  }
406  }
407  }
408  }
409  }
410 }
411 
413  std::cout << "Initializing trigger maker with default smearing parameterization" << std::endl;
414  TF1 *meanmodel = new TF1("meanmodel", "pol1", 0., 1000.);
415  meanmodel->SetParameter(0, -0.0206247);
416  meanmodel->SetParameter(1, 0.966160);
417  // Power law smearing
418  TF1 *widthmodel = new TF1("widthmodel", "[0] * TMath::Power(x, [1]) + [2]", 0., 1000.);
419  widthmodel->SetParameter(0, 0.0273139);
420  widthmodel->SetParameter(1, 1.36187);
421  widthmodel->SetParameter(2, 0.0736051);
422  fTriggerMaker->SetSmearModel(meanmodel, widthmodel);
423 }
424 
426  AliInfoStream() << "Initializing masked fastors from OADB container " << fMaskedFastorOADB.Data() << std::endl;
427  if(fMaskedFastorOADB.Contains("alien://") && !gGrid) TGrid::Connect("alien");
428  AliOADBContainer badchannelDB("AliEmcalMaskedFastors");
429  badchannelDB.InitFromFile(fMaskedFastorOADB, "AliEmcalMaskedFastors");
430  TObjArray *badchannelmap = static_cast<TObjArray *>(badchannelDB.GetObject(InputEvent()->GetRunNumber()));
431  if(!badchannelmap || !badchannelmap->GetEntries()) return;
432  for(TIter citer = TIter(badchannelmap).Begin(); citer != TIter::End(); ++citer){
433  TParameter<int> *channelID = static_cast<TParameter<int> *>(*citer);
434  AliDebugStream(1) << GetName() << ": Found masked fastor channel " << channelID->GetVal() << std::endl;
435  fTriggerMaker->AddFastORBadChannel(channelID->GetVal());
436  }
437 }
438 
439 
440 std::function<int (unsigned int, unsigned int)> AliEmcalTriggerMakerTask::GetMaskHandler(int itru) const {
441  bool isTRUsmallSM = ((itru >= 30 && itru < 31) || (itru >= 44 && itru < 45)) ;
442  if(fGeom->GetTriggerMappingVersion() == 2 && !isTRUsmallSM){
443  // Run 2 - complicated TRU layout in 6 subregions
444  return [] (unsigned int ifield, unsigned int ibit) -> int {
445  if(ifield >= 6 || ibit >= 16) throw kInvalidChannelException;
446  const int kChannelMap[6][16] = {{ 8, 9,10,11,20,21,22,23,32,33,34,35,44,45,46,47}, // Channels in mask0
447  {56,57,58,59,68,69,70,71,80,81,82,83,92,93,94,95}, // Channels in mask1
448  { 4, 5, 6, 7,16,17,18,19,28,29,30,31,40,41,42,43}, // Channels in mask2
449  {52,53,54,55,64,65,66,67,76,77,78,79,88,89,90,91}, // Channels in mask3
450  { 0, 1, 2, 3,12,13,14,15,24,25,26,27,36,37,38,39}, // Channels in mask4
451  {48,49,50,51,60,61,62,63,72,73,74,75,84,85,86,87}}; // Channels in mask5
452  return kChannelMap[ifield][ibit];
453  };
454  } else {
455  // Run 1 - linear mapping was used
456  return [] (int ifield, int ibit) -> int {
457  if(ifield >= 6 || ibit >= 16) throw kInvalidChannelException;
458  return ifield * 16 + ibit;
459  };
460  }
461 }
462 
464  if(fGeom->GetTriggerMappingVersion() == 2){
465  const int trumapping[46] = {0,1,2,5,4,3,6,7,8,11,10,9,12,13,14,17,16,15,18,19,20,23,22,21,24,25,26,29,28,27,30,31,32,33,37,36,38,39,43,42,44,45,49,48,50,51};
466  return trumapping[itru];
467  } else return itru;
468 }
469 
470 void AliEmcalTriggerMakerTask::FillQAHistos(const TString &patchtype, const AliEMCALTriggerPatchInfo &recpatch){
471  fQAHistos->FillTH2("RCPos" + patchtype, recpatch.GetColStart(), recpatch.GetRowStart());
472  fQAHistos->FillTH2("EPCentPos" + patchtype, recpatch.GetEtaGeo(), recpatch.GetPhiGeo());
473  fQAHistos->FillTH2("PatchADCvsE" + patchtype, recpatch.GetADCAmp(), recpatch.GetPatchE());
474  fQAHistos->FillTH2("PatchEvsEsmear" + patchtype, recpatch.GetPatchE(), recpatch.GetSmearedEnergy());
475  fQAHistos->FillTH2("PatchADCvsEsmear" + patchtype, recpatch.GetADCAmp(), recpatch.GetSmearedEnergy());
476  fQAHistos->FillTH2("PatchADCOffvsE" + patchtype, recpatch.GetADCOfflineAmp(), recpatch.GetPatchE());
477  fQAHistos->FillTH2("PatchEvsADCrough" + patchtype, recpatch.GetPatchE(), recpatch.GetADCAmpGeVRough());
478 }
AliVVZERO * fV0
! VZERO data
AliEmcalTriggerMakerTask()
Dummy constructor.
void Reset()
Reset all data grids and VZERO-dependent L1 thresholds.
int RemapTRUIndex(int itru) const
Fix mapping in TRU index.
New configuration, distinction between high and low threshold.
void InitializeBadFEEChannels()
Initialize bad channels from the OADB container.
virtual void ExecOnce()
Initialize the trigger maker kernel.
void ConfigureForPbPb2015()
Configure the class for 2015 PbPb.
Base task in the EMCAL framework.
Bool_t fLocalInitialized
whether or not the task has been already initialized
virtual Bool_t Run()
Run trigger patch finding.
void ConfigureForPP2015()
Configure the class for 2015 pp.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
void InitializeFastORMaskingFromOADB()
Initialize the FastOR masking from the OADB.
void AddFastORBadChannel(Short_t absId)
Add a FastOR bad channel to the list.
void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config)
Set the trigger bit configuration applied for the given data set.
void ConfigureForPbPb2011()
Configure the class for 2011 PbPb.
Bool_t fUseL0Amplitudes
Use L0 amplitudes instead of L1 time sum (useful for runs where STU was not read) ...
virtual void UserCreateOutputObjects()
Initializing output objects.
void Init()
Initialize the trigger maker Kernel.
void CreateTriggerPatches(const AliVEvent *inputevent, std::vector< AliEMCALTriggerPatchInfo > &outputcont, Bool_t useL0amp=kFALSE)
Run patch finders on input data.
void ClearFastORBadChannels()
Clear FastOR bad channel list.
void SetIsMC(Bool_t isMC)
Define whether running on MC or not (for offset)
void ConfigureForPP2011()
Configure the class for 2011 pp.
Bool_t fLoadFastORMaskingFromOCDB
Load FastOR masking from the OCDB.
void ReadTriggerData(AliVCaloTrigger *trigger)
Read the calo trigger data.
virtual ~AliEmcalTriggerMakerTask()
Destructor.
TString fV0InName
name of output track array
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
Old configuration, no distinction between high and low threshold.
void ConfigureForPP2012()
Configure the class for 2012 pp.
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
AliEMCALGeometry * fGeom
!emcal geometry
void SetUseTriggerBitConfig(TriggerMakerBitConfig_t bitConfig)
Trigger bit configuration to be used in the trigger patch maker.
AliEmcalTriggerMakerKernel * fTriggerMaker
The actual trigger maker kernel.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
std::function< int(unsigned int, unsigned int)> GetMaskHandler(int itru) const
Create functor handling the conversion between reg mask and channel.
void AddOfflineBadChannel(Short_t absId)
Add an offline bad channel to the set.
EMCAL trigger maker task.
double GetTriggerChannelEnergy(Int_t col, Int_t row) const
Get energy of the trigger channel estimated from cells (in col-row space)
Bool_t fRunSmearing
Also calculate smeared patch energy based on FastOR energy resolution.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
const std::set< Short_t > & GetListOfBadFastORAbsIDs() const
Get the list of online masked FastOR&#39;s used in the trigger maker.
void InitializeSmearModel()
Initialise smearing parameters for generated FastOR ADCs.
AliVCaloCells * fCaloCells
!cells
void BuildL1ThresholdsOffline(const AliVVZERO *vzdata)
Build VZERO-dependent thresholds for the offline trigger.
bool HasSmearModel() const
Check whether smear model has already been provided.
AliEmcalList * fOutput
!output list
void SetGeometry(const AliEMCALGeometry *const geo)
Provide the EMCAL geometry to the trigger maker Kernel.
virtual void RunChanged(Int_t newrun)
RunChanged method of the trigger maker.
void FillQAHistos(const TString &patchtype, const AliEMCALTriggerPatchInfo &recpatch)
Internal QA handler for trigger pathches of given type.
TString fBadFEEChannelOADB
name of the OADB container containing channels to be masked inside the trigger maker ...
TString fCaloTriggersOutName
name of output track array
void SetSmearModel(TF1 *mean, TF1 *width)
Set energy-dependent models for gaussian energy smearing.
TClonesArray * fCaloTriggersOut
! trigger array out
void ClearOfflineBadChannels()
Clear offline bad channel list.
double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const
Get estimated energy of the trigger channel based on ADC measurement (in col-row space) ...
Container class for histograms.
Definition: THistManager.h:99
double GetTriggerChannelEnergySmeared(Int_t col, Int_t row) const
Get (simulated) smeared energy of a trigger channel estimated based on the measured energy from cells...
Kernel of the EMCAL trigger patch maker.
TString fMaskedFastorOADB
name of the OADB container containing fastors to be masked inside the trigger maker ...
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
AliVCaloTrigger * fCaloTriggers
!calo triggers
void UserCreateOutputObjects()
Main initialization function on the worker.
void InitializeFastORMaskingFromOCDB()
Initialize the FastOR masking from the OCDB.
bool Bool_t
Definition: External.C:53
THistManager * fQAHistos
! Histograms for QA
double GetDataGridDimensionRows() const
Get the dimension of the underlying data grids in row direction.
void SetApplyOnlineBadChannelMaskingToSmeared(Bool_t doApply=kTRUE)
Apply online bad channel masking to smeared channel energies. This means that cell energies in cells ...
Bool_t fDoQA
Fill QA histograms.
void ReadCellData(AliVCaloCells *cells)
Read the EMCAL cell data.
void ConfigureForPPb2013()
Configure the class for 2013 pPb.