ATLAS Offline Software
Loading...
Searching...
No Matches
TileDigitsMonTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ********************************************************************
6//
7// NAME: TileDigitsMonTool.h
8// PACKAGE:
9//
10// AUTHOR: Alexander Solodkov
11//
12//
13// ********************************************************************
14#ifndef TILEMONITORING_TILEDIGITSMONTOOL_H
15#define TILEMONITORING_TILEDIGITSMONTOOL_H
16
17#include "TilePaterMonTool.h"
21
23class TileInfo;
24
25
29
30class ATLAS_NOT_THREAD_SAFE TileDigitsMonTool: public TilePaterMonTool // deprecated: ATLASRECTS-7259
31 , virtual public ITileStuckBitsProbsTool {
32
33 public:
34
35 TileDigitsMonTool(const std::string & type, const std::string & name, const IInterface* parent);
36
37 virtual ~TileDigitsMonTool();
38
39 virtual StatusCode initialize() override;
40
41 //pure virtual methods
42 virtual StatusCode bookHists() override;
43 virtual StatusCode fillHists() override;
44 virtual StatusCode finalHists() override;
45 virtual StatusCode checkHists(bool fromFinalize) override;
46
47 void bookHists(int ros, int drawer);
48 void drawHists(int ros, int drawer, const std::string& moduleName);
49
50 virtual const uint8_t* stuckBitProb (int ros, int module, int channel, int gain) const override;
51 virtual void saveStuckBitsProbabilities(TTree* tree) override;
52
53 private:
54
57 int stuckBits(TH1S *hist, int adc);
58 //int stuckBits_maker(TH1S *hist);
61 int stuckBits_Amp(TH1S *hist, int adc);
62 int stuckBits_Amp2(TH1S *hist, TH1C *modhist, int adc, TH2C *outhist = NULL, int ch = 0, uint8_t *stuck_probs = NULL);
65 void CRCcheck(const TileDQstatus* dqStatus,
66 uint32_t crc32, uint32_t crcMask, int headsize, int ros, int drawer);
67
68 //void DMUheaderCheck(std::vector<uint32_t>* headerVec, int headsize, int ros, int drawer, int gain);
69 bool DMUheaderCheck(std::vector<uint32_t>* headerVec, int ros, int drawer, int gain, int dmu);
70
71 //methods to shift and stat test histos
72 void shiftHisto(TH1S *hist, int ros, int drawer, int ch, int gain);
73 void statTestHistos(int ros, int drawer, int gain);
74
75 // method to define coloour palette
76 static const int m_NCont = 10; //number of colors in palette
77 int define_palette(int ncolors, int *colors = NULL);
78
79 StatusCode RODCRCcalc(const TileDQstatus* dqStatus);
80
85 inline bool DMUheaderFormatCheck(uint32_t header) {
86 if (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0))
87 return false; // no error
88 else
89 return true; //error
90 };
91
95 inline bool DMUheaderParityCheck(uint32_t header) {
96 uint32_t parity(0);
97 for (int i = 0; i < 32; ++i)
98 parity += ((header >> i) & 0x1);
99
100 if ((parity % 2) == 1) return false; //no error
101 else return true; //error
102 };
103
104 bool m_bookAll{};
105 bool m_book2D{};
107 std::string m_contNameDSP;
108
109 enum RunType {
110 Unknown = 0, // expect monogain
111 PhysRun = 1, // expect monogain
112 LasRun = 2, // expect monogain
113 LedRun = 3, // expect monogain
114 PedRun = 4, // expect bigain
115 CisRun = 8, // expect bigain
116 MonoRun = 9, // expect monogain
117 CisRamp = 10 // expect monogain
118 };
119
120 ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample;
121
122 const uint32_t* m_cispar{};
123
124 bool m_bigain{};
127 // Factor these out to avoid triggering the ubsan sanity checks.
128 struct Data {
129 double m_sumPed1[5][64][48][2]={{{{0}}}};
130 double m_sumPed2[5][64][48][2]={{{{0}}}};
131 double m_sumRms1[5][64][48][2]={{{{0}}}};
132 double m_sumRms2[5][64][48][2]={{{{0}}}};
133 double m_meanAmp[5][64][2][48]={{{{0}}}};
134 double m_meanAmp_ij[5][64][2][48][48]={{{{{0}}}}};
135 int m_nEvents_i[5][64][2][48]={{{{0}}}};
136 int m_nEvents_ij[5][64][2][48][48]={{{{{0}}}}};
137 double m_cov_ratio[5][64][2]={{{0}}}; //covariance ratio printed in covariance plots
138 uint8_t m_stuck_probs[5][64][48][2][10]={{{{{0}}}}};
139
140 //vector to hold data corruption information
141 // std::vector<bool> corrup[5][64][2]; //ros, drawer, gain (index of each vector is channel)
142 bool m_corrup[5][64][2][16]={{{{0}}}}; //ros, drawer, gain, DMU
143
144 //Pointers to Histograms
145 std::vector<TH1S *> m_hist0[5][64]; // ros,drawer
146 std::vector<TH1S *> m_hist1[5][64][48][2]; // ros,drawer,channel,gain
147 std::vector<TH1C *> m_histC[5][64][48][2]; // ros,drawer,channel,gain
148 std::vector<TH1I *> m_hist_DMUerr[5][64][48][2]; // ros,drawer,channel,gain for DMU BCID/CRC errors
149 std::vector<TH2F *> m_hist2[5][64][2];
150 std::vector<TProfile *> m_histP[5][64][48][2];
151 std::vector<TH1F *> m_final_hist1[5][64][2]; // ros, drawer, gain
152 std::vector<TH2F *> m_final_hist2[5][64][2];
153 TH2C* m_final_hist_stucks[5][64][2]; // stuck bits, saturation: ros, drawer. gain
154 std::vector<TH1D *> m_outInHighGain;
155
156 //shifted histos for DQMF
157 TH1S * m_shifted_hist[5][64][49][2]={}; // one extra histo for reference!
158
159 };
160 std::unique_ptr<Data> m_data;
162
163 //For test
164 //int hp;
165 //int hb;
168
169 // TileInfo
170 std::string m_infoName;
173 float m_f_ADCmax{};
175
176 bool m_is12bit{};
178
181
183};
184
185#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
virtual void saveStuckBitsProbabilities(TTree *tree)=0
virtual const uint8_t * stuckBitProb(int ros, int module, int channel, int gain) const =0
virtual StatusCode fillHists()
Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over,...
virtual StatusCode bookHists()
Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.
virtual StatusCode finalHists()
Calls procHists( true, true, true ).
virtual StatusCode checkHists(bool calledFromFinalize)
This implementation does nothing; equivalent functionality may be provided by procHists(....
Property holding a SG store/key/clid from which a ReadHandle is made.
Class that holds Data Quality fragment information and provides functions to extract the data quality...
bool DMUheaderFormatCheck(uint32_t header)
Function to check that the DMU header format is correct bit_31 of the DMU header must be 1 and bit_17...
int define_palette(int ncolors, int *colors=NULL)
const TileInfo * m_tileInfo
int stuckBits_Amp2(TH1S *hist, TH1C *modhist, int adc, TH2C *outhist=NULL, int ch=0, uint8_t *stuck_probs=NULL)
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
void CRCcheck(const TileDQstatus *dqStatus, uint32_t crc32, uint32_t crcMask, int headsize, int ros, int drawer)
Method to check global CRC and DMU CRC.
void shiftHisto(TH1S *hist, int ros, int drawer, int ch, int gain)
void drawHists(int ros, int drawer, const std::string &moduleName)
int stuckBits(TH1S *hist, int adc)
Method to find stuckbits in Read-Out ADC channel.
bool DMUheaderParityCheck(uint32_t header)
Function to check that the DMU header parity is correct Parity of the DMU header should be odd Return...
StatusCode RODCRCcalc(const TileDQstatus *dqStatus)
TileDigitsMonTool(const std::string &type, const std::string &name, const IInterface *parent)
std::unique_ptr< Data > m_data
static const int m_NCont
bool DMUheaderCheck(std::vector< uint32_t > *headerVec, int ros, int drawer, int gain, int dmu)
DMU header format as defined in http://www.sysf.physto.se/~klere/tile-dmu/header.html Bits: 1pllllesd...
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
tool which provided noise values
int stuckBits_Amp(TH1S *hist, int adc)
A crude method to check Read-Out ADC channel stuckbits.
const uint32_t * m_cispar
void statTestHistos(int ros, int drawer, int gain)
std::string m_digitsContainerName
virtual StatusCode initialize() override
TilePaterMonTool(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< TProfile * > m_histP[5][64][48][2]
bool m_corrup[5][64][2][16]
std::vector< TH1S * > m_hist1[5][64][48][2]
double m_sumRms1[5][64][48][2]
uint8_t m_stuck_probs[5][64][48][2][10]
int m_nEvents_ij[5][64][2][48][48]
double m_meanAmp_ij[5][64][2][48][48]
double m_sumPed2[5][64][48][2]
double m_sumPed1[5][64][48][2]
TH1S * m_shifted_hist[5][64][49][2]
std::vector< TH1D * > m_outInHighGain
double m_sumRms2[5][64][48][2]
std::vector< TH1S * > m_hist0[5][64]
std::vector< TH1I * > m_hist_DMUerr[5][64][48][2]
int m_nEvents_i[5][64][2][48]
double m_meanAmp[5][64][2][48]
std::vector< TH2F * > m_final_hist2[5][64][2]
std::vector< TH1C * > m_histC[5][64][48][2]
std::vector< TH2F * > m_hist2[5][64][2]
std::vector< TH1F * > m_final_hist1[5][64][2]
TH2C * m_final_hist_stucks[5][64][2]
TChain * tree