ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelMonTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ********************************************************************
6//
7// NAME: TileRawChannelMonTool.h
8// PACKAGE:
9//
10// AUTHOR: Alexander Solodkov
11//
12//
13// ********************************************************************
14#ifndef TILEMONITORING_TILERAWCHANNELMONTOOL_H
15#define TILEMONITORING_TILERAWCHANNELMONTOOL_H
16
17#include "TilePaterMonTool.h"
21#include <map>
22#include <vector>
23#include <memory>
24#include <string>
25
26class TileRawChannel;
28class TileInfo;
29
33
34class ATLAS_NOT_THREAD_SAFE TileRawChannelMonTool: public TilePaterMonTool { // deprecated: ATLASRECTS-7259
35
36 public:
37
38 TileRawChannelMonTool(const std::string & type, const std::string & name, const IInterface* parent);
39
40 virtual ~TileRawChannelMonTool();
41
42 virtual StatusCode initialize() override;
43
44 //pure virtual methods
45 virtual StatusCode bookHists() override;
46 virtual StatusCode fillHists() override;
47 virtual StatusCode finalHists() override;
48 virtual StatusCode checkHists(bool fromFinalize) override;
49
50 void bookHists(int ros, int drawer);
51 void drawHists(int ros, int drawer, const std::string& moduleName);
52 void ratioErrorBar(TH1S* hist, double& xmin, double& xmax, double mean);
53 void rangeErrorBar(double& xmin, double& max, double mean);
54 void bookDsp(int ros, int drawer);
55 StatusCode fillDsp(std::map<int, std::vector<double> > &efitMap, std::map<int, std::vector<double> > &tfitMap);
56 StatusCode finalDsp(int ros, int drawer);
57
58 void drawDsp(int ros, int drawer, const std::string& moduleName);
59 void drawOptFilt(int ros, int drawer, const std::string& moduleName);
60 TF1* GetTimeFitFunc(TH2S* hist2d);
61 void LaserFancyPlotting(int ros, int drawer, int maxgain, const std::string& moduleName);
62
63 private:
64
65 void bookSummaryHistograms(int ros, int drawer);
66 StatusCode fillSummaryHistograms();
68
69 bool m_bookAll{};
70 bool m_book2D{};
72 int m_runType{};
73 std::string m_contName;
74 std::string m_contNameDSP;
75 std::string m_contNameOF;
76 double m_DownLimit{}; // Down Threshold for Amp/Q ratio plots
77 double m_UpLimit{}; // Up Threshold for Amp/Q ratio plots
78 double m_lo_IntegralLimit{}; // Warning error bar Low limit for Amp/Q ratio plots
79 double m_med_IntegralLimit{}; // Warning error bar Med limit for Amp/Q ratio plots
80 double m_hi_IntegralLimit{}; // Warning error bar High limit for Amp/Q ratio plots
81 bool m_useratioerror{}; //use ratioerror bar or rangeerror bar ?
82 //bool m_plotOptFilt; //book Optimal Filter histograms?
83 bool m_plotDsp{}; //book Optimal Filter histograms?
84 bool m_storeGraph{}; //Store TGraph to file: necessary due to THistSvc bug
85 std::map<int, std::vector<double> > m_efitMap;
86 std::map<int, std::vector<double> > m_tfitMap;
87 ToolHandle<TileCondToolEmscale> m_tileToolEmscale;
88 double m_efitThresh{};
89
91
93
94 bool checkDmuHeader(std::vector<uint32_t>* headerVec, int dmu);
95 //vector to hold data corruption information
96 // std::vector<bool> corrup[5][64][2]; //ros, drawer, gain (index of each vector is channel)
97 bool m_corrup[5][64][2][16]={}; //ros, drawer, gain, DMU
98
103 inline bool checkDmuHeaderFormat(uint32_t header) {
104 if (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0))
105 return false; //no error
106 else
107 return true; //error
108 };
109
113 inline bool checkDmuHeaderParity(uint32_t header) {
114 uint32_t parity(0);
115 for (int i = 0; i < 32; ++i)
116 parity += ((header >> i) & 0x1);
117
118 if ((parity % 2) == 1) return false; //no error
119 else return true; //error
120
121 };
122
123 enum RunType {
124 Unknown = 0, PhysRun = 1, // expect monogain
125 LasRun = 2, // expect monogain
126 LedRun = 3, // expect monogain
127 PedRun = 4, // expect bigain
128 CisRun = 8, // expect bigain
129 MonoRun = 9, // expect monogain
130 CisRamp = 10 // expect monogain
131 };
132
133 enum DspPlot {
134 Edsp = 0, Tdsp = 1, chi2dsp = 2, Edsp_fit = 3, Tdsp_fit = 4
135 };
136
139 };
140
141 const uint32_t* m_cispar;
142
143 bool m_bigain{};
145 struct Data {
146 float m_rangeQ[2][2][3][48];
147 double m_timeCov[5][64][48][2][2][6];
148 double m_timeCovCorr[5][64][48][2][2][3]; //Lukas
149
150 //Pointers to Histograms
151 std::vector<TH1S *> m_hist1[5][64][48][2]; // ros,drawer,channel,gain
152 std::vector<TH2S *> m_hist2[5][64][48][2];
153 std::vector<TH1F *> m_finalHist1[5][64][2][2]; //ros, drawer,capacitor, gain
154 std::vector<TH2F *> m_finalHist2[256][2];
155
156 std::vector<TH1F *> m_histDsp1[5][64][48][2]; // ros,drawer,channel,gain
157 std::vector<TH2F *> m_histDsp2[5][64][48][2];
158 std::vector<TH1F *> m_finalHistDsp1[5][64][2]; //ros,drawer,gain
159 std::vector<TH2F *> m_finalHistDsp2[5][64][2];
160 std::vector<TH1F *> m_hBarDsp1[5][64][2]; // ros, drawer,gain
161
162 std::vector<TH1F *> m_summaryPmts[5][64][2][2];
163 };
164 std::unique_ptr<Data> m_data;
165
167
173 // TileInfo
174 std::string m_infoName{};
176 bool m_is12bit{};
179 double m_dac2Charge[3]={};
180};
181
182#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 max(a, b)
Definition cfImp.cxx:41
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
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.
Calibration of TileCal channels and access to calibration factors.
virtual StatusCode initialize() override
TilePaterMonTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode fillDsp(std::map< int, std::vector< double > > &efitMap, std::map< int, std::vector< double > > &tfitMap)
bool m_corrup[5][64][2][16]
void drawHists(int ros, int drawer, const std::string &moduleName)
TileRawChannelMonTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
void ratioErrorBar(TH1S *hist, double &xmin, double &xmax, double mean)
void drawOptFilt(int ros, int drawer, const std::string &moduleName)
void drawDsp(int ros, int drawer, const std::string &moduleName)
std::map< int, std::vector< double > > m_efitMap
TF1 * GetTimeFitFunc(TH2S *hist2d)
Time Slope parameters for CIS runs.
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
StatusCode finalDsp(int ros, int drawer)
TileRawChannelUnit::UNIT m_calibUnit
bool checkDmuHeaderParity(uint32_t header)
Function to check that the DMU header parity is correct Parity of the DMU header should be odd Return...
void LaserFancyPlotting(int ros, int drawer, int maxgain, const std::string &moduleName)
std::unique_ptr< Data > m_data
bool checkDmuHeaderFormat(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...
void rangeErrorBar(double &xmin, double &max, double mean)
void bookDsp(int ros, int drawer)
void bookSummaryHistograms(int ros, int drawer)
std::map< int, std::vector< double > > m_tfitMap
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60
std::vector< TH2F * > m_finalHist2[256][2]
std::vector< TH1F * > m_hBarDsp1[5][64][2]
std::vector< TH2F * > m_finalHistDsp2[5][64][2]
std::vector< TH1F * > m_summaryPmts[5][64][2][2]
std::vector< TH2S * > m_hist2[5][64][48][2]
double m_timeCov[5][64][48][2][2][6]
std::vector< TH1F * > m_histDsp1[5][64][48][2]
std::vector< TH1F * > m_finalHistDsp1[5][64][2]
std::vector< TH2F * > m_histDsp2[5][64][48][2]
std::vector< TH1F * > m_finalHist1[5][64][2][2]
double m_timeCovCorr[5][64][48][2][2][3]
std::vector< TH1S * > m_hist1[5][64][48][2]