AliPhysics  master (3d17d9d)
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 
121  void SetOnlineBackgroundSubtraction(Bool_t doSubtraction) { fDoBackgroundSubtraction = doSubtraction; }
122 
129  double GetL0TriggerChannelAmplitude(Int_t col, Int_t row) const;
130 
137  double GetTriggerChannelADC(Int_t col, Int_t row) const;
138 
145  double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const;
146 
153  double GetTriggerChannelADCSimple(Int_t col, Int_t row) const;
154 
161  double GetTriggerChannelEnergy(Int_t col, Int_t row) const;
162 
169  double GetTriggerChannelEnergySmeared(Int_t col, Int_t row) const;
170 
175  double GetDataGridDimensionRows() const;
176 
181  bool HasSmearModel() const { return fSmearModelMean && fSmearModelSigma; }
182 
187  void SetIsMC(Bool_t isMC) { fIsMC = isMC; }
188 
193  void SetGeometry(const AliEMCALGeometry *const geo) { fGeometry = geo; }
194 
199  void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config);
200 
206  void SetL0TimeRange(Int_t min, Int_t max) { fL0MinTime = min; fL0MaxTime = max; }
207 
214  void SetFastORandCellThresholds(Int_t l0, Int_t l1, Int_t cell) { fMinL0FastORAmp = l0; fMinL1FastORAmp = l1; fMinCellAmp = cell; }
215 
220  void SetL1ADCtoGeVConversion(Double_t conversionfactor) { fADCtoGeV = conversionfactor; }
221 
226  void AddFastORBadChannel(Short_t absId) { fBadChannels.insert(absId); }
227 
232  void ReadFastORBadChannelFromStream(std::istream& stream);
233 
237  void ClearFastORBadChannels();
238 
243  void ReadFastORBadChannelFromFile(const char* fname);
244 
249  void AddOfflineBadChannel(Short_t absId) { fOfflineBadChannels.insert(absId); }
250 
255  void ReadOfflineBadChannelFromStream(std::istream& stream);
256 
261  void ReadOfflineBadChannelFromFile(const char* fname);
262 
266  void ClearOfflineBadChannels();
267 
272  void ReadFastORPedestalFromStream(std::istream& stream);
273 
278  void ReadFastORPedestalFromFile(const char* fname);
279 
285  void SetFastORPedestal(Short_t absId, Float_t ped);
286 
290  void ResetFastORPedestal() { fFastORPedestal.Reset(); }
291 
296  void SetMaxAbsCellTime(Double_t maxCellTime) { fCellTimeLimits[0] = -maxCellTime; fCellTimeLimits[1] = maxCellTime; }
297 
303  void SetAcceptCellTimeRange(Double_t minCellTime, Double_t maxCellTime) { fCellTimeLimits[0] = minCellTime; fCellTimeLimits[1] = maxCellTime; }
304 
309  void SetLowerCellTimeCut(Double_t minCellTime) { fCellTimeLimits[0] = minCellTime; }
310 
315  void SetUpperCellTimeCut(Double_t maxCellTime) { fCellTimeLimits[1] = maxCellTime; }
316 
321  void SetMinFEEAmplitude(Double_t minamp) { fMinCellAmplitude = minamp; }
322 
330  void SetApplyOnlineBadChannelMaskingToOffline(Bool_t doApply = kTRUE) { fApplyOnlineBadChannelsToOffline = doApply; }
331 
339  void SetApplyOnlineBadChannelMaskingToSmeared(Bool_t doApply = kTRUE) { fApplyOnlineBadChannelsToSmeared = doApply; }
340 
344  void Reset();
345 
353  void ReadTriggerData(AliVCaloTrigger *trigger);
354 
365  void ReadCellData(AliVCaloCells *cells);
366 
371  void BuildL1ThresholdsOffline(const AliVVZERO *vzdata);
372 
381  void AddL1TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
382 
391  void SetL0TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
392 
398  void SetSmearModel(TF1 *mean, TF1 *width) {
399  fSmearModelMean = mean;
400  fSmearModelSigma = width;
401  }
402 
409  void SetSmearThreshold(Double_t threshold) { fSmearThreshold = threshold; }
410 
415  void SetScaleShift(Double_t scaleshift) { fScaleShift = scaleshift; }
416 
422  Bool_t IsConfigured() const { return fConfigured; }
423 
427  void ConfigureForPbPb2015();
428 
432  void ConfigureForPP2015();
433 
437  void ConfigureForPP20158x8();
438 
442  void ConfigureForPPb2013();
443 
447  void ConfigureForPP2012();
448 
452  void ConfigureForPbPb2011();
453 
457  void ConfigureForPP2011();
458 
459 protected:
460  enum{
461  kColsEta = 48
462  };
463  enum {
464  kIndRhoEMCAL = 0,
465  kIndRhoDCAL = 1,
466  kNIndRho = 2
467  };
468 
477  ELevel0TriggerStatus_t CheckForL0(Int_t col, Int_t row) const;
478 
484  Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const;
490  Bool_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const;
496  Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const;
497 
505  bool HasPHOSOverlap(const AliEMCALTriggerRawPatch &patch) const;
506 
507  std::set<Short_t> fBadChannels;
508  std::set<Short_t> fOfflineBadChannels;
509  TArrayF fFastORPedestal;
510  const AliEMCALTriggerBitConfig *fTriggerBitConfig;
511 
519  Int_t fThresholdConstants[4][3];
520  ULong64_t fL1ThresholdsOffline[4];
525  Double_t fCellTimeLimits[2];
535 
536  const AliEMCALGeometry *fGeometry;
543  Double_t fRhoValues[kNIndRho];
544 
546 
548  ClassDef(AliEmcalTriggerMakerKernel, 4);
550 };
551 
552 #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 SetScaleShift(Double_t scaleshift)
Simulate constant shift of the EMCAL Energy scale.
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 fApplyOnlineBadChannelsToSmeared
Apply online bad channels to smeared energies values.
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.
Bool_t fDoBackgroundSubtraction
Swtich for background subtraction (only online ADC)
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 HasSmearModel() const
Check whether smear model has already been provided.
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.
void SetOnlineBackgroundSubtraction(Bool_t doSubtraction)
Switch on median subtraction of the online ADC value.
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 SetApplyOnlineBadChannelMaskingToSmeared(Bool_t doApply=kTRUE)
Apply online bad channel masking to smeared channel energies. This means that cell energies in cells ...
void SetTriggerThresholdJetLow(Int_t a, Int_t b, Int_t c)
AliEMCALTriggerDataGrid< double > * fPatchEnergySimpleSmeared
! Data grid for smeared energy values from cell energies
Double_t fScaleShift
Scale shift simulation.
TF1 * fSmearModelSigma
Smearing parameterization for the width.
const Double_t kEMCL0ADCtoGeV_AP