ATLAS Offline Software
Loading...
Searching...
No Matches
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
16class TDirectory ;
17class TH2 ;
18class HepMatrix ;
19
20namespace 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
void add(const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual)
void addfirst(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual)
HistoChisqProjection & operator=(const HistoChisqProjection &)=delete
HistoChisqProjection(const HistoChisqProjection &)=delete
HistoChisqProjection(const char *name, int dim, int nbins, float xmin, float xmax)
void addsecond(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight)
CLHEP::HepVector getFittedHalfDChisqDX(std::ostream &os=std::cout) const
void add(const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual, const CLHEP::HepSymMatrix &secondweight)
double xmax
Definition listroot.cxx:61
double xmin
Definition listroot.cxx:60