AliPhysics  97344c9 (97344c9)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
9 #include <TObject.h>
10 #include <TArrayF.h>
11 
12 class TF1;
13 class TObjArray;
14 class AliEMCALTriggerPatchInfo;
15 class AliEMCALTriggerRawPatch;
16 class AliEMCALGeometry;
17 class AliVCaloCells;
18 class AliVCaloTrigger;
19 class AliVEvent;
20 class AliVVZERO;
21 template<class T> class AliEMCALTriggerDataGrid;
22 template<class T> class AliEMCALTriggerAlgorithm;
23 template<class T> class AliEMCALTriggerPatchFinder;
24 
25 // To be moved to AliRoot in AliEMCALTriggerConstants.h at the first occasion
26 namespace EMCALTrigger {
27 const Double_t kEMCL0ADCtoGeV_AP = 0.018970588*4; // 0.075882352; ///< Conversion from EMCAL Level0 ADC to energy
28 }
29 
48 public:
49 
51 
56 
61 
71  void Init();
72 
90  TObjArray *CreateTriggerPatches(const AliVEvent *inputevent, Bool_t useL0amp=kFALSE);
91 
96  const std::set<Short_t> &GetListOfBadFastORAbsIDs() const { return fBadChannels; }
97 
105  const std::set<Short_t> &GetListOfOfflineBadCellAbsIDs() const { return fOfflineBadChannels; }
106 
113 
120  double GetTriggerChannelADC(Int_t col, Int_t row) const;
121 
128  double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const;
129 
136  double GetTriggerChannelADCSimple(Int_t col, Int_t row) const;
137 
144  double GetTriggerChannelEnergy(Int_t col, Int_t row) const;
145 
152  double GetTriggerChannelEnergySmeared(Int_t col, Int_t row) const;
153 
158  double GetDataGridDimensionRows() const;
159 
164  void SetIsMC(Bool_t isMC) { fIsMC = isMC; }
165 
170  void SetGeometry(const AliEMCALGeometry *const geo) { fGeometry = geo; }
171 
176  void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config);
177 
183  void SetL0TimeRange(Int_t min, Int_t max) { fL0MinTime = min; fL0MaxTime = max; }
184 
192 
197  void SetL1ADCtoGeVConversion(Double_t conversionfactor) { fADCtoGeV = conversionfactor; }
198 
203  void AddFastORBadChannel(Short_t absId) { fBadChannels.insert(absId); }
204 
209  void ReadFastORBadChannelFromStream(std::istream& stream);
210 
214  void ClearFastORBadChannels();
215 
220  void ReadFastORBadChannelFromFile(const char* fname);
221 
226  void AddOfflineBadChannel(Short_t absId) { fOfflineBadChannels.insert(absId); }
227 
232  void ReadOfflineBadChannelFromStream(std::istream& stream);
233 
238  void ReadOfflineBadChannelFromFile(const char* fname);
239 
244 
249  void ReadFastORPedestalFromStream(std::istream& stream);
250 
255  void ReadFastORPedestalFromFile(const char* fname);
256 
262  void SetFastORPedestal(Short_t absId, Float_t ped);
263 
268 
273  void SetMaxAbsCellTime(Double_t maxCellTime) { fCellTimeLimits[0] = -maxCellTime; fCellTimeLimits[1] = maxCellTime; }
274 
280  void SetAcceptCellTimeRange(Double_t minCellTime, Double_t maxCellTime) { fCellTimeLimits[0] = minCellTime; fCellTimeLimits[1] = maxCellTime; }
281 
286  void SetLowerCellTimeCut(Double_t minCellTime) { fCellTimeLimits[0] = minCellTime; }
287 
292  void SetUpperCellTimeCut(Double_t maxCellTime) { fCellTimeLimits[1] = maxCellTime; }
293 
298  void SetMinFEEAmplitude(Double_t minamp) { fMinCellAmplitude = minamp; }
299 
308 
312  void Reset();
313 
321  void ReadTriggerData(AliVCaloTrigger *trigger);
322 
333  void ReadCellData(AliVCaloCells *cells);
334 
339  void BuildL1ThresholdsOffline(const AliVVZERO *vzdata);
340 
349  void AddL1TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
350 
359  void SetL0TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
360 
366  void SetSmearModel(TF1 *mean, TF1 *width) {
367  fSmearModelMean = mean;
368  fSmearModelSigma = width;
369  }
370 
377  void SetSmearThreshold(Double_t threshold) { fSmearThreshold = threshold; }
378 
384  Bool_t IsConfigured() const { return fConfigured; }
385 
389  void ConfigureForPbPb2015();
390 
394  void ConfigureForPP2015();
395 
399  void ConfigureForPPb2013();
400 
404  void ConfigureForPP2012();
405 
409  void ConfigureForPbPb2011();
410 
414  void ConfigureForPP2011();
415 
416 protected:
417  enum{
418  kColsEta = 48
419  };
420 
430 
436  Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const;
442  Bool_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const;
448  Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const;
449 
457  bool HasPHOSOverlap(const AliEMCALTriggerRawPatch &patch) const;
458 
459  std::set<Short_t> fBadChannels;
460  std::set<Short_t> fOfflineBadChannels;
461  TArrayF fFastORPedestal;
462  const AliEMCALTriggerBitConfig *fTriggerBitConfig;
463 
472  ULong64_t fL1ThresholdsOffline[4];
484 
485  const AliEMCALGeometry *fGeometry;
492 
494 
496  ClassDef(AliEmcalTriggerMakerKernel, 4);
498 };
499 
500 #endif
void Reset()
Reset all data grids and VZERO-dependent L1 thresholds.
Int_t fBkgThreshold
threshold for the background patches (8x8)
ELevel0TriggerStatus_t CheckForL0(Int_t col, Int_t row) const
Accept trigger patch as Level0 patch.
double Double_t
Definition: External.C:58
Double_t fCellTimeLimits[2]
Maximum allowed abs cell time (default [0] = - 10000, [1] = 10000)
Double_t fMinCellAmplitude
Minimum amplitude in cell required to be considered for filling the data grid.
Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const
Check from the bitmask whether the patch is a gamma patch.
void ConfigureForPbPb2015()
Configure the class for 2015 PbPb.
void ConfigureForPP2015()
Configure the class for 2015 pp.
Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const
Check from the bitmask whether the patch is a background patch.
TObjArray * CreateTriggerPatches(const AliVEvent *inputevent, Bool_t useL0amp=kFALSE)
Run patch finders on input data.
bool HasPHOSOverlap(const AliEMCALTriggerRawPatch &patch) const
AliEMCALTriggerDataGrid< int > * fTriggerBitMap
! Map of trigger bits
void ReadFastORBadChannelFromStream(std::istream &stream)
Read the FastOR bad channel map from a standard stream.
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
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 fConfigured
Switch specifying whether the trigger maker kernel has been configured for a given data set...
void Init()
Initialize the trigger maker Kernel.
Int_t fMinCellAmp
Minimum offline amplitude of the cells used to generate the patches.
void ClearFastORBadChannels()
Clear FastOR bad channel list.
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)
void ConfigureForPP2011()
Configure the class for 2011 pp.
void ReadFastORBadChannelFromFile(const char *fname)
Read the FastOR bad channel map from a text file.
Bool_t fApplyOnlineBadChannelsToOffline
Apply online bad channels to offline ADC values.
void ReadTriggerData(AliVCaloTrigger *trigger)
Read the calo trigger data.
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.
ULong64_t fL1ThresholdsOffline[4]
container for V0-dependent offline thresholds
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
void ReadOfflineBadChannelFromFile(const char *fname)
Read the offline bad channel map from a text file.
void ConfigureForPP2012()
Configure the class for 2012 pp.
Int_t fThresholdConstants[4][3]
simple offline trigger thresholds constants
float Float_t
Definition: External.C:68
virtual ~AliEmcalTriggerMakerKernel()
Destructor.
double GetTriggerChannelADC(Int_t col, Int_t row) const
Get ADC value of a given trigger channel (in col-row space)
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
void AddL1TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize)
void SetL0TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize)
Set the L0 algorithm.
const std::set< Short_t > & GetListOfOfflineBadCellAbsIDs() const
Get the list of bad cells used when calculating offline patch energy.
void ReadOfflineBadChannelFromStream(std::istream &stream)
Read the offline bad channel map from a standard stream.
void SetFastORPedestal(Short_t absId, Float_t ped)
Set the pedestal value for a FastOR.
void AddOfflineBadChannel(Short_t absId)
Add an offline bad channel to the set.
double GetTriggerChannelEnergy(Int_t col, Int_t row) const
Get energy of the trigger channel estimated from cells (in col-row space)
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'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.
void BuildL1ThresholdsOffline(const AliVVZERO *vzdata)
Build VZERO-dependent thresholds for the offline trigger.
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.
void ClearOfflineBadChannels()
Clear offline bad channel list.
double GetTriggerChannelADCSimple(Int_t col, Int_t row) const
Get ADC value of trigger channel estimated from cell energies.
double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const
Get estimated energy of the trigger channel based on ADC measurement (in col-row space) ...
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...
AliEMCALTriggerDataGrid< double > * fPatchADCSimple
! patch map for simple offline trigger
Kernel of the EMCAL trigger patch maker.
void ReadFastORPedestalFromFile(const char *fname)
Read the FastOR pedestals from a text file.
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_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const
Check from the bitmask whether the patch is a jet patch.
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...
double GetDataGridDimensionRows() const
Get the dimension of the underlying data grids in row direction.
void ReadFastORPedestalFromStream(std::istream &stream)
Read the FastOR pedestals from a standard stream.
void ReadCellData(AliVCaloCells *cells)
Read the EMCAL cell data.
void SetTriggerThresholdJetLow(Int_t a, Int_t b, Int_t c)
void ConfigureForPPb2013()
Configure the class for 2013 pPb.
AliEMCALTriggerDataGrid< double > * fPatchEnergySimpleSmeared
! Data grid for smeared energy values from cell energies
TF1 * fSmearModelSigma
Smearing parameterization for the width.
const Double_t kEMCL0ADCtoGeV_AP