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 RecoPPS_ProtonReconstruction_ProtonReconstructionAlgorithm_h
8 #define RecoPPS_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,
29  bool improved_estimate,
30  const std::string &multiRPAlgorithm,
31  unsigned int verbosity);
33 
35  void release();
36 
39  const LHCInfo &lhcInfo,
40  std::ostream &os) const;
41 
44  const LHCInfo &lhcInfo,
45  std::ostream &os) const;
46 
47 private:
48  unsigned int verbosity_;
49  bool fitVtxY_;
53 
55  struct RPOpticsData {
57  std::shared_ptr<const TSpline3> s_x_d_vs_xi, s_L_x_vs_xi, s_xi_vs_x_d, s_y_d_vs_xi, s_v_y_vs_xi, s_L_y_vs_xi;
58  double x0;
59  double y0;
60  double ch0;
61  double ch1;
62  double la0;
63  double la1;
64  };
65 
67  std::map<unsigned int, RPOpticsData> m_rp_optics_;
68 
70  class ChiSquareCalculator {
71  public:
72  ChiSquareCalculator() = default;
73 
74  double operator()(const double *parameters) const;
75 
77  const std::map<unsigned int, RPOpticsData> *m_rp_optics;
78  };
79 
81  std::unique_ptr<ROOT::Fit::Fitter> fitter_;
82 
84  std::unique_ptr<ChiSquareCalculator> chiSquareCalculator_;
85 
86  static void doLinearFit(const std::vector<double> &vx, const std::vector<double> &vy, double &b, double &a);
87 
88  static double newtonGoalFcn(double xi, double x_N, double x_F, const RPOpticsData &i_N, const RPOpticsData &i_F);
89 };
90 
91 #endif
ProtonReconstructionAlgorithm::RPOpticsData::x0
double x0
beam horizontal position, cm
Definition: ProtonReconstructionAlgorithm.h:60
ProtonReconstructionAlgorithm::ChiSquareCalculator::operator()
double operator()(const double *parameters) const
Definition: ProtonReconstructionAlgorithm.cc:126
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
ProtonReconstructionAlgorithm::RPOpticsData::optics
const LHCInterpolatedOpticalFunctionsSet * optics
Definition: ProtonReconstructionAlgorithm.h:58
hybridSuperClusters_cfi.xi
xi
Definition: hybridSuperClusters_cfi.py:10
LHCInfo.h
reco::ForwardProton
Definition: ForwardProton.h:21
LHCInterpolatedOpticalFunctionsSet.h
LHCInfo
Definition: LHCInfo.h:12
ProtonReconstructionAlgorithm::newtonGoalFcn
static double newtonGoalFcn(double xi, double x_N, double x_F, const RPOpticsData &i_N, const RPOpticsData &i_F)
Definition: ProtonReconstructionAlgorithm.cc:159
ProtonReconstructionAlgorithm::ChiSquareCalculator::ChiSquareCalculator
ChiSquareCalculator()=default
ProtonReconstructionAlgorithm::init
void init(const LHCInterpolatedOpticalFunctionsSetCollection &opticalFunctions)
Definition: ProtonReconstructionAlgorithm.cc:53
edm::RefVector< CTPPSLocalTrackLiteCollection >
ProtonReconstructionAlgorithm::RPOpticsData::la1
double la1
slope for linear approximation of
Definition: ProtonReconstructionAlgorithm.h:65
ProtonReconstructionAlgorithm::RPOpticsData::la0
double la0
intercept for linear approximation of
Definition: ProtonReconstructionAlgorithm.h:64
ProtonReconstructionAlgorithm::reconstructFromMultiRP
reco::ForwardProton reconstructFromMultiRP(const CTPPSLocalTrackLiteRefVector &tracks, const LHCInfo &lhcInfo, std::ostream &os) const
run proton reconstruction using multiple-RP strategy
Definition: ProtonReconstructionAlgorithm.cc:170
ProtonReconstructionAlgorithm::RPOpticsData::s_x_d_vs_xi
std::shared_ptr< const TSpline3 > s_x_d_vs_xi
Definition: ProtonReconstructionAlgorithm.h:59
ProtonReconstructionAlgorithm::fitter_
std::unique_ptr< ROOT::Fit::Fitter > fitter_
fitter object
Definition: ProtonReconstructionAlgorithm.h:83
edm::Ref
Definition: AssociativeIterator.h:58
ProtonReconstructionAlgorithm::reconstructFromSingleRP
reco::ForwardProton reconstructFromSingleRP(const CTPPSLocalTrackLiteRef &track, const LHCInfo &lhcInfo, std::ostream &os) const
run proton reconstruction using single-RP strategy
Definition: ProtonReconstructionAlgorithm.cc:404
LHCInterpolatedOpticalFunctionsSetCollection
Definition: LHCInterpolatedOpticalFunctionsSetCollection.h:10
ProtonReconstructionAlgorithm::chiSquareCalculator_
std::unique_ptr< ChiSquareCalculator > chiSquareCalculator_
object to calculate chi^2
Definition: ProtonReconstructionAlgorithm.h:86
ProtonReconstructionAlgorithm::doLinearFit
static void doLinearFit(const std::vector< double > &vx, const std::vector< double > &vy, double &b, double &a)
Definition: ProtonReconstructionAlgorithm.cc:98
ProtonReconstructionAlgorithm
Definition: ProtonReconstructionAlgorithm.h:25
LHCInterpolatedOpticalFunctionsSetCollection.h
ProtonReconstructionAlgorithm::RPOpticsData::s_xi_vs_x_d
std::shared_ptr< const TSpline3 > s_xi_vs_x_d
Definition: ProtonReconstructionAlgorithm.h:59
ForwardProtonFwd.h
ProtonReconstructionAlgorithm::RPOpticsData::s_v_y_vs_xi
std::shared_ptr< const TSpline3 > s_v_y_vs_xi
Definition: ProtonReconstructionAlgorithm.h:59
ProtonReconstructionAlgorithm::~ProtonReconstructionAlgorithm
~ProtonReconstructionAlgorithm()=default
ProtonReconstructionAlgorithm::multi_rp_algorithm_
enum ProtonReconstructionAlgorithm::@955 multi_rp_algorithm_
ProtonReconstructionAlgorithm::ProtonReconstructionAlgorithm
ProtonReconstructionAlgorithm(bool fit_vtx_y, bool improved_estimate, const std::string &multiRPAlgorithm, unsigned int verbosity)
Definition: ProtonReconstructionAlgorithm.cc:21
b
double b
Definition: hdecay.h:118
ProtonReconstructionAlgorithm::RPOpticsData::s_L_x_vs_xi
std::shared_ptr< const TSpline3 > s_L_x_vs_xi
Definition: ProtonReconstructionAlgorithm.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LHCInterpolatedOpticalFunctionsSet
Set of optical functions corresponding to one scoring plane along LHC, including splines for interpol...
Definition: LHCInterpolatedOpticalFunctionsSet.h:14
a
double a
Definition: hdecay.h:119
ProtonReconstructionAlgorithm::verbosity_
unsigned int verbosity_
Definition: ProtonReconstructionAlgorithm.h:50
ProtonReconstructionAlgorithm::mrpaNewton
Definition: ProtonReconstructionAlgorithm.h:53
ProtonReconstructionAlgorithm::RPOpticsData::ch0
double ch0
intercept for linear approximation of
Definition: ProtonReconstructionAlgorithm.h:62
ProtonReconstructionAlgorithm::RPOpticsData::s_L_y_vs_xi
std::shared_ptr< const TSpline3 > s_L_y_vs_xi
Definition: ProtonReconstructionAlgorithm.h:59
ProtonReconstructionAlgorithm::ChiSquareCalculator
class for calculation of chi^2
Definition: ProtonReconstructionAlgorithm.h:72
ProtonReconstructionAlgorithm::RPOpticsData::s_y_d_vs_xi
std::shared_ptr< const TSpline3 > s_y_d_vs_xi
Definition: ProtonReconstructionAlgorithm.h:59
ProtonReconstructionAlgorithm::mrpaChi2
Definition: ProtonReconstructionAlgorithm.h:53
ProtonReconstructionAlgorithm::RPOpticsData
optics data associated with 1 RP
Definition: ProtonReconstructionAlgorithm.h:57
ProtonReconstructionAlgorithm::fitVtxY_
bool fitVtxY_
Definition: ProtonReconstructionAlgorithm.h:51
ProtonReconstructionAlgorithm::RPOpticsData::y0
double y0
beam vertical position, cm
Definition: ProtonReconstructionAlgorithm.h:61
ProtonReconstructionAlgorithm::initialized_
bool initialized_
Definition: ProtonReconstructionAlgorithm.h:54
ProtonReconstructionAlgorithm::RPOpticsData::ch1
double ch1
slope for linear approximation of
Definition: ProtonReconstructionAlgorithm.h:63
ProtonReconstructionAlgorithm::ChiSquareCalculator::m_rp_optics
const std::map< unsigned int, RPOpticsData > * m_rp_optics
Definition: ProtonReconstructionAlgorithm.h:79
CTPPSLocalTrackLiteFwd.h
ProtonReconstructionAlgorithm::m_rp_optics_
std::map< unsigned int, RPOpticsData > m_rp_optics_
map: RP id --> optics data
Definition: ProtonReconstructionAlgorithm.h:69
ParameterSet.h
ProtonReconstructionAlgorithm::release
void release()
Definition: ProtonReconstructionAlgorithm.cc:118
ProtonReconstructionAlgorithm::mrpaUndefined
Definition: ProtonReconstructionAlgorithm.h:53
ProtonReconstructionAlgorithm::mrpaAnalIter
Definition: ProtonReconstructionAlgorithm.h:53
ProtonReconstructionAlgorithm::ChiSquareCalculator::tracks
const CTPPSLocalTrackLiteRefVector * tracks
Definition: ProtonReconstructionAlgorithm.h:78
ProtonReconstructionAlgorithm::useImprovedInitialEstimate_
bool useImprovedInitialEstimate_
Definition: ProtonReconstructionAlgorithm.h:52
OpticalFunctionsConfig_cfi.opticalFunctions
opticalFunctions
Definition: OpticalFunctionsConfig_cfi.py:16