2121#include " EMCALBase/Mapper.h"
2222#include < memory>
2323#include < array>
24+ #include < cstdint>
25+ #include < unordered_map>
26+
27+ #include " DetectorsRaw/RDHUtils.h"
28+ #include " Headers/RAWDataHeader.h"
29+ #include < Framework/InputRecord.h>
30+ #include < CommonConstants/Triggers.h>
2431
2532class TH1F ;
2633class TH2F ;
2734class TProfile2D ;
2835
2936using namespace o2 ::quality_control::core;
3037
38+ namespace o2 ::emcal
39+ {
40+ class Geometry ;
41+ }
42+
3143namespace o2 ::quality_control_modules::emcal
3244{
3345
@@ -52,26 +64,62 @@ class RawTask final : public TaskInterface
5264 void endOfActivity (Activity& activity) override ;
5365 void reset () override ;
5466
67+ enum class EventType {
68+ CAL_EVENT ,
69+ PHYS_EVENT
70+ };
71+
5572 private:
56- TH1F * mHistogram = nullptr ;
73+ // / \struct RawEventType
74+ // / \brief Key type for maps caching event information from different subevents, containing also trigger information
75+ struct RawEventType {
76+ o2::InteractionRecord mIR ;
77+ uint32_t mTrigger ;
78+ bool operator ==(const RawEventType& other) const { return mIR == other.mIR ; }
79+ bool operator <(const RawEventType& other) const { return mIR < other.mIR ; }
80+ };
81+
82+ // / \struct RawEventTypeHash
83+ // / \brief Hash-value calculation for struct RawEventType, used in std::unordered_map
84+ struct RawEventTypeHash {
85+ // / \brief Hash function, purely based on bc and orbit ID as they are unique for a collision
86+ // / \param evtype Raw event information with event interaction record
87+ // / \return Hash value
88+ std::size_t operator ()(const RawEventType& evtype) const
89+ {
90+ size_t h1 = std::hash<int >()(evtype.mIR .bc );
91+ size_t h2 = std::hash<int >()(evtype.mIR .orbit );
92+ return h1 ^ (h2 << 1 );
93+ }
94+ };
95+
96+ o2::emcal::Geometry* mGeometry = nullptr ; // /< EMCAL geometry
97+ TH1 * mPayloadSize = nullptr ;
5798 TH1 * mMessageCounter = nullptr ;
5899 TH1 * mNumberOfSuperpagesPerMessage ;
59100 TH1 * mNumberOfPagesPerMessage ;
60- TH1 * mSuperpageCounter = nullptr ; // /< Counter for number of superpages
61- TH1 * mPageCounter = nullptr ; // /< Counter for number of pages (headers)
62- TH1 * mTotalDataVolume = nullptr ; // /< Total data volume
63- std::map<std::string, std::array<TH1 *, 20 >> mRawAmplitudeEMCAL ; // ///< Raw amplitude in EMCAL
64- std::map<std::string, std::array<TH1 *, 20 >> mRawAmplMaxEMCAL ; // /< Max Raw amplitude in EMCAL per cell
65- std::map<std::string, std::array<TH1 *, 20 >> mRawAmplMinEMCAL ; // /< Min Raw amplitude in EMCAL per cell
66- std::map<std::string, std::array<TProfile2D*, 20 >> mRMSperSM ; // /< ADC rms per SM
67- std::map<std::string, std::array<TProfile2D*, 20 >> mMEANperSM ; // /< ADC mean per SM
68- std::map<std::string, std::array<TProfile2D*, 20 >> mMAXperSM ; // /< ADC max per SM
69- std::map<std::string, std::array<TProfile2D*, 20 >> mMINperSM ; // /< ADC min per SM
70- std::unique_ptr<o2::emcal::MappingHandler> mMappings ; // /< Mappings Hardware address -> Channel
71- TH2F * mErrorTypeAltro = nullptr ; // /< Error from AltroDecoder
72- TH2F * mPayloadSizePerDDL = nullptr ; // /< Payload size per ddl
73- Int_t mNumberOfSuperpages = 0 ; // /< Simple total superpage counter
74- Int_t mNumberOfPages = 0 ; // /< Simple total number of superpages counter
101+ TH1 * mSuperpageCounter = nullptr ; // /< Counter for number of superpages
102+ TH1 * mPageCounter = nullptr ; // /< Counter for number of pages (headers)
103+ TH1 * mTotalDataVolume = nullptr ; // /< Total data volume
104+ std::array<TH1 *, 20 > mFECmaxCount ; // /< max number of hit channels
105+ std::array<TH1 *, 20 > mFECmaxID ; // /< FEC ID max number of hit channels
106+ std::unordered_map<EventType, TProfile2D*> mRMS ; // /< ADC rms for EMCAL+DCAL togheter
107+ std::unordered_map<EventType, TProfile2D*> mMEAN ; // /< ADC mean
108+ std::unordered_map<EventType, TProfile2D*> mMAX ; // /< ADC max
109+ std::unordered_map<EventType, TProfile2D*> mMIN ; // /< ADC min
110+ std::unordered_map<EventType, std::array<TH1 *, 20 >> mRawAmplitudeEMCAL ; // ///< Raw amplitude in EMCAL
111+ std::unordered_map<EventType, std::array<TH1 *, 20 >> mMINRawAmplitudeEMCAL ; // ///< Raw amplitude in EMCAL
112+ std::unordered_map<EventType, std::array<TH1 *, 20 >> mRawAmplMaxEMCAL ; // /< Max Raw amplitude in EMCAL per cell
113+ std::unordered_map<EventType, std::array<TH1 *, 20 >> mRawAmplMinEMCAL ; // /< Min Raw amplitude in EMCAL per cell
114+ std::unordered_map<EventType, std::array<TProfile2D*, 20 >> mRMSperSM ; // /< ADC rms per SM
115+ std::unordered_map<EventType, std::array<TProfile2D*, 20 >> mMEANperSM ; // /< ADC mean per SM
116+ std::unordered_map<EventType, std::array<TProfile2D*, 20 >> mMAXperSM ; // /< ADC max per SM
117+ std::unordered_map<EventType, std::array<TProfile2D*, 20 >> mMINperSM ; // /< ADC min per SM
118+ std::unique_ptr<o2::emcal::MappingHandler> mMappings ; // /< Mappings Hardware address -> Channel
119+ TH2F * mErrorTypeAltro = nullptr ; // /< Error from AltroDecoder
120+ TH2F * mPayloadSizePerDDL = nullptr ; // /< Payload size per ddl
121+ Int_t mNumberOfSuperpages = 0 ; // /< Simple total superpage counter
122+ Int_t mNumberOfPages = 0 ; // /< Simple total number of superpages counter
75123 Int_t mNumberOfMessages = 0 ;
76124};
77125
0 commit comments