CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
track_associator Namespace Reference

Functions

double getChi2 (const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const Basic3DVector< double > &momAtVtx, const Basic3DVector< double > &vert, int charge, const MagneticField &, const reco::BeamSpot &)
 basic method where chi2 is computed More...
 

Function Documentation

double track_associator::getChi2 ( const reco::TrackBase::ParameterVector rParameters,
const reco::TrackBase::CovarianceMatrix recoTrackCovMatrix,
const Basic3DVector< double > &  momAtVtx,
const Basic3DVector< double > &  vert,
int  charge,
const MagneticField magfield,
const reco::BeamSpot bs 
)

basic method where chi2 is computed

Definition at line 7 of file getChi2.cc.

References beam_dqm_sourceclient-live_cfg::chi2, reco::deltaPhi(), f, LogDebug, funct::sin(), and reco::trackingParametersAtClosestApproachToBeamSpot().

Referenced by TrackGenAssociatorByChi2Impl::associateGenToReco(), TrackGenAssociatorByChi2Impl::associateRecoToGen(), TrackAssociatorByChi2Impl::associateRecoToSim(), TrackAssociatorByChi2Impl::associateSimToReco(), TrackGenAssociatorByChi2Impl::getChi2(), and TrackAssociatorByChi2Impl::getChi2().

13  {
14 
15  double chi2 = 10000000000.;
16 
17  std::pair<bool,reco::TrackBase::ParameterVector> params = reco::trackingParametersAtClosestApproachToBeamSpot(vert, momAtVtx, charge, magfield, bs);
18  if (params.first){
19  reco::TrackBase::ParameterVector sParameters=params.second;
20 
21  reco::TrackBase::ParameterVector diffParameters = rParameters - sParameters;
22  diffParameters[2] = reco::deltaPhi(diffParameters[2],0.f);
23  chi2 = ROOT::Math::Dot(diffParameters * recoTrackCovMatrix, diffParameters);
24  chi2 /= 5;
25 
26  LogDebug("TrackAssociator") << "====NEW RECO TRACK WITH PT=" << sin(rParameters[1])*float(charge)/rParameters[0] << "====\n"
27  << "qoverp sim: " << sParameters[0] << "\n"
28  << "lambda sim: " << sParameters[1] << "\n"
29  << "phi sim: " << sParameters[2] << "\n"
30  << "dxy sim: " << sParameters[3] << "\n"
31  << "dsz sim: " << sParameters[4] << "\n"
32  << ": " /*<< */ << "\n"
33  << "qoverp rec: " << rParameters[0] << "\n"
34  << "lambda rec: " << rParameters[1] << "\n"
35  << "phi rec: " << rParameters[2] << "\n"
36  << "dxy rec: " << rParameters[3] << "\n"
37  << "dsz rec: " << rParameters[4] << "\n"
38  << ": " /*<< */ << "\n"
39  << "chi2: " << chi2 << "\n";
40 
41  }
42  return chi2;
43  }
#define LogDebug(id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:74
double f[11][100]
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
std::pair< bool, reco::TrackBase::ParameterVector > trackingParametersAtClosestApproachToBeamSpot(const Basic3DVector< double > &vertex, const Basic3DVector< double > &momAtVtx, float charge, const MagneticField &magField, const BeamSpot &bs)