CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 70 of file ProtonReconstructionAlgorithm.h.

Constructor & Destructor Documentation

◆ ChiSquareCalculator()

ProtonReconstructionAlgorithm::ChiSquareCalculator::ChiSquareCalculator ( )
default

Member Function Documentation

◆ operator()()

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

Definition at line 127 of file ProtonReconstructionAlgorithm.cc.

References m_rp_optics, HLT_2022v11_cff::track, tracks, x, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, y, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

127  {
128  // extract proton parameters
130  0., parameters[1], parameters[3], parameters[2], parameters[0]};
131 
132  // calculate chi^2 by looping over hits
133  double s2 = 0.;
134 
135  for (const auto &track : *tracks) {
136  const CTPPSDetId rpId(track->rpId());
137 
138  // transport proton to the RP
139  auto oit = m_rp_optics->find(rpId);
141  oit->second.optics->transport(k_in, k_out);
142 
143  // proton position wrt. beam
144  const double x = k_out.x - oit->second.x0;
145  const double y = k_out.y - oit->second.y0;
146 
147  // calculate chi^2 contributions, convert track data mm --> cm
148  const double x_diff_norm = (x - track->x() * 1E-1) / (track->xUnc() * 1E-1);
149  const double y_diff_norm = (y - track->y() * 1E-1) / (track->yUnc() * 1E-1);
150 
151  // increase chi^2
152  s2 += x_diff_norm * x_diff_norm + y_diff_norm * y_diff_norm;
153  }
154 
155  return s2;
156 }
const std::map< unsigned int, RPOpticsData > * m_rp_optics
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32

Member Data Documentation

◆ m_rp_optics

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

Definition at line 77 of file ProtonReconstructionAlgorithm.h.

Referenced by operator()().

◆ tracks

const CTPPSLocalTrackLiteRefVector* ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks

Definition at line 76 of file ProtonReconstructionAlgorithm.h.

Referenced by operator()().