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>(
230 output_tracks->push_back(*
i);
263 for (
unsigned int irecHits = 0; irecHits <
recHits->size(); ++irecHits) {
265 unsigned int detlayerId =
recHitDet->detUnitId();
270 if (detlayerId == 2014314496)
272 else if (detlayerId == 2014838784)
274 else if (detlayerId == 2031091712)
276 else if (detlayerId == 2031616000)
278 else if (detlayerId == 2046820352) {
282 }
else if (detlayerId == 2063597568) {
335 H_RecRPObject*
station =
nullptr;
366 LogDebug(
"CTPPSFastTrackingProducer::SearchTrack:") <<
"thx " << thx <<
" thy " << thy <<
" eloss " << eloss;
371 double ImpPar =
sqrt(x0 * x0 + y0 * y0);
384 if (xi < 0. || xi > 1. || t < 0. || t > 10. ||
pt <= 0.) {
403 H_RecRPObject* pps_station,
double x1,
double y1,
double x2,
double y2,
double& tx,
double& ty,
double& eloss) {
413 pps_station->setPositions(
x1,
y1,
x2,
y2);
414 double energy = pps_station->getE(AM);
417 tx = pps_station->getTXIP();
418 ty = pps_station->getTYIP();
419 eloss = pps_station->getE();
423 int cellId, std::vector<int> vrecCellId, std::vector<double> vrecTof,
bool&
match,
double& recTof) {
424 for (
unsigned int i = 0;
i < vrecCellId.size();
i++) {
425 if (cellId == vrecCellId.at(
i)) {
427 recTof = vrecTof.at(
i);
435 double xi,
t, partP,
pt,
phi, x0, y0, thx, thy, xt, yt, X1d, Y1d, X2d, Y2d;
440 std::vector<double> vToFCellWidth;
441 vToFCellWidth.reserve(8);
442 for (
int i = 0;
i < 8;
i++) {
458 if (
SearchTrack(
i,
j, Direction,
xi,
t, partP,
pt, thx, thy, x0, y0, xt, yt, X1d, Y1d, X2d, Y2d)) {
462 bool matchCellId =
false;
466 }
else if (Direction < 0) {
476 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)
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
#define DEFINE_FWK_MODULE(type)
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.
const GeomDet * recHitDet(const TrackingRecHit &hit, const TrackingGeometry *geom)
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)
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)