Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRD cleanup work #2037

Merged
merged 4 commits into from
Nov 20, 2023
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
76 changes: 24 additions & 52 deletions Modules/TRD/include/TRD/DigitsTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
// or submit itself to any jurisdiction.

///
/// \file TRDDigitQcTask.h
/// \author My Name
/// \file DigitsTask.h
///

#ifndef QC_MODULE_TRD_DIGITSTASK_H
Expand All @@ -24,9 +23,6 @@

class TH1F;
class TH2F;
class TH1D;
class TH2D;
class TLine;
class TProfile;
class TProfile2D;
using namespace o2::quality_control::core;
Expand All @@ -38,12 +34,9 @@ namespace o2::quality_control_modules::trd
/// \author My Name
class DigitsTask final : public TaskInterface
{

public:
/// \brief Constructor
DigitsTask() = default;
/// Destructor
~DigitsTask() override;
~DigitsTask() override = default;

// Definition of the methods for the template method pattern
void initialize(o2::framework::InitContext& ctx) override;
Expand All @@ -54,68 +47,47 @@ class DigitsTask final : public TaskInterface
void endOfActivity(const Activity& activity) override;
void reset() override;
void buildHistograms();
void drawLinesMCM(TH2F* histo);
void drawTrdLayersGrid(TH2F* hist);
void retrieveCCDBSettings();
void drawLinesOnPulseHeight(TH1F* h);
void fillLinesOnHistsPerLayer(int iLayer);
void drawHashOnLayers(int layer, int hcid, int col, int rowstart, int rowend);
void buildChamberIgnoreBP();
bool isChamberToBeIgnored(unsigned int sm, unsigned int stack, unsigned int layer);

private:
// limits
bool mLayerLabelsIgnore = false;
// user settings
unsigned int mPulseHeightThreshold;
std::pair<float, float> mDriftRegion;
bool mDoClusterize{ false };
std::pair<float, float> mPulseHeightPeakRegion;
long int mTimestamp;
std::string mChambersToIgnore;
std::bitset<o2::trd::constants::MAXCHAMBER> mChambersToIgnoreBP;
int mClsCutoff = 1000;
int mAdcBaseline = 10;

// histograms
std::shared_ptr<TH1F> mDigitsPerEvent;
std::shared_ptr<TH1F> mEventswDigitsPerTimeFrame;
std::shared_ptr<TH2F> mDigitsSizevsTrackletSize;
std::shared_ptr<TH1F> mDigitHCID = nullptr;
std::shared_ptr<TH2F> mClusterAmplitudeChamber;
std::array<std::shared_ptr<TH2F>, 6> mNClsLayer;
std::shared_ptr<TH1D> mADCvalue;
std::array<std::shared_ptr<TH1F>, 18> mADC;
std::array<std::shared_ptr<TH2F>, 18> mADCTB;
std::array<std::shared_ptr<TH2F>, 18> mADCTBfull;
std::shared_ptr<TH1F> mDigitsSizevsTrackletSize;
std::shared_ptr<TH1F> mDigitHCID;
std::shared_ptr<TH1F> mADCvalue;

// histograms for clusterizer are not published by default
std::shared_ptr<TH1F> mNCls;
std::array<std::shared_ptr<TH2F>, 18> mHCMCM;
std::array<std::shared_ptr<TH1F>, 18> mClsSM;
std::shared_ptr<TH2F> mClsTb;
std::shared_ptr<TH2F> mClsChargeFirst;
std::shared_ptr<TH1F> mClsAmp;
std::shared_ptr<TH1F> mClsChargeTb;
std::shared_ptr<TH1F> mClsChargeTbCycle;
std::shared_ptr<TH1F> mClsNTb;
std::shared_ptr<TH1F> mClsAmp;
std::shared_ptr<TH1F> mNClsAmp;
std::shared_ptr<TH1F> mClsAmpDrift;
std::shared_ptr<TH1F> mClsAmpTb;
std::shared_ptr<TH1F> mClsAmpCh;
std::array<std::shared_ptr<TH2F>, 18> mClsDetAmp;
std::shared_ptr<TH2F> mClsSector;
std::shared_ptr<TH2F> mClsStack;
std::shared_ptr<TH1F> mClsChargeTbTigg;
std::shared_ptr<TH2F> mClsChargeTbTrigHM;
std::shared_ptr<TH2F> mClsChargeTbTrigMinBias;
std::shared_ptr<TH2F> mClsChargeTbTrigTRDL1;
std::array<std::shared_ptr<TH2F>, 18> mClsTbSM;

std::array<std::shared_ptr<TH2F>, o2::trd::constants::NSECTOR> mHCMCM;

std::shared_ptr<TH1F> mPulseHeight = nullptr;
std::shared_ptr<TH1F> mPulseHeightScaled = nullptr;
std::shared_ptr<TH2F> mTotalPulseHeight2D = nullptr;
std::array<std::shared_ptr<TH1F>, 18> mPulseHeight2DperSM;
std::shared_ptr<TH1F> mPulseHeightn = nullptr;
std::array<std::shared_ptr<TH1F>, o2::trd::constants::NSECTOR> mPulseHeight2DperSM;
std::shared_ptr<TProfile> mPulseHeightpro = nullptr;
std::shared_ptr<TProfile2D> mPulseHeightperchamber = nullptr;
// std::array<std::shared_ptr<TH1F>, 540> mPulseHeightPerChamber_1D; // ph2DSM;
std::vector<TH2F*> mLayers;
// information pulled from ccdb
o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
o2::trd::HalfChamberStatusQC* mChamberStatus = nullptr;
std::string mChambersToIgnore;
std::bitset<o2::trd::constants::MAXCHAMBER> mChambersToIgnoreBP;
std::array<std::shared_ptr<TH2F>, o2::trd::constants::NLAYER> mLayers;

// CCDB objects
const o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
const o2::trd::HalfChamberStatusQC* mChamberStatus = nullptr;
};

} // namespace o2::quality_control_modules::trd
Expand Down
4 changes: 1 addition & 3 deletions Modules/TRD/include/TRD/RawData.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

