Line data Source code
1 : /**
2 : * @file AliEMCALTriggerQA.h
3 : * @date Nov. 23, 2015
4 : * @author Salvatore Aiola <salvatore.aiola@cern.ch>, Yale University
5 : */
6 : #ifndef ALIEMCALTRIGGERQA_H
7 : #define ALIEMCALTRIGGERQA_H
8 : /* Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
9 : * See cxx source for full Copyright notice */
10 :
11 : #include <TNamed.h>
12 : #include <TArrayI.h>
13 : #include <cstring>
14 :
15 : #include <AliEMCALTriggerConstants.h>
16 :
17 : class AliEMCALTriggerPatchInfo;
18 : class TCollection;
19 : class TObjArray;
20 : class AliEMCALTriggerFastOR;
21 : class AliVCaloCells;
22 : class AliEMCALGeometry;
23 :
24 : /**
25 : * @class AliEMCALTriggerQA
26 : * @brief Class to generate EMCal trigger QA plots
27 : */
28 :
29 : class AliEMCALTriggerQA : public TNamed {
30 : public:
31 :
32 : typedef EMCALTrigger::EMCalTriggerType_t EMCalTriggerType_t;
33 :
34 : enum PatchTypes_t {
35 : kOnlinePatch = 0,
36 : kRecalcPatch = 1,
37 : kOfflinePatch = 2
38 : };
39 :
40 : struct AliEMCALCellInfo {
41 : AliEMCALCellInfo() : fAbsId(-1), fEnergy(0.) {}
42 : void Set(Int_t absId, Double_t e) { fAbsId = absId; fEnergy = e; }
43 :
44 : Short_t fAbsId;
45 : Double_t fEnergy;
46 : };
47 :
48 : AliEMCALTriggerQA();
49 : AliEMCALTriggerQA(const char* name);
50 : AliEMCALTriggerQA(const AliEMCALTriggerQA& ref);
51 : virtual ~AliEMCALTriggerQA();
52 :
53 0 : void SetDebugLevel(Int_t l) { fDebugLevel = l; }
54 0 : void SetADCperBin(Int_t i) { fADCperBin = i; }
55 :
56 0 : Int_t GetDebugLevel() const { return fDebugLevel ; }
57 :
58 : void EnablePatchType(PatchTypes_t patchtype, EMCalTriggerType_t triggertype, Bool_t e);
59 : Bool_t IsPatchTypeEnabled(Int_t patchtype, Int_t triggertype) const;
60 0 : void EnableHistogramsByTimeStamp(UInt_t binWidth = 600){ fTimeStampBinWidth = binWidth ; }
61 0 : void SetEMCALGeometry(const AliEMCALGeometry* geom) { fGeom = geom; }
62 :
63 : // This is the minimum set of methods that must be implemented by derived classes
64 : virtual void Init() = 0;
65 : virtual void ProcessPatch(const AliEMCALTriggerPatchInfo* patch) = 0;
66 : virtual void ProcessFastor(const AliEMCALTriggerFastOR* fastor, AliVCaloCells* cells = 0) = 0;
67 : virtual void EventCompleted() = 0;
68 : virtual TCollection* GetListOfHistograms() = 0;
69 :
70 : // Additional virtual methods that can optionally be overloaded
71 : virtual void ExecOnce();
72 0 : virtual void ProcessCell(const AliEMCALCellInfo& /*cell*/) {;}
73 : virtual void EventTimeStamp(UInt_t timeStamp);
74 :
75 : // These virtual methods are implemented only for PbPb
76 0 : virtual void ProcessBkgPatch(const AliEMCALTriggerPatchInfo* /*patch*/) {;}
77 0 : virtual void ComputeBackground() {;}
78 0 : virtual void GetEMCalMedian(Double_t /*median*/[3]) const {;}
79 0 : virtual void GetDCalMedian(Double_t /*median*/[3]) const {;}
80 0 : virtual void GetEMCalBkg(Double_t /*bkg*/[3]) const {;}
81 0 : virtual void GetDCalBkg(Double_t /*bkg*/[3]) const {;}
82 :
83 : static Int_t GetAmplitude(const AliEMCALTriggerPatchInfo* patch, Int_t itype);
84 :
85 : static const Int_t fgkSM = 20;
86 : static const Int_t fgkNPatchTypes = 3;
87 : static const Int_t fgkNTriggerTypes = 6;
88 : static const Int_t fgkNDet = 2;
89 :
90 : static const Int_t fgkMaxPatchAmp[fgkNTriggerTypes]; ///< Maximum patch amplitude for the histograms
91 : static const TString fgkPatchTypes[fgkNPatchTypes]; ///< Patch type names
92 :
93 : protected:
94 : UInt_t fEnabledTriggerPatches[fgkNPatchTypes]; ///< Patch types to be plotted
95 : Int_t fFastorL0Th; ///< FastOR L0 threshold
96 : Int_t fFastorL1Th; ///< FastOR L1 threshold
97 : Int_t fADCperBin; ///< ADC counts per bin
98 : Int_t fDebugLevel; ///< Debug level
99 : UInt_t fTimeStampBinWidth; ///< Time stamp bin width
100 :
101 : const AliEMCALGeometry *fGeom; //!<! Pointer to the EMCal geometry
102 : UInt_t fEventTimeStamp; //!<! Time stamp of the current event
103 : UInt_t fEventTimeStampBin; //!<! Time stamp bin
104 :
105 : private:
106 : AliEMCALTriggerQA &operator=(const AliEMCALTriggerQA &); // not implemented
107 :
108 : /// \cond CLASSIMP
109 22 : ClassDef(AliEMCALTriggerQA, 3);
110 : /// \endcond
111 : };
112 :
113 : #endif
|