ATLAS Offline Software
TRTAlignHistoChisqProjection.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 #ifndef __TRTALIGNHISTOCHISQPROJECTION_HH__
6 #define __TRTALIGNHISTOCHISQPROJECTION_HH__
7 
8 // this class keeps track of chisquare derivatives. it makes
9 // histograms of the projections to the derivatives, which is kind of
10 // useful, sometimes.
11 
12 #include <vector>
13 #include "CLHEP/Matrix/SymMatrix.h"
14 #include "CLHEP/Matrix/Vector.h"
15 
16 class TDirectory ;
17 class TH2 ;
18 class HepMatrix ;
19 
20 namespace TRTAlign
21 {
22 
24  {
25  public:
26  HistoChisqProjection(const char* name, int dim, int nbins, float xmin, float xmax) ;
28 
31 
32  // use this if the weight matrix for first and second derivative are equal
33  void add( const CLHEP::HepMatrix& deriv, const CLHEP::HepSymMatrix& weight,
34  const CLHEP::HepSymMatrix& variance, const CLHEP::HepVector& residual ) {
35  addfirst( deriv, weight, variance, residual ) ;
36  addsecond( deriv, weight ) ;
37  }
38 
39  // use this if they are not (like in global chisquare method)
40  void add( const CLHEP::HepMatrix& deriv, const CLHEP::HepSymMatrix& weight,
41  const CLHEP::HepSymMatrix& variance, const CLHEP::HepVector& residual,
42  const CLHEP::HepSymMatrix& secondweight) {
43  addfirst( deriv, weight, variance, residual ) ;
44  addsecond( deriv, secondweight ) ;
45  }
46 
47  CLHEP::HepVector getFittedHalfDChisqDX(std::ostream& os=std::cout) const ;
48  CLHEP::HepVector getNormalHalfDChisqDX() const { return m_halfdChisqdX ; }
49 
50  // set the TDirectory where the histograms are kept
51  void setDirectory(TDirectory* dir) ;
52 
53  private:
54  void addfirst( const CLHEP::HepMatrix& derivative, const CLHEP::HepSymMatrix& weight,
55  const CLHEP::HepSymMatrix& variance, const CLHEP::HepVector& residual ) ;
56  void addsecond( const CLHEP::HepMatrix& derivative, const CLHEP::HepSymMatrix& weight) ;
57 
58  private:
59  int m_dim ;
60  TH2* m_h2 ;
62  std::vector<double> m_integrals ;
63  CLHEP::HepVector m_halfdChisqdX ;
64  CLHEP::HepSymMatrix m_halfd2ChisqdX2 ;
65  } ;
66 
67 }
68 
69 #endif
TRTAlign::HistoChisqProjection::add
void add(const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual, const CLHEP::HepSymMatrix &secondweight)
Definition: TRTAlignHistoChisqProjection.h:40
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
TRTAlign::HistoChisqProjection::m_h2
TH2 * m_h2
Definition: TRTAlignHistoChisqProjection.h:60
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
TRTAlign::HistoChisqProjection::getFittedHalfDChisqDX
CLHEP::HepVector getFittedHalfDChisqDX(std::ostream &os=std::cout) const
Definition: TRTAlignHistoChisqProjection.cxx:67
TRTAlign::HistoChisqProjection::add
void add(const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual)
Definition: TRTAlignHistoChisqProjection.h:33
MuonCalib::Legendre::derivative
constexpr double derivative(const double x)
Definition: LegendrePoly.h:120
TRTAlign::HistoChisqProjection::m_halfd2ChisqdX2
CLHEP::HepSymMatrix m_halfd2ChisqdX2
Definition: TRTAlignHistoChisqProjection.h:64
TRTAlign::HistoChisqProjection::setDirectory
void setDirectory(TDirectory *dir)
Definition: TRTAlignHistoChisqProjection.cxx:91
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xmin
double xmin
Definition: listroot.cxx:60
TRTAlign::HistoChisqProjection::m_dim
int m_dim
Definition: TRTAlignHistoChisqProjection.h:59
TRTAlign::HistoChisqProjection::m_halfdChisqdX
CLHEP::HepVector m_halfdChisqdX
Definition: TRTAlignHistoChisqProjection.h:63
TRTAlign::HistoChisqProjection::HistoChisqProjection
HistoChisqProjection(const char *name, int dim, int nbins, float xmin, float xmax)
Definition: TRTAlignHistoChisqProjection.cxx:14
TRTAlign::HistoChisqProjection::operator=
HistoChisqProjection & operator=(const HistoChisqProjection &)=delete
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
beamspotman.dir
string dir
Definition: beamspotman.py:623
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRTAlign::HistoChisqProjection::addfirst
void addfirst(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual)
Definition: TRTAlignHistoChisqProjection.cxx:22
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
TRTAlign::HistoChisqProjection::HistoChisqProjection
HistoChisqProjection(const HistoChisqProjection &)=delete
xmax
double xmax
Definition: listroot.cxx:61
TRTAlign::HistoChisqProjection::addsecond
void addsecond(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight)
Definition: TRTAlignHistoChisqProjection.cxx:46
TRTAlign::HistoChisqProjection
Definition: TRTAlignHistoChisqProjection.h:24
TRTAlign::HistoChisqProjection::m_integrals
std::vector< double > m_integrals
Definition: TRTAlignHistoChisqProjection.h:62
TRTAlign::HistoChisqProjection::~HistoChisqProjection
~HistoChisqProjection()
TRTAlign::HistoChisqProjection::getNormalHalfDChisqDX
CLHEP::HepVector getNormalHalfDChisqDX() const
Definition: TRTAlignHistoChisqProjection.h:48
TRTAlign::HistoChisqProjection::m_unweightedh2
TH2 * m_unweightedh2
Definition: TRTAlignHistoChisqProjection.h:61
TRTAlign
Definition: TRTAlignHistoChisqProjection.cxx:12