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 112 of file ProtonReconstructionAlgorithm.cc.

References indexGen::s2, HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, x, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, y, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

112  {
113  // extract proton parameters
115  0., parameters[1], parameters[3], parameters[2], parameters[0]};
116 
117  // calculate chi^2 by looping over hits
118  double s2 = 0.;
119 
120  for (const auto &track : *tracks) {
121  const CTPPSDetId rpId(track->rpId());
122 
123  // transport proton to the RP
124  auto oit = m_rp_optics->find(rpId);
126  oit->second.optics->transport(k_in, k_out);
127 
128  // proton position wrt. beam
129  const double x = k_out.x - oit->second.x0;
130  const double y = k_out.y - oit->second.y0;
131 
132  // calculate chi^2 contributions, convert track data mm --> cm
133  const double x_diff_norm = (x - track->x() * 1E-1) / (track->xUnc() * 1E-1);
134  const double y_diff_norm = (y - track->y() * 1E-1) / (track->yUnc() * 1E-1);
135 
136  // increase chi^2
137  s2 += x_diff_norm * x_diff_norm + y_diff_norm * y_diff_norm;
138  }
139 
140  return s2;
141 }
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 73 of file ProtonReconstructionAlgorithm.h.

const CTPPSLocalTrackLiteRefVector* ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks

Definition at line 72 of file ProtonReconstructionAlgorithm.h.