Skip to content

Commit

Permalink
Merge branch 'master' into ClusterQC
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhawani Singh committed May 15, 2024
2 parents 76a92df + 9d5ee3f commit fa401f7
Show file tree
Hide file tree
Showing 27 changed files with 1,825 additions and 66 deletions.
5 changes: 5 additions & 0 deletions Framework/script/RepoCleaner/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release notes

1.7
- [QC-1144] 1_per_run : Consider RunNumber=0 as no run number (#2238)
- [QC-1142 ]fix object preservation for 1_per_run policy (#2228)
- [QC-996] policy multiple_per_run can delete first and last (#1921)

1.6
- add option to set adjustableEOV when updating validity
- [QC-986] Do not touch the validity any more in rules 1_per_hour and production
Expand Down
2 changes: 1 addition & 1 deletion Framework/script/RepoCleaner/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='qcrepocleaner',
version='1.6',
version='1.7',
author='Barthelemy von Haller',
author_email='[email protected]',
url='https://gitlab.cern.ch/AliceO2Group/QualityControl/Framework/script/RepoCleaner',
Expand Down
5 changes: 5 additions & 0 deletions Framework/script/updateCcdbConsul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ for ((nodeIndex = 0; nodeIndex < ${#HEAD_NODES[@]}; nodeIndex++)); do
# for each file
for file in "${array_files[@]}"; do
echo "file: $file"
# avoid touching the repo cleaner file
if [[ $file == *repoCleanerConfig.yaml* ]]; then
echo " it is the repo cleaner config file, we skip it"
continue
fi

# download
local_file=$(basename $file)
Expand Down
5 changes: 4 additions & 1 deletion Framework/src/AggregatorRunnerFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ AggregatorRunnerConfig AggregatorRunnerFactory::extractRunnerConfig(const core::
commonSpec.activityPeriodName,
commonSpec.activityPassName,
commonSpec.activityProvenance,
{ commonSpec.activityStart, commonSpec.activityEnd }
{ commonSpec.activityStart, commonSpec.activityEnd },
commonSpec.activityBeamType,
commonSpec.activityPartitionName,
commonSpec.activityFillNumber
};

return {
Expand Down
5 changes: 4 additions & 1 deletion Framework/src/CheckRunnerFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ CheckRunnerConfig CheckRunnerFactory::extractConfig(const CommonSpec& commonSpec
commonSpec.activityPeriodName,
commonSpec.activityPassName,
commonSpec.activityProvenance,
{ commonSpec.activityStart, commonSpec.activityEnd }
{ commonSpec.activityStart, commonSpec.activityEnd },
commonSpec.activityBeamType,
commonSpec.activityPartitionName,
commonSpec.activityFillNumber
};
return {
commonSpec.database,
Expand Down
2 changes: 1 addition & 1 deletion Modules/CTP/include/CTP/CTPTrendingTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CTPTrendingTask : public PostProcessingInterface
void trendValues(const Trigger& t, quality_control::repository::DatabaseInterface& qcdb);
void generatePlots();

o2::ctp::CTPConfiguration* mCTPconfig;
o2::ctp::CTPConfiguration* mCTPconfig{ nullptr };
TrendingConfigCTP mConfig;
MetaData mMetaData;
UInt_t mTime;
Expand Down
8 changes: 5 additions & 3 deletions Modules/EMCAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

add_library(O2QcEMCAL)

target_sources(O2QcEMCAL PRIVATE src/PedestalTask.cxx src/BCTask.cxx src/RawErrorCheck.cxx src/RawTask.cxx src/RawCheck.cxx src/CellTask.cxx src/CellCheck.cxx src/DigitsQcTask.cxx src/DigitCheck.cxx src/OccupancyReductor.cxx src/ClusterTask.cxx src/RawErrorTask.cxx src/CalibMonitoringTask.cxx src/SupermoduleProjectorTask.cxx src/BadChannelMapReductor.cxx src/TimeCalibParamReductor.cxx src/SupermoduleProjectionReductor.cxx src/SubdetectorProjectionReductor.cxx src/BCVisualization.cxx)
target_sources(O2QcEMCAL PRIVATE src/TriggerTask.cxx src/PedestalTask.cxx src/BCTask.cxx src/RawErrorCheck.cxx src/RawTask.cxx src/RawCheck.cxx src/CellTask.cxx src/CellCheck.cxx src/DigitsQcTask.cxx src/DigitCheck.cxx src/OccupancyReductor.cxx src/ClusterTask.cxx src/RawErrorTask.cxx src/CalibMonitoringTask.cxx src/SupermoduleProjectorTask.cxx src/BadChannelMapReductor.cxx src/TimeCalibParamReductor.cxx src/SupermoduleProjectionReductor.cxx src/SubdetectorProjectionReductor.cxx src/BCVisualization.cxx src/CalibCheck.cxx)

target_include_directories(
O2QcEMCAL
Expand Down Expand Up @@ -31,8 +31,10 @@ add_root_dictionary(O2QcEMCAL
include/EMCAL/SupermoduleProjectionReductor.h
include/EMCAL/SubdetectorProjectionReductor.h
include/EMCAL/BCVisualization.h
include/EMCAL/PedestalTask.h
LINKDEF include/EMCAL/LinkDef.h)
include/EMCAL/PedestalTask.h
include/EMCAL/TriggerTask.h
include/EMCAL/CalibCheck.h
LINKDEF include/EMCAL/LinkDef.h)

install(TARGETS O2QcEMCAL
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
68 changes: 68 additions & 0 deletions Modules/EMCAL/include/EMCAL/CalibCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 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.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \file CalibCheck.h
/// \author Sierra Cantway
///

#ifndef QC_MODULE_EMCAL_EMCALCALIBCHECK_H
#define QC_MODULE_EMCAL_EMCALCALIBCHECK_H

#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::emcal
{

/// \brief Check whether a plot is good or not.
///
/// \author Sierra Cantway
class CalibCheck : public o2::quality_control::checker::CheckInterface
{
public:
/// Default constructor
CalibCheck() = default;
/// Destructor
~CalibCheck() override = default;

// Override interface
void configure() override;
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
std::string getAcceptedType() override;

private:
/************************************************
* threshold cuts *
************************************************/

float mBadThresholdMaskStatsAll = 10.; ///< Bad Threshold used in the Max Stats All bad and dead channels check
float mBadThresholdTimeCalibCoeff = 10.; ///< Bad Threshold used in the time Calib Coeff points outside of mean check
float mBadThresholdFractionGoodCellsEvent = 0.; ///< Bad Threshold used in the fraction Good Cells per Event check
float mBadThresholdFractionGoodCellsSupermodule = 0.; ///< Bad Threshold used in the fraction Good Cells per Supermodule check
float mBadThresholdCellAmplitudeSupermoduleCalibPHYS = 10.; ///< Bad Threshold used in the PHYS Cell amplitude (Calib) vs. supermodule ID check
float mBadThresholdCellTimeSupermoduleCalibPHYS = 10.; ///< Bad Threshold used in the PHYS Cell Time (Calib) vs. supermodule ID (High gain) check

float mMedThresholdMaskStatsAll = 10.; ///< Medium Threshold used in the Max Stats All bad and dead channels check
float mMedThresholdTimeCalibCoeff = 10.; ///< Medium Threshold used in the time Calib Coeff points outside of mean check
float mMedThresholdFractionGoodCellsEvent = 10.; ///< Medium Threshold used in the fraction Good Cells per Event check
float mMedThresholdFractionGoodCellsSupermodule = 10.; ///< Medium Threshold used in the fraction Good Cells per Supermodule check
float mMedThresholdCellAmplitudeSupermoduleCalibPHYS = 10.; ///< Medium Threshold used in the PHYS Cell amplitude (Calib) vs. supermodule ID check
float mMedThresholdCellTimeSupermoduleCalibPHYS = 10.; ///< Medium Threshold used in the PHYS Cell Time (Calib) vs. supermodule ID (High gain) check

float mSigmaTimeCalibCoeff = 2.; ///< Number of sigmas used in the timeCalibCoeff points outside of mean check

ClassDefOverride(CalibCheck, 1);
};

} // namespace o2::quality_control_modules::emcal

#endif // QC_MODULE_EMCAL_EMCALCALIBCHECK_H
9 changes: 6 additions & 3 deletions Modules/EMCAL/include/EMCAL/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#pragma link C++ class o2::quality_control_modules::emcal::BCTask + ;
#pragma link C++ class o2::quality_control_modules::emcal::BCVisualization + ;

#pragma link C++ class o2::quality_control_modules::emcal::PedestalTask+;

#endif
#pragma link C++ class o2::quality_control_modules::emcal::PedestalTask + ;

#pragma link C++ class o2::quality_control_modules::emcal::CalibCheck + ;
#pragma link C++ class o2::quality_control_modules::emcal::TriggerTask + ;

#endif
152 changes: 152 additions & 0 deletions Modules/EMCAL/include/EMCAL/TriggerTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// 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.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \file TriggerTask.h
/// \author Markus Fasel
///

#ifndef QC_MODULE_EMCAL_EMCALTRIGGERTASK_H
#define QC_MODULE_EMCAL_EMCALTRIGGERTASK_H

#include "QualityControl/TaskInterface.h"
#include "EMCALBase/TriggerMappingV2.h"
#include <gsl/span>
#include <memory>
#include <vector>

class TH1;
class TH2;
class TProfile2D;

namespace o2
{
class InteractionRecord;
}

namespace o2::emcal
{
class CompressedTRU;
class CompressedTriggerPatch;
class CompressedL0TimeSum;
class TriggerRecord;
}; // namespace o2::emcal

using namespace o2::quality_control::core;

namespace o2::quality_control_modules::emcal
{

/// \class TriggerTask
/// \brief Task monitoring EMCAL trigger observables
/// \author Markus Fasel <[email protected]>, Oak Ridge National Laboratory
/// \since April 19, 2024
///
/// Task monitoring basic observables of the EMCAL trigger system. The task subscibes to:
///
/// || Binding || Channel || Information ||
/// |---------------|-----------------|---------------------------------------|
/// | truinfo | EMC/TRUS | TRU data |
/// | trurecords | EMC/TRUSTRGR | Trigger records of TRU data |
/// | patchinfos | EMC/PATCHES | Trigger patches |
/// | patchrecords | EMC/PATCHESTRGR | Trigger records of trigger patches |
/// | timesums | EMC/FASTORS | L0 FastOR timesums |
/// |timesumrecords | EMC/FASTORSTRGR | Trigger records of L0 FastOR timesums |
///
/// Monitoring per timeframe is done in the function monitorData, which delegates
/// the monitoring per trigger to an internal function processEvent.
///
/// The task defines the following task parameters:
/// - None so far
class TriggerTask final : public TaskInterface
{
public:
/// \brief Constructor
TriggerTask() = default;
/// \brief Destructor
~TriggerTask() override;

/// \brief Initialize task (histograms and trigger mapping)
/// \param ctx InitContenxt
void initialize(o2::framework::InitContext& ctx) override;

/// \brief Operations performed at the start of activity (start of run)
/// \param activity Activity
void startOfActivity(const Activity& activity) override;

/// \brief Operations at performed at the start of a new monitoring cycle
void startOfCycle() override;

/// \brief Monitoring data for a given timeframe
/// \param ctx Processing context with data
///
/// As the data in EMCAL is organized in triggers within the container the
/// monitoring is delegated to the internal function processEvent. monitorData
/// subscribes to the timeframe-based container of the TRU information, trigger
/// patches and timesums, as well as their corresponding trigger records. Iteration
/// over all BCs found in any of the containers via getAllBCs is performed, and
/// for each trigger the TRU, patch and FastOR information is extracted from the
/// timeframe-based containers.
void monitorData(o2::framework::ProcessingContext& ctx) override;

/// \brief Operations performed at the end of the current monitoring cycle
void endOfCycle() override;

/// \brief Operations performed at the end fo the activity (end of run)
/// \param activity Activity
void endOfActivity(const Activity& activity) override;

/// \brief Reset all histograms
void reset() override;

private:
/// \brief Fill monitoring histograms for a single event
/// \param trudata TRU data for the event
/// \param triggerpatches Trigger patches found in the event
/// \param timesums L0 timesums found in the event
void processEvent(const gsl::span<const o2::emcal::CompressedTRU> trudata, const gsl::span<const o2::emcal::CompressedTriggerPatch> triggerpatches, const gsl::span<const o2::emcal::CompressedL0TimeSum> timesums);

/// \brief Find all BCs with data in either of the components (or all)
/// \param trurecords Trigger records for TRU data
/// \param patchrecords Trigger records for trigger patches
/// \param timesumrecords Trigger records for L0 timesums
/// \return List of found BCs (sorted)
std::vector<o2::InteractionRecord> getAllBCs(const gsl::span<const o2::emcal::TriggerRecord> trurecords, const gsl::span<const o2::emcal::TriggerRecord> patchrecords, const gsl::span<const o2::emcal::TriggerRecord> timesumrecords) const;

std::unique_ptr<o2::emcal::TriggerMappingV2> mTriggerMapping; ///< Trigger mapping
TH1* mTRUFired = nullptr; ///< Histogram with counters per TRU fired
TH1* mFastORFired = nullptr; ///< Histogram with counters per FastOR fired (in patches)
TH2* mPositionFasORFired = nullptr; ///< Histogram with the position of fired FastORs (in patches)
TH1* mNumberOfTRUsPerEvent = nullptr; ///< Counter histogram for number of fired TRUs per event
TH1* mNumberOfPatchesPerEvent = nullptr; ///< Counter histogram for number of fired patches per event
TH1* mPatchEnergySpectrumPerEvent = nullptr; ///< Histogram for integrated patch energy spectrum
TH1* mLeadingPatchEnergySpectrumPerEvent = nullptr; ///< Histogram for integrated leading patch energy spectrum
TH2* mPatchEnergyTRU = nullptr; ///< Histogram for patch energy spectrum per TRU
TH2* mLeadingPatchEnergyTRU = nullptr; ///< Histogram for leading patch energy spectrum per TRU
TH2* mNumberOfPatchesPerTRU = nullptr; ///< Counter histogram for number of patches per TRU
TH2* mPatchIndexFired = nullptr; ///< Histogram with the fired patch index per TRU
TH2* mPatchIndexLeading = nullptr; ///< Histogram with the leading fired patch index per TRU
TH2* mTRUTime = nullptr; ///< Histogram with TRU time vs TRU index
TH2* mPatchTime = nullptr; ///< Histogram with patch time vs. TRU index
TH2* mLeadingPatchTime = nullptr; ///< Histogram with patch time of the leading patch vs. TRU index
TH1* mNumberTimesumsEvent = nullptr; ///< Counter histogram with number of non-0 FastOR timesums per event
TH1* mL0Timesums = nullptr; ///< ADC spectrum of the FastOR timesums
TH2* mL0TimesumsTRU = nullptr; ///< ADC spectrum of the the FastOR timesums per TRU
TH1* mADCMaxTimesum = nullptr; ///< ADC spectrum of the leading FastOR timesum per event
TH1* mFastORIndexMaxTimesum = nullptr; ///< Index of the leading FastOR timesum per event
TH2* mPositionMaxTimesum = nullptr; ///< Position of teh leading FastOR timsum per event
TH2* mIntegratedTimesums = nullptr; ///< Integrated ADC timesum
TProfile2D* mAverageTimesum = nullptr; ///< Average ADC timesum
};

} // namespace o2::quality_control_modules::emcal

#endif // QC_MODULE_EMCAL_EMCALTRIGGERTASK_H
Loading

0 comments on commit fa401f7

Please sign in to comment.