///
/// \file RawData.h
/// \author My Name
/// \author Sean Murray
///

#ifndef QC_MODULE_TRD_TRDRAWDATA_H
Expand All @@ -33,9 +33,7 @@ namespace o2::quality_control_modules::trd
class RawData final : public TaskInterface
{
public:
/// \brief Constructor
RawData() = default;
/// Destructor
~RawData() override;

// Definition of the methods for the template method pattern
Expand Down
30 changes: 6 additions & 24 deletions Modules/TRD/include/TRD/TrackletsTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

///
/// \file TrackletsTask.h
/// \author My Name
///

#ifndef QC_MODULE_TRD_TRDTRACKLETSTASK_H
Expand All @@ -31,15 +30,11 @@ using namespace o2::quality_control::core;
namespace o2::quality_control_modules::trd
{

/// \brief Example Quality Control DPL Task
/// \author My Name
class TrackletsTask final : public TaskInterface
{
public:
/// \brief Constructor
TrackletsTask() = default;
/// Destructor
~TrackletsTask() override;
~TrackletsTask() override = default;

// Definition of the methods for the template method pattern
void initialize(o2::framework::InitContext& ctx) override;
Expand All @@ -50,44 +45,31 @@ class TrackletsTask final : public TaskInterface
void endOfActivity(const Activity& activity) override;
void reset() override;
void buildHistograms();
void retrieveCCDBSettings();
void drawLinesMCM(TH2F* histo);
void drawTrdLayersGrid(TH2F* hist);
void buildTrackletLayers();
void drawHashedOnHistsPerLayer(int layer); //, int hcid, int rowstart, int rowend);
void drawHashOnLayers(int layer, int hcid, int rowstart, int rowend);

private:
long int mTimestamp;
bool mLayerLabelsIgnore = false;
std::array<TH2F*, 18> moHCMCM;
std::array<TH1F*, 18> mTrackletQ0perSector;
std::array<TH1F*, 18> mTrackletQ1perSector;
std::array<TH1F*, 18> mTrackletQ2perSector;
// settings
bool mRemoveNoise{ false };
// histograms
std::array<TH1F*, 3> mTrackletQ;
TH1F* mTrackletSlope = nullptr;
TH1F* mTrackletSlopeRaw = nullptr;
TH1F* mTrackletHCID = nullptr;
TH1F* mTrackletPosition = nullptr;
TH1F* mTrackletPositionRaw = nullptr;
TH1F* mTrackletsPerEvent = nullptr;
TH1F* mTrackletsPerEventPP = nullptr;
TH1F* mTrackletsPerEventPbPb = nullptr;
TH2F* mTrackletsPerHC2D = nullptr;
std::array<TH2F*, 18> moHCMCMn;
TH1F* mTrackletSlopen = nullptr;
TH1F* mTrackletSlopeRawn = nullptr;
TH1F* mTrackletHCIDn = nullptr;
TH1F* mTrackletPositionn = nullptr;
TH1F* mTrackletPositionRawn = nullptr;
TH1F* mTrackletsPerTimeFrame = nullptr;
TH1F* mTriggersPerTimeFrame = nullptr;
TH1F* mTrackletsPerTimeFrameCycled = nullptr;
std::array<TH2F*, 6> mLayers;

// data to pull from CCDB
o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
o2::trd::HalfChamberStatusQC* mChamberStatus = nullptr;
const o2::trd::NoiseStatusMCM* mNoiseMap = nullptr;
const o2::trd::HalfChamberStatusQC* mChamberStatus = nullptr;
};

} // namespace o2::quality_control_modules::trd
Expand Down
Loading
Loading