ATLAS Offline Software
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"
18 #include "TileEvent/TileDQstatus.h"
21 
23 class TileInfo;
24 
25 
30 class 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 
86  if (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0))
87  return false; // no error
88  else
89  return true; //error
90  };
91 
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{};
106  int m_runType{};
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{};
125  int m_nEventsTileMon{};
126  int m_nSamples{};
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;
161  bool m_allHistsFilled{};
162 
163  //For test
164  //int hp;
165  //int hb;
166  bool m_fillPedestalDifference{};
168 
169  // TileInfo
170  std::string m_infoName;
171  const TileInfo* m_tileInfo{};
172  int m_i_ADCmax{};
173  float m_f_ADCmax{};
174  float m_ADCmaxMinusEps{};
175 
176  bool m_is12bit{};
177  int m_shiftnbins{};
178 
179  int m_zeroLimitHG{};
180  int m_saturationLimitHG{};
181 
183 };
184 
185 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
header
Definition: hcg.cxx:526
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
ITileStuckBitsProbsTool::stuckBitProb
virtual const uint8_t * stuckBitProb(int ros, int module, int channel, int gain) const =0
ManagedMonitorToolBase::fillHists
virtual StatusCode fillHists()
Calls fillHists( bool, bool, bool ); if an eventBlock,lumiBlock, or run has turned over,...
Definition: ManagedMonitorToolBase.cxx:741
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileDigitsMonTool::RunType
RunType
Definition: TileDigitsMonTool.h:109
TileDigitsMonTool::m_contNameDSP
std::string m_contNameDSP
Definition: TileDigitsMonTool.h:107
ITileStuckBitsProbsTool
Definition: ITileStuckBitsProbsTool.h:13
plotmaker.hist
hist
Definition: plotmaker.py:148
initialize
void initialize()
Definition: run_EoverP.cxx:894
tree
TChain * tree
Definition: tile_monitor.h:30
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TilePaterMonTool
Base class for tilecal calibration monitoring tools.
Definition: TilePaterMonTool.h:50
TileInfo
Definition: TileInfo.h:49
SG::ReadHandleKey< TileDQstatus >
TileDigitsMonTool::DMUheaderFormatCheck
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...
Definition: TileDigitsMonTool.h:85
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
ManagedMonitorToolBase::checkHists
virtual StatusCode checkHists(bool calledFromFinalize)
This implementation does nothing; equivalent functionality may be provided by procHists(....
Definition: ManagedMonitorToolBase.cxx:1672
TilePaterMonTool.h
TileDigitsMonTool::m_tileToolNoiseSample
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
tool which provided noise values
Definition: TileDigitsMonTool.h:120
python.PyAthena.module
module
Definition: PyAthena.py:131
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
PURW_create_actual_mu_profile.outhist
outhist
Definition: PURW_create_actual_mu_profile.py:58
perfmonmt-plotter.colors
dictionary colors
Definition: perfmonmt-plotter.py:21
TileDigitsMonTool::Data::m_outInHighGain
std::vector< TH1D * > m_outInHighGain
Definition: TileDigitsMonTool.h:154
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
ManagedMonitorToolBase::bookHists
virtual StatusCode bookHists()
Calls bookHists( true, true, true ) and initializes lumiBlock and run numbers.
Definition: ManagedMonitorToolBase.cxx:731
TileDQstatus.h
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
ITileStuckBitsProbsTool::saveStuckBitsProbabilities
virtual void saveStuckBitsProbabilities(TTree *tree)=0
TileDigitsMonTool::m_digitsContainerName
std::string m_digitsContainerName
Definition: TileDigitsMonTool.h:167
TileDigitsMonTool::Data
Definition: TileDigitsMonTool.h:128
TileDigitsMonTool::m_DQstatusKey
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
Definition: TileDigitsMonTool.h:182
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TileDigitsMonTool::DMUheaderParityCheck
bool DMUheaderParityCheck(uint32_t header)
Function to check that the DMU header parity is correct Parity of the DMU header should be odd Return...
Definition: TileDigitsMonTool.h:95
TileDigitsMonTool::m_data
std::unique_ptr< Data > m_data
Definition: TileDigitsMonTool.h:160
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
TileCondToolNoiseSample
Definition: TileCondToolNoiseSample.h:22
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ManagedMonitorToolBase::finalHists
virtual StatusCode finalHists()
Calls procHists( true, true, true ).
Definition: ManagedMonitorToolBase.cxx:1257
ITileStuckBitsProbsTool.h
TileDigitsMonTool::m_infoName
std::string m_infoName
Definition: TileDigitsMonTool.h:170
TileDigitsMonTool
Class for TileCal monitoring at digits level.
Definition: TileDigitsMonTool.h:31