41 #include "TLorentzVector.h"
44 #include "H_Parameters.h"
45 #include "H_BeamLine.h"
46 #include "H_RecRPObject.h"
47 #include "H_BeamParticle.h"
64 H_RecRPObject* pps_station,
double x1,
double y1,
double x2,
double y2,
double& tx,
double& ty,
double& eloss);
65 void MatchCellId(
int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof,
bool&
match,
double& recTof);
85 void ProjectToToF(
const double x1,
const double y1,
const double x2,
const double y2,
double& xt,
double& yt) {
111 std::unique_ptr<CTPPSTrkDetector>
det1F;
112 std::unique_ptr<CTPPSTrkDetector>
det1B;
113 std::unique_ptr<CTPPSTrkDetector>
det2F;
114 std::unique_ptr<CTPPSTrkDetector>
det2B;
136 : m_verbosity(
false), fBeamMomentum(0.), fCrossAngleCorr(
false), fCrossingAngleBeam1(0.), fCrossingAngleBeam2(0.) {
138 produces<edm::CTPPSFastTrackContainer>(
"CTPPSFastTrack");
182 LogDebug(
"CTPPSFastTrackingProducer") <<
"CTPPSFastTrackingProducer: WARNING: lengthctpps= " <<
lengthctpps;
190 det1F = std::make_unique<CTPPSTrkDetector>(
192 det2F = std::make_unique<CTPPSTrkDetector>(
194 det1B = std::make_unique<CTPPSTrkDetector>(
196 det2B = std::make_unique<CTPPSTrkDetector>(
200 std::vector<double> vToFCellWidth;
201 vToFCellWidth.reserve(8);
202 for (
int i = 0;
i < 8;
i++) {
206 detToF_F = std::make_unique<CTPPSToFDetector>(
208 detToF_B = std::make_unique<CTPPSToFDetector>(
230 output_tracks->push_back(*
i);
264 for (
unsigned int irecHits = 0; irecHits <
recHits->size(); ++irecHits) {
266 unsigned int detlayerId =
recHitDet->detUnitId();
271 if (detlayerId == 2014314496)
273 else if (detlayerId == 2014838784)
275 else if (detlayerId == 2031091712)
277 else if (detlayerId == 2031616000)
279 else if (detlayerId == 2046820352) {
283 }
else if (detlayerId == 2063597568) {
337 H_RecRPObject*
station =
nullptr;
369 LogDebug(
"CTPPSFastTrackingProducer::SearchTrack:") <<
"thx " << thx <<
" thy " << thy <<
" eloss " << eloss;
374 double ImpPar =
sqrt(x0 * x0 + y0 * y0);
387 if (xi < 0. || xi > 1. || t < 0. || t > 10. ||
pt <= 0.) {
407 H_RecRPObject* pps_station,
double x1,
double y1,
double x2,
double y2,
double& tx,
double& ty,
double& eloss) {
417 pps_station->setPositions(
x1,
y1,
x2,
y2);
418 double energy = pps_station->getE(AM);
421 tx = pps_station->getTXIP();
422 ty = pps_station->getTYIP();
423 eloss = pps_station->getE();
427 int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof,
bool&
match,
double& recTof) {
428 for (
unsigned int i = 0;
i < vrecCellId.size();
i++) {
429 if (cellId == vrecCellId.at(
i)) {
431 recTof = vrecTof.at(
i);
439 double xi,
t, partP,
pt,
phi, x0, y0, thx, thy, xt, yt, X1d, Y1d, X2d, Y2d;
444 std::vector<double> vToFCellWidth;
445 vToFCellWidth.reserve(8);
446 for (
int i = 0;
i < 8;
i++) {
462 if (
SearchTrack(
i,
j,
Direction,
xi,
t, partP,
pt, thx, thy, x0, y0, xt, yt, X1d, Y1d, X2d, Y2d)) {
466 bool matchCellId =
false;
474 phi = atan2(thy, thx);
480 TLorentzVector
p(
px,
py, pz,
e);