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
17 changes: 14 additions & 3 deletions Modules/FT0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

add_library(O2QcFT0)

target_sources(O2QcFT0 PRIVATE src/BasicDigitQcTask.cxx
target_sources(O2QcFT0 PRIVATE src/BasicDigitQcTask.cxx
src/DigitQcTask.cxx
src/ChannelsCheck.cxx
src/DigitsCheck.cxx
src/MergedTreeCheck.cxx
src/TreeReaderPostProcessing.cxx
src/CalibrationTask.cxx
src/ChannelTimeCalibrationCheck.cxx)
src/ChannelTimeCalibrationCheck.cxx
src/BasicPPTask.cxx
src/OutOfBunchCollTask.cxx
src/CFDEffCheck.cxx
src/TriggerQcTask.cxx
src/OutOfBunchCollCheck.cxx
)

target_include_directories(
O2QcFT0
Expand All @@ -35,11 +41,16 @@ add_root_dictionary(O2QcFT0
include/FT0/TreeReaderPostProcessing.h
include/FT0/CalibrationTask.h
include/FT0/ChannelTimeCalibrationCheck.h
include/FT0/BasicPPTask.h
include/FT0/OutOfBunchCollTask.h
include/FT0/CFDEffCheck.h
include/FT0/TriggerQcTask.h
include/FT0/OutOfBunchCollCheck.h
LINKDEF include/FT0/LinkDef.h
BASENAME O2QcFT0)

# ---- Executables ----
# keep commented as an example
# keep commented as an example

#set(EXE_SRCS
# src/runDataProducer.cxx )
Expand Down
60 changes: 60 additions & 0 deletions Modules/FT0/include/FT0/BasicPPTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// 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 BasicPPTask.h
/// \author Sebastian Bysiak sbysiak@cern.ch
///

#ifndef QC_MODULE_FT0_BASICPPTASK_H
#define QC_MODULE_FT0_BASICPPTASK_H

#include "QualityControl/PostProcessingInterface.h"
#include "QualityControl/DatabaseInterface.h"
#include "FT0Base/Constants.h"

#include <TCanvas.h>

class TH1F;
class TGraph;
class TCanvas;
class TLegend;
class TProfile;

namespace o2::quality_control_modules::ft0
{

/// \brief Basic Postprocessing Task for FT0, computes among others the trigger rates
/// \author Sebastian Bysiak sbysiak@cern.ch
class BasicPPTask final : public quality_control::postprocessing::PostProcessingInterface
{
public:
BasicPPTask() = default;
~BasicPPTask() override;
void initialize(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;
void update(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;
void finalize(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;

private:
o2::quality_control::repository::DatabaseInterface* mDatabase = nullptr;
std::unique_ptr<TGraph> mRateOrA;
std::unique_ptr<TGraph> mRateOrC;
std::unique_ptr<TGraph> mRateVertex;
std::unique_ptr<TGraph> mRateCentral;
std::unique_ptr<TGraph> mRateSemiCentral;
std::unique_ptr<TCanvas> mRatesCanv;
TProfile* mAmpl = nullptr;
TProfile* mTime = nullptr;
};

} // namespace o2::quality_control_modules::ft0

#endif //QC_MODULE_FT0_BASICPPTASK_H
49 changes: 49 additions & 0 deletions Modules/FT0/include/FT0/CFDEffCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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 CFDEffCheck.h
/// \author Sebastian Bysiak sbysiak@cern.ch
///

#ifndef QC_MODULE_FT0_FT0CFDEFFCHECK_H
#define QC_MODULE_FT0_FT0CFDEFFCHECK_H

#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::ft0
{

/// \brief checks if CFD efficiency is below threshold
/// \author Sebastian Bysiak sbysiak@cern.ch
class CFDEffCheck : public o2::quality_control::checker::CheckInterface
{
public:
CFDEffCheck() = default;
~CFDEffCheck() override = default;

void configure(std::string name) 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;

ClassDefOverride(CFDEffCheck, 1);

private:
float mThreshWarning;
float mThreshError;
int mNumWarnings;
int mNumErrors;
};

} // namespace o2::quality_control_modules::ft0

#endif // QC_MODULE_FT0_FT0CFDEFFCHECK_H
41 changes: 34 additions & 7 deletions Modules/FT0/include/FT0/DigitQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
///
/// \file DigitQcTask.h
/// \author Artur Furs afurs@cern.ch
/// modified by Sebastin Bysiak sbysiak@cern.ch
/// QC Task for FT0 detector, mostly for data visualisation during FEE tests

#ifndef QC_MODULE_FT0_FT0DIGITQCTASK_H
Expand All @@ -27,6 +28,7 @@
#include <memory>
#include <regex>
#include <type_traits>
#include <boost/algorithm/string.hpp>
#include "TH1.h"
#include "TH2.h"
#include "TList.h"
Expand Down Expand Up @@ -54,6 +56,18 @@ class DigitQcTask final : public TaskInterface
void reset() override;

private:
// three ways of computing cycle duration:
// 1) number of time frames
// 2) time in ns from InteractionRecord: total range (totalMax - totalMin)
// 3) time in ns from InteractionRecord: sum of each TF duration
// later on choose the best and remove others
double mTimeMinNS = 0.;
double mTimeMaxNS = 0.;
double mTimeCurNS = 0.;
int mTfCounter = 0;
double mTimeSum = 0.;
const float mCFDChannel2NS = 0.01302; // CFD channel width in ns

template <typename Param_t,
typename = typename std::enable_if<std::is_floating_point<Param_t>::value ||
std::is_same<std::string, Param_t>::value || (std::is_integral<Param_t>::value && !std::is_same<bool, Param_t>::value)>::type>
Expand All @@ -74,12 +88,23 @@ class DigitQcTask final : public TaskInterface
return vecResult;
}

// Object which will be published
void rebinFromConfig();

TList* mListHistGarbage;
std::set<unsigned int> mSetAllowedChIDs;
std::array<o2::InteractionRecord, o2::ft0::Constants::sNCHANNELS_PM> mStateLastIR2Ch;
std::map<int, std::string> mMapDigitTrgNames;
std::map<o2::ft0::ChannelData::EEventDataBit, std::string> mMapChTrgNames;
std::unique_ptr<TH1F> mHistNumADC;
std::unique_ptr<TH1F> mHistNumCFD;

// Objects which will be published
std::unique_ptr<TH2F> mHistAmp2Ch;
std::unique_ptr<TH2F> mHistTime2Ch;
std::unique_ptr<TH2F> mHistEventDensity2Ch;
std::unique_ptr<TH2F> mHistOrbit2BC;
std::unique_ptr<TH2F> mHistChDataBits;
std::unique_ptr<TH2F> mHistOrbit2BC;
std::unique_ptr<TH1F> mHistBC;
std::unique_ptr<TH1F> mHistTriggers;
std::unique_ptr<TH1F> mHistNchA;
std::unique_ptr<TH1F> mHistNchC;
Expand All @@ -88,15 +113,17 @@ class DigitQcTask final : public TaskInterface
std::unique_ptr<TH1F> mHistAverageTimeA;
std::unique_ptr<TH1F> mHistAverageTimeC;
std::unique_ptr<TH1F> mHistChannelID;
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;
std::unique_ptr<TH1F> mHistCFDEff;
std::unique_ptr<TH2F> mHistTimeSum2Diff;
std::unique_ptr<TH2F> mHistTriggersCorrelation;
std::unique_ptr<TH1D> mHistCycleDuration;
std::unique_ptr<TH1D> mHistCycleDurationNTF;
std::unique_ptr<TH1D> mHistCycleDurationRange;
std::map<unsigned int, TH1F*> mMapHistAmp1D;
std::map<unsigned int, TH1F*> mMapHistTime1D;
std::map<unsigned int, TH1F*> mMapHistPMbits;
std::map<unsigned int, TH2F*> mMapHistAmpVsTime;
std::set<unsigned int> mSetAllowedChIDs;
std::map<unsigned int, TH2F*> mMapTrgBcOrbit;
};

} // namespace o2::quality_control_modules::ft0
Expand Down
5 changes: 5 additions & 0 deletions Modules/FT0/include/FT0/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
#pragma link C++ class o2::quality_control_modules::ft0::TreeReaderPostProcessing + ;
#pragma link C++ class o2::quality_control_modules::ft0::CalibrationTask + ;
#pragma link C++ class o2::quality_control_modules::ft0::ChannelTimeCalibrationCheck + ;
#pragma link C++ class o2::quality_control_modules::ft0::BasicPPTask + ;
#pragma link C++ class o2::quality_control_modules::ft0::OutOfBunchCollTask + ;
#pragma link C++ class o2::quality_control_modules::ft0::CFDEffCheck + ;
#pragma link C++ class o2::quality_control_modules::ft0::TriggerQcTask + ;
#pragma link C++ class o2::quality_control_modules::ft0::OutOfBunchCollCheck + ;

#endif
53 changes: 53 additions & 0 deletions Modules/FT0/include/FT0/OutOfBunchCollCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// 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 OutOfBunchCollCheck.h
/// \author Sebastian Bysiak sbysiak@cern.ch
///

#ifndef QC_MODULE_FT0_FT0OUTOFBUNCHCOLLCHECK_H
#define QC_MODULE_FT0_FT0OUTOFBUNCHCOLLCHECK_H

#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::ft0
{

/// \brief Checks what fraction of collisions is out of bunch
/// \author Sebastian Bysiak sbysiak@cern.ch
class OutOfBunchCollCheck : public o2::quality_control::checker::CheckInterface
{
public:
/// Default constructor
OutOfBunchCollCheck() = default;
/// Destructor
~OutOfBunchCollCheck() override = default;

// Override interface
void configure(std::string name) 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;

ClassDefOverride(OutOfBunchCollCheck, 1);

private:
float mFractionOutOfBunchColl;
int mNumNonEmptyBins;
float mThreshWarning;
float mThreshError;
std::string mTrgName;
};

} // namespace o2::quality_control_modules::ft0

#endif // QC_MODULE_FT0_FT0OUTOFBUNCHCOLLCHECK_H
63 changes: 63 additions & 0 deletions Modules/FT0/include/FT0/OutOfBunchCollTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// 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 OutOfBunchCollTask.h
/// \author Sebastian Bysiak sbysiak@cern.ch
///

#ifndef QC_MODULE_FT0_OUTOFBUNCHCOLLTASK_H
#define QC_MODULE_FT0_OUTOFBUNCHCOLLTASK_H

#include "CommonDataFormat/BunchFilling.h"
#include "QualityControl/PostProcessingInterface.h"
#include "QualityControl/DatabaseInterface.h"
#include "FT0Base/Constants.h"
#include "DataFormatsFT0/Digit.h"
#include "DataFormatsFT0/ChannelData.h"
#include "CCDB/CcdbApi.h"

#include "TList.h"
#include "Rtypes.h"

class TH1F;
class TH2F;

namespace o2::quality_control_modules::ft0
{

/// \brief PostProcessing task which finds collisions not compatible with BC pattern
/// \author Sebastian Bysiak sbysiak@cern.ch
class OutOfBunchCollTask final : public quality_control::postprocessing::PostProcessingInterface
{
public:
OutOfBunchCollTask() = default;
~OutOfBunchCollTask() override;
void initialize(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;
void update(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;
void finalize(quality_control::postprocessing::Trigger, framework::ServiceRegistry&) override;
void configure(std::string, const boost::property_tree::ptree&) override;

private:
o2::quality_control::repository::DatabaseInterface* mDatabase = nullptr;
std::string mCcdbUrl;
o2::ccdb::CcdbApi mCcdbApi;
TList* mListHistGarbage;
std::map<int, std::string> mMapDigitTrgNames;
std::map<unsigned int, TH2F*> mMapOutOfBunchColl;
// if storage size matters it can be replaced with TH1
// and TH2 can be created based on it on the fly, but only TH1 would be stored
std::unique_ptr<TH2F> mHistBcPattern;
};

} // namespace o2::quality_control_modules::ft0

#endif //QC_MODULE_FT0_OUTOFBUNCHCOLLTASK_H
Loading