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 
48 //
49 // class declaration
50 //
51 class H_BeamParticle;
52 class H_RecRPObject;
53 class H_BeamLine;
54 
56  public:
58  ~CTPPSFastTrackingProducer() override;
59 
60  private:
61  void beginStream(edm::StreamID) override;
62  void produce(edm::Event&, const edm::EventSetup&) override;
63  void endStream() override;
64  //this function will only be called once per event
65  virtual void beginEvent(edm::Event& event, const edm::EventSetup& eventSetup);
66  virtual void endEvent(edm::Event& event, const edm::EventSetup& eventSetup);
67 
68  // ----------member data ---------------------------
69 
70  typedef std::vector<CTPPSFastRecHit> CTPPSFastRecHitContainer;
73  void FastReco(int Direction,H_RecRPObject* station);
74  void Reconstruction();
75  void ReconstructArm(H_RecRPObject* pps_station, double x1,double y1,double x2,double y2, double& tx, double& ty,double& eloss);
76  void MatchCellId(int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof, bool& match, double& recTof);
77  bool SearchTrack(int ,int ,int Direction,double& xi,double& t,double& partP,double& pt,double& thx,double& thy,
78  double& x0,double& y0, double& xt, double& yt, double& X1d, double& Y1d, double& X2d, double& Y2d);
79  void TrackerStationClear();
81  void ProjectToToF(const double x1, const double y1, const double x2, const double y2, double& xt, double& yt) {
82  xt = ((fz_timing-fz_tracker2)*(x2-x1)/(fz_tracker2-fz_tracker1)) + x2;
83  yt = ((fz_timing-fz_tracker2)*(y2-y1)/(fz_tracker2-fz_tracker1)) + y2;
84  };
85  // Hector objects
86  bool SetBeamLine();
87 
88  std::map<unsigned int, H_BeamParticle*> m_beamPart;
89  std::unique_ptr<H_BeamLine> m_beamlineCTPPS1;
90  std::unique_ptr<H_BeamLine> m_beamlineCTPPS2;
91  std::unique_ptr<H_RecRPObject> pps_stationF;
92  std::unique_ptr<H_RecRPObject> pps_stationB;
93 
96 
97  // Defaults
98  double lengthctpps ;
100  double fBeamEnergy;
106  std::unique_ptr<CTPPSTrkStation> TrkStation_F; // auxiliary object with the tracker geometry
107  std::unique_ptr<CTPPSTrkStation> TrkStation_B;
108  std::unique_ptr<CTPPSTrkDetector> det1F;
109  std::unique_ptr<CTPPSTrkDetector> det1B;
110  std::unique_ptr<CTPPSTrkDetector> det2F;
111  std::unique_ptr<CTPPSTrkDetector> det2B;
112  std::unique_ptr<CTPPSToFDetector> detToF_F;
113  std::unique_ptr<CTPPSToFDetector> detToF_B;
114 
115  std::vector<CTPPSFastTrack> theCTPPSFastTrack;
116 
118 
119  std::vector<int> recCellId_F, recCellId_B ;
120  std::vector<double> recTof_F, recTof_B ;
121 
124  std::vector<double> fToFCellWidth;
128 
129 
130 };
131 #endif
132 
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
edm::EDGetTokenT< CTPPSFastRecHitContainer > _recHitToken
std::unique_ptr< CTPPSTrkDetector > det1F
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)