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 public:
28  ProtonReconstructionAlgorithm(bool fit_vtx_y, bool improved_estimate, unsigned int verbosity);
30 
31  void init(const LHCInterpolatedOpticalFunctionsSetCollection &opticalFunctions);
32  void release();
33 
36  const LHCInfo &lhcInfo,
37  std::ostream &os) const;
38 
41  const LHCInfo &lhcInfo,
42  std::ostream &os) const;
43 
44 private:
45  unsigned int verbosity_;
46  bool fitVtxY_;
49 
51  struct RPOpticsData {
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  public:
68  ChiSquareCalculator() = default;
69 
70  double operator()(const double *parameters) const;
71 
73  const std::map<unsigned int, RPOpticsData> *m_rp_optics;
74  };
75 
77  std::unique_ptr<ROOT::Fit::Fitter> fitter_;
78 
80  std::unique_ptr<ChiSquareCalculator> chiSquareCalculator_;
81 
82  static void doLinearFit(const std::vector<double> &vx, const std::vector<double> &vy, double &b, double &a);
83 };
84 
85 #endif
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:118
double a
Definition: hdecay.h:119
const LHCInterpolatedOpticalFunctionsSet * optics
double ch1
slope for linear approximation of