Skip to content

Commit

Permalink
renaming and adding to daq.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Aug 20, 2024
1 parent 869e3c1 commit 55455fb
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 57 deletions.
47 changes: 31 additions & 16 deletions Modules/Daq/daq.json → Modules/Daq/etc/daq.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,35 @@
"active": "true",
"className": "o2::quality_control_modules::daq::DaqTask",
"moduleName": "QcDaq",
"detectorName": "DAQ"
"detectorName": "ITS",
"cycleDurationSeconds": "10",
"dataSource": {
"type": "direct",
"query": "raw:ITS/RAWDATA"
},
"taskParameters": {
"TFSizeBins":"100",
"TFSizeMin":"0",
"TFSizeMax":"2047",
"payloadSizeInputsBins":"100",
"payloadSizeInputsMin":"0",
"payloadSizeInputsMax":"2047",
"numberRDHsBins":"100",
"numberRDHsMin":"0",
"numberRDHsMax":"2047",
"sumRdhSizesInTFBins":"100",
"sumRdhSizesInTFMin":"0",
"sumRdhSizesInTFMax":"2047",
"RdhSizesBins":"100",
"RdhSizesMin":"0",
"RdhSizesMax":"2047",
"RdhPayloadSizeBins":"100",
"RdhPayloadSizeMin":"0",
"RdhPayloadSizeMax":"2047",
"CRUidBins":"100",
"CRUidMin":"0",
"CRUidMax":"2047"
}
}
},
"checks": {
Expand All @@ -36,7 +64,7 @@
"className": "o2::quality_control_modules::common::NonEmpty",
"moduleName": "QcCommon",
"policy": "OnAny",
"detectorName": "DAQ",
"detectorName": "ITS",
"dataSource": [{
"type": "Task",
"name": "DaqTask",
Expand All @@ -48,26 +76,13 @@
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
"moduleName": "QcSkeleton",
"policy": "OnAny",
"detectorName": "DAQ",
"dataSource": [{
"type": "Task",
"name": "DaqTask",
"MOs": ["IDs"]
}]
},
"CheckIncreasingIDs": {
"active": "true",
"className": "o2::quality_control_modules::daq::EverIncreasingGraph",
"moduleName": "QcDaq",
"policy": "OnAny",
"detectorName": "DAQ",
"detectorName": "ITS",
"dataSource": [{
"type": "Task",
"name": "DaqTask",
"MOs": ["IDs"]
}]
}

}
}
}
12 changes: 6 additions & 6 deletions Modules/Daq/include/Daq/DaqTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class DaqTask final : public o2::quality_control::core::TaskInterface
// Message related
// Block = the whole InputRecord, i.e. the thing we receive and analyse in monitorData(...)
// SubBlock = a single input of the InputRecord
std::unique_ptr<TH1F> mInputRecordPayloadSize; // filled w/ the sum of the payload size of all the inputs of an inputrecord
std::unique_ptr<TH1F> mInputSize; // filled w/ the size of the inputs in each InputRecord we encounter
std::unique_ptr<TH1F> mNumberRDHs; // filled w/ the number of RDHs found in each InputRecord we encounter
std::unique_ptr<TH1F> mSumRDHSizesPerInputRecord; // filled w/ the the sum of RDH memory sizes per InputRecord
std::unique_ptr<TH1F> mSumRDHSizesPerRDH; // filled w/ the RDH memory sizes for each RDH
std::unique_ptr<TH2F> mRDHSizesPerCRUIds; // filled w/ the RDH payload size per CRUId
std::unique_ptr<TH1F> mTFRecordPayloadSize; // filled w/ the sum of the payload size of all the inputs of an inputrecord
std::unique_ptr<TH1F> mInputSize; // filled w/ the size of the inputs in each InputRecord we encounter
std::unique_ptr<TH1F> mNumberRDHs; // filled w/ the number of RDHs found in each InputRecord we encounter
std::unique_ptr<TH1F> mSumRDHSizesInTF; // filled w/ the the sum of RDH memory sizes per InputRecord
std::unique_ptr<TH1F> mSumRDHSizesInRDH; // filled w/ the RDH memory sizes for each RDH
std::unique_ptr<TH2F> mRDHSizesPerCRUIds; // filled w/ the RDH payload size per CRUId
};

} // namespace o2::quality_control_modules::daq
Expand Down
71 changes: 36 additions & 35 deletions Modules/Daq/src/DaqTask.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and bopyright holders of ALICE O2.
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -45,45 +45,45 @@ void DaqTask::initialize(o2::framework::InitContext& /*ctx*/)
{
ILOG(Debug, Devel) << "initializiation of DaqTask" << ENDM;

mInputRecordPayloadSize = std::make_unique<TH1F>("inputRecordSize", "Total payload size per InputRecord;bytes",
getIntParam("inputRecordSizeBins", 128),
getIntParam("inputRecordSizeMin", 0),
getIntParam("inputRecordSizeMax", 2047));
getObjectsManager()->startPublishing(mInputRecordPayloadSize.get(), PublicationPolicy::Forever);
mTFRecordPayloadSize = std::make_unique<TH1F>("TFSize", "Total payload size in TF;bytes",
getIntParam("TFSizeBins", 128),
getIntParam("TFSizeMin", 0),
getIntParam("TFSizeMax", 2047));
getObjectsManager()->startPublishing(mTFRecordPayloadSize.get(), PublicationPolicy::Forever);

mInputSize = std::make_unique<TH1F>("payloadSizeInputs", "Payload size of the inputs;bytes",
getIntParam("payloadSizeInputsBins", 128),
getIntParam("payloadSizeInputsMin", 0),
getIntParam("payloadSizeInputsMax", 2047));
getObjectsManager()->startPublishing(mInputSize.get(), PublicationPolicy::Forever);

mNumberRDHs = std::make_unique<TH1F>("numberRdhs", "Number of RDHs per InputRecord",
mNumberRDHs = std::make_unique<TH1F>("numberRdhs", "Number of RDHs in TF;RDH count",
getIntParam("numberRDHsBins", 100),
getIntParam("numberRDHsMin", 1),
getIntParam("numberRDHsMax", 100));
getObjectsManager()->startPublishing(mNumberRDHs.get(), PublicationPolicy::Forever);

mSumRDHSizesPerInputRecord = std::make_unique<TH1F>("sumRdhSizesPerInputRecord", "Sum of RDH sizes per InputRecord;bytes",
getIntParam("sumRdhSizesPerInputRecordBins", 128),
getIntParam("sumRdhSizesPerInputRecordMin", 0),
getIntParam("sumRdhSizesPerInputRecordMax", 2047));
getObjectsManager()->startPublishing(mSumRDHSizesPerInputRecord.get(), PublicationPolicy::Forever);
mSumRDHSizesInTF = std::make_unique<TH1F>("sumRdhSizesInTF", "Sum of RDH sizes in TF;bytes",
getIntParam("sumRdhSizesInTFBins", 128),
getIntParam("sumRdhSizesInTFMin", 0),
getIntParam("sumRdhSizesInTFMax", 2047));
getObjectsManager()->startPublishing(mSumRDHSizesInTF.get(), PublicationPolicy::Forever);

mSumRDHSizesPerRDH = std::make_unique<TH1F>("RdhSizes", "RDH sizes; bytes",
getIntParam("RdhSizesBins", 128),
getIntParam("RdhSizesMin", 0),
getIntParam("RdhSizesMax", 2047));
getObjectsManager()->startPublishing(mSumRDHSizesPerRDH.get(), PublicationPolicy::Forever);
mSumRDHSizesInRDH = std::make_unique<TH1F>("RdhSizes", "RDH sizes;bytes",
getIntParam("RdhSizesBins", 128),
getIntParam("RdhSizesMin", 0),
getIntParam("RdhSizesMax", 2047));
getObjectsManager()->startPublishing(mSumRDHSizesInRDH.get(), PublicationPolicy::Forever);

mRDHSizesPerCRUIds = std::make_unique<TH2F>("RdhPayloadSizePerCRUid", "RDH payload size per CRU",
getIntParam("CRUidBins", (1 << 12) - 1), // CRU id is defined as 12 bits (see O2 RAWDataHeader.h cruID)
getIntParam("CRUidMin", 0),
getIntParam("CRUidMax", 500),
getIntParam("RdhPayloadSizeBins", 128),
getIntParam("RdhPayloadSizeMin", 0),
getIntParam("RdhPayloadSizeMax", 2047),
getIntParam("CRUidBins", 500),
getIntParam("CRUidMin", 0),
getIntParam("CRUidMax", 500));
mRDHSizesPerCRUIds->GetXaxis()->SetTitle("bytes");
mRDHSizesPerCRUIds->GetYaxis()->SetTitle("CRU Id");
getIntParam("RdhPayloadSizeMax", 2047));
mRDHSizesPerCRUIds->GetXaxis()->SetTitle("CRU Id");
mRDHSizesPerCRUIds->GetYaxis()->SetTitle("bytes");
getObjectsManager()->startPublishing(mRDHSizesPerCRUIds.get(), PublicationPolicy::Forever);
}

