Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modules/ITS/include/ITS/ITSFeeTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class ITSFeeTask final : public TaskInterface
int mNPayloadSizeBins = 4096;
bool mResetLaneStatus = false;
bool mResetPayload = false;
bool precisePayload = false;
int mPayloadParseEvery_n_HBF_per_TF = 32; // -1 to disable, 1 to process all the HBFs
int mPayloadParseEvery_n_TF = 1; // Use >= 1 values
bool mEnableIHWReading = 0;
Expand Down
3 changes: 2 additions & 1 deletion Modules/ITS/itsFee.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"PayloadParsingEvery_n_HBFperTF": "0",
"PayloadParsingEvery_n_TF": "1",
"DecodeCDW": "0",
"nResetCycle": "3"
"nResetCycle": "3",
"precisePayload": "1"
}
}
},
Expand Down
70 changes: 42 additions & 28 deletions Modules/ITS/src/ITSFeeTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void ITSFeeTask::initialize(o2::framework::InitContext& /*ctx*/)

void ITSFeeTask::createFeePlots()
{

mTrigger = new TH1I("TriggerFlag", "Trigger vs counts", mTriggerType.size(), 0.5, mTriggerType.size() + 0.5);
getObjectsManager()->startPublishing(mTrigger); // mTrigger

Expand Down Expand Up @@ -142,7 +143,7 @@ void ITSFeeTask::createFeePlots()
mFlag1Check = new TH2I("Flag1Check", "Flag 1 Check", NFees, 0, NFees, 3, 0, 3); // Row 1 : transmission_timeout, Row 2 : packet_overflow, Row 3 : lane_starts_violation
getObjectsManager()->startPublishing(mFlag1Check); // mFlag1Check

mDecodingCheck = new TH2I("DecodingCheck", "Error in parsing data", NFees, 0, NFees, 5, 0, 5); // 0: DataFormat not recognized, 1: DDW index != 0, 2: DDW wrong identifier, 3: IHW wrong identifier, 4: CDW wrong version -- adapt y range!
mDecodingCheck = new TH2I("DecodingCheck", "Error in parsing data", NFees, 0, NFees, 6, 0, 6); // 0: DataFormat not recognized, 1: DDW index != 0, 2: DDW wrong identifier, 3: IHW wrong identifier, 4: CDW wrong version, 5: Empty Payload -- adapt y range!
getObjectsManager()->startPublishing(mDecodingCheck);

mPayloadSize = new TH2F("PayloadSize", "Payload Size", NFees, 0, NFees, mNPayloadSizeBins, 0, 4.096e5);
Expand Down Expand Up @@ -513,7 +514,10 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)

} // if doLookForTDT || mDecodeCDW

//
// Check on empty payload
if (!it.size()) {
mDecodingCheck->Fill(ifee, 5);
}

// Operations at the first page of each orbit
// - decoding ITS header work and fill histogram with number of active lanes
Expand Down Expand Up @@ -546,12 +550,34 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
}

// Operations at last page of each orbit:

// - decoding Diagnostic Word DDW0 and fill lane status plots and vectors
if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) {

for (int i = 0; i < NFees; i++) {
mPayloadSize->Fill(i, (float)payloadTot[i]);
payloadTot[i] = 0;
// - read triggers in RDH and fill histogram
// - fill histogram with packet_done TDTs counted so far and reset counter
// fill trailer count histo and reset counters
if (doLookForTDT) {

if (!RampOngoing && !clockEvt) {
mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
}
TDTcounter[ifee] = 0;
}

nStops[ifee]++;
for (int i = 0; i < mTriggerType.size(); i++) {
if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) {
mTrigger->Fill(i + 1);
mTriggerVsFeeId->Fill(ifee, i + 1);
mTriggerVsFeeId_reset->Fill(ifee, i + 1);
}
}

if (precisePayload) {
mPayloadSize->Fill(ifee, payloadTot[ifee]);
payloadTot[ifee] = 0;
}

const GBTDiagnosticWord* ddw;
Expand Down Expand Up @@ -604,29 +630,6 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
}
}
}

// Operations at last page of each orbit:
// - read triggers in RDH and fill histogram
// - fill histogram with packet_done TDTs counted so far and reset counter
if ((int)(o2::raw::RDHUtils::getStop(rdh))) {
// fill trailer count histo and reset counters
if (doLookForTDT) {

if (!RampOngoing && !clockEvt) {
mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
}
TDTcounter[ifee] = 0;
}
nStops[ifee]++;
for (int i = 0; i < mTriggerType.size(); i++) {
if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) {
mTrigger->Fill(i + 1);
mTriggerVsFeeId->Fill(ifee, i + 1);
mTriggerVsFeeId_reset->Fill(ifee, i + 1);
}
}
}
}

// Filling histograms: loop over mStatusFlagNumber[ilayer][istave][ilane][iflag]
Expand Down Expand Up @@ -671,6 +674,16 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
mLaneStatusOverview[1]->SetBinError(istave + 1 + StaveBoundary[ilayer], 1e-15);
}
}

if (!precisePayload) {
for (int i = 0; i < NFees; i++) {
if (nStops[i]) {
float payloadAvg = (float)payloadTot[i] / nStops[i];
mPayloadSize->Fill(i, payloadAvg);
}
}
}

mTimeFrameId++;
mTFInfo->Fill(mTimeFrameId % 10000);
end = std::chrono::high_resolution_clock::now();
Expand All @@ -691,6 +704,7 @@ void ITSFeeTask::getParameters()
mEnableIHWReading = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "EnableIHWReading", mEnableIHWReading);
mDecodeCDW = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "DecodeCDW", mDecodeCDW);
nResetCycle = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "nResetCycle", nResetCycle);
precisePayload = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "precisePayload", precisePayload);
}

void ITSFeeTask::getStavePoint(int layer, int stave, double* px, double* py)
Expand Down
Loading