CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
tauImpactParameter::Chi2VertexFitter Class Reference

#include <Chi2VertexFitter.h>

Inheritance diagram for tauImpactParameter::Chi2VertexFitter:
tauImpactParameter::TrackHelixVertexFitter

Public Member Functions

 Chi2VertexFitter (const std::vector< TrackParticle > &particles, const TVector3 &vguess, double nsigma=4.0)
 
bool fit () override
 
 ~Chi2VertexFitter () override
 
- Public Member Functions inherited from tauImpactParameter::TrackHelixVertexFitter
virtual double chiSquare ()
 
LorentzVectorParticle getMother (int pdgid)
 
std::vector< LorentzVectorParticlegetRefitLorentzVectorParticles ()
 
virtual std::vector< TrackParticlegetRefitTracks ()
 
virtual TVector3 getVertex ()
 
virtual TMatrixTSym< double > getVertexError ()
 
virtual double ndf ()
 
 TrackHelixVertexFitter (const std::vector< TrackParticle > &particles, const TVector3 &vguess)
 
virtual double updateChisquare (const TVectorT< double > &inpar)
 
virtual ~TrackHelixVertexFitter ()
 

Private Attributes

double nsigma_
 

Additional Inherited Members

- Public Types inherited from tauImpactParameter::TrackHelixVertexFitter
enum  ExtraPar { BField0 = 0, MassOffSet = 1, NExtraPar = 1 }
 
enum  FreeTrackPar { kappa0 = 3, lambda0, phi0, NFreeTrackPar }
 
enum  FreeVertexPar { x0 = 0, y0, z0, NFreeVertexPar }
 
- Static Public Member Functions inherited from tauImpactParameter::TrackHelixVertexFitter
static void computedxydz (const TVectorT< double > &inpar, int particle, double &kappa, double &lam, double &phi, double &x, double &y, double &z, double &s, double &dxy, double &dz)
 
static TVectorT< double > computeLorentzVectorPar (const TVectorT< double > &inpar)
 
- Protected Member Functions inherited from tauImpactParameter::TrackHelixVertexFitter
virtual TString freeParName (int Par)
 
- Protected Attributes inherited from tauImpactParameter::TrackHelixVertexFitter
double chi2_
 
bool isConfigured_
 
bool isFit_
 
double ndf_
 
TVectorT< double > par_
 
TMatrixTSym< double > parcov_
 

Detailed Description

Definition at line 16 of file Chi2VertexFitter.h.

Constructor & Destructor Documentation

◆ Chi2VertexFitter()

tauImpactParameter::Chi2VertexFitter::Chi2VertexFitter ( const std::vector< TrackParticle > &  particles,
const TVector3 &  vguess,
double  nsigma = 4.0 
)
inline

Definition at line 18 of file Chi2VertexFitter.h.

19  : TrackHelixVertexFitter(particles, vguess), nsigma_(nsigma){};

◆ ~Chi2VertexFitter()

tauImpactParameter::Chi2VertexFitter::~Chi2VertexFitter ( )
inlineoverride

Definition at line 20 of file Chi2VertexFitter.h.

20 {};

Member Function Documentation

◆ fit()

bool Chi2VertexFitter::fit ( void  )
overridevirtual

Implements tauImpactParameter::TrackHelixVertexFitter.

Definition at line 26 of file Chi2VertexFitter.cc.

