ATLAS Offline Software
DigitMonitor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef LArSamples_DigitMonitor_H
11 #define LArSamples_DigitMonitor_H
12 
13 #include "TArrayI.h"
14 #include "TH1D.h"
15 #include "TH2D.h"
16 #include "TMatrixD.h"
17 #include "TString.h"
18 
20 #include "LArSamplesMon/Chi2Calc.h"
21 #include "LArSamplesMon/History.h"
22 #include "LArSamplesMon/Data.h"
23 #include "LArCafJobs/CaloId.h"
25 
26 class TF1;
27 
28 namespace LArSamples {
29 
30  class SimpleShape;
31  class Residuals;
32 
34  {
35 
36  public:
37 
39  DigitMonitor(const Interface& interface) : MonitorBase(interface) { }
40 
41  TH1D* chi2Dist(const TString& name, int nBins, double max, double kFactor = 0, double fitMax = -1,
42  int lwb = -1, int upb = -1, unsigned int chi2Pars = DefaultChi2, ShapeErrorType shapeErrorType = BestShapeError,
43  unsigned int nDof = 0) const;
44 
45  static TF1* chi2Func(const char* name, double xMin, double xMax);
46  static TF1* fitChi2(TH1D& h, const char* name, double xMin, double xMax, double nDof = -1,
47  double fitMin = Definitions::none, double fitMax = Definitions::none);
48 
49  TH1D* bestChi2Dist(const TString& name, int nBins, double max,
50  double refErrMin, double refErrMax, unsigned int refErrNBins,
51  int lwb = -1, int upb = -1, unsigned int chi2Pars = DefaultChi2,
52  unsigned int nDof = 0) const;
53 
54  TH1D* gainDist(const TString& name) const;
55  TH1D* layerDist(const TString& name) const;
56 
57  TH1D* energyDist(const TString& name, int nBins, double eMax = 10000) const;
58  TH1D* timeDist(const TString& name, int nBins, double tMin = -25, double tMax = 25) const;
59  TH1D* adcMaxDist(const TString& name, int nBins, double aMin = 0, double aMax = 4096) const;
60  TH1D* noiseDist(const TString& name, int nBins, double max) const;
61 
62  TH2D* maxValueMap(TString name, PartitionId partition) const;
63  TH2D* minValueMap(TString name, PartitionId partition) const;
64 
65  TH1D* residualDist(unsigned int k, const TString& name, int nBins, double rMin, double rMax, bool norm = false) const;
66 
67  bool residualPlots(CaloId calo, unsigned int layer, CaloGain::CaloGain gain = CaloGain::LARHIGHGAIN, bool xip = false, bool ring = false,
68  double lo = -0.05, double hi = 0.05, const TString& fileName = "residuals");
69  bool residualPlotsRingComp(CaloId calo, unsigned int layer, CaloGain::CaloGain gain = CaloGain::LARHIGHGAIN, bool xip = false,
70  double lo = -0.05, double hi = 0.05, const TString& fileName = "residuals");
71  bool residualPlotsGainComp(CaloId calo, unsigned int layer, bool ring = false, bool xip = false,
72  double lo = -0.05, double hi = 0.05, const TString& fileName = "residuals");
73 
74  TH1D* shapeErrorDist(unsigned int k, const TString& name, int nBins, double rMin, double rMax, double mean = 0) const;
75  double residualCorr(unsigned int k1, unsigned int k2) const;
76 
77  bool makeResidualCorrections(const TString& outputFile, short resTrunc = -1, short timeTrunc = -1,
78  double absResTrunc = -1, unsigned int minSize = 0,
79  bool weigh = false, bool adjust = false, bool zeroTime = false) const;
80  Residuals* getResiduals(unsigned int hash, CaloGain::CaloGain gain, double absResTrunc = -1, bool adjust = false, bool zeroTime = false) const;
81 
82  bool residualParams(int lwb, int upb, CovMatrix& k, TVectorD& means) const;
83  CovMatrix kMatrix(int lwb, int upb) { CovMatrix k; TVectorD means; residualParams(lwb, upb, k, means); return k; }
84  TVectorD means(int lwb, int upb) { CovMatrix k; TVectorD means; residualParams(lwb, upb, k, means); return means; }
85 
86  int combine(SimpleShape*& shape, SimpleShape*& ref, const TString& selection = "", bool timeAligned = true) const;
87  };
88 }
89 
90 #endif
LArSamples::DigitMonitor::kMatrix
CovMatrix kMatrix(int lwb, int upb)
Definition: DigitMonitor.h:83
CaloId.h
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
Chi2Calc.h
WriteBchToCool.adjust
adjust
Definition: WriteBchToCool.py:73
mean
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="")
Definition: dependence.cxx:254
max
#define max(a, b)
Definition: cfImp.cxx:41
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
LArSamples::CovMatrix
TMatrixTSym< double > CovMatrix
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:11
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArSamples::SimpleShape
Definition: SimpleShape.h:25
LArSamples
Definition: AbsShape.h:24
MonitorBase.h
FlavorTagDiscriminants::combine
size_t combine(size_t lhs, size_t rhs)
Definition: hash.h:21
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
LArSamples::Definitions::none
static const double none
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:17
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
GetAllXsec.kFactor
kFactor
Definition: GetAllXsec.py:95
LArSamples::DigitMonitor::DigitMonitor
DigitMonitor(const Interface &interface)
Constructor
Definition: DigitMonitor.h:39
LArSamples::ShapeErrorType
ShapeErrorType
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:21
LArSamples::BestShapeError
@ BestShapeError
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:25
LArSamples::PartitionId
PartitionId
Definition: CaloId.h:29
selection
std::string selection
Definition: fbtTestBasics.cxx:75
LArSamples::Residuals
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:72
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArSamples::DigitMonitor
storage of the time histories of all the cells
Definition: DigitMonitor.h:34
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArSamples::DigitMonitor::means
TVectorD means(int lwb, int upb)
Definition: DigitMonitor.h:84
LArSamples::CaloId
CaloId
Definition: CaloId.h:21
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArSamples::DefaultChi2
@ DefaultChi2
Definition: Chi2Calc.h:24
h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
ref
const boost::regex ref(r_ef)
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
LArSamples::MonitorBase
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/MonitorBase.h:30
LArSamples::Interface
Definition: Interface.h:36
Data.h
History.h
CaloGain.h
fitman.k
k
Definition: fitman.py:528