AliPhysics  b81c3d2 (b81c3d2)
 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 #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 template<class T> class AliEMCALTriggerDataGrid;
24 template<class T> class AliEMCALTriggerAlgorithm;
25 template<class T> class AliEMCALTriggerPatchFinder;
26 
27 // To be moved to AliRoot in AliEMCALTriggerConstants.h at the first occasion
28 namespace EMCALTrigger {
29 const Double_t kEMCL0ADCtoGeV_AP = 0.018970588*4; // 0.075882352; ///< Conversion from EMCAL Level0 ADC to energy
30 }
31 
50 public:
51 
53 
58 
63 
73  void Init();
74 
93  void CreateTriggerPatches(const AliVEvent *inputevent, std::vector<AliEMCALTriggerPatchInfo> &outputcont, Bool_t useL0amp=kFALSE);
94 
99  const std::set<Short_t> &GetListOfBadFastORAbsIDs() const { return fBadChannels; }
100 
108  const std::set<Short_t> &GetListOfOfflineBadCellAbsIDs() const { return fOfflineBadChannels; }
109 
116 
123  double GetTriggerChannelADC(Int_t col, Int_t row) const;
124 
131  double GetTriggerChannelEnergyRough(Int_t col, Int_t row) const;
132 
139  double GetTriggerChannelADCSimple(Int_t col, Int_t row) const;
140 
147  double GetTriggerChannelEnergy(Int_t col, Int_t row) const;
148 
155  double GetTriggerChannelEnergySmeared(Int_t col, Int_t row) const;
156 
161  double GetDataGridDimensionRows() const;
162 
167  void SetIsMC(Bool_t isMC) { fIsMC = isMC; }
168 
173  void SetGeometry(const AliEMCALGeometry *const geo) { fGeometry = geo; }
174 
179  void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config);
180 
186  void SetL0TimeRange(Int_t min, Int_t max) { fL0MinTime = min; fL0MaxTime = max; }
187 
195 
200  void SetL1ADCtoGeVConversion(Double_t conversionfactor) { fADCtoGeV = conversionfactor; }
201 
206  void AddFastORBadChannel(Short_t absId) { fBadChannels.insert(absId); }
207 
212  void ReadFastORBadChannelFromStream(std::istream& stream);
213 
217  void ClearFastORBadChannels();
218 
223  void ReadFastORBadChannelFromFile(const char* fname);
224 
229  void AddOfflineBadChannel(Short_t absId) { fOfflineBadChannels.insert(absId); }
230 
235  void ReadOfflineBadChannelFromStream(std::istream& stream);
236 
241  void ReadOfflineBadChannelFromFile(const char* fname);
242 
247 
252  void ReadFastORPedestalFromStream(std::istream& stream);
253 
258  void ReadFastORPedestalFromFile(const char* fname);
259 
265  void SetFastORPedestal(Short_t absId, Float_t ped);
266 
271 
276  void SetMaxAbsCellTime(Double_t maxCellTime) { fCellTimeLimits[0] = -maxCellTime; fCellTimeLimits[1] = maxCellTime; }
277 
283  void SetAcceptCellTimeRange(Double_t minCellTime, Double_t maxCellTime) { fCellTimeLimits[0] = minCellTime; fCellTimeLimits[1] = maxCellTime; }
284 
289  void SetLowerCellTimeCut(Double_t minCellTime) { fCellTimeLimits[0] = minCellTime; }
290 
295  void SetUpperCellTimeCut(Double_t maxCellTime) { fCellTimeLimits[1] = maxCellTime; }
296 
301  void SetMinFEEAmplitude(Double_t minamp) { fMinCellAmplitude = minamp; }
302 
311 
315  void Reset();
316 
324  void ReadTriggerData(AliVCaloTrigger *trigger);
325 
336  void ReadCellData(AliVCaloCells *cells);
337 
342  void BuildL1ThresholdsOffline(const AliVVZERO *vzdata);
343 
352  void AddL1TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
353 
362  void SetL0TriggerAlgorithm(Int_t rowmin, Int_t rowmax, UInt_t bitmask, Int_t patchSize, Int_t subregionSize);
363 
369  void SetSmearModel(TF1 *mean, TF1 *width) {
370  fSmearModelMean = mean;
371  fSmearModelSigma = width;
372  }
373 
380  void SetSmearThreshold(Double_t threshold) { fSmearThreshold = threshold; }
381 
387  Bool_t IsConfigured() const { return fConfigured; }
388 
392  void ConfigureForPbPb2015();
393 
397  void ConfigureForPP2015();
398 
402  void ConfigureForPPb2013();
403 
407  void ConfigureForPP2012();
408 
412  void ConfigureForPbPb2011();
413 
417  void ConfigureForPP2011();
418 
419 protected:
420  enum{
421  kColsEta = 48
422  };
423 
433 
439  Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const;
445  Bool_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const;
451  Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const;
452 
460  bool HasPHOSOverlap(const AliEMCALTriggerRawPatch &patch) const;
461 
462  std::set<Short_t> fBadChannels;
463  std::set<Short_t> fOfflineBadChannels;
464  TArrayF fFastORPedestal;
465  const AliEMCALTriggerBitConfig *fTriggerBitConfig;
466 
475  ULong64_t fL1ThresholdsOffline[4];
487 
488  const AliEMCALGeometry *fGeometry;
495 
497 
499  ClassDef(AliEmcalTriggerMakerKernel, 4);
501 };
502 
503 #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.
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 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 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