26  {
27  if (isFit_ == true)
28  return true; // do not refit
29  if (!isConfigured_)
30  return false; // do not fit if configuration failed
32  ROOT::Minuit2::MnUserParameters MnPar;
33  for (int i = 0; i < par_.GetNrows(); i++) {
34  TString name = freeParName(i);
35  // if not limited (vhigh <= vlow)
36  MnPar.Add(name.Data(),
37  par_(i),
38  sqrt(fabs(parcov_(i, i))),
39  par_(i) - nsigma_ * sqrt(fabs(parcov_(i, i))),
40  par_(i) + nsigma_ * sqrt(fabs(parcov_(i, i))));
41  }
42 
43  unsigned int max = 10;
44  int numberofcalls = 200 + par_.GetNrows() * 100 + par_.GetNrows() * par_.GetNrows() * 5;
45  double tolerance(0.01);
46  double edmMin(0.001 * updator.Up() * tolerance);
47 
48  ROOT::Minuit2::MnMinimize minimize(updator, MnPar);
49  ROOT::Minuit2::FunctionMinimum min = minimize(numberofcalls, tolerance);
50  for (unsigned int i = 0; i <= max && min.Edm() > edmMin; i++) {
51  if (i == max)
52  return false;
53  min = minimize(i * numberofcalls, tolerance);
54  }
55  // give return flag based on status
56  if (min.IsAboveMaxEdm()) {
57  edm::LogWarning("Chi2VertexFitter::Fit") << "Found Vertex that is above EDM " << std::endl;
58  return false;
59  }
60  if (!min.IsValid()) {
61  edm::LogWarning("Chi2VertexFitter::Fit") << "Failed min.IsValid()" << std::endl;
62  if (!min.HasValidParameters()) {
63  edm::LogWarning("Chi2VertexFitter::Fit") << "Failed min.HasValidParameters()" << std::endl;
64  }
65  if (!min.HasValidCovariance()) {
66  edm::LogWarning("Chi2VertexFitter::Fit") << "Failed min.HasValidCovariance()" << std::endl;
67  }
68  if (!min.HesseFailed()) {
69  edm::LogWarning("Chi2VertexFitter::Fit") << "Failed min.HesseFailed()" << std::endl;
70  }
71  if (!min.HasReachedCallLimit()) {
72  edm::LogWarning("Chi2VertexFitter::Fit") << "Failed min.HasReachedCallLimit()" << std::endl;
73  }
74  return false;
75  }
76  chi2_ = min.Fval();
77  // Get output parameters
78  for (int i = 0; i < par_.GetNrows(); i++) {
79  par_(i) = min.UserParameters().Value(i);
80  }
81  // Get output covariance
82  for (int i = 0; i < par_.GetNrows(); i++) {
83  for (int j = 0; j < par_.GetNrows(); j++) {
84  parcov_(i, j) = min.UserCovariance()(i, j);
85  }
86  }
87 
88  isFit_ = true;
89  return isFit_;
90 }

References tauImpactParameter::TrackHelixVertexFitter::chi2_, tauImpactParameter::TrackHelixVertexFitter::freeParName(), mps_fire::i, tauImpactParameter::TrackHelixVertexFitter::isConfigured_, tauImpactParameter::TrackHelixVertexFitter::isFit_, dqmiolumiharvest::j, SiStripPI::max, min(), Skims_PA_cff::name, nsigma_, tauImpactParameter::TrackHelixVertexFitter::par_, tauImpactParameter::TrackHelixVertexFitter::parcov_, mathSSE::sqrt(), tolerance, and HLT_FULL_cff::updator.

Referenced by trackingPlots.Iteration::modules().

Member Data Documentation

◆ nsigma_

double tauImpactParameter::Chi2VertexFitter::nsigma_
private

Definition at line 25 of file Chi2VertexFitter.h.

Referenced by fit().

mps_fire.i
i
Definition: mps_fire.py:428
min
T min(T a, T b)
Definition: MathUtil.h:58
tauImpactParameter::TrackHelixVertexFitter::parcov_
TMatrixTSym< double > parcov_
Definition: TrackHelixVertexFitter.h:59
tauImpactParameter::TrackHelixVertexFitter::isConfigured_
bool isConfigured_
Definition: TrackHelixVertexFitter.h:57
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
tauImpactParameter::TrackHelixVertexFitter::chi2_
double chi2_
Definition: TrackHelixVertexFitter.h:61
ecalTrigSettings_cff.particles
particles
Definition: ecalTrigSettings_cff.py:11
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
tauImpactParameter::TrackHelixVertexFitter::freeParName
virtual TString freeParName(int Par)
Definition: TrackHelixVertexFitter.cc:265
HLT_FULL_cff.updator
updator
Definition: HLT_FULL_cff.py:123
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:26
tauImpactParameter::TrackHelixVertexFitter::TrackHelixVertexFitter
TrackHelixVertexFitter(const std::vector< TrackParticle > &particles, const TVector3 &vguess)
Definition: TrackHelixVertexFitter.cc:13
tauImpactParameter::ChiSquareFunctionUpdator
Definition: ChiSquareFunctionUpdator.h:17
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
tauImpactParameter::TrackHelixVertexFitter::isFit_
bool isFit_
Definition: TrackHelixVertexFitter.h:57
tauImpactParameter::TrackHelixVertexFitter::par_
TVectorT< double > par_
Definition: TrackHelixVertexFitter.h:58
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
tauImpactParameter::Chi2VertexFitter::nsigma_
double nsigma_
Definition: Chi2VertexFitter.h:25