AliPhysics  75b74d3 (75b74d3)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 TObjArray;
13 class AliEMCALTriggerPatchInfo;
14 class AliEMCALTriggerRawPatch;
15 class AliEMCALGeometry;
16 class AliVCaloCells;
17 class AliVCaloTrigger;
18 class AliVEvent;
19 class AliVVZERO;
20 template<class T> class AliEMCALTriggerDataGrid;
21 template<class T> class AliEMCALTriggerAlgorithm;
22 template<class T> class AliEMCALTriggerPatchFinder;
23 
24 // To be moved to AliRoot in AliEMCALTriggerConstants.h at the first occasion
25 namespace EMCALTrigger {
26 const Double_t kEMCL0ADCtoGeV_AP = 0.018970588*4; // 0.075882352; ///< Conversion from EMCAL Level0 ADC to energy
27 }
28 
43 class AliEmcalTriggerMakerKernel : public TObject {
44 public:
45 
47 
52 
57 
66  void Init();
67 
82  TObjArray *CreateTriggerPatches(const AliVEvent *inputevent, Bool_t useL0amp=kFALSE);
83 
84  void SetTriggerThresholdJetLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[2][0] = a; fThresholdConstants[2][1] = b; fThresholdConstants[2][2] = c; }
85  void SetTriggerThresholdJetHigh ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[0][0] = a; fThresholdConstants[0][1] = b; fThresholdConstants[0][2] = c; }
86  void SetTriggerThresholdGammaLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[3][1] = b; fThresholdConstants[3][2] = c; }
87  void SetTriggerThresholdGammaHigh( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[1][0] = a; fThresholdConstants[1][1] = b; fThresholdConstants[1][2] = c; }
88  void SetBackgroundThreshold(Int_t t) { fBkgThreshold = t; }
89  void SetL0Threshold(Int_t t) { fL0Threshold = t; }
94  void SetJetPatchsize(Int_t patchsize) { fJetPatchsize = patchsize; }
99  void SetIsMC(Bool_t isMC) { fIsMC = isMC; }
100 
105  void SetGeometry(const AliEMCALGeometry *const geo) { fGeometry = geo; }
106 
111  void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config) { fTriggerBitConfig = config; }
112 
118  void SetL0TimeRange(Int_t min, Int_t max) { fL0MinTime = min; fL0MaxTime = max; }
119 
126  void SetFastORandCellThresholds(Int_t l0, Int_t l1, Int_t cell) { fMinL0FastORAmp = l0; fMinL1FastORAmp = l1; fMinCellAmp = cell; }
127 
132  void AddFastORBadChannel(Short_t absId) { fBadChannels.insert(absId); }
133 
138  void ReadFastORBadChannelFromStream(std::istream& stream);
139 
144  void ReadFastORBadChannelFromFile(const char* fname);
145 
150  void AddOfflineBadChannel(Short_t absId) { fOfflineBadChannels.insert(absId); }
151 
156  void ReadOfflineBadChannelFromStream(std::istream& stream);
157 
162  void ReadOfflineBadChannelFromFile(const char* fname);
163 
168  void ReadFastORPedestalFromStream(std::istream& stream);
169 
174  void ReadFastORPedestalFromFile(const char* fname);
175 
181  void SetFastORPedestal(Short_t absId, Float_t ped);
182 
187 
191  void Reset();
192 
200  void ReadTriggerData(AliVCaloTrigger *trigger);
201 
206  void ReadCellData(AliVCaloCells *cells);
207 
212  void BuildL1ThresholdsOffline(const AliVVZERO *vzdata);
213 
214 protected:
215  enum{
216  kColsEta = 48
217  };
218 
225  ELevel0TriggerStatus_t CheckForL0(Int_t col, Int_t row) const;
226 
233  AliEMCALTriggerAlgorithm<double> *CreateGammaTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const;
240  AliEMCALTriggerAlgorithm<double> *CreateJetTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const;
247  AliEMCALTriggerAlgorithm<double> *CreateBkgTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const;
248 
254  Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const;
260  Bool_t IsJetPatch(const AliEMCALTriggerRawPatch &patch) const;
266  Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const;
267 
268  std::set<Short_t> fBadChannels;
269  std::set<Short_t> fOfflineBadChannels;
270  TArrayF fFastORPedestal;
271  const AliEMCALTriggerBitConfig *fTriggerBitConfig;
272  const AliEMCALGeometry *fGeometry;
273 
279 
282  Int_t fL0MinTime;
283  Int_t fL0MaxTime;
284  Double_t fADCtoGeV;
285 
286  Int_t fMinCellAmp;
290  Int_t fThresholdConstants[4][3];
291  ULong64_t fL1ThresholdsOffline[4];
293  Int_t fL0Threshold;
294  Bool_t fIsMC;
295 
296  Int_t fDebugLevel;
297 
299  ClassDef(AliEmcalTriggerMakerKernel, 3);
301 };
302 
303 #endif
Int_t fBkgThreshold
threshold for the background patches (8x8)
ELevel0TriggerStatus_t CheckForL0(Int_t col, Int_t row) const
Bool_t IsGammaPatch(const AliEMCALTriggerRawPatch &patch) const
Bool_t IsBkgPatch(const AliEMCALTriggerRawPatch &patch) const
TObjArray * CreateTriggerPatches(const AliVEvent *inputevent, Bool_t useL0amp=kFALSE)
AliEMCALTriggerDataGrid< int > * fTriggerBitMap
! Map of trigger bits
void ReadFastORBadChannelFromStream(std::istream &stream)
TArrayF fFastORPedestal
FastOR pedestal.
void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *const config)
Int_t fMinCellAmp
Minimum offline amplitude of the cells used to generate the patches.
void ReadFastORBadChannelFromFile(const char *fname)
void ReadTriggerData(AliVCaloTrigger *trigger)
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)
ULong64_t fL1ThresholdsOffline[4]
container for V0-dependent offline thresholds
void ReadOfflineBadChannelFromFile(const char *fname)
Int_t fThresholdConstants[4][3]
simple offline trigger thresholds constants
AliEMCALTriggerAlgorithm< double > * CreateGammaTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const
void SetTriggerThresholdGammaHigh(Int_t a, Int_t b, Int_t c)
Double_t fADCtoGeV
! Conversion factor from ADC to GeV
void ReadOfflineBadChannelFromStream(std::istream &stream)
void SetFastORPedestal(Short_t absId, Float_t ped)
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)
AliEMCALTriggerDataGrid< double > * fPatchAmplitudes
! TRU Amplitudes (for L0)
void SetL0TimeRange(Int_t min, Int_t max)
void BuildL1ThresholdsOffline(const AliVVZERO *vzdata)
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)
AliEMCALTriggerAlgorithm< double > * CreateBkgTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const
std::set< Short_t > fOfflineBadChannels
Abd ID of offline bad channels.
AliEMCALTriggerPatchFinder< double > * fPatchFinder
! The actual patch finder
AliEMCALTriggerDataGrid< double > * fPatchADCSimple
! patch map for simple offline trigger
Kernel of the EMCAL trigger patch makerThe trigger maker kernel contains the core functionality of th...
void ReadFastORPedestalFromFile(const char *fname)
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
Int_t fJetPatchsize
Size of a jet patch.
void ReadFastORPedestalFromStream(std::istream &stream)
void ReadCellData(AliVCaloCells *cells)
void SetTriggerThresholdJetLow(Int_t a, Int_t b, Int_t c)
AliEMCALTriggerAlgorithm< double > * CreateJetTriggerAlgorithm(Int_t rowmin, Int_t rowmax) const
const Double_t kEMCL0ADCtoGeV_AP