diff --git a/Modules/EMCAL/include/EMCAL/DigitsQcTask.h b/Modules/EMCAL/include/EMCAL/DigitsQcTask.h index 20df894ec8..c3fcb7d03f 100644 --- a/Modules/EMCAL/include/EMCAL/DigitsQcTask.h +++ b/Modules/EMCAL/include/EMCAL/DigitsQcTask.h @@ -57,20 +57,20 @@ class DigitsQcTask final : public TaskInterface void setThreshold(Double_t threshold) { mCellThreshold = threshold; } private: - Double_t mCellThreshold = 0.5; ///< energy cell threshold - std::array mDigitAmplitude; ///< Digit amplitude - std::array mDigitTime; ///< Digit time - std::array mDigitAmplitudeCalib; ///< Digit amplitude calibrated - std::array mDigitTimeCalib; ///< Digit time calibrated - TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL - TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold - TProfile2D* mIntegratedOccupancy = nullptr; ///< Digit integrated occupancy - TH1* mDigitAmplitudeEMCAL = nullptr; ///< Digit amplitude in EMCAL - TH1* mDigitAmplitudeDCAL = nullptr; ///< Digit amplitude in DCAL - TH1* mnumberEvents = nullptr; ///< Number of Events for normalization - o2::emcal::Geometry* mGeometry = nullptr; ///< EMCAL geometry - o2::emcal::BadChannelMap* mBadChannelMap; ///< EMCAL channel map - o2::emcal::TimeCalibrationParams* mTimeCalib; ///< EMCAL time calib + Double_t mCellThreshold = 0.5; ///< energy cell threshold + std::map> mDigitAmplitude; ///< Digit amplitude + std::map> mDigitTime; ///< Digit time + std::map> mDigitAmplitudeCalib; ///< Digit amplitude calibrated + std::map> mDigitTimeCalib; ///< Digit time calibrated + TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL + TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold + TProfile2D* mIntegratedOccupancy = nullptr; ///< Digit integrated occupancy + TH1* mDigitAmplitudeEMCAL = nullptr; ///< Digit amplitude in EMCAL + TH1* mDigitAmplitudeDCAL = nullptr; ///< Digit amplitude in DCAL + TH1* mnumberEvents = nullptr; ///< Number of Events for normalization + o2::emcal::Geometry* mGeometry = nullptr; ///< EMCAL geometry + o2::emcal::BadChannelMap* mBadChannelMap; ///< EMCAL channel map + o2::emcal::TimeCalibrationParams* mTimeCalib; ///< EMCAL time calib }; } // namespace emcal diff --git a/Modules/EMCAL/include/EMCAL/RawTask.h b/Modules/EMCAL/include/EMCAL/RawTask.h index d60c4819e3..951ba76394 100644 --- a/Modules/EMCAL/include/EMCAL/RawTask.h +++ b/Modules/EMCAL/include/EMCAL/RawTask.h @@ -57,21 +57,21 @@ class RawTask final : public TaskInterface TH1* mMessageCounter = nullptr; TH1* mNumberOfSuperpagesPerMessage; TH1* mNumberOfPagesPerMessage; - TH1* mSuperpageCounter = nullptr; ///< Counter for number of superpages - TH1* mPageCounter = nullptr; ///< Counter for number of pages (headers) - TH1* mTotalDataVolume = nullptr; ///< Total data volume - std::array mRawAmplitudeEMCAL; ///< Raw amplitude in EMCAL - std::array mRawAmplMaxEMCAL; ///< Max Raw amplitude in EMCAL per cell - std::array mRawAmplMinEMCAL; ///< Min Raw amplitude in EMCAL per cell - std::unique_ptr mMappings; ///< Mappings Hardware address -> Channel - std::array mRMSperSM; ///< ADC rms per SM - std::array mMEANperSM; ///< ADC mean per SM - std::array mMAXperSM; ///< ADC max per SM - std::array mMINperSM; ///< ADC min per SM - TH2F* mErrorTypeAltro = nullptr; ///< Error from AltroDecoder - TH2F* mPayloadSizePerDDL = nullptr; ///< Payload size per ddl - Int_t mNumberOfSuperpages = 0; ///< Simple total superpage counter - Int_t mNumberOfPages = 0; ///< Simple total number of superpages counter + TH1* mSuperpageCounter = nullptr; ///< Counter for number of superpages + TH1* mPageCounter = nullptr; ///< Counter for number of pages (headers) + TH1* mTotalDataVolume = nullptr; ///< Total data volume + std::map> mRawAmplitudeEMCAL; /////< Raw amplitude in EMCAL + std::map> mRawAmplMaxEMCAL; ///< Max Raw amplitude in EMCAL per cell + std::map> mRawAmplMinEMCAL; ///< Min Raw amplitude in EMCAL per cell + std::map> mRMSperSM; ///< ADC rms per SM + std::map> mMEANperSM; ///< ADC mean per SM + std::map> mMAXperSM; ///< ADC max per SM + std::map> mMINperSM; ///< ADC min per SM + std::unique_ptr mMappings; ///< Mappings Hardware address -> Channel + TH2F* mErrorTypeAltro = nullptr; ///< Error from AltroDecoder + TH2F* mPayloadSizePerDDL = nullptr; ///< Payload size per ddl + Int_t mNumberOfSuperpages = 0; ///< Simple total superpage counter + Int_t mNumberOfPages = 0; ///< Simple total number of superpages counter Int_t mNumberOfMessages = 0; }; diff --git a/Modules/EMCAL/src/DigitsQcTask.cxx b/Modules/EMCAL/src/DigitsQcTask.cxx index 53e116bcd5..34969b0c5d 100644 --- a/Modules/EMCAL/src/DigitsQcTask.cxx +++ b/Modules/EMCAL/src/DigitsQcTask.cxx @@ -17,6 +17,7 @@ #include "EMCALCalib/BadChannelMap.h" #include "EMCALCalib/TimeCalibrationParams.h" #include +#include namespace o2 { @@ -27,17 +28,25 @@ namespace emcal DigitsQcTask::~DigitsQcTask() { - for (auto h : mDigitAmplitude) { - delete h; + for (auto& [trg, histos] : mDigitAmplitude) { + for (auto h : histos) { + delete h; + } } - for (auto h : mDigitTime) { - delete h; + for (auto& [trg, histos] : mDigitTime) { + for (auto h : histos) { + delete h; + } } - for (auto h : mDigitAmplitudeCalib) { - delete h; + for (auto& [trg, histos] : mDigitAmplitudeCalib) { + for (auto h : histos) { + delete h; + } } - for (auto h : mDigitTimeCalib) { - delete h; + for (auto& [trg, histos] : mDigitTimeCalib) { + for (auto h : histos) { + delete h; + } } if (mDigitAmplitudeEMCAL) delete mDigitAmplitudeEMCAL; @@ -48,10 +57,32 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) { QcInfoLogger::GetInstance() << "initialize DigitsQcTask" << AliceO2::InfoLogger::InfoLogger::endm; //define histograms - mDigitAmplitude[0] = new TH2F("digitAmplitudeHG", "Digit Amplitude (High gain)", 100, 0, 100, 20000, 0., 20000.); - mDigitAmplitude[1] = new TH2F("digitAmplitudeLG", "Digit Amplitude (Low gain)", 100, 0, 100, 20000, 0., 20000.); - mDigitAmplitudeCalib[0] = new TH2F("digitAmplitudeHGCalib", "Digit Amplitude Calib (High gain)", 100, 0, 100, 20000, 0., 20000.); - mDigitAmplitudeCalib[1] = new TH2F("digitAmplitudeLGCalib", "Digit Amplitude Calib (Low gain)", 100, 0, 100, 20000, 0., 20000.); + + std::array triggers = { { "CAL", "PHYS" } }; + for (const auto& trg : triggers) { + + std::array histosDigitAmplitude; + std::array histosDigitAmplitudeCalib; + std::array histosDigitTime; + std::array histosDigitTimeCalib; + + histosDigitAmplitude[0] = new TH2F(Form("digitAmplitudeHG_%s", trg.data()), Form("Digit Amplitude (High gain) %s", trg.data()), 100, 0, 100, 20000, 0., 20000.); + histosDigitAmplitude[1] = new TH2F(Form("digitAmplitudeHG_%s", trg.data()), Form("Digit Amplitude (Low gain) %s", trg.data()), 100, 0, 100, 20000, 0., 20000.); + + histosDigitAmplitudeCalib[0] = new TH2F(Form("digitAmplitudeHG_%s", trg.data()), Form("Digit Amplitude (High gain) %s", trg.data()), 100, 0, 100, 20000, 0., 20000.); + histosDigitAmplitudeCalib[1] = new TH2F(Form("digitAmplitudeLG_%s", trg.data()), Form("Digit Amplitude (Low gain) %s", trg.data()), 100, 0, 100, 20000, 0., 20000.); + + histosDigitTime[0] = new TH2F(Form("digitTimeHG_%s", trg.data()), Form("Digit Time (High gain) %s", trg.data()), 2000, -200, 200, 20000, 0., 20000.); + histosDigitTime[1] = new TH2F(Form("digitTimeLG_%s", trg.data()), Form("Digit Time (Low gain) %s", trg.data()), 2000, -200, 200, 20000, 0., 20000.); + + histosDigitTimeCalib[0] = new TH2F(Form("digitTimeHGCalib_%s", trg.data()), Form("Digit Time Calib (High gain) %s", trg.data()), 2000, -200, 200, 20000, 0., 20000.); + histosDigitTimeCalib[1] = new TH2F(Form("digitTimeLGCalib_%s", trg.data()), Form("Digit Time Calib (Low gain) %s", trg.data()), 2000, -200, 200, 20000, 0., 20000.); + + mDigitAmplitude[trg] = histosDigitAmplitude; + mDigitAmplitude[trg] = histosDigitAmplitudeCalib; + mDigitTime[trg] = histosDigitTime; + mDigitTimeCalib[trg] = histosDigitTimeCalib; + } //trigger type mDigitOccupancy = new TH2F("digitOccupancyEMC", "Digit Occupancy EMCAL", 96, -0.5, 95.5, 208, -0.5, 207.5); mDigitOccupancyThr = new TH2F("digitOccupancyEMCwThr", "Digit Occupancy EMCAL with E>0.5 GeV/c", 96, -0.5, 95.5, 208, -0.5, 207.5); @@ -59,11 +90,6 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) mIntegratedOccupancy = new TProfile2D("digitOccupancyInt", "Digit Occupancy Integrated", 96, -0.5, 95.5, 208, -0.5, 207.5); mIntegratedOccupancy->GetXaxis()->SetTitle("col"); mIntegratedOccupancy->GetYaxis()->SetTitle("row"); - - mDigitTime[0] = new TH2F("digitTimeHG", "Digit Time (High gain)", 2000, -200, 200, 20000, 0., 20000.); - mDigitTime[1] = new TH2F("digitTimeLG", "Digit Time (Low gain)", 2000, -200, 200, 20000, 0., 20000.); - mDigitTimeCalib[0] = new TH2F("digitTimeHGCalib", "Digit Time Calib (High gain)", 2000, -200, 200, 20000, 0., 20000.); - mDigitTimeCalib[1] = new TH2F("digitTimeLGCalib", "Digit Time Calib (Low gain)", 2000, -200, 200, 20000, 0., 20000.); // 1D histograms for showing the integrated spectrum mDigitAmplitudeEMCAL = new TH1F("digitAmplitudeEMCAL", "Digit amplitude in EMCAL", 100, 0., 100.); @@ -71,17 +97,28 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) mnumberEvents = new TH1F("NumberOfEvents", "Number Of Events", 1, 0.5, 1.5); //Puglishing histograms - for (auto h : mDigitAmplitude) - getObjectsManager()->startPublishing(h); - - for (auto h : mDigitTime) - getObjectsManager()->startPublishing(h); + for (auto& [trg, histos] : mDigitAmplitude) { + for (auto h : histos) { + getObjectsManager()->startPublishing(h); + } + } - for (auto h : mDigitAmplitudeCalib) - getObjectsManager()->startPublishing(h); + for (auto& [trg, histos] : mDigitTime) { + for (auto h : histos) { + getObjectsManager()->startPublishing(h); + } + } + for (auto& [trg, histos] : mDigitAmplitudeCalib) { + for (auto h : histos) { + getObjectsManager()->startPublishing(h); + } + } - for (auto h : mDigitTimeCalib) - getObjectsManager()->startPublishing(h); + for (auto& [trg, histos] : mDigitTimeCalib) { + for (auto h : histos) { + getObjectsManager()->startPublishing(h); + } + } getObjectsManager()->startPublishing(mDigitAmplitudeEMCAL); getObjectsManager()->startPublishing(mDigitAmplitudeDCAL); @@ -142,21 +179,34 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx) //gsl::span eventdigits(digitcontainer.data() + trg.getFirstEntry(), trg.getNumberOfObjects()); gsl::span eventdigits(digitcontainer.data() + trg.getFirstEntry(), trg.getNumberOfObjects()); + //trigger type + auto triggertype = trg.getTriggerBits(); + bool isPhysTrigger = triggertype & o2::trigger::PhT, isCalibTrigger = triggertype & o2::trigger::Cal; + std::string trgClass; + if (isPhysTrigger) + trgClass = "PHYS"; + else if (isCalibTrigger) + trgClass = "CAL"; + else { + QcInfoLogger::GetInstance() << QcInfoLogger::Error << " Unmonitored trigger class requested " << AliceO2::InfoLogger::InfoLogger::endm; + continue; + } + for (auto digit : eventdigits) { int index = digit.getHighGain() ? 0 : (digit.getLowGain() ? 1 : -1); if (index < 0) continue; auto cellindices = mGeometry->GetCellIndex(digit.getTower()); - mDigitAmplitude[index]->Fill(digit.getEnergy(), digit.getTower()); + mDigitAmplitude[trgClass][index]->Fill(digit.getEnergy(), digit.getTower()); auto timeoffset = mTimeCalib->getTimeCalibParam(digit.getTower(), digit.getLowGain()); if ((mBadChannelMap->getChannelStatus(digit.getTower()) == MaskType_t::GOOD_CELL)) { - mDigitAmplitudeCalib[index]->Fill(digit.getEnergy(), digit.getTower()); - mDigitTimeCalib[index]->Fill(digit.getTimeStamp() - timeoffset, digit.getTower()); + mDigitAmplitudeCalib[trgClass][index]->Fill(digit.getEnergy(), digit.getTower()); + mDigitTimeCalib[trgClass][index]->Fill(digit.getTimeStamp() - timeoffset, digit.getTower()); } - mDigitTime[index]->Fill(digit.getTimeStamp(), digit.getTower()); + mDigitTime[trgClass][index]->Fill(digit.getTimeStamp(), digit.getTower()); // get the supermodule for filling EMCAL/DCAL spectra @@ -200,10 +250,16 @@ void DigitsQcTask::reset() // clean all the monitor objects here QcInfoLogger::GetInstance() << "Resetting the histogram" << AliceO2::InfoLogger::InfoLogger::endm; - for (auto h : mDigitAmplitude) - h->Reset(); - for (auto h : mDigitTime) - h->Reset(); + for (auto& [trg, histos] : mDigitAmplitude) { + for (auto h : histos) { + h->Reset(); + } + } + for (auto& [trg, histos] : mDigitTime) { + for (auto h : histos) { + h->Reset(); + } + } mDigitAmplitudeEMCAL->Reset(); mDigitAmplitudeDCAL->Reset(); diff --git a/Modules/EMCAL/src/RawTask.cxx b/Modules/EMCAL/src/RawTask.cxx index 5e3d7ada24..2569738010 100644 --- a/Modules/EMCAL/src/RawTask.cxx +++ b/Modules/EMCAL/src/RawTask.cxx @@ -28,6 +28,7 @@ #include "EMCALReconstruction/RawReaderMemory.h" #include "EMCALReconstruction/RawHeaderStream.h" #include +#include using namespace o2::emcal; @@ -61,32 +62,45 @@ RawTask::~RawTask() delete mErrorTypeAltro; } - for (auto h : mRawAmplitudeEMCAL) { - delete h; - } + for (auto& [trg, histos] : mRawAmplitudeEMCAL) { + for (auto h : histos) { - for (auto h : mRawAmplMaxEMCAL) { - delete h; + delete h; + } } - for (auto h : mRawAmplMinEMCAL) { - delete h; + for (auto& [trg, histos] : mRawAmplMaxEMCAL) { + for (auto h : histos) { + delete h; + } } - for (auto h : mRMSperSM) { - delete h; + for (auto& [trg, histos] : mRawAmplMinEMCAL) { + for (auto h : histos) { + delete h; + } } - - for (auto h : mMEANperSM) { - delete h; + for (auto& [trg, histos] : mRMSperSM) { + for (auto h : histos) { + delete h; + } } - for (auto h : mMAXperSM) { - delete h; + for (auto& [trg, histos] : mMEANperSM) { + for (auto h : histos) { + delete h; + } } - for (auto h : mMINperSM) { - delete h; + for (auto& [trg, histos] : mMAXperSM) { + for (auto h : histos) { + delete h; + } + } + for (auto& [trg, histos] : mMINperSM) { + for (auto h : histos) { + delete h; + } } } void RawTask::initialize(o2::framework::InitContext& /*ctx*/) @@ -103,7 +117,6 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) if (auto param = mCustomParameters.find("myOwnKey"); param != mCustomParameters.end()) { QcInfoLogger::GetInstance() << "Custom parameter - myOwnKey : " << param->second << AliceO2::InfoLogger::InfoLogger::endm; } - mMappings = std::unique_ptr(new o2::emcal::MappingHandler); //initialize the unique pointer to Mapper // Statistics histograms @@ -162,42 +175,63 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mErrorTypeAltro); //histos per SM - for (Int_t i = 0; i < 20; i++) { - mRawAmplitudeEMCAL[i] = new TH1F(Form("RawAmplitudeEMCAL_sm%d", i), Form(" RawAmplitudeEMCAL%d", i), 100, 0., 100.); - mRawAmplitudeEMCAL[i]->GetXaxis()->SetTitle("Raw Amplitude"); - mRawAmplitudeEMCAL[i]->GetYaxis()->SetTitle("Counts"); - getObjectsManager()->startPublishing(mRawAmplitudeEMCAL[i]); - - mRawAmplMaxEMCAL[i] = new TH1F(Form("RawAmplMaxEMCAL_sm%d", i), Form(" RawAmpMaxEMCAL%d", i), 100, 0., 100.); - mRawAmplMaxEMCAL[i]->GetXaxis()->SetTitle("Max Raw Amplitude"); - mRawAmplMaxEMCAL[i]->GetYaxis()->SetTitle("Counts"); - getObjectsManager()->startPublishing(mRawAmplMaxEMCAL[i]); - - mRawAmplMinEMCAL[i] = new TH1F(Form("RawAmplMinEMCAL_sm%d", i), Form(" RawAmpMinEMCAL%d", i), 100, 0., 100.); - mRawAmplMinEMCAL[i]->GetXaxis()->SetTitle("Min Raw Amplitude"); - mRawAmplMinEMCAL[i]->GetYaxis()->SetTitle("Counts"); - getObjectsManager()->startPublishing(mRawAmplMinEMCAL[i]); - - mRMSperSM[i] = new TProfile2D(Form("RMSADCperSM%d", i), Form("RMSperSM%d", i), 48, 0, 48, 24, 0, 24); - mRMSperSM[i]->GetXaxis()->SetTitle("col"); - mRMSperSM[i]->GetYaxis()->SetTitle("row"); - getObjectsManager()->startPublishing(mRMSperSM[i]); - - mMEANperSM[i] = new TProfile2D(Form("MeanADCperSM%d", i), Form("MeanADCperSM%d", i), 48, 0, 48, 24, 0, 24); - mMEANperSM[i]->GetXaxis()->SetTitle("col"); - mMEANperSM[i]->GetYaxis()->SetTitle("row"); - getObjectsManager()->startPublishing(mMEANperSM[i]); - - mMAXperSM[i] = new TProfile2D(Form("MaxADCperSM%d", i), Form("MaxADCperSM%d", i), 48, 0, 47, 24, 0, 23); - mMAXperSM[i]->GetXaxis()->SetTitle("col"); - mMAXperSM[i]->GetYaxis()->SetTitle("row"); - getObjectsManager()->startPublishing(mMAXperSM[i]); - - mMINperSM[i] = new TProfile2D(Form("MinADCperSM%d", i), Form("MinADCperSM%d", i), 48, 0, 47, 24, 0, 23); - mMINperSM[i]->GetXaxis()->SetTitle("col"); - mMINperSM[i]->GetYaxis()->SetTitle("row"); - getObjectsManager()->startPublishing(mMINperSM[i]); - } + + std::array triggers = { { "CAL", "PHYS" } }; + for (const auto& trg : triggers) { + std::array histosRawAmplEMCALSM; + std::array histosRawAmplMaxEMCALSM; + std::array histosRawAmplMinEMCALSM; + std::array histosRawAmplRmsSM; + std::array histosRawAmplMeanSM; + std::array histosRawAmplMaxSM; + std::array histosRawAmplMinSM; + + for (auto ism = 0; ism < 20; ism++) { + + histosRawAmplEMCALSM[ism] = new TH1F(Form("RawAmplitudeEMCAL_sm%d_%s", ism, trg.data()), Form(" RawAmplitudeEMCAL%d, %s", ism, trg.data()), 100, 0., 100.); + histosRawAmplEMCALSM[ism]->GetXaxis()->SetTitle("Raw Amplitude"); + histosRawAmplEMCALSM[ism]->GetYaxis()->SetTitle("Counts"); + getObjectsManager()->startPublishing(histosRawAmplEMCALSM[ism]); + + histosRawAmplMaxEMCALSM[ism] = new TH1F(Form("RawAmplMaxEMCAL_sm%d_%s", ism, trg.data()), Form(" RawAmplMaxEMCAL_sm%d_%s", ism, trg.data()), 500, 0., 500.); + histosRawAmplMaxEMCALSM[ism]->GetXaxis()->SetTitle("Max Raw Amplitude [ADC]"); + histosRawAmplMaxEMCALSM[ism]->GetYaxis()->SetTitle("Counts"); + getObjectsManager()->startPublishing(histosRawAmplMaxEMCALSM[ism]); + + histosRawAmplMinEMCALSM[ism] = new TH1F(Form("RawAmplMinEMCAL_sm%d_%s", ism, trg.data()), Form("RawAmplMinEMCAL_sm%d_%s", ism, trg.data()), 100, 0., 100.); + histosRawAmplMinEMCALSM[ism]->GetXaxis()->SetTitle("Min Raw Amplitude"); + histosRawAmplMinEMCALSM[ism]->GetYaxis()->SetTitle("Counts"); + getObjectsManager()->startPublishing(histosRawAmplMinEMCALSM[ism]); + + histosRawAmplRmsSM[ism] = new TProfile2D(Form("RMSADCperSM%d_%s", ism, trg.data()), Form("RMSperSM%d_%s", ism, trg.data()), 48, 0, 48, 24, 0, 24); + histosRawAmplRmsSM[ism]->GetXaxis()->SetTitle("col"); + histosRawAmplRmsSM[ism]->GetYaxis()->SetTitle("row"); + getObjectsManager()->startPublishing(histosRawAmplRmsSM[ism]); + + histosRawAmplMeanSM[ism] = new TProfile2D(Form("MeanADCperSM%d_%s", ism, trg.data()), Form("MeanADCperSM%d_%s", ism, trg.data()), 48, 0, 48, 24, 0, 24); + histosRawAmplMeanSM[ism]->GetXaxis()->SetTitle("col"); + histosRawAmplMeanSM[ism]->GetYaxis()->SetTitle("row"); + getObjectsManager()->startPublishing(histosRawAmplMeanSM[ism]); + + histosRawAmplMaxSM[ism] = new TProfile2D(Form("MaxADCperSM%d_%s", ism, trg.data()), Form("MaxADCperSM%d_%s", ism, trg.data()), 48, 0, 47, 24, 0, 23); + histosRawAmplMaxSM[ism]->GetXaxis()->SetTitle("col"); + histosRawAmplMaxSM[ism]->GetYaxis()->SetTitle("row"); + getObjectsManager()->startPublishing(histosRawAmplMaxSM[ism]); + + histosRawAmplMinSM[ism] = new TProfile2D(Form("MinADCperSM%d_%s", ism, trg.data()), Form("MinADCperSM%d_%s", ism, trg.data()), 48, 0, 47, 24, 0, 23); + histosRawAmplMinSM[ism]->GetXaxis()->SetTitle("col"); + histosRawAmplMinSM[ism]->GetYaxis()->SetTitle("raw"); + getObjectsManager()->startPublishing(histosRawAmplMinSM[ism]); + } //loop SM + mRawAmplitudeEMCAL[trg] = histosRawAmplEMCALSM; + mRawAmplMaxEMCAL[trg] = histosRawAmplMaxEMCALSM; + mRawAmplMinEMCAL[trg] = histosRawAmplMinEMCALSM; + mRMSperSM[trg] = histosRawAmplRmsSM; + mMEANperSM[trg] = histosRawAmplMeanSM; + mMAXperSM[trg] = histosRawAmplMaxSM; + mMINperSM[trg] = histosRawAmplMinSM; + + } //loop trigger case } void RawTask::startOfActivity(Activity& /*activity*/) @@ -272,11 +306,26 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) auto triggerBC = o2::raw::RDHUtils::getTriggerBC(headerR); mPayloadSizePerDDL->Fill(feeID, payLoadSize / 1024.); + //trigger type + auto triggertype = o2::raw::RDHUtils::getTriggerType(headerR); + bool isPhysTrigger = triggertype & o2::trigger::PhT, isCalibTrigger = triggertype & o2::trigger::Cal; + std::string trgClass; + if (isPhysTrigger) + trgClass = "PHYS"; + else if (isCalibTrigger) + trgClass = "CAL"; + else { + QcInfoLogger::GetInstance() << QcInfoLogger::Error << " Unmonitored trigger class requested " << AliceO2::InfoLogger::InfoLogger::endm; + continue; + } + //fill histograms with max ADC for each supermodules and reset cache if (!first) { // check if it is the first event in the payload if (triggerBC > currentTrigger) { // new event for (int sm = 0; sm < 20; sm++) { - mRawAmplitudeEMCAL[sm]->Fill(maxADCSM[sm]); + + mRawAmplitudeEMCAL[trgClass][sm]->Fill(maxADCSM[sm]); + maxADCSM[sm] = 0; //initialize minADCSM[sm] = SHRT_MAX; @@ -364,26 +413,25 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) auto maxADCbunch = *max_element(adcs.begin(), adcs.end()); if (maxADCbunch > maxADC) maxADC = maxADCbunch; - mRawAmplMaxEMCAL[j]->Fill(maxADCbunch); // max for each cell + mRawAmplMaxEMCAL[trgClass][j]->Fill(maxADCbunch); //max for each cell auto minADCbunch = *min_element(adcs.begin(), adcs.end()); if (minADCbunch < minADC) minADC = minADCbunch; - mRawAmplMinEMCAL[j]->Fill(minADCbunch); // min for each cell + mRawAmplMinEMCAL[trgClass][j]->Fill(minADCbunch); // min for each cell meanADC = TMath::Mean(adcs.begin(), adcs.end()); rmsADC = TMath::RMS(adcs.begin(), adcs.end()); - mRMSperSM[j]->Fill(col, row, rmsADC); - mMEANperSM[j]->Fill(col, row, meanADC); + mRMSperSM[trgClass][j]->Fill(col, row, rmsADC); + mMEANperSM[trgClass][j]->Fill(col, row, meanADC); } if (maxADC > maxADCSM[j]) maxADCSM[j] = maxADC; - mMAXperSM[j]->Fill(col, row, maxADC); + mMAXperSM[trgClass][j]->Fill(col, row, maxADC); if (minADC < minADCSM[j]) minADCSM[j] = minADC; - mMINperSM[j]->Fill(col, row, minADC); - + mMINperSM[trgClass][j]->Fill(col, row, minADC); } //channels } //new page } //header @@ -410,14 +458,17 @@ void RawTask::reset() QcInfoLogger::GetInstance() << "Resetting the histogram" << AliceO2::InfoLogger::InfoLogger::endm; mHistogram->Reset(); - for (Int_t i = 0; i < 20; i++) { - mRawAmplitudeEMCAL[i]->Reset(); - mRawAmplMaxEMCAL[i]->Reset(); - mRawAmplMinEMCAL[i]->Reset(); - mRMSperSM[i]->Reset(); - mMEANperSM[i]->Reset(); - mMAXperSM[i]->Reset(); - mMINperSM[i]->Reset(); + std::array triggers = { { "CAL", "PHYS" } }; + for (const auto& trg : triggers) { + for (Int_t i = 0; i < 20; i++) { + mRawAmplitudeEMCAL[trg][i]->Reset(); + mRawAmplMaxEMCAL[trg][i]->Reset(); + mRawAmplMinEMCAL[trg][i]->Reset(); + mRMSperSM[trg][i]->Reset(); + mMEANperSM[trg][i]->Reset(); + mMAXperSM[trg][i]->Reset(); + mMINperSM[trg][i]->Reset(); + } } mPayloadSizePerDDL->Reset(); mHistogram->Reset();