CMS 3D CMS Logo

CTPPSFastTrackingProducer.h
Go to the documentation of this file.
1 #ifndef FastSimulation_CTPPSFastTrackingProducer_h
2 #define FastSimulation_CTPPSFastTrackingProducer_h
3 
4 // user include files
7 
10 
13 
15 
19 
22 
25 
28 
30 
31 //C++ library
32 #include <iostream>
33 #include <fstream>
34 #include <string>
35 #include <cmath>
36 #include <cmath>
37 #include <map>
38 #include <vector>
39 #include <utility>
40 #include <cmath>
41 
45 
46 //
47 // class declaration
48 //
49 class H_BeamParticle;
50 class H_RecRPObject;
51 class H_BeamLine;
52 
54 public:
56  ~CTPPSFastTrackingProducer() override;
57 
58 private:
59  void beginStream(edm::StreamID) override;
60  void produce(edm::Event&, const edm::EventSetup&) override;
61  void endStream() override;
62  //this function will only be called once per event
63  virtual void beginEvent(edm::Event& event, const edm::EventSetup& eventSetup);
64  virtual void endEvent(edm::Event& event, const edm::EventSetup& eventSetup);
65 
66  // ----------member data ---------------------------
67 
68  typedef std::vector<CTPPSFastRecHit> CTPPSFastRecHitContainer;
71  void FastReco(int Direction, H_RecRPObject* station);
72  void Reconstruction();
73  void ReconstructArm(
74  H_RecRPObject* pps_station, double x1, double y1, double x2, double y2, double& tx, double& ty, double& eloss);
75  void MatchCellId(int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof, bool& match, double& recTof);
76  bool SearchTrack(int,
77  int,
78  int Direction,
79  double& xi,
80  double& t,
81  double& partP,
82  double& pt,
83  double& thx,
84  double& thy,
85  double& x0,
86  double& y0,
87  double& xt,
88  double& yt,
89  double& X1d,
90  double& Y1d,
91  double& X2d,
92  double& Y2d);
93  void TrackerStationClear();
95  void ProjectToToF(const double x1, const double y1, const double x2, const double y2, double& xt, double& yt) {
96  xt = ((fz_timing - fz_tracker2) * (x2 - x1) / (fz_tracker2 - fz_tracker1)) + x2;
97  yt = ((fz_timing - fz_tracker2) * (y2 - y1) / (fz_tracker2 - fz_tracker1)) + y2;
98  };
99  // Hector objects
100  bool SetBeamLine();
101 
102  std::map<unsigned int, H_BeamParticle*> m_beamPart;
103  std::unique_ptr<H_BeamLine> m_beamlineCTPPS1;
104  std::unique_ptr<H_BeamLine> m_beamlineCTPPS2;
105  std::unique_ptr<H_RecRPObject> pps_stationF;
106  std::unique_ptr<H_RecRPObject> pps_stationB;
107 
110 
111  // Defaults
112  double lengthctpps;
114  double fBeamEnergy;
120  std::unique_ptr<CTPPSTrkStation> TrkStation_F; // auxiliary object with the tracker geometry
121  std::unique_ptr<CTPPSTrkStation> TrkStation_B;
122  std::unique_ptr<CTPPSTrkDetector> det1F;
123  std::unique_ptr<CTPPSTrkDetector> det1B;
124  std::unique_ptr<CTPPSTrkDetector> det2F;
125  std::unique_ptr<CTPPSTrkDetector> det2B;
126  std::unique_ptr<CTPPSToFDetector> detToF_F;
127  std::unique_ptr<CTPPSToFDetector> detToF_B;
128 
129  std::vector<CTPPSFastTrack> theCTPPSFastTrack;
130 
132 
133  std::vector<int> recCellId_F, recCellId_B;
134  std::vector<double> recTof_F, recTof_B;
135 
138  std::vector<double> fToFCellWidth;
142 };
143 #endif
void beginStream(edm::StreamID) override
std::unique_ptr< CTPPSTrkDetector > det2B
std::unique_ptr< H_BeamLine > m_beamlineCTPPS1
virtual void endEvent(edm::Event &event, const edm::EventSetup &eventSetup)
void FastReco(int Direction, H_RecRPObject *station)
void ReconstructArm(H_RecRPObject *pps_station, double x1, double y1, double x2, double y2, double &tx, double &ty, double &eloss)
std::unique_ptr< H_RecRPObject > pps_stationB
std::unique_ptr< CTPPSToFDetector > detToF_F
std::unique_ptr< CTPPSTrkDetector > det2F
std::unique_ptr< H_RecRPObject > pps_stationF
CTPPSFastTrackingProducer(const edm::ParameterSet &)
std::unique_ptr< CTPPSTrkDetector > det1B
virtual void beginEvent(edm::Event &event, const edm::EventSetup &eventSetup)
std::unique_ptr< CTPPSTrkStation > TrkStation_B
std::unique_ptr< CTPPSToFDetector > detToF_B
std::map< unsigned int, H_BeamParticle * > m_beamPart
std::vector< CTPPSFastRecHit > CTPPSFastRecHitContainer
std::unique_ptr< H_BeamLine > m_beamlineCTPPS2
void ProjectToToF(const double x1, const double y1, const double x2, const double y2, double &xt, double &yt)
void MatchCellId(int cellId, std::vector< int > vrecCellId, std::vector< double > vrecTof, bool &match, double &recTof)
std::unique_ptr< CTPPSTrkStation > TrkStation_F
std::vector< CTPPSFastTrack > theCTPPSFastTrack
std::unique_ptr< CTPPSTrkDetector > det1F
edm::EDGetTokenT< CTPPSFastRecHitContainer > _recHitToken
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void produce(edm::Event &, const edm::EventSetup &) override
void ReadRecHits(edm::Handle< CTPPSFastRecHitContainer > &)
Definition: event.py:1
bool SearchTrack(int, int, int Direction, double &xi, double &t, double &partP, double &pt, double &thx, double &thy, double &x0, double &y0, double &xt, double &yt, double &X1d, double &Y1d, double &X2d, double &Y2d)