diff --git a/Modules/EMCAL/include/EMCAL/DigitsQcTask.h b/Modules/EMCAL/include/EMCAL/DigitsQcTask.h index 8fd4da18c0..4b9b1e511f 100644 --- a/Modules/EMCAL/include/EMCAL/DigitsQcTask.h +++ b/Modules/EMCAL/include/EMCAL/DigitsQcTask.h @@ -76,19 +76,23 @@ class DigitsQcTask final : public TaskInterface TH2* mDigitTimeSupermodule = nullptr; TH2* mDigitTimeSupermoduleCalib = nullptr; - TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL - TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold - TH2* 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 + TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL + TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold + TH2* mDigitOccupancyThrBelow = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold + TH2* mIntegratedOccupancy = nullptr; ///< Digit integrated occupancy + TH1* mDigitAmplitudeEMCAL = nullptr; ///< Digit amplitude in EMCAL + TH1* mDigitAmplitudeEMCAL_0 = nullptr; ///< Digit amplitude in EMCAL if bc==0 + TH1* mDigitAmplitudeDCAL = nullptr; ///< Digit amplitude in DCAL + TH1* mDigitTimeSupermoduleEMCAL = nullptr; ///< Digit amplitude in DCAL per SuperModule + TH1* mDigitTimeSupermoduleDCAL = nullptr; ///< Digit amplitude in DCAL per SuperModule + TH1* mnumberEvents = nullptr; ///< Number of Events for normalization void initForTrigger(const std::string trigger, bool hasAmpVsCellID, bool hasTimeVsCellID, bool hasHistosCalib2D); void startPublishing(o2::quality_control::core::ObjectsManager& manager); void reset(); void clean(); - void fillHistograms(const o2::emcal::Cell& cell, bool isGood, double timeoffset); + void fillHistograms(const o2::emcal::Cell& cell, bool isGood, double timeoffset, int bcphase); void countEvent(); }; diff --git a/Modules/EMCAL/include/EMCAL/RawTask.h b/Modules/EMCAL/include/EMCAL/RawTask.h index 368a95b9cf..acb3590ae9 100644 --- a/Modules/EMCAL/include/EMCAL/RawTask.h +++ b/Modules/EMCAL/include/EMCAL/RawTask.h @@ -66,6 +66,15 @@ class RawTask final : public TaskInterface void endOfActivity(Activity& activity) override; void reset() override; + /// \brief Set the data origin + /// \param origin Data origin + /// + /// Normally data origin is EMC, however in case the + /// Task subscribes directly to readout or the origin + /// is different in the STFbuilder this needs to be handled + /// accordingly + void setDataOrigin(const std::string_view origin) { mDataOrigin = origin; } + enum class EventType { CAL_EVENT, PHYS_EVENT @@ -98,6 +107,7 @@ class RawTask final : public TaskInterface bool isLostTimeframe(framework::ProcessingContext& ctx) const; o2::emcal::Geometry* mGeometry = nullptr; ///< EMCAL geometry + std::string mDataOrigin = "EMC"; TH1* mPayloadSize = nullptr; TH1* mMessageCounter = nullptr; TH1* mNumberOfSuperpagesPerMessage; @@ -108,6 +118,10 @@ class RawTask final : public TaskInterface TH1* mNbunchPerChan = nullptr; ///< Number of bunch per Channel TH1* mNofADCsamples = nullptr; ///< Number of ADC samples per Channel TH1* mADCsize = nullptr; ///< ADC size per bunch + TH2* mFECmaxCountperSM = nullptr; ///< max number of hit channels per SM + TH2* mFECmaxIDperSM = nullptr; ///< FEC ID max number of hit channels per SM + std::unordered_map mRawAmplMinEMCAL_tot; ///< Min Raw amplitude in whole EMCAL + std::unordered_map mRawAmplMinDCAL_tot; ///< Min Raw amplitude in whole DCAL std::array mFECmaxCount; ///< max number of hit channels std::array mFECmaxID; ///< FEC ID max number of hit channels std::unordered_map mRMS; ///< ADC rms for EMCAL+DCAL togheter @@ -125,6 +139,7 @@ class RawTask final : public TaskInterface std::unique_ptr mMappings; ///< Mappings Hardware address -> Channel TH2F* mErrorTypeAltro = nullptr; ///< Error from AltroDecoder TH2F* mPayloadSizePerDDL = nullptr; ///< Payload size per ddl + TH2F* mPayloadSizeTFPerDDL = nullptr; ///< Payload size per TimeFrame 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 29b2d6f624..7f7f3ba667 100644 --- a/Modules/EMCAL/src/DigitsQcTask.cxx +++ b/Modules/EMCAL/src/DigitsQcTask.cxx @@ -85,8 +85,11 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) auto hasAmpVsCell = get_bool(getConfigValueLower("hasAmpVsCell")), hasTimeVsCell = get_bool(getConfigValueLower("hasTimeVsCell")), hasCalib2D = get_bool(getConfigValueLower("hasHistValibVsCell")); + mIgnoreTriggerTypes = get_bool(getConfigValue("ignoreTriggers")); - double threshold = hasConfigValue("threshold") ? get_double(getConfigValue("threshold")) : 0.5; + //add a second threshold + double thresholdCAL = hasConfigValue("threshold") ? get_double(getConfigValue("threshold")) : 0.5; + double thresholdPHYS = hasConfigValue("threshold") ? get_double(getConfigValue("threshold")) : 0.2; if (hasAmpVsCell) { QcInfoLogger::GetInstance() << QcInfoLogger::Debug << "Enabling histograms : Amplitude vs. cellID" << QcInfoLogger::endm; @@ -105,7 +108,7 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/) std::array triggers = { { "CAL", "PHYS" } }; for (const auto& trg : triggers) { DigitsHistograms histos; - histos.mCellThreshold = threshold; + histos.mCellThreshold = (trg == "CAL") ? thresholdCAL : thresholdPHYS; histos.mGeometry = mGeometry; histos.initForTrigger(trg.data(), hasAmpVsCell, hasTimeVsCell, hasCalib2D); histos.startPublishing(*getObjectsManager()); @@ -234,6 +237,7 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx) continue; } + auto bcphase = trg.mInteractionRecord.bc % 4; // to be fixed:4 histos for EMCAL, 4 histos for DCAL auto histos = mHistogramContainer[trgClass]; // iterate over subevents @@ -254,7 +258,7 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx) if (mBadChannelMap) { goodcell = mBadChannelMap->getChannelStatus(digit.getTower()) != MaskType_t::GOOD_CELL; } - histos.fillHistograms(digit, goodcell, timeoffset); + histos.fillHistograms(digit, goodcell, timeoffset, bcphase); ndigit++; ndigitGlobal++; } @@ -399,7 +403,7 @@ void DigitsQcTask::DigitsHistograms::initForTrigger(const std::string trigger, b } mDigitAmpSupermodule = histBuilder2D("digitAmplitudeSupermodule", "Digit amplitude vs. supermodule ID ", 400, 0., 100, 20, -0.5, 19.5, false); - mDigitTimeSupermodule = histBuilder2D("digitTimeSupermodule", "Digit Time vs. supermodule ID (High gain)", 400, -200, 200, 20, -0.5, 19.5, false); + mDigitTimeSupermodule = histBuilder2D("digitTimeSupermodule", "Digit Time vs. supermodule ID ", 400, -200, 200, 20, -0.5, 19.5, false); if (hasHistosCalib2D) { mDigitAmpSupermoduleCalib = histBuilder2D("digitAmplitudeSupermoduleCalib", "Digit amplitude (Calib) vs. supermodule ID ", 400, 0., 100, 20, -0.5, 19.5, false); mDigitTimeSupermoduleCalib = histBuilder2D("digitTimeSupermoduleCalib", "Digit Time (Calib) vs. supermodule ID (High gain)", 400, -200, 200, 20, -0.5, 19.5, false); @@ -408,18 +412,22 @@ void DigitsQcTask::DigitsHistograms::initForTrigger(const std::string trigger, b mDigitOccupancy = histBuilder2D("digitOccupancyEMC", "Digit Occupancy EMCAL", 96, -0.5, 95.5, 208, -0.5, 207.5, false); mDigitOccupancyThr = histBuilder2D("digitOccupancyEMCwThr", Form("Digit Occupancy EMCAL with E>%.1f GeV/c", mCellThreshold), 96, -0.5, 95.5, 208, -0.5, 207.5, false); + mDigitOccupancyThrBelow = histBuilder2D("digitOccupancyEMCwThrBelow", Form("Digit Occupancy EMCAL with E<%.1f GeV/c", mCellThreshold), 96, -0.5, 95.5, 208, -0.5, 207.5, false); mIntegratedOccupancy = histBuilder2D("digitOccupancyInt", "Digit Occupancy Integrated", 96, -0.5, 95.5, 208, -0.5, 207.5, true); mIntegratedOccupancy->GetXaxis()->SetTitle("col"); mIntegratedOccupancy->GetYaxis()->SetTitle("row"); // 1D histograms for showing the integrated spectrum + mDigitTimeSupermoduleEMCAL = histBuilder1D("digitTimeEMCAL", "Digit Time EMCAL", 400, -200, 200); + mDigitTimeSupermoduleDCAL = histBuilder1D("digitTimeDCAL", "Digit Time DCAL", 400, -200, 200); mDigitAmplitudeEMCAL = histBuilder1D("digitAmplitudeEMCAL", "Digit amplitude in EMCAL", 400, 0., 100.); + mDigitAmplitudeEMCAL_0 = histBuilder1D("digitAmplitudeEMCAL_bc0", "Digit amplitude in EMCAL(bc=0)", 400, 0., 100.); mDigitAmplitudeDCAL = histBuilder1D("digitAmplitudeDCAL", "Digit amplitude in DCAL", 400, 0., 100.); mnumberEvents = histBuilder1D("NumberOfEvents", "Number Of Events", 1, 0.5, 1.5); } -void DigitsQcTask::DigitsHistograms::fillHistograms(const o2::emcal::Cell& digit, bool goodCell, double timecalib) +void DigitsQcTask::DigitsHistograms::fillHistograms(const o2::emcal::Cell& digit, bool goodCell, double timecalib, int bcphase) { auto fillOptional1D = [](TH1* hist, double x, double weight = 1.) { if (hist) @@ -449,7 +457,10 @@ void DigitsQcTask::DigitsHistograms::fillHistograms(const o2::emcal::Cell& digit } if (digit.getEnergy() > mCellThreshold) { fillOptional2D(mDigitOccupancyThr, col, row); + } else { + fillOptional2D(mDigitOccupancyThrBelow, col, row); } + fillOptional2D(mIntegratedOccupancy, col, row, digit.getEnergy()); } catch (o2::emcal::InvalidCellIDException& e) { @@ -466,9 +477,14 @@ void DigitsQcTask::DigitsHistograms::fillHistograms(const o2::emcal::Cell& digit fillOptional2D(mDigitTimeSupermoduleCalib, digit.getTimeStamp() - timecalib, supermoduleID); } if (supermoduleID < 12) { - fillOptional1D(mDigitAmplitudeEMCAL, digit.getEnergy()); + + fillOptional1D(mDigitTimeSupermoduleEMCAL, digit.getTimeStamp()); + fillOptional1D(mDigitAmplitudeEMCAL, digit.getEnergy()); //EMCAL + if (bcphase == 0) + fillOptional1D(mDigitAmplitudeEMCAL_0, digit.getEnergy()); //EMCALBC bcphase in the name?if bcphase=0-->Fill? } else { fillOptional1D(mDigitAmplitudeDCAL, digit.getEnergy()); + fillOptional1D(mDigitTimeSupermoduleDCAL, digit.getTimeStamp()); } } catch (o2::emcal::InvalidCellIDException& e) { QcInfoLogger::GetInstance() << "Invalid cell ID: " << e.getCellID() << QcInfoLogger::endm; @@ -494,11 +510,15 @@ void DigitsQcTask::DigitsHistograms::startPublishing(o2::quality_control::core:: publishOptional(mDigitAmpSupermodule); publishOptional(mDigitAmpSupermoduleCalib); publishOptional(mDigitTimeSupermodule); + publishOptional(mDigitTimeSupermoduleEMCAL); + publishOptional(mDigitTimeSupermoduleDCAL); publishOptional(mDigitTimeSupermoduleCalib); publishOptional(mDigitAmplitudeEMCAL); + publishOptional(mDigitAmplitudeEMCAL_0); publishOptional(mDigitAmplitudeDCAL); publishOptional(mDigitOccupancy); publishOptional(mDigitOccupancyThr); + publishOptional(mDigitOccupancyThrBelow); publishOptional(mIntegratedOccupancy); publishOptional(mnumberEvents); // publishOptional(mEvCounterTF); @@ -535,11 +555,15 @@ void DigitsQcTask::DigitsHistograms::reset() resetOptional(mDigitAmpSupermodule); resetOptional(mDigitAmpSupermoduleCalib); resetOptional(mDigitTimeSupermodule); + resetOptional(mDigitTimeSupermoduleEMCAL); + resetOptional(mDigitTimeSupermoduleDCAL); resetOptional(mDigitTimeSupermoduleCalib); resetOptional(mDigitAmplitudeEMCAL); + resetOptional(mDigitAmplitudeEMCAL_0); resetOptional(mDigitAmplitudeDCAL); resetOptional(mDigitOccupancy); resetOptional(mDigitOccupancyThr); + resetOptional(mDigitOccupancyThrBelow); resetOptional(mIntegratedOccupancy); resetOptional(mnumberEvents); // resetOptional(mEvCounterTF); @@ -575,11 +599,15 @@ void DigitsQcTask::DigitsHistograms::clean() cleanOptional(mDigitAmpSupermodule); cleanOptional(mDigitAmpSupermoduleCalib); cleanOptional(mDigitTimeSupermodule); + cleanOptional(mDigitTimeSupermoduleEMCAL); + cleanOptional(mDigitTimeSupermoduleDCAL); cleanOptional(mDigitTimeSupermoduleCalib); cleanOptional(mDigitAmplitudeEMCAL); + cleanOptional(mDigitAmplitudeEMCAL_0); cleanOptional(mDigitAmplitudeDCAL); cleanOptional(mDigitOccupancy); cleanOptional(mDigitOccupancyThr); + cleanOptional(mDigitOccupancyThrBelow); cleanOptional(mIntegratedOccupancy); cleanOptional(mnumberEvents); // cleanOptional(mEvCounterTF); diff --git a/Modules/EMCAL/src/RawTask.cxx b/Modules/EMCAL/src/RawTask.cxx index 358255ed06..fbcf944136 100644 --- a/Modules/EMCAL/src/RawTask.cxx +++ b/Modules/EMCAL/src/RawTask.cxx @@ -50,6 +50,9 @@ RawTask::~RawTask() if (mPayloadSizePerDDL) { delete mPayloadSizePerDDL; } + if (mPayloadSizeTFPerDDL) { + delete mPayloadSizeTFPerDDL; + } if (mMessageCounter) { delete mMessageCounter; } @@ -62,14 +65,12 @@ RawTask::~RawTask() if (mNumberOfPagesPerMessage) { delete mNumberOfPagesPerMessage; } - for (auto h : mFECmaxCount) { delete h; } for (auto h : mFECmaxID) { delete h; } - if (mNumberOfSuperpagesPerMessage) { delete mNumberOfSuperpagesPerMessage; } @@ -88,6 +89,13 @@ RawTask::~RawTask() if (mADCsize) { delete mADCsize; } + if (mFECmaxCountperSM) { + delete mFECmaxCountperSM; + } + if (mFECmaxIDperSM) { + delete mFECmaxIDperSM; + } + for (auto& histos : mRMS) { delete histos.second; } @@ -103,7 +111,12 @@ RawTask::~RawTask() for (auto& histos : mMIN) { delete histos.second; } - + for (auto& histos : mRawAmplMinEMCAL_tot) { + delete histos.second; + } + for (auto& histos : mRawAmplMinDCAL_tot) { + delete histos.second; + } for (auto& histos : mRawAmplitudeEMCAL) { for (auto h : histos.second) { delete h; @@ -163,6 +176,10 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) if (!mGeometry) mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); + // this is how to get access to custom parameters defined in the config file at qc.tasks..taskParameters + 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 @@ -197,11 +214,16 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mTotalDataVolume); // EMCAL related histograms - mPayloadSizePerDDL = new TH2F("PayloadSizePerDDL", "PayloadSizePerDDL", 40, 0, 40, 100, 0, 1); + mPayloadSizePerDDL = new TH2F("PayloadSizePerDDL", "PayloadSizePerDDL", 40, 0, 40, 200, 0, 20); mPayloadSizePerDDL->GetXaxis()->SetTitle("ddl"); - mPayloadSizePerDDL->GetYaxis()->SetTitle("PayloadSize"); + mPayloadSizePerDDL->GetYaxis()->SetTitle("Payload Size / Event (kB)"); getObjectsManager()->startPublishing(mPayloadSizePerDDL); + mPayloadSizeTFPerDDL = new TH2F("PayloadSizeTFPerDDL", "PayloadSizeTFPerDDL", 40, 0, 40, 100, 0, 100); + mPayloadSizeTFPerDDL->GetXaxis()->SetTitle("ddl"); + mPayloadSizeTFPerDDL->GetYaxis()->SetTitle("Payload Size / TF (kB)"); + getObjectsManager()->startPublishing(mPayloadSizeTFPerDDL); + mPayloadSize = new TH1F("PayloadSize", "PayloadSize", 20, 0, 60000000); // mPayloadSize->GetXaxis()->SetTitle("bytes"); mPayloadSize->GetYaxis()->SetTitle("Counts"); @@ -224,14 +246,24 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) mNbunchPerChan->GetXaxis()->SetTitle("# bunches per channels"); getObjectsManager()->startPublishing(mNbunchPerChan); - mNofADCsamples = new TH1F("NumberOfADCPerChannel", "NumberOfADCPerChannel", 16, -0.5, 15.5); + mNofADCsamples = new TH1F("NumberOfADCPerChannel", "NumberOfADCPerChannel", 15, -0.5, 14.5); mNofADCsamples->GetXaxis()->SetTitle("# of ADC sample per channels"); getObjectsManager()->startPublishing(mNofADCsamples); - mADCsize = new TH1F("ADCsizePerBunch", "ADCsizePerBunch", 16, -0.5, 15.5); + mADCsize = new TH1F("ADCsizePerBunch", "ADCsizePerBunch", 15, -0.5, 14.5); mADCsize->GetXaxis()->SetTitle("ADC size per bunch"); getObjectsManager()->startPublishing(mADCsize); + mFECmaxCountperSM = new TH2F("NumberOfChWithInput_perSM", "NumberOfChWithInput_perSM", 20, 0, 20, 40, 0, 40); + mFECmaxCountperSM->GetXaxis()->SetTitle("SM"); + mFECmaxCountperSM->GetYaxis()->SetTitle("max FEC count"); + getObjectsManager()->startPublishing(mFECmaxCountperSM); + + mFECmaxIDperSM = new TH2F("FECidMaxChWithInput_perSM", "FECidMaxChWithInput_perSM", 20, 0, 20, 40, 0, 40); + mFECmaxIDperSM->GetXaxis()->SetTitle("SM"); + mFECmaxIDperSM->GetYaxis()->SetTitle("FEC id"); + getObjectsManager()->startPublishing(mFECmaxIDperSM); + //histos per SM for (auto ism = 0; ism < 20; ism++) { mFECmaxCount[ism] = new TH1F(Form("NumberOfChWithInputSM_%d", ism), Form("Number of Channels with input for SM %d", ism), 40, -0.5, 39.5); @@ -275,6 +307,19 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) histosRawAmplMin->GetYaxis()->SetTitle("raw"); getObjectsManager()->startPublishing(histosRawAmplMin); + TH1D* histosRawMinEMCALtot; + TH1D* histosRawMinDCALtot; + + histosRawMinEMCALtot = new TH1D(Form("mRawAmplMinEMCAL_distr_%s", histoStr[trg].Data()), Form("mRawAmplMinEMCAL_distr_%s", histoStr[trg].Data()), 100, 0., 100.); + histosRawMinEMCALtot->GetXaxis()->SetTitle("Raw Amplitude"); + histosRawMinEMCALtot->GetYaxis()->SetTitle("Counts"); + getObjectsManager()->startPublishing(histosRawMinEMCALtot); + + histosRawMinDCALtot = new TH1D(Form("mRawAmplMinDCAL_distr_%s", histoStr[trg].Data()), Form("mRawAmplMinDCAL_distr_%s", histoStr[trg].Data()), 100, 0., 100.); + histosRawMinDCALtot->GetXaxis()->SetTitle("Raw Amplitude"); + histosRawMinDCALtot->GetYaxis()->SetTitle("Counts"); + getObjectsManager()->startPublishing(histosRawMinDCALtot); + std::array histosRawAmplEMCALSM; std::array histosMINRawAmplEMCALSM; std::array histosRawAmplMaxEMCALSM; @@ -341,6 +386,9 @@ void RawTask::initialize(o2::framework::InitContext& /*ctx*/) mMAX[triggers[trg]] = histosRawAmplMax; mMIN[triggers[trg]] = histosRawAmplMin; + mRawAmplMinEMCAL_tot[triggers[trg]] = histosRawMinEMCALtot; + mRawAmplMinDCAL_tot[triggers[trg]] = histosRawMinDCALtot; + } //loop trigger case } @@ -357,8 +405,26 @@ void RawTask::startOfCycle() void RawTask::monitorData(o2::framework::ProcessingContext& ctx) { + // In this function you can access data inputs specified in the JSON config file, for example: + // "query": "random:ITS/RAWDATA/0" + // which is correspondingly :// 4) { + QcInfoLogger::GetInstance() << QcInfoLogger::Error << "No valid data origin" << mDataOrigin << ", cannot process" << QcInfoLogger::endm; + return; + } + char dataOrigin[4]; + strcpy(dataOrigin, mDataOrigin.data()); + if (isLostTimeframe(ctx)) return; @@ -368,15 +434,12 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) mMessageCounter->Fill(1); //for expert const int NUMBERSM = 20; + const int NFEESM = 40; //number of fee per sm std::unordered_map, RawEventTypeHash> maxADCSM, minADCSM; - std::unordered_map, NUMBERSM>, RawEventTypeHash> fecMaxPayload; - - const int NFEESM = 40; //number of fee per sm - int nchannels[NFEESM]; //channel counting for FECid. - for (Int_t i = 0; i < NFEESM; i++) - nchannels[i] = 0; + std::unordered_map, NUMBERSM>, RawEventTypeHash> fecMaxPayload; + // Accept only descriptor RAWDATA, discard FLP/SUBTIMEFRAME auto posReadout = ctx.inputs().getPos("readout"); auto nslots = ctx.inputs().getNofParts(posReadout); for (decltype(nslots) islot = 0; islot < nslots; islot++) { @@ -396,10 +459,11 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) mTotalDataVolume->Fill(1., header->payloadSize); //for expert // Skip SOX headers - auto rdhblock = reinterpret_cast(rawData.payload); + auto rdhblock = reinterpret_cast(rawData.payload); // if (o2::raw::RDHUtils::getHeaderSize(rdhblock) == static_cast(header->payloadSize)) { continue; } + mPayloadSizeTFPerDDL->Fill(o2::raw::RDHUtils::getFEEID(rdhblock), header->payloadSize / 1024.); //PayLoad size per TimeFrame for shifter // try decoding payload o2::emcal::RawReaderMemory rawreader(gsl::span(rawData.payload, header->payloadSize)); @@ -436,9 +500,10 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) // Needs separate maps for the two trigger classes auto fecMaxChannelsEvent = fecMaxPayload.find(evIndex); if (fecMaxChannelsEvent == fecMaxPayload.end()) { - std::array, NUMBERSM> fecMaxCh; - for (auto ism = 0; ism < NUMBERSM; ism++) - fecMaxCh[ism] = { -1, -1 }; + std::array, NUMBERSM> fecMaxCh; + for (auto ism = 0; ism < NUMBERSM; ism++) { + std::fill(fecMaxCh[ism].begin(), fecMaxCh[ism].end(), 0); + } fecMaxChannelsEvent = (fecMaxPayload.insert({ evIndex, fecMaxCh })).first; } @@ -533,8 +598,8 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) fecIndex = chan.getFECIndex(); branchIndex = chan.getBranchIndex(); - fecID = mMappings->getFEEForChannelInDDL(supermoduleID, fecIndex, branchIndex); - nchannels[fecID]++; + fecID = mMappings->getFEEForChannelInDDL(feeID, fecIndex, branchIndex); + fecMaxChannelsEvent->second[supermoduleID][fecID]++; Short_t maxADC = 0; Short_t minADC = SHRT_MAX; @@ -565,6 +630,10 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) if (minADCbunch < minADC) minADC = minADCbunch; mRawAmplMinEMCAL[evtype][supermoduleID]->Fill(minADCbunch); // min for each cell --> for for expert only + if (supermoduleID < 12) + mRawAmplMinEMCAL_tot[evtype]->Fill(minADCbunch); //shifter + else + mRawAmplMinDCAL_tot[evtype]->Fill(minADCbunch); //shifter meanADC = TMath::Mean(adcs.begin(), adcs.end()); rmsADC = TMath::RMS(adcs.begin(), adcs.end()); @@ -588,26 +657,10 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) mMINperSM[evtype][supermoduleID]->Fill(col, row, minADC); //min col,row, per SM mMIN[evtype]->Fill(globCol, globRow, minADC); //for shifter } //channels - //check on trigger type - //meaningless for CALIB trigger since the whole detector is illuminated - int channelID = -1, maxCount = -1; - for (Int_t i = 0; i < 40; i++) { - if (nchannels[i] > maxCount) { - maxCount = nchannels[i]; - channelID = i; - } - } - auto& currentmaxchannelSM = fecMaxChannelsEvent->second[supermoduleID]; - if (maxCount > currentmaxchannelSM.second) { - // new slowest channel found - currentmaxchannelSM.first = channelID; - currentmaxchannelSM.second = maxCount; - } - - } //new page - } //header - } //inputs - mNumberOfPagesPerMessage->Fill(nPagesMessage); // for experts + } //new page + } //header + } //inputs + mNumberOfPagesPerMessage->Fill(nPagesMessage); // for experts mNumberOfSuperpagesPerMessage->Fill(nSuperpagesMessage); // Fill histograms with cached values @@ -617,8 +670,22 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) if (!isPhysTrigger) continue; // Only select phys event for max FEC, in case of calibration events the whole EMCAL gets the FEC pulse, so the payload size is roughly equal for (auto ism = 0; ism < NUMBERSM; ism++) { - mFECmaxID[ism]->Fill(maxfec.second[ism].first); // histo to monitor the ID of FEC with max count for shifter - mFECmaxCount[ism]->Fill(maxfec.second[ism].second); // histo to monitor the count //for shifter + // Find maximum FEC in array of FECs + int maxfecID(-1), maxfecCount(-1); + auto& fecsSM = maxfec.second[ism]; + for (int ifec = 0; ifec < NFEESM; ifec++) { + if (fecsSM[ifec] > maxfecCount) { + maxfecCount = fecsSM[ifec]; + maxfecID = ifec; + } + } + if (maxfecCount <= 0) + continue; // Reject links on different FLP + mFECmaxID[ism]->Fill(maxfecID); // histo to monitor the ID of FEC with max count for shifter + mFECmaxCount[ism]->Fill(maxfecCount); // histo to monitor the count //for shifter + + mFECmaxIDperSM->Fill(ism, maxfecID); //filled as a funcion of SM (shifter) + mFECmaxCountperSM->Fill(ism, maxfecCount); //filled as a function of SM (shifter) } } for (auto maxadc : maxADCSM) { @@ -635,7 +702,7 @@ void RawTask::monitorData(o2::framework::ProcessingContext& ctx) bool isPhysTrigger = triggertype & o2::trigger::PhT; EventType evtype = isPhysTrigger ? EventType::PHYS_EVENT : EventType::CAL_EVENT; for (int ism = 0; ism < NUMBERSM; ism++) { - mMINRawAmplitudeEMCAL[evtype][ism]->Fill(minadc.second[ism]); //max in the event for shifter + mMINRawAmplitudeEMCAL[evtype][ism]->Fill(minadc.second[ism]); //max in the event (not for shifter) } } // Same for other cached values @@ -658,7 +725,6 @@ void RawTask::reset() // clean all the monitor objects here QcInfoLogger::GetInstance() << "Resetting the histogram" << AliceO2::InfoLogger::InfoLogger::endm; - mPayloadSize->Reset(); EventType triggers[2] = { EventType::CAL_EVENT, EventType::PHYS_EVENT }; for (const auto& trg : triggers) { @@ -678,24 +744,33 @@ void RawTask::reset() } } mPayloadSizePerDDL->Reset(); + mPayloadSizeTFPerDDL->Reset(); mPayloadSize->Reset(); mErrorTypeAltro->Reset(); mNbunchPerChan->Reset(); mNofADCsamples->Reset(); mADCsize->Reset(); + mFECmaxIDperSM->Reset(); + mFECmaxCountperSM->Reset(); } bool RawTask::isLostTimeframe(framework::ProcessingContext& ctx) const { - auto posReadout = ctx.inputs().getPos("readout"); - auto nslots = ctx.inputs().getNofParts(posReadout); - for (decltype(nslots) islot = 0; islot < nslots; islot++) { - const auto& ref = ctx.inputs().getByPos(posReadout, islot); + constexpr auto originEMC = header::gDataOriginEMC; + o2::framework::InputSpec dummy{ "dummy", + framework::ConcreteDataMatcher{ originEMC, + header::gDataDescriptionRawData, + 0xDEADBEEF } }; + for (const auto& ref : o2::framework::InputRecordWalker(ctx.inputs(), { dummy })) { + //auto posReadout = ctx.inputs().getPos("readout"); + //auto nslots = ctx.inputs().getNofParts(posReadout); + //for (decltype(nslots) islot = 0; islot < nslots; islot++) { + // const auto& ref = ctx.inputs().getByPos(posReadout, islot); const auto dh = o2::framework::DataRefUtils::getHeader(ref); - if (dh->subSpecification == 0xDEADBEEF) { - if (dh->payloadSize == 0) { - return true; - } + // if (dh->subSpecification == 0xDEADBEEF) { + if (dh->payloadSize == 0) { + return true; + // } } } return false;