CMS 3D CMS Logo

ProtonReconstructionAlgorithm.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Authors:
3  * Jan Kašpar
4  * Laurent Forthomme
5  ****************************************************************************/
6 
7 #ifndef RecoCTPPS_ProtonReconstruction_ProtonReconstructionAlgorithm_h
8 #define RecoCTPPS_ProtonReconstruction_ProtonReconstructionAlgorithm_h
9 
11 
14 
18 
19 #include "TSpline.h"
20 #include "Fit/Fitter.h"
21 
22 #include <unordered_map>
23 
24 //----------------------------------------------------------------------------------------------------
25 
27 {
28  public:
29  ProtonReconstructionAlgorithm(bool fit_vtx_y, bool improved_estimate, unsigned int verbosity);
31 
32  void init(const LHCInterpolatedOpticalFunctionsSetCollection &opticalFunctions);
33  void release();
34 
37  const LHCInfo& lhcInfo, std::ostream& os) const;
38 
41  const LHCInfo& lhcInfo, std::ostream& os) const;
42 
43  private:
44  unsigned int verbosity_;
45  bool fitVtxY_;
48 
50  struct RPOpticsData
51  {
53  std::shared_ptr<const TSpline3> s_xi_vs_x_d, s_y_d_vs_xi, s_v_y_vs_xi, s_L_y_vs_xi;
54  double x0;
55  double y0;
56  double ch0;
57  double ch1;
58  double la0;
59  double la1;
60  };
61 
63  std::map<unsigned int, RPOpticsData> m_rp_optics_;
64 
67  {
68  public:
69  ChiSquareCalculator() = default;
70 
71  double operator() (const double *parameters) const;
72 
74  const std::map<unsigned int, RPOpticsData>* m_rp_optics;
75  };
76 
78  std::unique_ptr<ROOT::Fit::Fitter> fitter_;
79 
81  std::unique_ptr<ChiSquareCalculator> chiSquareCalculator_;
82 
83  static void doLinearFit(const std::vector<double> &vx, const std::vector<double> &vy, double &b, double &a);
84 };
85 
86 #endif
87 
std::unique_ptr< ROOT::Fit::Fitter > fitter_
fitter object
reco::ForwardProton reconstructFromSingleRP(const CTPPSLocalTrackLiteRef &track, const LHCInfo &lhcInfo, std::ostream &os) const
run proton reconstruction using single-RP strategy
std::map< unsigned int, RPOpticsData > m_rp_optics_
map: RP id –> optics data
const std::map< unsigned int, RPOpticsData > * m_rp_optics
void init(const LHCInterpolatedOpticalFunctionsSetCollection &opticalFunctions)
std::unique_ptr< ChiSquareCalculator > chiSquareCalculator_
object to calculate chi^2
double ch0
intercept for linear approximation of
double la1
slope for linear approximation of
reco::ForwardProton reconstructFromMultiRP(const CTPPSLocalTrackLiteRefVector &tracks, const LHCInfo &lhcInfo, std::ostream &os) const
run proton reconstruction using multiple-RP strategy
static void doLinearFit(const std::vector< double > &vx, const std::vector< double > &vy, double &b, double &a)
double la0
intercept for linear approximation of
Set of optical functions corresponding to one scoring plane along LHC, including splines for interpol...
ProtonReconstructionAlgorithm(bool fit_vtx_y, bool improved_estimate, unsigned int verbosity)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const LHCInterpolatedOpticalFunctionsSet * optics
double ch1
slope for linear approximation of