Expand Down Expand Up @@ -113,11 +113,11 @@ void DaqTask::endOfActivity(const Activity& /*activity*/)
{
ILOG(Debug, Devel) << "endOfActivity" << ENDM;

getObjectsManager()->stopPublishing(mInputRecordPayloadSize.get());
getObjectsManager()->stopPublishing(mTFRecordPayloadSize.get());
getObjectsManager()->stopPublishing(mInputSize.get());
getObjectsManager()->stopPublishing(mNumberRDHs.get());
getObjectsManager()->stopPublishing(mSumRDHSizesPerInputRecord.get());
getObjectsManager()->stopPublishing(mSumRDHSizesPerRDH.get());
getObjectsManager()->stopPublishing(mSumRDHSizesInRDH.get());
getObjectsManager()->stopPublishing(mSumRDHSizesInRDH.get());
getObjectsManager()->stopPublishing(mRDHSizesPerCRUIds.get());
}

Expand All @@ -128,11 +128,12 @@ void DaqTask::reset()
// TODO if the number of plots grows we should probably have a container with pointers/references to all of them.
// then we can just iterate over.

mInputRecordPayloadSize->Reset();
mTFRecordPayloadSize->Reset();
mInputSize->Reset();
mNumberRDHs->Reset();
mSumRDHSizesPerRDH->Reset();
mSumRDHSizesPerInputRecord->Reset();
mSumRDHSizesInRDH->Reset();
mSumRDHSizesInRDH->Reset();
mRDHSizesPerCRUIds->Reset();
}

