ATLAS Offline Software
Chi2Calc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef LArSamples_Chi2Calc_H
11 #define LArSamples_Chi2Calc_H
12 
14 #include "TArrayI.h"
15 #include "TVectorD.h"
16 #include "LArCafJobs/AbsShape.h"
17 #include "LArCafJobs/Definitions.h"
18 
19 namespace LArSamples {
20 
21  class OFC;
22  class ScaledErrorData;
23 
24  enum Chi2Params { DefaultChi2 = 0, NoCorrs = 1, BasicChi2 = 2, OFCChi2 = 4 };
25 
27 
28  public:
29 
31  Chi2Calc(int pars = 0)
32  : m_pars(pars), m_lwb(-1), m_upb(-1) { }
33 
34  virtual ~Chi2Calc() { }
35 
36  TVectorD deltas(const AbsShape& data, const AbsShape& reference, CovMatrix& errors, const ScaledErrorData* shapeError = 0,
37  int lwb = -1, int upb = -1, bool noDataError = false);
38 
39  double chi2(const AbsShape& data, const AbsShape& reference, const ScaledErrorData* shapeError = 0,
40  int lwb = -1, int upb = -1);
41 
42  // From AbsShape
43  double scalarProduct(const TVectorD& values1, const TVectorD& values2, const CovMatrix& invCovMat) const;
44 
45  int lwb() const { return m_lwb; }
46  int upb() const { return m_upb; }
47  unsigned int nDof() const { return upb() - lwb() + 1; }
48 
49  bool bestRescale(const AbsShape& data, const AbsShape& reference, double& k, double& chi2, double deltaT = 0,
50  const ScaledErrorData* sed = 0, unsigned int minNDof = 0) const;
51 
52  private:
53 
54  bool useCorrs() const { return !(m_pars & NoCorrs); }
55 
56  int m_pars;
57 
58  int m_lwb, m_upb;
59  };
60 }
61 #endif
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
AbsShape.h
IndexRange.h
LArSamples::Chi2Calc::m_pars
int m_pars
Definition: Chi2Calc.h:56
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
LArSamples::Chi2Calc::Chi2Calc
Chi2Calc(int pars=0)
Constructor (takes ownership of LArCellInfo object)
Definition: Chi2Calc.h:31
LArSamples::Chi2Calc::lwb
int lwb() const
Definition: Chi2Calc.h:45
LArSamples
Definition: AbsShape.h:24
ScaledErrorData
Liquid Argon class for standalone storage of cell shape information.
LArSamples::Chi2Params
Chi2Params
Definition: Chi2Calc.h:24
reference
Definition: hcg.cxx:437
LArSamples::ScaledErrorData
Definition: ScaledErrorData.h:17
LArSamples::Chi2Calc
Definition: Chi2Calc.h:26
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
LArSamples::NoCorrs
@ NoCorrs
Definition: Chi2Calc.h:24
LArSamples::Chi2Calc::~Chi2Calc
virtual ~Chi2Calc()
Definition: Chi2Calc.h:34
LArSamples::OFCChi2
@ OFCChi2
Definition: Chi2Calc.h:24
LArSamples::DefaultChi2
@ DefaultChi2
Definition: Chi2Calc.h:24
LArSamples::BasicChi2
@ BasicChi2
Definition: Chi2Calc.h:24
LArSamples::FitterData::minNDof
unsigned int minNDof
Definition: ShapeFitter.cxx:27
LArSamples::AbsShape
Definition: AbsShape.h:28
LArSamples::IndexRange
storage of the time histories of all the cells
Definition: IndexRange.h:19
Definitions.h
LArSamples::Chi2Calc::useCorrs
bool useCorrs() const
Definition: Chi2Calc.h:54
LArSamples::FitterData::sed
const ScaledErrorData * sed
Definition: ShapeFitter.cxx:26
LArSamples::Chi2Calc::nDof
unsigned int nDof() const
Definition: Chi2Calc.h:47
LArSamples::Chi2Calc::upb
int upb() const
Definition: Chi2Calc.h:46
fitman.k
k
Definition: fitman.py:528
LArSamples::Chi2Calc::m_upb
int m_upb
Definition: Chi2Calc.h:58