AliPhysics  31210d0 (31210d0)
AliEmcalTriggerMakerKernel.h
Go to the documentation of this file.
1 #ifndef ALIEMCALTRIGGERMAKERKERNEL_H
2 #define ALIEMCALTRIGGERMAKERKERNEL_H
3 /* Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <set>
7 #include <iostream>
8 #include <vector>
9 
10 #include <TObject.h>
11 #include <TArrayF.h>
12 //#include <AliEMCALTriggerPatchInfoV1.h>
13 
14 class TF1;
15 class TObjArray;
16 class AliEMCALTriggerPatchInfo;
17 class AliEMCALTriggerRawPatch;
18 class AliEMCALGeometry;
19 class AliVCaloCells;
20 class AliVCaloTrigger;
21 class AliVEvent;
22 class AliVVZERO;
23 class AliEMCALTriggerBitConfig;
24 template<class T> class AliEMCALTriggerDataGrid;
25 template<class T> class AliEMCALTriggerAlgorithm;
26 template<class T> class AliEMCALTriggerPatchFinder;
27 
28 // To be moved to AliRoot in AliEMCALTriggerConstants.h at the first occasion
29 namespace EMCALTrigger {
30 const Double_t kEMCL0ADCtoGeV_AP = 0.018970588*4; // 0.075882352; ///< Conversion from EMCAL Level0 ADC to energy
31 }
32 
51 public:
52 
53  enum ELevel0TriggerStatus_t { kNotLevel0, kLevel0Candidate, kLevel0Fired };
54 
59 
63  virtual ~AliEmcalTriggerMakerKernel();
64 
74  void Init();
75 
94  void CreateTriggerPatches(const AliVEvent *inputevent, std::vector<AliEMCALTriggerPatchInfo> &outputcont, Bool_t useL0amp=kFALSE);
95 
100  const std::set<Short_t> &GetListOfBadFastORAbsIDs() const { return fBadChannels; }
101 
109  const std::set<Short_t> &GetListOfOfflineBadCellAbsIDs() const { return fOfflineBadChannels; }
110 
111  void SetTriggerThresholdJetLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[2][0] = a; fThresholdConstants[2][1] = b; fThresholdConstants[2][2] = c; }
112  void SetTriggerThresholdJetHigh ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[0][0] = a; fThresholdConstants[0][1] = b; fThresholdConstants[0][2] = c; }
113  void SetTriggerThresholdGammaLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[3][1] = b; fThresholdConstants[3][2] = c; }
114  void SetTriggerThresholdGammaHigh( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[1][0] = a; fThresholdConstants[1][1] = b; fThresholdConstants[1][2] = c; }
115  void SetBackgroundThreshold(Int_t t) { fBkgThreshold = t; }
116  void SetL0Threshold(Int_t t) { fL0Threshold = t; }
117 
124  double GetL0TriggerChannelAmplitude(Int_t col, Int_t row) const;
125 
132  double GetTriggerChannelADC(Int_t col, Int_t row) const;
133 
140  double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const;
141 
148  double GetTriggerChannelADCSimple(Int_t col, Int_t row) const;
149 
156  double GetTriggerChannelEnergy(Int_t col, Int_t row) const;
157 
164  double GetTriggerChannelEnergySmeared(Int_t col, Int_t row) const;
165 
170  double GetDataGridDimensionRows() const;
171 
176  void SetIsMC(Bool_t isMC) { fIsMC = isMC; }
177 
182  void SetGeometry(const AliEMCALGeometry *const geo) { fGeometry = geo; }
183 
188  void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config);
189 
195  void SetL0TimeRange(Int_t min, Int_t max) { fL0MinTime = min; fL0MaxTime = max; }
196 
203  void SetFastORandCellThresholds(Int_t l0, Int_t l1, Int_t cell) { fMinL0FastORAmp = l0; fMinL1FastORAmp = l1; fMinCellAmp = cell; }
204 
209  void SetL1ADCtoGeVConversion(Double_t conversionfactor) { fADCtoGeV = conversionfactor; }
210 
215  void AddFastORBadChannel(Short_t absId) { fBadChannels.insert(absId); }
216 
221  void ReadFastORBadChannelFromStream(std::istream& stream);
222 
226  void ClearFastORBadChannels();
227 
232  void ReadFastORBadChannelFromFile(const char* fname);
233 
238  void AddOfflineBadChannel(Short_t absId) { fOfflineBadChannels.insert(absId); }
239 
244  void ReadOfflineBadChannelFromStream(std::istream& stream);
245 
250  void ReadOfflineBadChannelFromFile(const char* fname);
251 
255  void ClearOfflineBadChannels();
256 
261  void ReadFastORPedestalFromStream(std::istream& stream);
262 
267  void ReadFastORPedestalFromFile(const char* fname);
268 
274  void SetFastORPedestal(Short_t absId, Float_t ped);
275 
279  void ResetFastORPedestal() { fFastORPedestal.Reset(); }
280 
285  void SetMaxAbsCellTime(Double_t maxCellTime) { fCellTimeLimits[0] = -maxCellTime; fCellTimeLimits[1] = maxCellTime; }
286 
292  void SetAcceptCellTimeRange(Double_t minCellTime, Double_t maxCellTime) { fCellTimeLimits[0] = minCellTime; fCellTimeLimits[1] = maxCellTime; }
293 
298  void SetLowerCellTimeCut(Double_t minCellTime) { fCellTimeLimits[0] = minCellTime; }
299 
304  void SetUpperCellTimeCut(Double_t maxCellTime) { fCellTimeLimits[1] = maxCellTime; }
305 
310  void SetMinFEEAmplitude(Double_t minamp) { fMinCellAmplitude = minamp; }
311 
319  void SetApplyOnlineBadChannelMaskingToOffline(Bool_t doApply = kTRUE) { fApplyOnlineBadChannelsToOffline = doApply; }
320 
324  void Reset();
325 
333  void ReadTriggerData(AliVCaloTrigger *trigger);
334 
345  void ReadCellData(AliVCaloCells *cells);
346 
351  void BuildL1ThresholdsOffline(const AliVVZERO *vzdata);
352 
361  void AddL1TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
362 
371  void SetL0TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
372 
378  void SetSmearModel(TF1 *mean, TF1 *width) {
379  fSmearModelMean = mean;
380  fSmearModelSigma = width;
381  }
382 
389  void SetSmearThreshold(Double_t threshold) { fSmearThreshold = threshold; }
390 
396  Bool_t IsConfigured() const { return fConfigured; }
397 
401  void ConfigureForPbPb2015();
402 
406  void ConfigureForPP2015();
407 
411  void ConfigureForPP20158x8();
412 
416  void ConfigureForPPb2013();
417 
421  void ConfigureForPP2012();
422 
426  void ConfigureForPbPb2011();
427 
431  void ConfigureForPP2011();
432 
433 protected:
434  enum{
435  kColsEta = 48
436  };
437 
446  ELevel0TriggerStatus_t CheckForL0(Int_t col, Int_t row) const;
447 
453  Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const;
459  Bool_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const;
465  Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const;
466 
474  bool HasPHOSOverlap(const AliEMCALTriggerRawPatch &patch) const;
475 
476  std::set<Short_t> fBadChannels;
477  std::set<Short_t> fOfflineBadChannels;
478  TArrayF fFastORPedestal;
479  const AliEMCALTriggerBitConfig *fTriggerBitConfig;
480 
488  Int_t fThresholdConstants[4][3];
489  ULong64_t fL1ThresholdsOffline[4];
494  Double_t fCellTimeLimits[2];
501 
502  const AliEMCALGeometry *fGeometry;
509 
511 
513  ClassDef(AliEmcalTriggerMakerKernel, 4);
515 };
516 
517 #endif
Int_t fBkgThreshold
threshold for the background patches (8x8)
double Double_t
Definition: External.C:58
Double_t fMinCellAmplitude
Minimum amplitude in cell required to be considered for filling the data grid.
AliEMCALTriggerDataGrid< int > * fTriggerBitMap
! Map of trigger bits
TArrayF fFastORPedestal
FastOR pedestal.
void AddFastORBadChannel(Short_t absId)
Add a FastOR bad channel to the list.
void SetSmearThreshold(Double_t threshold)
Set the energy threshold for smearing.
TCanvas * c
Definition: TestFitELoss.C:172
Bool_t fConfigured
Switch specifying whether the trigger maker kernel has been configured for a given data set...
Int_t fMinCellAmp
Minimum offline amplitude of the cells used to generate the patches.
void SetUpperCellTimeCut(Double_t maxCellTime)
Set upper cut on the cell time allowed to accept the cell contributing to cell offline energy / offli...
void SetIsMC(Bool_t isMC)
Define whether running on MC or not (for offset)
Bool_t fApplyOnlineBadChannelsToOffline
Apply online bad channels to offline ADC values.
Int_t fMinL1FastORAmp
Minimum L1 amplitude of the FastORs used to generate the patches.
const AliEMCALTriggerBitConfig * fTriggerBitConfig
Trigger bit configuration, aliroot-dependent.
const AliEMCALGeometry * fGeometry
! Underlying EMCAL geometry
void SetFastORandCellThresholds(Int_t l0, Int_t l1, Int_t cell)
Set thresholds applied to FastORs and offline cells before patch reconstruction.
void SetAcceptCellTimeRange(Double_t minCellTime, Double_t maxCellTime)
Set symmmetric limit of the cell time allowed to accept the cell contributing to cell offline energy ...
void SetMinFEEAmplitude(Double_t minamp)
Set cut on the minimum cell amplitude.
int Int_t
Definition: External.C:63
void ResetFastORPedestal()
Reset the FastOR pedestal array.
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void SetMaxAbsCellTime(Double_t maxCellTime)
Set symmmetric limit of the cell time allowed to accept the cell contributing to cell offline energy ...
void SetTriggerThresholdGammaHigh(Int_t a, Int_t b, Int_t c)
Double_t fSmearThreshold
Smear threshold: Only cell energies above threshold are smeared.
void SetL1ADCtoGeVConversion(Double_t conversionfactor)
Set conversion between ADC counts and energy in GeV.
void SetApplyOnlineBadChannelMaskingToOffline(Bool_t doApply=kTRUE)
Apply online bad channel masking to offline channel energies. This means that cell energies in cells ...
Double_t fADCtoGeV
! Conversion factor from ADC to GeV
const std::set< Short_t > & GetListOfOfflineBadCellAbsIDs() const
Get the list of bad cells used when calculating offline patch energy.
void AddOfflineBadChannel(Short_t absId)
Add an offline bad channel to the set.
std::set< Short_t > fBadChannels
Container of bad channels.
void SetTriggerThresholdGammaLow(Int_t a, Int_t b, Int_t c)
Int_t fL0Threshold
threshold for the L0 patches (2x2)
const std::set< Short_t > & GetListOfBadFastORAbsIDs() const
Get the list of online masked FastOR&#39;s used in the trigger maker.
AliEMCALTriggerDataGrid< double > * fPatchAmplitudes
! TRU Amplitudes (for L0)
short Short_t
Definition: External.C:23
void SetL0TimeRange(Int_t min, Int_t max)
Set range for L0 time.
AliEMCALTriggerDataGrid< double > * fPatchADC
! ADC values map
Bool_t isMC
Int_t fMinL0FastORAmp
Minimum L0 amplitude of the FastORs used to generate the patches.
void SetGeometry(const AliEMCALGeometry *const geo)
Provide the EMCAL geometry to the trigger maker Kernel.
std::set< Short_t > fOfflineBadChannels
Abd ID of offline bad channels.
void SetSmearModel(TF1 *mean, TF1 *width)
Set energy-dependent models for gaussian energy smearing.
AliEMCALTriggerPatchFinder< double > * fPatchFinder
The actual patch finder.
AliEMCALTriggerDataGrid< double > * fPatchADCSimple
! patch map for simple offline trigger
Kernel of the EMCAL trigger patch maker.
void SetTriggerThresholdJetHigh(Int_t a, Int_t b, Int_t c)
AliEMCALTriggerDataGrid< char > * fLevel0TimeMap
! Map needed to store the level0 times
AliEMCALTriggerAlgorithm< double > * fLevel0PatchFinder
Patch finder for Level0 patches.
bool Bool_t
Definition: External.C:53
TF1 * fSmearModelMean
Smearing parameterization for the mean.
void SetLowerCellTimeCut(Double_t minCellTime)
Set lower cut on the cell time allowed to accept the cell contributing to cell offline energy / offli...
void SetTriggerThresholdJetLow(Int_t a, Int_t b, Int_t c)
AliEMCALTriggerDataGrid< double > * fPatchEnergySimpleSmeared
! Data grid for smeared energy values from cell energies
TF1 * fSmearModelSigma
Smearing parameterization for the width.
const Double_t kEMCL0ADCtoGeV_AP