CMS 3D CMS Logo

BSFitter.h
Go to the documentation of this file.
1 #ifndef BeamSpotProducer_BSFitter_h
2 #define BeamSpotProducer_BSFitter_h
3 
15 // CMS
19 
20 // ROOT
21 #include "TMatrixD.h"
22 #include "TMath.h"
23 #include "Minuit2/VariableMetricMinimizer.h"
24 #include "TH1F.h"
25 
26 // C++ standard
27 #include <vector>
28 #include <string>
29 
30 class BSFitter {
31 public:
32  //typedef std::vector <BSTrkParameters> BSTrkCollection;
33 
34  BSFitter();
35  BSFitter(const std::vector<BSTrkParameters> &BSvector);
36 
37  virtual ~BSFitter();
38 
40 
42 
44 
45  reco::BeamSpot Fit(double *inipar);
46 
47  // Fit Z distribution with a gaussian
48  reco::BeamSpot Fit_z(std::string type, double *inipar);
49 
50  reco::BeamSpot Fit_z_chi2(double *inipar);
51  reco::BeamSpot Fit_z_likelihood(double *inipar);
52 
53  // Fit only d0-phi distribution with a chi2
55  void SetMaximumZ(double z) { fMaxZ = z; }
56  void SetConvergence(double val) { fconvergence = val; }
57  void SetMinimumNTrks(int n) { fminNtrks = n; }
58  void Setd0Cut_d0phi(double d0cut);
59  void SetChi2Cut_d0phi(double chi2cut);
61  int GetAcceptedTrks() { return ftmprow; }
62  void d0phi_Init() {
63  ftmprow = 0;
64  ftmp.ResizeTo(4, 1);
65  ftmp.Zero();
66  fnthite = 0;
67  goodfit = true;
68  }
69  std::vector<BSTrkParameters> GetData() { return fBSvector; }
70 
72 
73  reco::BeamSpot Fit_d_likelihood(double *inipar);
74  reco::BeamSpot Fit_d_z_likelihood(double *inipar, double *error_par);
75  reco::BeamSpot Fit_dres_z_likelihood(double *inipar);
76 
77  double scanPDF(double *init_pars, int &tracksFailed, int option);
78 
79  double GetMinimum() { return ff_minimum; }
80  double GetResPar0() { return fresolution_c0; }
81  double GetResPar1() { return fresolution_c1; }
82  double GetResPar0Err() { return fres_c0_err; }
83  double GetResPar1Err() { return fres_c1_err; }
84 
86 
87  TH1F *GetVzHisto() { return h1z; }
88 
89 private:
90  ROOT::Minuit2::ModularFunctionMinimizer *theFitter;
91  //BSzFcn* theGausszFcn;
93 
97 
98  double ff_minimum;
99 
100  static const int fdim = 7;
101 
103 
104  Double_t fsqrt2pi;
105 
106  std::vector<BSTrkParameters> fBSvector;
107  std::vector<BSTrkParameters> fBSvectorBW;
108 
111  double fres_c0_err;
112  double fres_c1_err;
114  //reco::BeamSpot fBSforCuts;
115  TMatrixD ftmp;
118  double fd0cut;
119  double fchi2cut;
120  int ftmprow;
121  int fnthite;
122  bool goodfit;
123  double fMaxZ;
124  double fconvergence;
127  TH1F *h1z;
128 };
129 
130 #endif
BSFitter::fchi2cut
double fchi2cut
Definition: BSFitter.h:119
BSFitter::Fit_d0phi
reco::BeamSpot Fit_d0phi()
Definition: BSFitter.cc:410
BSFitter::Fit_z_likelihood
reco::BeamSpot Fit_z_likelihood(double *inipar)
Definition: BSFitter.cc:255
BSFitter::fbeamtype
reco::BeamSpot::BeamType fbeamtype
Definition: BSFitter.h:94
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
BSFitter::~BSFitter
virtual ~BSFitter()
Definition: BSFitter.cc:95
BSFitter::fresolution_c1
double fresolution_c1
Definition: BSFitter.h:110
BSFitter::fminNtrks
int fminNtrks
Definition: BSFitter.h:125
trackAssociatorByChi2_cfi.chi2cut
chi2cut
Definition: trackAssociatorByChi2_cfi.py:4
BSFitter::GetAcceptedTrks
int GetAcceptedTrks()
Definition: BSFitter.h:61
BSFitter::scanPDF
double scanPDF(double *init_pars, int &tracksFailed, int option)
Definition: BSFitter.cc:625
BSFitter::goodfit
bool goodfit
Definition: BSFitter.h:122
BSTrkParameters.h
BSpdfsFcn
Definition: BSpdfsFcn.h:22
BSFitter::ffit_variable
std::string ffit_variable
Definition: BSFitter.h:96
BSFitter::SetMaximumZ
void SetMaximumZ(double z)
Definition: BSFitter.h:55
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
BSFitter::GetResPar0Err
double GetResPar0Err()
Definition: BSFitter.h:82
BSFitter::GetResMatrix
reco::BeamSpot::ResCovMatrix GetResMatrix()
Definition: BSFitter.h:85
BSFitter::SetInputBeamWidth
void SetInputBeamWidth(double val)
Definition: BSFitter.h:60
BSFitter::fBSvector
std::vector< BSTrkParameters > fBSvector
Definition: BSFitter.h:106
BSFitter::Fit
reco::BeamSpot Fit()
Definition: BSFitter.cc:102
BSFitter::fMaxZ
double fMaxZ
Definition: BSFitter.h:123
BeamSpot.h
BSFitter::thePDF
BSpdfsFcn * thePDF
Definition: BSFitter.h:92
BSFitter::fres_c0_err
double fres_c0_err
Definition: BSFitter.h:111
BSFitter::fapplychi2cut
bool fapplychi2cut
Definition: BSFitter.h:117
reco::BeamSpot
Definition: BeamSpot.h:21
DDAxes::z
BSFitter::fdim
static const int fdim
Definition: BSFitter.h:100
BSFitter::Fit_ited0phi
reco::BeamSpot Fit_ited0phi()
Definition: BSFitter.cc:360
reco::BeamSpot::ResCovMatrix
math::Error< resdim >::type ResCovMatrix
Definition: BeamSpot.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BSFitter::GetResPar1
double GetResPar1()
Definition: BSFitter.h:81
BSFitter::Fit_dres_z_likelihood
reco::BeamSpot Fit_dres_z_likelihood(double *inipar)
Definition: BSFitter.cc:809
BSFitter::fresolution_c0
double fresolution_c0
Definition: BSFitter.h:109
BSFitter::fconvergence
double fconvergence
Definition: BSFitter.h:124
BSFitter::d0phi_Init
void d0phi_Init()
Definition: BSFitter.h:62
BSFitter::Fit_z
reco::BeamSpot Fit_z(std::string type, double *inipar)
BSFitter::fres_matrix
reco::BeamSpot::ResCovMatrix fres_matrix
Definition: BSFitter.h:113
BSFitter::SetConvergence
void SetConvergence(double val)
Definition: BSFitter.h:56
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
BSFitter::fpar_name
std::string fpar_name[fdim]
Definition: BSFitter.h:102
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
BSFitter::BSFitter
BSFitter()
Definition: BSFitter.cc:41
BSFitter::ff_minimum
double ff_minimum
Definition: BSFitter.h:98
BSFitter::Setd0Cut_d0phi
void Setd0Cut_d0phi(double d0cut)
Definition: BSFitter.cc:576
BSFitter::SetMinimumNTrks
void SetMinimumNTrks(int n)
Definition: BSFitter.h:57
reco::BeamSpot::BeamType
BeamType
beam spot flags
Definition: BeamSpot.h:24
BSFitter::fres_c1_err
double fres_c1_err
Definition: BSFitter.h:112
BSFitter::theFitter
ROOT::Minuit2::ModularFunctionMinimizer * theFitter
Definition: BSFitter.h:90
BSFitter::GetData
std::vector< BSTrkParameters > GetData()
Definition: BSFitter.h:69
BSFitter::fd0cut
double fd0cut
Definition: BSFitter.h:118
BSFitter::ftmprow
int ftmprow
Definition: BSFitter.h:120
BSFitter::Fit_d_likelihood
reco::BeamSpot Fit_d_likelihood(double *inipar)
Definition: BSFitter.cc:592
heppy_batch.val
val
Definition: heppy_batch.py:351
BSFitter::ffit_type
std::string ffit_type
Definition: BSFitter.h:95
BSFitter::h1z
TH1F * h1z
Definition: BSFitter.h:127
BSFitter::fsqrt2pi
Double_t fsqrt2pi
Definition: BSFitter.h:104
BSFitter::Fit_z_chi2
reco::BeamSpot Fit_z_chi2(double *inipar)
Definition: BSFitter.cc:321
BSFitter::GetResPar1Err
double GetResPar1Err()
Definition: BSFitter.h:83
BSFitter::fnthite
int fnthite
Definition: BSFitter.h:121
BSFitter::ftmp
TMatrixD ftmp
Definition: BSFitter.h:115
BSFitter::SetFitVariable
void SetFitVariable(std::string name)
Definition: BSFitter.h:41
BSFitter::fapplyd0cut
bool fapplyd0cut
Definition: BSFitter.h:116
BSpdfsFcn.h
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BSFitter::GetResPar0
double GetResPar0()
Definition: BSFitter.h:80
BSFitter
Definition: BSFitter.h:30
BSFitter::SetFitType
void SetFitType(std::string type)
Definition: BSFitter.h:39
BSFitter::SetChi2Cut_d0phi
void SetChi2Cut_d0phi(double chi2cut)
Definition: BSFitter.cc:584
BSFitter::GetMinimum
double GetMinimum()
Definition: BSFitter.h:79
BSFitter::finputBeamWidth
double finputBeamWidth
Definition: BSFitter.h:126
BSFitter::GetVzHisto
TH1F * GetVzHisto()
Definition: BSFitter.h:87
BSFitter::fBSvectorBW
std::vector< BSTrkParameters > fBSvectorBW
Definition: BSFitter.h:107
BSFitter::Fit_d_z_likelihood
reco::BeamSpot Fit_d_z_likelihood(double *inipar, double *error_par)
Definition: BSFitter.cc:718