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
2 changes: 1 addition & 1 deletion Modules/FT0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

target_link_libraries(O2QcFT0 PUBLIC O2QualityControl O2::DataFormatsFT0 O2::FITCalibration)
target_link_libraries(O2QcFT0 PUBLIC O2QualityControl O2::DataFormatsFT0 O2::FT0Base O2::FITCalibration)

install(TARGETS O2QcFT0
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
64 changes: 64 additions & 0 deletions Modules/FT0/ft0-digits-qc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"host": "http://localhost:8083",
"username": "not_applicable",
"password": "not_applicable",
"name": "not_applicable"
},
"Activity": {
"number": "42",
"type": "2"
},
"monitoring": {
"url": "infologger:///debug?METRIC"
},
"consul": {
"url": "http://localhost:8500"
},
"conditionDB": {
"url": "http://localhost:8083"
}
},
"tasks": {
"DigitQcTask": {
"active": "true",
"className": "o2::quality_control_modules::ft0::DigitQcTask",
"moduleName": "QcFT0",
"detectorName": "FT0",
"cycleDurationSeconds": "60",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "digits:FT0/DIGITSBC/0;channels:FT0/DIGITSCH/0"
},
"taskParameters": {
"ChannelIDs": "204,205"
},
"location": "local",
"localMachines": [
"localhost"
],
"remoteMachine": "localhost",
"remotePort": "30132",
"mergingMode": "entire"
}
},
"checks": {
"DummyAnalysisCheck": {
"active": "true",
"className": "o2::quality_control_modules::skeleton::SkeletonCheck",
"moduleName": "QcSkeleton",
"policy": "OnAny",
"detectorName": "FT0",
"dataSource": [{
"type": "Task",
"name": "DigitQcTask",
"MOs": ["example"]
}]
}
}
}
}
4 changes: 2 additions & 2 deletions Modules/FT0/include/FT0/DigitQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <Framework/InputRecord.h>

#include "QualityControl/QcInfoLogger.h"
#include "FT0Base/Constants.h"
#include "DataFormatsFT0/Digit.h"
#include "DataFormatsFT0/ChannelData.h"
#include "QualityControl/TaskInterface.h"
Expand Down Expand Up @@ -72,7 +73,6 @@ class DigitQcTask final : public TaskInterface
return vecResult;
}

static constexpr unsigned int sNchannels = 208;
// Object which will be published
std::unique_ptr<TH2F> mHistAmp2Ch;
std::unique_ptr<TH2F> mHistTime2Ch;
Expand All @@ -87,7 +87,7 @@ class DigitQcTask final : public TaskInterface
std::unique_ptr<TH1F> mHistAverageTimeA;
std::unique_ptr<TH1F> mHistAverageTimeC;
std::unique_ptr<TH1F> mHistChannelID;
std::array<o2::InteractionRecord, sNchannels> mStateLastIR2Ch;
std::array<o2::InteractionRecord, o2::ft0::Constants::sNCHANNELS_PM> mStateLastIR2Ch;
std::map<o2::ft0::ChannelData::EEventDataBit, std::string> mMapChTrgNames;
std::map<int, std::string> mMapDigitTrgNames;
TList* mListHistGarbage;
Expand Down
13 changes: 7 additions & 6 deletions Modules/FT0/src/CalibrationTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "FT0/CalibrationTask.h"
#include "DataFormatsFT0/Digit.h"
#include "DataFormatsFT0/ChannelData.h"
#include "FT0Base/Constants.h"
#include <Framework/InputRecord.h>
#include "DetectorsCalibration/Utils.h"
#include "CCDB/BasicCCDBManager.h"
Expand All @@ -35,13 +36,13 @@ CalibrationTask::~CalibrationTask()

