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
CTPPSFastTrackingProducer::fTrackerWidth
double fTrackerWidth
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackContainer.h
edm::StreamID
Definition: StreamID.h:30
CTPPSFastTrackingProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CTPPSFastTrackingProducer.cc:116
Handle.h
CTPPSFastTrackingProducer
Definition: CTPPSFastTrackingProducer.h:53
CTPPSFastTrackingProducer::ProjectToToF
void ProjectToToF(const double x1, const double y1, const double x2, const double y2, double &xt, double &yt)
Definition: CTPPSFastTrackingProducer.h:95
CTPPSFastTrackingProducer::fToFPitchY
double fToFPitchY
Definition: CTPPSFastTrackingProducer.h:139
CTPPSFastTrackingProducer::m_beamlineCTPPS1
std::unique_ptr< H_BeamLine > m_beamlineCTPPS1
Definition: CTPPSFastTrackingProducer.h:103
CTPPSFastTrackingProducer::fBeamMomentum
double fBeamMomentum
Definition: CTPPSFastTrackingProducer.h:115
CTPPSFastRecHit.h
Vector.h
CTPPSFastTrackingProducer::endEvent
virtual void endEvent(edm::Event &event, const edm::EventSetup &eventSetup)
Definition: CTPPSFastTrackingProducer.cc:142
CTPPSFastTrackingProducer::fBeamXRMS_Trk2
double fBeamXRMS_Trk2
Definition: CTPPSFastTrackingProducer.h:137
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::EDGetTokenT< CTPPSFastRecHitContainer >
relativeConstraints.station
station
Definition: relativeConstraints.py:67
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
CTPPSFastTrackingProducer::~CTPPSFastTrackingProducer
~CTPPSFastTrackingProducer() override
Definition: CTPPSFastTrackingProducer.cc:110
CTPPSFastTrackingProducer::det1B
std::unique_ptr< CTPPSTrkDetector > det1B
Definition: CTPPSFastTrackingProducer.h:123
CTPPSFastTrackingProducer::recTof_F
std::vector< double > recTof_F
Definition: CTPPSFastTrackingProducer.h:134
hybridSuperClusters_cfi.xi
xi
Definition: hybridSuperClusters_cfi.py:10
EDProducer.h
PPSUnitConversion.h
CTPPSFastTrack
Definition: CTPPSFastTrack.h:9
CTPPSFastTrackingProducer::det2F
std::unique_ptr< CTPPSTrkDetector > det2F
Definition: CTPPSFastTrackingProducer.h:124
CTPPSFastTrackingProducer::fTrackerInsertion
double fTrackerInsertion
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackingProducer::TrackerStationClear
void TrackerStationClear()
Definition: CTPPSFastTrackingProducer.cc:147
CTPPSFastTrackingProducer::fToFNCellX
int fToFNCellX
Definition: CTPPSFastTrackingProducer.h:140
CTPPSFastTrackingProducer::fToFNCellY
int fToFNCellY
Definition: CTPPSFastTrackingProducer.h:140
CTPPSFastTrackingProducer::endStream
void endStream() override
Definition: CTPPSFastTrackingProducer.cc:428
CTPPSFastTrackingProducer::fTimeSigma
double fTimeSigma
Definition: CTPPSFastTrackingProducer.h:141
CTPPSFastTrackingProducer::fCrossingAngleBeam2
double fCrossingAngleBeam2
Definition: CTPPSFastTrackingProducer.h:118
CTPPSFastTrackingProducer::fToFInsertion
double fToFInsertion
Definition: CTPPSFastTrackingProducer.h:141
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSFastTrackingProducer::TrackerStationStarting
void TrackerStationStarting()
Definition: CTPPSFastTrackingProducer.cc:154
PPSUtilities.h
CTPPSFastTrackingProducer::fToFCellWidth
std::vector< double > fToFCellWidth
Definition: CTPPSFastTrackingProducer.h:138
CTPPSFastTrackingProducer::fImpParcut
double fImpParcut
Definition: CTPPSFastTrackingProducer.h:141
CTPPSFastTrackingProducer::FastReco
void FastReco(int Direction, H_RecRPObject *station)
Definition: CTPPSFastTrackingProducer.cc:346
FileInPath.h
CTPPSTrkDetector.h
CTPPSFastRecHitContainer.h
CTPPSFastTrackingProducer::TrkStation_F
std::unique_ptr< CTPPSTrkStation > TrkStation_F
Definition: CTPPSFastTrackingProducer.h:120
MakerMacros.h
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
CTPPSFastTrackingProducer::fToFCellHeight
double fToFCellHeight
Definition: CTPPSFastTrackingProducer.h:139
CTPPSFastTrackingProducer::fTrk1XOffset
double fTrk1XOffset
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackingProducer::detToF_F
std::unique_ptr< CTPPSToFDetector > detToF_F
Definition: CTPPSFastTrackingProducer.h:126
CTPPSFastTrack.h
CTPPSFastTrackingProducer::recTof_B
std::vector< double > recTof_B
Definition: CTPPSFastTrackingProducer.h:134
CTPPSFastTrackingProducer::SetBeamLine
bool SetBeamLine()
Definition: CTPPSFastTrackingProducer.cc:429
CTPPSFastTrackingProducer::_recHitToken
edm::EDGetTokenT< CTPPSFastRecHitContainer > _recHitToken
Definition: CTPPSFastTrackingProducer.h:69
CTPPSFastTrackingProducer::beam1filename
std::string beam1filename
Definition: CTPPSFastTrackingProducer.h:108
OrderedSet.t
t
Definition: OrderedSet.py:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSFastTrackingProducer::CTPPSFastTrackingProducer
CTPPSFastTrackingProducer(const edm::ParameterSet &)
Definition: CTPPSFastTrackingProducer.cc:34
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
CTPPSFastTrackingProducer::TrkStation_B
std::unique_ptr< CTPPSTrkStation > TrkStation_B
Definition: CTPPSFastTrackingProducer.h:121
CTPPSFastTrackingProducer::recCellId_F
std::vector< int > recCellId_F
Definition: CTPPSFastTrackingProducer.h:133
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
CTPPSFastTrackingProducer::theCTPPSFastTrack
std::vector< CTPPSFastTrack > theCTPPSFastTrack
Definition: CTPPSFastTrackingProducer.h:129
CTPPSFastTrackingProducer::fz_tracker2
double fz_tracker2
Definition: CTPPSFastTrackingProducer.h:136
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
CTPPSFastTrackingProducer::fBeamXRMS_ToF
double fBeamXRMS_ToF
Definition: CTPPSFastTrackingProducer.h:141
CTPPSFastTrackingProducer::fToFPitchX
double fToFPitchX
Definition: CTPPSFastTrackingProducer.h:139
CTPPSFastTrackingProducer::fTrk2XOffset
double fTrk2XOffset
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackingProducer::beginEvent
virtual void beginEvent(edm::Event &event, const edm::EventSetup &eventSetup)
Definition: CTPPSFastTrackingProducer.cc:138
CTPPSFastTrackingProducer::det1F
std::unique_ptr< CTPPSTrkDetector > det1F
Definition: CTPPSFastTrackingProducer.h:122
edm::stream::EDProducer
Definition: EDProducer.h:38
CTPPSFastTrackingProducer::m_beamlineCTPPS2
std::unique_ptr< H_BeamLine > m_beamlineCTPPS2
Definition: CTPPSFastTrackingProducer.h:104
CTPPSFastTrackingProducer::CTPPSFastRecHitContainer
std::vector< CTPPSFastRecHit > CTPPSFastRecHitContainer
Definition: CTPPSFastTrackingProducer.h:68
edm::EventSetup
Definition: EventSetup.h:57
CTPPSFastTrackingProducer::beam2filename
std::string beam2filename
Definition: CTPPSFastTrackingProducer.h:109
CTPPSFastTrackingProducer::det2B
std::unique_ptr< CTPPSTrkDetector > det2B
Definition: CTPPSFastTrackingProducer.h:125
Direction
CTPPSFastTrackingProducer::track
CTPPSFastTrack track
Definition: CTPPSFastTrackingProducer.h:131
CTPPSFastTrackingProducer::ReconstructArm
void ReconstructArm(H_RecRPObject *pps_station, double x1, double y1, double x2, double y2, double &tx, double &ty, double &eloss)
Definition: CTPPSFastTrackingProducer.cc:315
CTPPSFastTrackingProducer::pps_stationB
std::unique_ptr< H_RecRPObject > pps_stationB
Definition: CTPPSFastTrackingProducer.h:106
CTPPSFastTrackingProducer::recCellId_B
std::vector< int > recCellId_B
Definition: CTPPSFastTrackingProducer.h:133
CTPPSFastTrackingProducer::fTrackerHeight
double fTrackerHeight
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackingProducer::ReadRecHits
void ReadRecHits(edm::Handle< CTPPSFastRecHitContainer > &)
Definition: CTPPSFastTrackingProducer.cc:164
Frameworkfwd.h
CTPPSFastTrackingProducer::detToF_B
std::unique_ptr< CTPPSToFDetector > detToF_B
Definition: CTPPSFastTrackingProducer.h:127
CTPPSToFDetector.h
CTPPSFastTrackingProducer::fBeamXRMS_Trk1
double fBeamXRMS_Trk1
Definition: CTPPSFastTrackingProducer.h:137
CTPPSFastTrackingProducer::lengthctpps
double lengthctpps
Definition: CTPPSFastTrackingProducer.h:112
Point3D.h
CTPPSFastTrackingProducer::m_verbosity
bool m_verbosity
Definition: CTPPSFastTrackingProducer.h:113
CTPPSFastTrackingProducer::fToFXOffset
double fToFXOffset
Definition: CTPPSFastTrackingProducer.h:141
CTPPSFastTrackingProducer::m_beamPart
std::map< unsigned int, H_BeamParticle * > m_beamPart
Definition: CTPPSFastTrackingProducer.h:102
CTPPSFastTrackingProducer::fBeamEnergy
double fBeamEnergy
Definition: CTPPSFastTrackingProducer.h:114
CTPPSFastTrackingProducer::fz_timing
double fz_timing
Definition: CTPPSFastTrackingProducer.h:136
ConsumesCollector.h
ParameterSet.h
CTPPSFastTrackingProducer::SearchTrack
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)
Definition: CTPPSFastTrackingProducer.cc:213
CTPPSFastTrackingProducer::MatchCellId
void MatchCellId(int cellId, std::vector< int > vrecCellId, std::vector< double > vrecTof, bool &match, double &recTof)
Definition: CTPPSFastTrackingProducer.cc:335
event
Definition: event.py:1
CTPPSFastTrackingProducer::fCrossingAngleBeam1
double fCrossingAngleBeam1
Definition: CTPPSFastTrackingProducer.h:117
edm::Event
Definition: Event.h:73
CTPPSFastTrackingProducer::Reconstruction
void Reconstruction()
Definition: CTPPSFastTrackingProducer.cc:204
Vector3D.h
StreamID.h
CTPPSFastTrackingProducer::fCrossAngleCorr
bool fCrossAngleCorr
Definition: CTPPSFastTrackingProducer.h:116
CTPPSFastTrackingProducer::beginStream
void beginStream(edm::StreamID) override
Definition: CTPPSFastTrackingProducer.cc:424
CTPPSFastTrackingProducer::fz_tracker1
double fz_tracker1
Definition: CTPPSFastTrackingProducer.h:136
CTPPSFastTrackingProducer::pps_stationF
std::unique_ptr< H_RecRPObject > pps_stationF
Definition: CTPPSFastTrackingProducer.h:105