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

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;

References m_rp_optics, year_2016_postTS2_cff::rpId, indexGen::s2, HLT_FULL_cff::track, tracks, x, LHCInterpolatedOpticalFunctionsSet::Kinematics::x, y, and LHCInterpolatedOpticalFunctionsSet::Kinematics::y.

Member Data Documentation

◆ m_rp_optics

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

Definition at line 79 of file ProtonReconstructionAlgorithm.h.

Referenced by operator()().

◆ tracks

const CTPPSLocalTrackLiteRefVector* ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks

Definition at line 78 of file ProtonReconstructionAlgorithm.h.

Referenced by operator()().

DDAxes::y
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11776
LHCInterpolatedOpticalFunctionsSet::Kinematics
proton kinematics description
Definition: LHCInterpolatedOpticalFunctionsSet.h:28
DDAxes::x
indexGen.s2
s2
Definition: indexGen.py:107
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
LHCInterpolatedOpticalFunctionsSet::Kinematics::y
double y
Definition: LHCInterpolatedOpticalFunctionsSet.h:31
LHCInterpolatedOpticalFunctionsSet::Kinematics::x
double x
Definition: LHCInterpolatedOpticalFunctionsSet.h:29
CTPPSDetId
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:31
ProtonReconstructionAlgorithm::ChiSquareCalculator::m_rp_optics
const std::map< unsigned int, RPOpticsData > * m_rp_optics
Definition: ProtonReconstructionAlgorithm.h:79
ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks
const CTPPSLocalTrackLiteRefVector * tracks
Definition: ProtonReconstructionAlgorithm.h:78