42 #include "TLorentzVector.h" 45 #include "H_Parameters.h" 46 #include "H_BeamLine.h" 47 #include "H_RecRPObject.h" 48 #include "H_BeamParticle.h" 65 H_RecRPObject* pps_station,
double x1,
double y1,
double x2,
double y2,
double& tx,
double& ty,
double& eloss);
66 void MatchCellId(
int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof,
bool&
match,
double& recTof);
86 void ProjectToToF(
const double x1,
const double y1,
const double x2,
const double y2,
double& xt,
double& yt) {
112 std::unique_ptr<CTPPSTrkDetector>
det1F;
113 std::unique_ptr<CTPPSTrkDetector>
det1B;
114 std::unique_ptr<CTPPSTrkDetector>
det2F;
115 std::unique_ptr<CTPPSTrkDetector>
det2B;
137 : m_verbosity(
false), fBeamMomentum(0.), fCrossAngleCorr(
false), fCrossingAngleBeam1(0.), fCrossingAngleBeam2(0.) {
139 produces<edm::CTPPSFastTrackContainer>(
"CTPPSFastTrack");
183 LogDebug(
"CTPPSFastTrackingProducer") <<
"CTPPSFastTrackingProducer: WARNING: lengthctpps= " <<
lengthctpps;
191 det1F = std::make_unique<CTPPSTrkDetector>(
193 det2F = std::make_unique<CTPPSTrkDetector>(
195 det1B = std::make_unique<CTPPSTrkDetector>(
197 det2B = std::make_unique<CTPPSTrkDetector>(
201 std::vector<double> vToFCellWidth;
202 vToFCellWidth.reserve(8);
203 for (
int i = 0;
i < 8;
i++) {
207 detToF_F = std::make_unique<CTPPSToFDetector>(
209 detToF_B = std::make_unique<CTPPSToFDetector>(
231 output_tracks->push_back(*
i);
265 for (
unsigned int irecHits = 0; irecHits <
recHits->size(); ++irecHits) {
267 unsigned int detlayerId =
recHitDet->detUnitId();
272 if (detlayerId == 2014314496)
274 else if (detlayerId == 2014838784)
276 else if (detlayerId == 2031091712)
278 else if (detlayerId == 2031616000)
280 else if (detlayerId == 2046820352) {
284 }
else if (detlayerId == 2063597568) {
337 H_RecRPObject*
station =
nullptr;
368 LogDebug(
"CTPPSFastTrackingProducer::SearchTrack:") <<
"thx " << thx <<
" thy " << thy <<
" eloss " << eloss;
373 double ImpPar =
sqrt(x0 * x0 + y0 * y0);
386 if (xi < 0. || xi > 1. || t < 0. || t > 10. ||
pt <= 0.) {
405 H_RecRPObject* pps_station,
double x1,
double y1,
double x2,
double y2,
double& tx,
double& ty,
double& eloss) {
415 pps_station->setPositions(
x1,
y1,
x2,
y2);
416 double energy = pps_station->getE(AM);
419 tx = pps_station->getTXIP();
420 ty = pps_station->getTYIP();
421 eloss = pps_station->getE();
425 int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof,
bool&
match,
double& recTof) {
426 for (
unsigned int i = 0;
i < vrecCellId.size();
i++) {
427 if (cellId == vrecCellId.at(
i)) {
429 recTof = vrecTof.at(
i);
437 double xi,
t, partP,
pt,
phi, x0, y0, thx, thy, xt, yt, X1d, Y1d, X2d, Y2d;
442 std::vector<double> vToFCellWidth;
443 vToFCellWidth.reserve(8);
444 for (
int i = 0;
i < 8;
i++) {
460 if (
SearchTrack(
i,
j, Direction,
xi,
t, partP,
pt, thx, thy, x0, y0, xt, yt, X1d, Y1d, X2d, Y2d)) {
464 bool matchCellId =
false;
468 }
else if (Direction < 0) {
472 phi = atan2(thy, thx);
478 TLorentzVector
p(
px,
py, pz,
e);
T getParameter(std::string const &) const
std::vector< double > ppsX_
std::unique_ptr< CTPPSTrkDetector > det2B
int findCellId(double x, double y)
constexpr bool isNotFinite(T x)
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< H_BeamLine > m_beamlineCTPPS1
Sin< T >::type sin(const T &t)
void FastReco(int Direction, H_RecRPObject *station)
void setvertex(const Point &vertex)
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
double fCrossingAngleBeam2
void TrackerStationClear()
std::unique_ptr< CTPPSTrkDetector > det2F
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< H_RecRPObject > pps_stationF
std::vector< double > fToFCellWidth
void setp(const Vector &momentum)
std::vector< int > recCellId_F
CTPPSFastTrackingProducer(const edm::ParameterSet &)
std::unique_ptr< CTPPSTrkDetector > det1B
double fCrossingAngleBeam1
std::string beam1filename
std::vector< double > recTof_F
std::unique_ptr< CTPPSTrkStation > TrkStation_B
Cos< T >::type cos(const T &t)
std::unique_ptr< CTPPSToFDetector > detToF_B
std::vector< double > recTof_B
std::vector< CTPPSFastRecHit > CTPPSFastRecHitContainer
void TrackerStationStarting()
std::unique_ptr< H_BeamLine > m_beamlineCTPPS2
std::string beam2filename
void ProjectToToF(const double x1, const double y1, const double x2, const double y2, double &xt, double &yt)
std::vector< int > recCellId_B
std::vector< double > ppsY_
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
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
static const double um_to_cm
std::unique_ptr< CTPPSTrkDetector > det1F
static const double mm_to_um
edm::EDGetTokenT< CTPPSFastRecHitContainer > _recHitToken
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
static constexpr float b2
const GeomDet * recHitDet(const TrackingRecHit &hit, const TrackingGeometry *geom)
Geom::Theta< T > theta() const
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< CTPPSFastTrack > CTPPSFastTrackContainer
void setcellid(unsigned int cellid)
void ReadRecHits(edm::Handle< CTPPSFastRecHitContainer > &)
static constexpr float b1
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)