Skip to content

Commit 90e9bd9

Browse files
authored
[EMCAL-526] histos for max number of hits,FECid (#750)
1 parent ca101a3 commit 90e9bd9

3 files changed

Lines changed: 341 additions & 113 deletions

File tree

Modules/EMCAL/include/EMCAL/RawTask.h

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,25 @@
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

2532
class TH1F;
2633
class TH2F;
2734
class TProfile2D;
2835

2936
using namespace o2::quality_control::core;
3037

38+
namespace o2::emcal
39+
{
40+
class Geometry;
41+
}
42+
3143
namespace 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

Modules/EMCAL/src/DigitsQcTask.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,19 @@ void DigitsQcTask::startOfCycle()
6161
{
6262
QcInfoLogger::GetInstance() << "startOfCycle" << AliceO2::InfoLogger::InfoLogger::endm;
6363
std::map<std::string, std::string> metadata;
64-
mBadChannelMap = retrieveConditionAny<o2::emcal::BadChannelMap>("EMC/BadChannelMap", metadata);
64+
mBadChannelMap = retrieveConditionAny<o2::emcal::BadChannelMap>("EMC/Calib/BadChannels", metadata);
65+
//it was EMC/BadChannelMap
6566
if (!mBadChannelMap)
6667
QcInfoLogger::GetInstance() << "No Bad Channel Map object " << AliceO2::InfoLogger::InfoLogger::endm;
6768

68-
mTimeCalib = retrieveConditionAny<o2::emcal::TimeCalibrationParams>("EMC/TimeCalibrationParams", metadata);
69+
mTimeCalib = retrieveConditionAny<o2::emcal::TimeCalibrationParams>("EMC/Calib/Time", metadata);
70+
//"EMC/TimeCalibrationParams
6971
if (!mTimeCalib)
7072
QcInfoLogger::GetInstance() << " No Time Calib object " << AliceO2::InfoLogger::InfoLogger::endm;
7173
}
7274

7375
void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
7476
{
75-
// QcInfoLogger::GetInstance() << "Start monitor data" << AliceO2::InfoLogger::InfoLogger::endm;
7677

7778
// check if we have payoad
7879
using MaskType_t = o2::emcal::BadChannelMap::MaskType_t;
@@ -82,7 +83,6 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
8283
auto const* emcheader = o2::framework::DataRefUtils::getHeader<o2::emcal::EMCALBlockHeader*>(dataref);
8384
if (!emcheader->mHasPayload) {
8485
QcInfoLogger::GetInstance() << "No more digits" << AliceO2::InfoLogger::InfoLogger::endm;
85-
//ctx.services().get<o2::framework::ControlService>().readyToQuit(false);
8686
return;
8787
}
8888
}
@@ -96,8 +96,8 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
9696
for (auto trg : triggerrecords) {
9797
if (!trg.getNumberOfObjects())
9898
continue;
99+
99100
QcInfoLogger::GetInstance() << QcInfoLogger::Debug << "Next event " << eventcounter << " has " << trg.getNumberOfObjects() << " digits" << QcInfoLogger::endm;
100-
//gsl::span<const o2::emcal::Digit> eventdigits(digitcontainer.data() + trg.getFirstEntry(), trg.getNumberOfObjects());
101101
gsl::span<const o2::emcal::Cell> eventdigits(digitcontainer.data() + trg.getFirstEntry(), trg.getNumberOfObjects());
102102

103103
//trigger type

0 commit comments

Comments
 (0)