#include <TRTAlignHistoChisqProjection.h>
|
| | HistoChisqProjection (const char *name, int dim, int nbins, float xmin, float xmax) |
| | ~HistoChisqProjection () |
| | HistoChisqProjection (const HistoChisqProjection &)=delete |
| HistoChisqProjection & | operator= (const HistoChisqProjection &)=delete |
| void | add (const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual) |
| void | add (const CLHEP::HepMatrix &deriv, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual, const CLHEP::HepSymMatrix &secondweight) |
| CLHEP::HepVector | getFittedHalfDChisqDX (std::ostream &os=std::cout) const |
| CLHEP::HepVector | getNormalHalfDChisqDX () const |
| void | setDirectory (TDirectory *dir) |
|
| void | addfirst (const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual) |
| void | addsecond (const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight) |
◆ HistoChisqProjection() [1/2]
| TRTAlign::HistoChisqProjection::HistoChisqProjection |
( |
const char * | name, |
|
|
int | dim, |
|
|
int | nbins, |
|
|
float | xmin, |
|
|
float | xmax ) |
Definition at line 14 of file TRTAlignHistoChisqProjection.cxx.
16 {
20 } ;
CLHEP::HepVector m_halfdChisqdX
std::vector< double > m_integrals
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
◆ ~HistoChisqProjection()
| TRTAlign::HistoChisqProjection::~HistoChisqProjection |
( |
| ) |
|
◆ HistoChisqProjection() [2/2]
◆ add() [1/2]
| void TRTAlign::HistoChisqProjection::add |
( |
const CLHEP::HepMatrix & | deriv, |
|
|
const CLHEP::HepSymMatrix & | weight, |
|
|
const CLHEP::HepSymMatrix & | variance, |
|
|
const CLHEP::HepVector & | residual ) |
|
inline |
Definition at line 33 of file TRTAlignHistoChisqProjection.h.
34 {
35 addfirst( deriv, weight, variance, residual ) ;
37 }
void addfirst(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight, const CLHEP::HepSymMatrix &variance, const CLHEP::HepVector &residual)
void addsecond(const CLHEP::HepMatrix &derivative, const CLHEP::HepSymMatrix &weight)
◆ add() [2/2]
| void TRTAlign::HistoChisqProjection::add |
( |
const CLHEP::HepMatrix & | deriv, |
|
|
const CLHEP::HepSymMatrix & | weight, |
|
|
const CLHEP::HepSymMatrix & | variance, |
|
|
const CLHEP::HepVector & | residual, |
|
|
const CLHEP::HepSymMatrix & | secondweight ) |
|
inline |
◆ addfirst()
| void TRTAlign::HistoChisqProjection::addfirst |
( |
const CLHEP::HepMatrix & | derivative, |
|
|
const CLHEP::HepSymMatrix & | weight, |
|
|
const CLHEP::HepSymMatrix & | variance, |
|
|
const CLHEP::HepVector & | residual ) |
|
private |
Definition at line 22 of file TRTAlignHistoChisqProjection.cxx.
24 {
25 int dimr =
weight.num_row() ;
26 CLHEP::HepMatrix derivtimesweight(deriv*weight) ;
27
28 for(int irow=1; irow<=dimr; ++irow) {
29 double thissigma = sqrt( variance.fast(irow,irow) ) ;
30
31 for(
int ipar=0; ipar<
m_dim; ++ipar) {
32 double thisweight = derivtimesweight(ipar+1, irow ) * thissigma ;
33 double thispull =
residual(irow) / thissigma ;
34 if( thisweight< 0 ) {
35 thisweight*=-1 ;
36 thispull*=-1 ;
37 }
38 m_h2->Fill(
double(ipar), thispull, thisweight ) ;
42 }
43 }
44 }
◆ addsecond()
| void TRTAlign::HistoChisqProjection::addsecond |
( |
const CLHEP::HepMatrix & | derivative, |
|
|
const CLHEP::HepSymMatrix & | weight ) |
|
private |
◆ getFittedHalfDChisqDX()
| CLHEP::HepVector TRTAlign::HistoChisqProjection::getFittedHalfDChisqDX |
( |
std::ostream & | os = std::cout | ) |
const |
Definition at line 67 of file TRTAlignHistoChisqProjection.cxx.
68 {
69 CLHEP::HepVector halfDChisqDX(
m_dim,0) ;
70
72 for(
int ipar=1; ipar<=
m_dim; ++ipar) {
73 char hisname[256] ;
74 sprintf(hisname,"tmph1_%d",ipar) ;
75 TH1* tmph1 =
m_h2->ProjectionY(hisname,ipar,ipar,
"e") ;
76 binwidth = tmph1->GetXaxis()->GetBinWidth(1) ;
77 tmph1->SetDirectory(
m_h2->GetDirectory()) ;
78 f1.SetParameter(0,tmph1->Integral());
79 f1.SetParLimits(0,0.5*tmph1->Integral(),2*tmph1->Integral()) ;
80 f1.SetParameter(1,0) ;
81 f1.SetParameter(2,tmph1->GetRMS()) ;
82 tmph1->Fit(&f1,"Q0I") ;
83 tmph1->GetListOfFunctions()->Add(
f1.Clone()) ;
84 halfDChisqDX(ipar) =
f1.GetParameter(1) *
m_integrals[ipar-1] ;
85 os <<
"fitresult: " <<
f1.GetParameter(1) <<
" weight: " <<
m_integrals[ipar-1] <<
" integrated mean: "
87 }
88 return halfDChisqDX ;
89 }
double gausfunc(double *x, double *par)
◆ getNormalHalfDChisqDX()
| CLHEP::HepVector TRTAlign::HistoChisqProjection::getNormalHalfDChisqDX |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ setDirectory()
| void TRTAlign::HistoChisqProjection::setDirectory |
( |
TDirectory * | dir | ) |
|
◆ m_dim
| int TRTAlign::HistoChisqProjection::m_dim |
|
private |
◆ m_h2
| TH2* TRTAlign::HistoChisqProjection::m_h2 |
|
private |
◆ m_halfd2ChisqdX2
| CLHEP::HepSymMatrix TRTAlign::HistoChisqProjection::m_halfd2ChisqdX2 |
|
private |
◆ m_halfdChisqdX
| CLHEP::HepVector TRTAlign::HistoChisqProjection::m_halfdChisqdX |
|
private |
◆ m_integrals
| std::vector<double> TRTAlign::HistoChisqProjection::m_integrals |
|
private |
◆ m_unweightedh2
| TH2* TRTAlign::HistoChisqProjection::m_unweightedh2 |
|
private |
The documentation for this class was generated from the following files: