diff --git a/Modules/FT0/CMakeLists.txt b/Modules/FT0/CMakeLists.txt index 3757fdafbf..3fa8f0cad0 100644 --- a/Modules/FT0/CMakeLists.txt +++ b/Modules/FT0/CMakeLists.txt @@ -17,7 +17,7 @@ target_include_directories( $ 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} diff --git a/Modules/FT0/ft0-digits-qc.json b/Modules/FT0/ft0-digits-qc.json new file mode 100644 index 0000000000..d7ab753cbe --- /dev/null +++ b/Modules/FT0/ft0-digits-qc.json @@ -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"] + }] + } + } + } +} diff --git a/Modules/FT0/include/FT0/DigitQcTask.h b/Modules/FT0/include/FT0/DigitQcTask.h index b11424a8c4..6db2c83874 100644 --- a/Modules/FT0/include/FT0/DigitQcTask.h +++ b/Modules/FT0/include/FT0/DigitQcTask.h @@ -19,6 +19,7 @@ #include #include "QualityControl/QcInfoLogger.h" +#include "FT0Base/Constants.h" #include "DataFormatsFT0/Digit.h" #include "DataFormatsFT0/ChannelData.h" #include "QualityControl/TaskInterface.h" @@ -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 mHistAmp2Ch; std::unique_ptr mHistTime2Ch; @@ -87,7 +87,7 @@ class DigitQcTask final : public TaskInterface std::unique_ptr mHistAverageTimeA; std::unique_ptr mHistAverageTimeC; std::unique_ptr mHistChannelID; - std::array mStateLastIR2Ch; + std::array mStateLastIR2Ch; std::map mMapChTrgNames; std::map mMapDigitTrgNames; TList* mListHistGarbage; diff --git a/Modules/FT0/src/CalibrationTask.cxx b/Modules/FT0/src/CalibrationTask.cxx index 5b6d343f91..7b596239fb 100644 --- a/Modules/FT0/src/CalibrationTask.cxx +++ b/Modules/FT0/src/CalibrationTask.cxx @@ -21,6 +21,7 @@ #include "FT0/CalibrationTask.h" #include "DataFormatsFT0/Digit.h" #include "DataFormatsFT0/ChannelData.h" +#include "FT0Base/Constants.h" #include #include "DetectorsCalibration/Utils.h" #include "CCDB/BasicCCDBManager.h" @@ -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("Not_calibrated_time", "Not_calibrated_time", 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE); mCalibratedChannelTimeHistogram = std::make_unique("Calibrated_time", "Calibrated_time", 2 * CHANNEL_TIME_HISTOGRAM_RANGE, -CHANNEL_TIME_HISTOGRAM_RANGE, CHANNEL_TIME_HISTOGRAM_RANGE); - mCalibratedTimePerChannelHistogram = std::make_unique("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("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(o2::ft0::Nchannels_FT0); + mCalibratedTimePerChannelHistogram = std::make_unique("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("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(Nchannels_FT0); mChannelTimeCalibrationObjectGraph->SetName("Channel_time_calibration_object"); mChannelTimeCalibrationObjectGraph->SetTitle("Channel_time_calibration_object"); mChannelTimeCalibrationObjectGraph->SetMarkerStyle(20); @@ -73,7 +74,7 @@ void CalibrationTask::startOfCycle() mCalibratedTimePerChannelHistogram->Reset(); mNotCalibratedTimePerChannelHistogram->Reset(); mCurrentChannelTimeCalibrationObject = ccdb::BasicCCDBManager::instance().get(o2::fit::FITCalibrationApi::getObjectPath()); - 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 { diff --git a/Modules/FT0/src/ChannelTimeCalibrationCheck.cxx b/Modules/FT0/src/ChannelTimeCalibrationCheck.cxx index 519441eaf1..d40891eed5 100644 --- a/Modules/FT0/src/ChannelTimeCalibrationCheck.cxx +++ b/Modules/FT0/src/ChannelTimeCalibrationCheck.cxx @@ -15,8 +15,9 @@ #include #include +#include #include "FT0/ChannelTimeCalibrationCheck.h" -#include "DataFormatsFT0/RawEventData.h" +#include "FT0Base/Constants.h" namespace o2::quality_control_modules::ft0 { @@ -38,7 +39,7 @@ Quality ChannelTimeCalibrationCheck::check(std::mapgetName() == "Calibrated_time_per_channel") { currentQuality = Quality::Good; auto histogram = dynamic_cast(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; diff --git a/Modules/FT0/src/DigitQcTask.cxx b/Modules/FT0/src/DigitQcTask.cxx index 341437057e..89a263064c 100644 --- a/Modules/FT0/src/DigitQcTask.cxx +++ b/Modules/FT0/src/DigitQcTask.cxx @@ -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("TimePerChannel", "Time vs Channel;Time;Channel;", 4100, -2050, 2050, sNchannels, 0, sNchannels); + mHistTime2Ch = std::make_unique("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("AmpPerChannel", "Amplitude vs Channel;Amp;Channel;", 4200, -100, 4100, sNchannels, 0, sNchannels); + mHistAmp2Ch = std::make_unique("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("OrbitPerBC", "BC-Orbit map;Orbit;BC;", 256, 0, 256, 3564, 0, 3564); mHistOrbit2BC->SetOption("colz"); - mHistEventDensity2Ch = std::make_unique("EventDensityPerChannel", "Event density(in BC) per Channel;Channel;BC;", sNchannels, 0, sNchannels, 10000, 0, 1e5); + mHistEventDensity2Ch = std::make_unique("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("ChannelDataBits", "ChannelData bits per ChannelID;Channel;Bit", sNchannels, 0, sNchannels, mMapChTrgNames.size(), 0, mMapChTrgNames.size()); + mHistChDataBits = std::make_unique("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) { @@ -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("NumChannelsA", "Number of channels(TCM), side A;Nch", sNchannels, 0, sNchannels); - mHistNchC = std::make_unique("NumChannelsC", "Number of channels(TCM), side C;Nch", sNchannels, 0, sNchannels); + mHistNchA = std::make_unique("NumChannelsA", "Number of channels(TCM), side A;Nch", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM); + mHistNchC = std::make_unique("NumChannelsC", "Number of channels(TCM), side C;Nch", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM); mHistSumAmpA = std::make_unique("SumAmpA", "Sum of amplitudes(TCM), side A;", 1000, 0, 1e4); mHistSumAmpC = std::make_unique("SumAmpC", "Sum of amplitudes(TCM), side C;", 1000, 0, 1e4); mHistAverageTimeA = std::make_unique("AverageTimeA", "Average time(TCM), side A", 4100, -2050, 2050); mHistAverageTimeC = std::make_unique("AverageTimeC", "Average time(TCM), side C", 4100, -2050, 2050); - mHistChannelID = std::make_unique("StatChannelID", "ChannelID statistics;ChannelID", sNchannels, 0, sNchannels); + mHistChannelID = std::make_unique("StatChannelID", "ChannelID statistics;ChannelID", o2::ft0::Constants::sNCHANNELS_PM, 0, o2::ft0::Constants::sNCHANNELS_PM); mListHistGarbage = new TList(); mListHistGarbage->SetOwner(kTRUE); std::vector vecChannelIDs; @@ -85,7 +85,7 @@ void DigitQcTask::initialize(o2::framework::InitContext& /*ctx*/) const std::string del = ","; vecChannelIDs = parseParameters(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) { @@ -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);