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;
472 phi = atan2(thy, thx);
478 TLorentzVector
p(
px,
py, pz,
e);