122 : trk1_pt_(iConfig.getParameter<double>(
"trk1_ptMin")),
123 trk1_eta_(iConfig.getParameter<double>(
"trk1_absEtaMax")),
124 trk1_mva_(iConfig.getParameter<double>(
"trk1_mvaMin")),
125 trk1_nstub_(iConfig.getParameter<
int>(
"trk1_nstubMin")),
126 trk1_dz_(iConfig.getParameter<double>(
"trk1_dzMax")),
127 trk1_mass_(iConfig.getParameter<double>(
"trk1_mass")),
128 trk2_pt_(iConfig.getParameter<double>(
"trk2_ptMin")),
129 trk2_eta_(iConfig.getParameter<double>(
"trk2_absEtaMax")),
130 trk2_mva_(iConfig.getParameter<double>(
"trk2_mvaMin")),
131 trk2_nstub_(iConfig.getParameter<
int>(
"trk2_nstubMin")),
132 trk2_dz_(iConfig.getParameter<double>(
"trk2_dzMax")),
133 trk2_mass_(iConfig.getParameter<double>(
"trk2_mass")),
134 trk3_pt_(iConfig.getParameter<double>(
"trk3_ptMin")),
135 trk3_eta_(iConfig.getParameter<double>(
"trk3_absEtaMax")),
136 trk3_mva_(iConfig.getParameter<double>(
"trk3_mvaMin")),
137 trk3_nstub_(iConfig.getParameter<
int>(
"trk3_nstubMin")),
138 trk3_dz_(iConfig.getParameter<double>(
"trk3_dzMax")),
139 trk3_mass_(iConfig.getParameter<double>(
"trk3_mass")),
140 displaced_(iConfig.getParameter<
bool>(
"displaced")),
141 triplet_massMin_(iConfig.getParameter<double>(
"triplet_massMin")),
142 triplet_massMax_(iConfig.getParameter<double>(
"triplet_massMax")),
143 triplet_ptMin_(iConfig.getParameter<double>(
"triplet_ptMin")),
144 triplet_ptMax_(iConfig.getParameter<double>(
"triplet_ptMax")),
145 triplet_etaMin_(iConfig.getParameter<double>(
"triplet_absEtaMin")),
146 triplet_etaMax_(iConfig.getParameter<double>(
"triplet_absEtaMax")),
147 triplet_abscharge_(iConfig.getParameter<
int>(
"triplet_absCharge")),
148 triplet_massOver_(iConfig.getParameter<double>(
"triplet_massOverflow")),
149 pair1_massMin_(iConfig.getParameter<double>(
"pair1_massMin")),
150 pair1_massMax_(iConfig.getParameter<double>(
"pair1_massMax")),
151 pair2_massMin_(iConfig.getParameter<double>(
"pair2_massMin")),
152 pair2_massMax_(iConfig.getParameter<double>(
"pair2_massMax")),
153 pair1_dzMin_(iConfig.getParameter<double>(
"pair1_dzMin")),
154 pair1_dzMax_(iConfig.getParameter<double>(
"pair1_dzMax")),
155 pair2_dzMin_(iConfig.getParameter<double>(
"pair2_dzMin")),
156 pair2_dzMax_(iConfig.getParameter<double>(
"pair2_dzMax")),
157 use_float_track_precision_(iConfig.getParameter<
bool>(
"float_precision")),
161 produces<l1t::TkTripletCollection>(
"L1TrackTripletExtended");
162 produces<l1t::TkTripletWordCollection>(
"L1TrackTripletWordExtended");
164 produces<l1t::TkTripletCollection>(
"L1TrackTriplet");
165 produces<l1t::TkTripletWordCollection>(
"L1TrackTripletWord");
179 double PVz = (PVtx->at(0)).
z0();
185 OutputDigisName +=
"Extended";
187 if (TTTrackHandle->
size() < 3) {
194 L1track trk1{-99, -99, -99, -99, -99, -99, -99, 0};
195 L1track trk2{-99, -99, -99, -99, -99, -99, -99, 0};
196 L1track trk3{-99, -99, -99, -99, -99, -99, -99, 0};
198 int current_track_idx = -1;
199 for (
auto current_track : *TTTrackHandle) {
200 current_track_idx += 1;
201 double current_track_pt = 0;
203 current_track_pt = current_track->momentum().perp();
206 if (current_track_pt < trk1.Pt)
211 trk1.Pt = current_track->momentum().perp();
212 trk1.Eta = current_track->eta();
213 trk1.Phi = current_track->phi();
214 trk1.Charge = (
int)(current_track->rInv() / fabs(current_track->rInv()));
215 trk1.MVA = current_track->trkMVA1();
216 trk1.Nstubs = current_track->getStubRefs().size();
217 trk1.Z0 = current_track->z0();
218 trk1.Index = current_track_idx;
223 trk1.Charge = (
int)(current_track->rInv() / fabs(current_track->rInv()));
224 trk1.MVA = current_track->trkMVA1();
225 trk1.Nstubs = current_track->getStubRefs().size();
227 trk1.Index = current_track_idx;
235 if (!track1_pass || !track2_pass || !track3_pass) {
246 bool event_pass =
true;
249 double triplet_mass = (pion1 + pion2 + pion3).M();
252 double triplet_eta = (pion1 + pion2 + pion3).Eta();
253 double triplet_pt = (pion1 + pion2 + pion3).Pt();
254 int triplet_charge = trk1.Charge + trk2.Charge + trk3.Charge;
255 std::vector<double> pair_masses{(pion1 + pion2).M(), (pion2 + pion3).M(), (pion1 + pion3).M()};
256 std::sort(pair_masses.begin(), pair_masses.end(), [](
auto &
a,
auto &
b) {
return a >
b; });
257 std::vector<double> pair_dzs{fabs(trk1.Z0 - trk2.Z0), fabs(trk2.Z0 - trk3.Z0), fabs(trk1.Z0 - trk3.Z0)};
258 std::sort(pair_dzs.begin(), pair_dzs.end(), [](
auto &
a,
auto &
b) {
return a >
b; });
283 float tripletPx = (pion1 + pion2 + pion3).Pt() *
cos((pion1 + pion2 + pion3).
Phi());
284 float tripletPy = (pion1 + pion2 + pion3).Pt() *
sin((pion1 + pion2 + pion3).
Phi());
285 float tripletPz = (pion1 + pion2 + pion3).Pt() * sinh((pion1 + pion2 + pion3).Eta());
287 sqrt(tripletPx * tripletPx + tripletPy * tripletPy + tripletPz * tripletPz + triplet_mass * triplet_mass);
297 L1TrackTripletContainer->push_back(trkTriplet);
306 TkTripletWord::TkTripletBitWidths::kGlbEtaSize,
310 TkTripletWord::TkTripletBitWidths::kGlbPhiSize,
311 (2. *
std::abs(
M_PI)) / (1 << TkTripletWord::TkTripletBitWidths::kGlbPhiSize));
314 TkTripletWord::TkTripletBitWidths::kChargeSize,
315 TkTripletWord::MAX_CHARGE / (1 << TkTripletWord::TkTripletBitWidths::kChargeSize));
318 TkTripletWord::TkTripletBitWidths::kMassSize,
319 TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kMassSize));
322 TkTripletWord::TkTripletBitWidths::kDiTrackMinMassSize,
323 TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMinMassSize));
326 TkTripletWord::TkTripletBitWidths::kDiTrackMaxMassSize,
327 TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMaxMassSize));
331 TkTripletWord::TkTripletBitWidths::kDiTrackMinZ0Size,
332 TkTripletWord::MAX_Z0 / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMinZ0Size));
335 TkTripletWord::TkTripletBitWidths::kDiTrackMaxZ0Size,
336 TkTripletWord::MAX_Z0 / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMaxZ0Size));
351 L1TrackTripletWordContainer->push_back(bitTriplet);
363 return (
track.Pt >= pt_min_cut) && (fabs(
track.Eta) <= eta_max_cut) && (
track.MVA >= mva_min_cut) &&
364 (fabs(
track.Z0 - PVz) <= dz_max_cut) && (
track.Nstubs >= nstub_min_cut);
368 ap_uint<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1> ptBits =
track.getRinvWord();
370 digipt.V = ptBits.range();
371 return (
double)digipt;
377 digieta.V = etaBits.range();
378 return (
double)digieta;
382 int Sector =
track.phiSector();
383 double sector_phi_value = 0;
385 sector_phi_value = 2.0 *
M_PI * Sector / 9.0;
387 sector_phi_value = (-1.0 *
M_PI +
M_PI / 9.0 + (Sector - 5) * 2.0 *
M_PI / 9.0);
392 local_phiBits.V =
track.getPhiWord();
414 desc.add<
double>(
"trk1_ptMin", -1.0);
415 desc.add<
double>(
"trk1_absEtaMax", 10e7);
416 desc.add<
double>(
"trk1_mvaMin", -1.0);
417 desc.add<
int>(
"trk1_nstubMin", -1);
418 desc.add<
double>(
"trk1_dzMax", 10e7);
419 desc.add<
double>(
"trk1_mass", 0.139);
420 desc.add<
double>(
"trk2_ptMin", -1.0);
421 desc.add<
double>(
"trk2_absEtaMax", 10e7);
422 desc.add<
double>(
"trk2_mvaMin", -1.0);
423 desc.add<
int>(
"trk2_nstubMin", -1);
424 desc.add<
double>(
"trk2_dzMax", 10e7);
425 desc.add<
double>(
"trk2_mass", 0.139);
426 desc.add<
double>(
"trk3_ptMin", -1.0);
427 desc.add<
double>(
"trk3_absEtaMax", 10e7);
428 desc.add<
double>(
"trk3_mvaMin", -1.0);
429 desc.add<
int>(
"trk3_nstubMin", 0);
430 desc.add<
double>(
"trk3_dzMax", 10e7);
431 desc.add<
double>(
"trk3_mass", 0.139);
432 desc.add<
bool>(
"displaced",
false);
433 desc.add<
double>(
"triplet_massMin", -1.0);
434 desc.add<
double>(
"triplet_massMax", 10e7);
435 desc.add<
double>(
"triplet_absEtaMin", -1.0);
436 desc.add<
double>(
"triplet_absEtaMax", 10e7);
437 desc.add<
double>(
"triplet_ptMin", -1.0);
438 desc.add<
double>(
"triplet_ptMax", 10e7);
439 desc.add<
int>(
"triplet_absCharge", -1);
440 desc.add<
double>(
"triplet_massOverflow", 1000);
441 desc.add<
double>(
"pair1_massMin", -1);
442 desc.add<
double>(
"pair1_massMax", 10e7);
443 desc.add<
double>(
"pair2_massMin", -1);
444 desc.add<
double>(
"pair2_massMax", 10e7);
445 desc.add<
double>(
"pair1_dzMin", -1);
446 desc.add<
double>(
"pair1_dzMax", 10e7);
447 desc.add<
double>(
"pair2_dzMin", -1);
448 desc.add<
double>(
"pair2_dzMax", 10e7);
449 desc.add<
bool>(
"float_precision",
false);
450 descriptions.
add(
"l1tTrackTripletEmulator",
desc);
const double pair2_dzMax_
const double triplet_etaMax_
bool TrackSelector(L1track &, double, double, double, double, double, int)
const double pair2_dzMin_
ap_int< kChargeSize > charge_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > PtEtaPhiMLorentzVectorD
Lorentz vector with cartesian internal representation.
const double pair2_massMin_
const int triplet_abscharge_
const unsigned int kExtraGlobalPhiBit
const double triplet_massMin_
const unsigned int DoubleToBit(double value, unsigned int maxBits, double step)
void produce(Event &, const EventSetup &) override
Sin< T >::type sin(const T &t)
ap_int< kGlbEtaSize > glbeta_t
std::vector< TkTriplet > TkTripletCollection
const double BitToDouble(unsigned int bits, unsigned int maxBits, double step)
double FloatPtFromBits(const L1TTTrackType &)
const double triplet_massOver_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const double triplet_ptMin_
double FloatEtaFromBits(const L1TTTrackType &)
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
ap_int< kMassSize > mass_t
ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern
const double pair1_dzMax_
ap_int< kDiTrackMinMassSize > ditrack_minmass_t
const double pair1_massMin_
const double triplet_etaMin_
double FloatZ0FromBits(const L1TTTrackType &)
Cos< T >::type cos(const T &t)
ap_uint< TkTripletBitWidths::kUnassignedSize > unassigned_t
const bool use_float_track_precision_
double FloatPhiFromBits(const L1TTTrackType &)
std::vector< l1t::TkTripletWord > TkTripletWordCollection
const double pair1_dzMin_
Abs< T >::type abs(const T &t)
ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern
#define DEFINE_FWK_MODULE(type)
ap_int< TTTrack_TrackWord::TrackBitWidths::kZ0Size > z0_intern
std::vector< VertexWord > VertexWordCollection
const double triplet_massMax_
L1TrackTripletEmulatorProducer(const ParameterSet &)
std::vector< edm::Ptr< L1TTTrackType > > L1TrkPtrs_
static void fillDescriptions(ConfigurationDescriptions &descriptions)
ap_int< kDiTrackMinZ0Size > ditrack_minz0_t
ap_int< kGlbPhiSize > glbphi_t
edm::RefVector< L1TTTrackCollectionType > L1TTTrackRefCollectionType
const EDGetTokenT< L1TTTrackRefCollectionType > trackToken_
const double triplet_ptMax_
ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
size_type size() const
Size of the RefVector.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
const double pair2_massMax_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static constexpr double stepPhi0
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kExtraGlobalPhiBit > glbphi_intern
const double pair1_massMax_
ap_uint< TrackBitWidths::kTanlSize > tanl_t
ap_int< kDiTrackMaxMassSize > ditrack_maxmass_t
ap_int< kDiTrackMaxZ0Size > ditrack_maxz0_t
const EDGetTokenT< l1t::VertexWordCollection > PVtxToken_
ap_fixed< TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT > glbeta_intern
vector< L1TTTrackType > L1TTTrackCollectionType
static constexpr double stepZ0
ap_uint< kValidSize > valid_t