CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
ProtonReconstructionAlgorithm::ChiSquareCalculator Class Reference

class for calculation of chi^2 More...

Public Member Functions

 ChiSquareCalculator ()=default
 
double operator() (const double *parameters) const
 

Public Attributes

const std::map< unsigned int, RPOpticsData > * m_rp_optics
 
const CTPPSLocalTrackLiteRefVectortracks
 

Detailed Description

class for calculation of chi^2

Definition at line 66 of file ProtonReconstructionAlgorithm.h.

Constructor & Destructor Documentation

ProtonReconstructionAlgorithm::ChiSquareCalculator::ChiSquareCalculator ( )
default

Member Function Documentation

double ProtonReconstructionAlgorithm::ChiSquareCalculator::operator() ( const double *  parameters) const

Definition at line 111 of file ProtonReconstructionAlgorithm.cc.

References year_2016_postTS2_cff::rpId, indexGen::s2, HiIsolationCommonParameters_cff::track, l1t::tracks, x, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, y, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

112 {
113  // extract proton parameters
114  const LHCInterpolatedOpticalFunctionsSet::Kinematics k_in = { 0., parameters[1], parameters[3], parameters[2], parameters[0] };
115 
116  // calculate chi^2 by looping over hits
117  double s2 = 0.;
118 
119  for (const auto &track : *tracks) {
120  const CTPPSDetId rpId(track->getRPId());
121 
122  // transport proton to the RP
123  auto oit = m_rp_optics->find(rpId);
125  oit->second.optics->transport(k_in, k_out);
126 
127  // proton position wrt. beam
128  const double x = k_out.x - oit->second.x0;
129  const double y = k_out.y - oit->second.y0;
130 
131  // calculate chi^2 contributions, convert track data mm --> cm
132  const double x_diff_norm = (x - track->getX()*1E-1) / (track->getXUnc()*1E-1);
133  const double y_diff_norm = (y - track->getY()*1E-1) / (track->getYUnc()*1E-1);
134 
135  // increase chi^2
136  s2 += x_diff_norm*x_diff_norm + y_diff_norm*y_diff_norm;
137  }
138 
139  return s2;
140 }
const std::map< unsigned int, RPOpticsData > * m_rp_optics
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32

Member Data Documentation

const std::map<unsigned int, RPOpticsData>* ProtonReconstructionAlgorithm::ChiSquareCalculator::m_rp_optics

Definition at line 74 of file ProtonReconstructionAlgorithm.h.

const CTPPSLocalTrackLiteRefVector* ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks

Definition at line 73 of file ProtonReconstructionAlgorithm.h.