void CalibrationTask::initialize(o2::framework::InitContext& /*ctx*/)
{
ILOG(Info, Support) << "initialize CalibrationTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well.

ILOG(Info, Support) << "initialize CalibrationTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well.
constexpr std::size_t Nchannels_FT0 = o2::ft0::Constants::sNCHANNELS_PM; //208(real) + 8 (empty) number of PM(without LCS) channels
mNotCalibratedChannelTimeHistogram = std::make_unique<TH1F>("Not_calibrated_time", "Not_calibrated_time", 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mCalibratedChannelTimeHistogram = std::make_unique<TH1F>("Calibrated_time", "Calibrated_time", 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mCalibratedTimePerChannelHistogram = std::make_unique<TH2F>("Calibrated_time_per_channel", "Calibrated_time_per_channel", o2::ft0::Nchannels_FT0, 0, o2::ft0::Nchannels_FT0, 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mNotCalibratedTimePerChannelHistogram = std::make_unique<TH2F>("Not_calibrated_time_per_channel", "Not_calibrated_time_per_channel", o2::ft0::Nchannels_FT0, 0, o2::ft0::Nchannels_FT0, 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mChannelTimeCalibrationObjectGraph = std::make_unique<TGraph>(o2::ft0::Nchannels_FT0);
mCalibratedTimePerChannelHistogram = std::make_unique<TH2F>("Calibrated_time_per_channel", "Calibrated_time_per_channel", Nchannels_FT0, 0, Nchannels_FT0, 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mNotCalibratedTimePerChannelHistogram = std::make_unique<TH2F>("Not_calibrated_time_per_channel", "Not_calibrated_time_per_channel", Nchannels_FT0, 0, Nchannels_FT0, 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE);
mChannelTimeCalibrationObjectGraph = std::make_unique<TGraph>(Nchannels_FT0);
mChannelTimeCalibrationObjectGraph->SetName("Channel_time_calibration_object");
mChannelTimeCalibrationObjectGraph->SetTitle("Channel_time_calibration_object");
mChannelTimeCalibrationObjectGraph->SetMarkerStyle(20);
Expand Down Expand Up @@ -73,7 +74,7 @@ void CalibrationTask::startOfCycle()
mCalibratedTimePerChannelHistogram->Reset();
mNotCalibratedTimePerChannelHistogram->Reset();
mCurrentChannelTimeCalibrationObject = ccdb::BasicCCDBManager::instance().get<o2::ft0::FT0ChannelTimeCalibrationObject>(o2::fit::FITCalibrationApi::getObjectPath<o2::ft0::FT0ChannelTimeCalibrationObject>());
for (std::size_t chID = 0; chID < o2::ft0::Nchannels_FT0; ++chID) {
for (std::size_t chID = 0; chID < o2::ft0::Constants::sNCHANNELS_PM; ++chID) {
if (mCurrentChannelTimeCalibrationObject) {
mChannelTimeCalibrationObjectGraph->SetPoint(chID, chID, mCurrentChannelTimeCalibrationObject->mTimeOffsets[chID]);
} else {
Expand Down
5 changes: 3 additions & 2 deletions Modules/FT0/src/ChannelTimeCalibrationCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

#include <TH2F.h>
#include <TText.h>
#include <TList.h>
#include "FT0/ChannelTimeCalibrationCheck.h"
#include "DataFormatsFT0/RawEventData.h"
#include "FT0Base/Constants.h"

namespace o2::quality_control_modules::ft0
{
Expand All @@ -38,7 +39,7 @@ Quality ChannelTimeCalibrationCheck::check(std::map<std::string, std::shared_ptr
if (obj->getName() == "Calibrated_time_per_channel") {
currentQuality = Quality::Good;
auto histogram = dynamic_cast<TH2F*>(obj->getObject());
for (size_t chID = 0; chID < o2::ft0::Nchannels_FT0; ++chID) {
for (size_t chID = 0; chID < o2::ft0::Constants::sNCHANNELS_PM; ++chID) { //Iterating over sNCHANNELS_PM = 208(real) + 8(empty) = 216 number of PM(without LCS) channels
auto channelProjection = histogram->ProjectionY(("Times per channel: " + std::to_string(chID)).c_str(), chID, chID);
if (channelProjection->GetEntries() < mMinEntries) {
return Quality::Bad;
Expand Down
18 changes: 9 additions & 9 deletions Modules/FT0/src/DigitQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/)
mMapDigitTrgNames.insert({ o2::ft0::Triggers::bitCen, "Central" });
mMapDigitTrgNames.insert({ o2::ft0::Triggers::bitSCen, "SemiCentral" });

mHistTime2Ch = std::make_unique<TH2F>("TimePerChannel", "Time vs Channel;Time;Channel;", 4100, -2050, 2050, sNchannels, 0, sNchannels);
mHistTime2Ch = std::make_unique<TH2F>("TimePerChannel", "Time vs Channel;Time;Channel;", 4100, -2050, 2050, o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM);
mHistTime2Ch->SetOption("colz");
mHistAmp2Ch = std::make_unique<TH2F>("AmpPerChannel", "Amplitude vs Channel;Amp;Channel;", 4200, -100, 4100, sNchannels, 0, sNchannels);
mHistAmp2Ch = std::make_unique<TH2F>("AmpPerChannel", "Amplitude vs Channel;Amp;Channel;", 4200, -100, 4100, o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM);
mHistAmp2Ch->SetOption("colz");
mHistOrbit2BC = std::make_unique<TH2F>("OrbitPerBC", "BC-Orbit map;Orbit;BC;", 256, 0, 256, 3564, 0, 3564);
mHistOrbit2BC->SetOption("colz");

mHistEventDensity2Ch = std::make_unique<TH2F>("EventDensityPerChannel", "Event density(in BC) per Channel;Channel;BC;", sNchannels, 0, sNchannels, 10000, 0, 1e5);
mHistEventDensity2Ch = std::make_unique<TH2F>("EventDensityPerChannel", "Event density(in BC) per Channel;Channel;BC;", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM, 10000, 0, 1e5);
mHistEventDensity2Ch->SetOption("colz");

mHistChDataBits = std::make_unique<TH2F>("ChannelDataBits", "ChannelData bits per ChannelID;Channel;Bit", sNchannels, 0, sNchannels, mMapChTrgNames.size(), 0, mMapChTrgNames.size());
mHistChDataBits = std::make_unique<TH2F>("ChannelDataBits", "ChannelData bits per ChannelID;Channel;Bit", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM, mMapChTrgNames.size(), 0, mMapChTrgNames.size());
mHistChDataBits->SetOption("colz");

for (const auto& entry : mMapChTrgNames) {
Expand All @@ -70,13 +70,13 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/)
for (const auto& entry : mMapDigitTrgNames) {
mHistTriggers->GetXaxis()->SetBinLabel(entry.first + 1, entry.second.c_str());
}
mHistNchA = std::make_unique<TH1F>("NumChannelsA", "Number of channels(TCM), side A;Nch", sNchannels, 0, sNchannels);
mHistNchC = std::make_unique<TH1F>("NumChannelsC", "Number of channels(TCM), side C;Nch", sNchannels, 0, sNchannels);
mHistNchA = std::make_unique<TH1F>("NumChannelsA", "Number of channels(TCM), side A;Nch", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM);
mHistNchC = std::make_unique<TH1F>("NumChannelsC", "Number of channels(TCM), side C;Nch", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM);
mHistSumAmpA = std::make_unique<TH1F>("SumAmpA", "Sum of amplitudes(TCM), side A;", 1000, 0, 1e4);
mHistSumAmpC = std::make_unique<TH1F>("SumAmpC", "Sum of amplitudes(TCM), side C;", 1000, 0, 1e4);
mHistAverageTimeA = std::make_unique<TH1F>("AverageTimeA", "Average time(TCM), side A", 4100, -2050, 2050);
mHistAverageTimeC = std::make_unique<TH1F>("AverageTimeC", "Average time(TCM), side C", 4100, -2050, 2050);
mHistChannelID = std::make_unique<TH1F>("StatChannelID", "ChannelID statistics;ChannelID", sNchannels, 0, sNchannels);
mHistChannelID = std::make_unique<TH1F>("StatChannelID", "ChannelID statistics;ChannelID", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM);
mListHistGarbage = new TList();
mListHistGarbage->SetOwner(kTRUE);
std::vector<unsigned int> vecChannelIDs;
Expand All @@ -85,7 +85,7 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/)
const std::string del = ",";
vecChannelIDs = parseParameters<unsigned int>(chIDs, del);
} else {
for (unsigned int iCh = 0; iCh < sNchannels; iCh++)
for (unsigned int iCh = 0; iCh < o2::ft0::Constants::sNCHANNELS_PM; iCh++)
vecChannelIDs.push_back(iCh);
}
for (const auto& entry : vecChannelIDs) {
Expand Down Expand Up @@ -184,7 +184,7 @@ void DigitQcTask::monitorData(o2::framework::ProcessingContext& ctx)
if (digit.mTriggers.amplA == -5000 && digit.mTriggers.amplC == -5000 && digit.mTriggers.timeA == -5000 && digit.mTriggers.timeC == -5000)
isTCM = false;
mHistOrbit2BC->Fill(digit.getOrbit() - firstOrbit, digit.getBC());
if (isTCM || !digit.mTriggers.getLaserBit()) {
if (isTCM && !digit.mTriggers.getLaserBit()) {
mHistNchA->Fill(digit.mTriggers.nChanA);
mHistNchC->Fill(digit.mTriggers.nChanC);
mHistSumAmpA->Fill(digit.mTriggers.amplA);
Expand Down