void DaqTask::printInputPayload(const header::DataHeader* header, const char* payload, size_t payloadSize)
Expand Down Expand Up @@ -193,7 +194,7 @@ void DaqTask::monitorInputRecord(InputRecord& inputRecord)
ILOG(Warning, Support) << "Received an input with an empty header" << ENDM;
}
}
mInputRecordPayloadSize->Fill(totalPayloadSize);
mTFRecordPayloadSize->Fill(totalPayloadSize);
}

template <class T>
Expand Down Expand Up @@ -244,20 +245,20 @@ void DaqTask::monitorRDHs(o2::framework::InputRecord& inputRecord)

// RDH plots
try {
const auto RDHSize = RDHUtils::getMemorySize(rdh) - RDHUtils::getHeaderSize(rdh);
mSumRDHSizesPerRDH->Fill(RDHSize);
totalSize += RDHSize;
const auto rdhSize = RDHUtils::getMemorySize(rdh) - RDHUtils::getHeaderSize(rdh);
mSumRDHSizesInRDH->Fill(rdhSize);
totalSize += rdhSize;
rdhCounter++;

mRDHSizesPerCRUIds->Fill(RDHSize, RDHUtils::getCRUID(rdh));
mRDHSizesPerCRUIds->Fill(RDHUtils::getCRUID(rdh), rdhSize);

} catch (std::runtime_error& e) {
ILOG(Error, Devel) << "Caught an exception when accessing the rdh fields: \n"
<< e.what() << ENDM;
}
}

mSumRDHSizesPerInputRecord->Fill(totalSize);
mSumRDHSizesInTF->Fill(totalSize);
mNumberRDHs->Fill(rdhCounter);
}

Expand Down

0 comments on commit 55455fb

Please sign in to comment.