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);
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 DoubleToBit(double value, unsigned int maxBits, double step)
Sin< T >::type sin(const T &t)
ap_int< kGlbEtaSize > glbeta_t
std::vector< TkTriplet > TkTripletCollection
double FloatPtFromBits(const L1TTTrackType &)
const double triplet_massOver_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double FloatEtaFromBits(const 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)
const double triplet_massMax_
ap_int< kDiTrackMinZ0Size > ditrack_minz0_t
ap_int< kGlbPhiSize > glbphi_t
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.
const double pair2_massMax_
const double pair1_massMax_
ap_int< kDiTrackMaxMassSize > ditrack_maxmass_t
ap_int< kDiTrackMaxZ0Size > ditrack_maxz0_t
const EDGetTokenT< l1t::VertexWordCollection > PVtxToken_
ap_uint< kValidSize > valid_t