CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TrackTripletEmulatorProducer Class Reference
Inheritance diagram for L1TrackTripletEmulatorProducer:
edm::stream::EDProducer<>

Classes

struct  L1track
 

Public Types

typedef vector< L1TTTrackTypeL1TTTrackCollectionType
 
typedef edm::RefVector< L1TTTrackCollectionTypeL1TTTrackRefCollectionType
 
typedef TTTrack< Ref_Phase2TrackerDigi_L1TTTrackType
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 L1TrackTripletEmulatorProducer (const ParameterSet &)
 
 ~L1TrackTripletEmulatorProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

double FloatEtaFromBits (const L1TTTrackType &)
 
double FloatPhiFromBits (const L1TTTrackType &)
 
double FloatPtFromBits (const L1TTTrackType &)
 
double FloatZ0FromBits (const L1TTTrackType &)
 
void produce (Event &, const EventSetup &) override
 
bool TrackSelector (L1track &, double, double, double, double, double, int)
 

Private Attributes

const bool displaced_
 
std::vector< edm::Ptr< L1TTTrackType > > L1TrkPtrs_
 
const double pair1_dzMax_
 
const double pair1_dzMin_
 
const double pair1_massMax_
 
const double pair1_massMin_
 
const double pair2_dzMax_
 
const double pair2_dzMin_
 
const double pair2_massMax_
 
const double pair2_massMin_
 
const EDGetTokenT< l1t::VertexWordCollectionPVtxToken_
 
vector< int > tdtrk_
 
const EDGetTokenT< L1TTTrackRefCollectionTypetrackToken_
 
const int triplet_abscharge_
 
const double triplet_etaMax_
 
const double triplet_etaMin_
 
const double triplet_massMax_
 
const double triplet_massMin_
 
const double triplet_massOver_
 
const double triplet_ptMax_
 
const double triplet_ptMin_
 
const double trk1_dz_
 
const double trk1_eta_
 
const double trk1_mass_
 
const double trk1_mva_
 
const double trk1_nstub_
 
const double trk1_pt_
 
const double trk2_dz_
 
const double trk2_eta_
 
const double trk2_mass_
 
const double trk2_mva_
 
const double trk2_nstub_
 
const double trk2_pt_
 
const double trk3_dz_
 
const double trk3_eta_
 
const double trk3_mass_
 
const double trk3_mva_
 
const double trk3_nstub_
 
const double trk3_pt_
 
const bool use_float_track_precision_
 

Detailed Description

Definition at line 46 of file L1TrackTripletEmulatorProducer.cc.

Member Typedef Documentation

◆ L1TTTrackCollectionType

Definition at line 51 of file L1TrackTripletEmulatorProducer.cc.

◆ L1TTTrackRefCollectionType

Definition at line 52 of file L1TrackTripletEmulatorProducer.cc.

◆ L1TTTrackType

Definition at line 50 of file L1TrackTripletEmulatorProducer.cc.

Constructor & Destructor Documentation

◆ L1TrackTripletEmulatorProducer()

L1TrackTripletEmulatorProducer::L1TrackTripletEmulatorProducer ( const ParameterSet iConfig)
explicit

Definition at line 121 of file L1TrackTripletEmulatorProducer.cc.

References displaced_.

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")),
158  trackToken_(consumes<L1TTTrackRefCollectionType>(iConfig.getParameter<InputTag>("L1TrackInputTag"))),
159  PVtxToken_(consumes<l1t::VertexWordCollection>(iConfig.getParameter<InputTag>("L1PVertexInputTag"))) {
160  if (displaced_) {
161  produces<l1t::TkTripletCollection>("L1TrackTripletExtended");
162  produces<l1t::TkTripletWordCollection>("L1TrackTripletWordExtended");
163  } else {
164  produces<l1t::TkTripletCollection>("L1TrackTriplet");
165  produces<l1t::TkTripletWordCollection>("L1TrackTripletWord");
166  }
167 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const EDGetTokenT< L1TTTrackRefCollectionType > trackToken_
const EDGetTokenT< l1t::VertexWordCollection > PVtxToken_

◆ ~L1TrackTripletEmulatorProducer()

L1TrackTripletEmulatorProducer::~L1TrackTripletEmulatorProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void L1TrackTripletEmulatorProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 408 of file L1TrackTripletEmulatorProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

408  {
409  //The following says we do not know what parameters are allowed so do no validation
410  // Please change this to state exactly what you do use, even if it is no parameters
412  desc.add<edm::InputTag>("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
413  desc.add<edm::InputTag>("L1PVertexInputTag", edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"));
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);
451 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ FloatEtaFromBits()

double L1TrackTripletEmulatorProducer::FloatEtaFromBits ( const L1TTTrackType track)
private

Definition at line 374 of file L1TrackTripletEmulatorProducer.cc.

References HLT_2024v14_cff::track.

Referenced by produce().

374  {
375  TTTrack_TrackWord::tanl_t etaBits = track.getTanlWord();
376  glbeta_intern digieta;
377  digieta.V = etaBits.range();
378  return (double)digieta;
379 }
ap_uint< TrackBitWidths::kTanlSize > tanl_t
ap_fixed< TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT > glbeta_intern

◆ FloatPhiFromBits()

double L1TrackTripletEmulatorProducer::FloatPhiFromBits ( const L1TTTrackType track)
private

Definition at line 381 of file L1TrackTripletEmulatorProducer.cc.

References l1ttrackjet::BitToDouble(), l1ttrackjet::DoubleToBit(), l1ttrackjet::kExtraGlobalPhiBit, M_PI, TTTrack_TrackWord::stepPhi0, and HLT_2024v14_cff::track.

Referenced by produce().

381  {
382  int Sector = track.phiSector();
383  double sector_phi_value = 0;
384  if (Sector < 5) {
385  sector_phi_value = 2.0 * M_PI * Sector / 9.0;
386  } else {
387  sector_phi_value = (-1.0 * M_PI + M_PI / 9.0 + (Sector - 5) * 2.0 * M_PI / 9.0);
388  }
389  glbphi_intern trkphiSector = DoubleToBit(
390  sector_phi_value, TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit, TTTrack_TrackWord::stepPhi0);
391  glbphi_intern local_phiBits = 0;
392  local_phiBits.V = track.getPhiWord();
393 
394  glbphi_intern local_phi =
395  DoubleToBit(BitToDouble(local_phiBits, TTTrack_TrackWord::TrackBitWidths::kPhiSize, TTTrack_TrackWord::stepPhi0),
396  TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit,
398  glbphi_intern digiphi = local_phi + trkphiSector;
399  return BitToDouble(
400  digiphi, TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit, TTTrack_TrackWord::stepPhi0);
401 }
const unsigned int kExtraGlobalPhiBit
const unsigned int DoubleToBit(double value, unsigned int maxBits, double step)
const double BitToDouble(unsigned int bits, unsigned int maxBits, double step)
#define M_PI
static constexpr double stepPhi0
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kExtraGlobalPhiBit > glbphi_intern

◆ FloatPtFromBits()

double L1TrackTripletEmulatorProducer::FloatPtFromBits ( const L1TTTrackType track)
private

Definition at line 367 of file L1TrackTripletEmulatorProducer.cc.

References HLT_2024v14_cff::track.

Referenced by produce().

367  {
368  ap_uint<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1> ptBits = track.getRinvWord();
369  pt_intern digipt;
370  digipt.V = ptBits.range();
371  return (double)digipt;
372 }
ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern

◆ FloatZ0FromBits()

double L1TrackTripletEmulatorProducer::FloatZ0FromBits ( const L1TTTrackType track)
private

Definition at line 403 of file L1TrackTripletEmulatorProducer.cc.

References l1ttrackjet::BitToDouble(), TTTrack_TrackWord::stepZ0, and HLT_2024v14_cff::track.

Referenced by produce().

403  {
404  z0_intern trkZ = track.getZ0Word();
405  return BitToDouble(trkZ, TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0);
406 }
const double BitToDouble(unsigned int bits, unsigned int maxBits, double step)
ap_int< TTTrack_TrackWord::TrackBitWidths::kZ0Size > z0_intern
static constexpr double stepZ0

◆ produce()

void L1TrackTripletEmulatorProducer::produce ( Event iEvent,
const EventSetup iSetup 
)
overrideprivate

Definition at line 169 of file L1TrackTripletEmulatorProducer.cc.

References a, funct::abs(), b, funct::cos(), displaced_, l1ttrackjet::DoubleToBit(), FloatEtaFromBits(), FloatPhiFromBits(), FloatPtFromBits(), FloatZ0FromBits(), iEvent, createfilelist::int, M_PI, MAX_ETA, eostools::move(), pair1_dzMax_, pair1_dzMin_, pair1_massMax_, pair1_massMin_, pair2_dzMax_, pair2_dzMin_, pair2_massMax_, pair2_massMin_, VtxSmearedParameters_cfi::Phi, PVtxToken_, funct::sin(), edm::RefVector< C, T, F >::size(), jetUpdater_cfi::sort, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, TrackSelector(), trackToken_, triplet_abscharge_, triplet_etaMax_, triplet_etaMin_, triplet_massMax_, triplet_massOver_, triplet_ptMax_, trk1_dz_, trk1_eta_, trk1_mass_, trk1_mva_, trk1_nstub_, trk1_pt_, trk2_dz_, trk2_eta_, trk2_mass_, trk2_mva_, trk2_nstub_, trk2_pt_, trk3_dz_, trk3_eta_, trk3_mass_, trk3_mva_, trk3_nstub_, trk3_pt_, use_float_track_precision_, heppy_batch::val, and ppsFastLocalSimulation_cfi::z0.

169  {
170  unique_ptr<l1t::TkTripletCollection> L1TrackTripletContainer(new l1t::TkTripletCollection);
171  unique_ptr<l1t::TkTripletWordCollection> L1TrackTripletWordContainer(new l1t::TkTripletWordCollection);
172 
173  // Read inputs
175  iEvent.getByToken(trackToken_, TTTrackHandle);
176 
178  iEvent.getByToken(PVtxToken_, PVtx);
179  double PVz = (PVtx->at(0)).z0();
180 
181  std::string OutputDigisName = "L1TrackTriplet";
182  std::string OutputWordName = "L1TrackTripletWord";
183 
184  if (displaced_)
185  OutputDigisName += "Extended";
186 
187  if (TTTrackHandle->size() < 3) {
188  iEvent.put(std::move(L1TrackTripletContainer), OutputDigisName);
189  iEvent.put(std::move(L1TrackTripletWordContainer), OutputWordName);
190  return;
191  }
192 
193  // Finding the 3 highest pT tracks
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};
197 
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();
204  else
205  current_track_pt = FloatPtFromBits(*current_track);
206  if (current_track_pt < trk1.Pt)
207  continue;
208  trk3 = trk2;
209  trk2 = trk1;
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;
219  } else {
220  trk1.Pt = FloatPtFromBits(*current_track);
221  trk1.Eta = FloatEtaFromBits(*current_track);
222  trk1.Phi = FloatPhiFromBits(*current_track);
223  trk1.Charge = (int)(current_track->rInv() / fabs(current_track->rInv()));
224  trk1.MVA = current_track->trkMVA1();
225  trk1.Nstubs = current_track->getStubRefs().size();
226  trk1.Z0 = FloatZ0FromBits(*current_track);
227  trk1.Index = current_track_idx;
228  }
229  }
230 
231  // track selection
232  bool track1_pass = TrackSelector(trk1, PVz, trk1_pt_, trk1_eta_, trk1_mva_, trk1_dz_, trk1_nstub_);
233  bool track2_pass = TrackSelector(trk2, PVz, trk2_pt_, trk2_eta_, trk2_mva_, trk2_dz_, trk2_nstub_);
234  bool track3_pass = TrackSelector(trk3, PVz, trk3_pt_, trk3_eta_, trk3_mva_, trk3_dz_, trk3_nstub_);
235  if (!track1_pass || !track2_pass || !track3_pass) {
236  iEvent.put(std::move(L1TrackTripletContainer), OutputDigisName);
237  iEvent.put(std::move(L1TrackTripletWordContainer), OutputWordName);
238  return;
239  }
240 
241  // create Lorentz Vectors
242  math::PtEtaPhiMLorentzVectorD pion1(trk1.Pt, trk1.Eta, trk1.Phi, trk1_mass_);
243  math::PtEtaPhiMLorentzVectorD pion2(trk2.Pt, trk2.Eta, trk2.Phi, trk2_mass_);
244  math::PtEtaPhiMLorentzVectorD pion3(trk3.Pt, trk3.Eta, trk3.Phi, trk3_mass_);
245 
246  bool event_pass = true;
247 
248  // create triplets
249  double triplet_mass = (pion1 + pion2 + pion3).M();
250  if (triplet_mass > triplet_massOver_)
251  triplet_mass = triplet_massOver_;
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; });
259 
260  //triplet selection
261  if (triplet_mass < triplet_massMin_ || triplet_mass > triplet_massMax_)
262  event_pass = false;
263  if (fabs(triplet_eta) < triplet_etaMin_ || fabs(triplet_eta) > triplet_etaMax_)
264  event_pass = false;
265  if (triplet_pt < triplet_ptMin_ || triplet_pt > triplet_ptMax_)
266  event_pass = false;
267  if (fabs(triplet_charge) != triplet_abscharge_ && triplet_abscharge_ > -1)
268  event_pass = false;
269  if (pair_masses[2] < pair2_massMin_ || pair_masses[2] > pair2_massMax_)
270  event_pass = false;
271  if (pair_masses[0] < pair1_massMin_ || pair_masses[0] > pair1_massMax_)
272  event_pass = false;
273  if (pair_dzs[2] < pair2_dzMin_ || pair_dzs[2] > pair2_dzMax_)
274  event_pass = false;
275  if (pair_dzs[0] < pair1_dzMin_ || pair_dzs[0] > pair1_dzMax_)
276  event_pass = false;
277 
278  if (!event_pass) {
279  iEvent.put(std::move(L1TrackTripletContainer), OutputDigisName);
280  iEvent.put(std::move(L1TrackTripletWordContainer), OutputWordName);
281  return;
282  }
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());
286  float tripletE =
287  sqrt(tripletPx * tripletPx + tripletPy * tripletPy + tripletPz * tripletPz + triplet_mass * triplet_mass);
288  TkTriplet trkTriplet(math::XYZTLorentzVector(tripletPx, tripletPy, tripletPz, tripletE),
289  triplet_charge,
290  pair_masses[0],
291  pair_masses[2],
292  pair_dzs[0],
293  pair_dzs[2],
294  {edm::Ptr<L1TTTrackType>(TTTrackHandle, trk1.Index),
295  edm::Ptr<L1TTTrackType>(TTTrackHandle, trk2.Index),
296  edm::Ptr<L1TTTrackType>(TTTrackHandle, trk3.Index)});
297  L1TrackTripletContainer->push_back(trkTriplet);
298 
299  iEvent.put(std::move(L1TrackTripletContainer), OutputDigisName);
300 
301  // bit assignment
303  l1t::TkTripletWord::pt_t bitPt = pt_intern((pion1 + pion2 + pion3).Pt());
305  DoubleToBit((pion1 + pion2 + pion3).Eta(),
306  TkTripletWord::TkTripletBitWidths::kGlbEtaSize,
307  TkTripletWord::MAX_ETA / (1 << TkTripletWord::TkTripletBitWidths::kGlbEtaSize));
309  DoubleToBit((pion1 + pion2 + pion3).Phi(),
310  TkTripletWord::TkTripletBitWidths::kGlbPhiSize,
311  (2. * std::abs(M_PI)) / (1 << TkTripletWord::TkTripletBitWidths::kGlbPhiSize));
312  l1t::TkTripletWord::charge_t bitCharge =
313  DoubleToBit(double(triplet_charge),
314  TkTripletWord::TkTripletBitWidths::kChargeSize,
315  TkTripletWord::MAX_CHARGE / (1 << TkTripletWord::TkTripletBitWidths::kChargeSize));
317  DoubleToBit((pion1 + pion2 + pion3).M(),
318  TkTripletWord::TkTripletBitWidths::kMassSize,
319  TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kMassSize));
320  l1t::TkTripletWord::ditrack_minmass_t bitDiTrackMinMass =
321  DoubleToBit(pair_masses[2],
322  TkTripletWord::TkTripletBitWidths::kDiTrackMinMassSize,
323  TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMinMassSize));
324  l1t::TkTripletWord::ditrack_maxmass_t bitDiTrackMaxMass =
325  DoubleToBit(pair_masses[0],
326  TkTripletWord::TkTripletBitWidths::kDiTrackMaxMassSize,
327  TkTripletWord::MAX_MASS / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMaxMassSize));
328 
329  l1t::TkTripletWord::ditrack_minz0_t bitDiTrackMinZ0 =
330  DoubleToBit(pair_dzs[2],
331  TkTripletWord::TkTripletBitWidths::kDiTrackMinZ0Size,
332  TkTripletWord::MAX_Z0 / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMinZ0Size));
333  l1t::TkTripletWord::ditrack_maxz0_t bitDiTrackMaxZ0 =
334  DoubleToBit(pair_dzs[0],
335  TkTripletWord::TkTripletBitWidths::kDiTrackMaxZ0Size,
336  TkTripletWord::MAX_Z0 / (1 << TkTripletWord::TkTripletBitWidths::kDiTrackMaxZ0Size));
337 
338  l1t::TkTripletWord::unassigned_t unassigned = 0;
339  l1t::TkTripletWord bitTriplet(val,
340  bitPt,
341  bitEta,
342  bitPhi,
343  bitMass,
344  bitCharge,
345  bitDiTrackMinZ0,
346  bitDiTrackMaxMass,
347  bitDiTrackMinZ0,
348  bitDiTrackMaxZ0,
349  unassigned);
350 
351  L1TrackTripletWordContainer->push_back(bitTriplet);
352 
353  iEvent.put(std::move(L1TrackTripletWordContainer), OutputWordName);
354 }
bool TrackSelector(L1track &, double, double, double, double, double, int)
ap_int< kChargeSize > charge_t
Definition: TkTripletWord.h:76
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > PtEtaPhiMLorentzVectorD
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:10
const unsigned int DoubleToBit(double value, unsigned int maxBits, double step)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ap_int< kGlbEtaSize > glbeta_t
Definition: TkTripletWord.h:73
std::vector< TkTriplet > TkTripletCollection
Definition: TkTripletFwd.h:22
double FloatPtFromBits(const L1TTTrackType &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double FloatEtaFromBits(const L1TTTrackType &)
int iEvent
Definition: GenABIO.cc:224
ap_int< kMassSize > mass_t
Definition: TkTripletWord.h:75
ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern
ap_int< kDiTrackMinMassSize > ditrack_minmass_t
Definition: TkTripletWord.h:77
T sqrt(T t)
Definition: SSEVec.h:23
double FloatZ0FromBits(const L1TTTrackType &)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
ap_uint< TkTripletBitWidths::kUnassignedSize > unassigned_t
Definition: TkTripletWord.h:81
double FloatPhiFromBits(const L1TTTrackType &)
std::vector< l1t::TkTripletWord > TkTripletWordCollection
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ap_int< kDiTrackMinZ0Size > ditrack_minz0_t
Definition: TkTripletWord.h:79
ap_int< kGlbPhiSize > glbphi_t
Definition: TkTripletWord.h:74
#define M_PI
const EDGetTokenT< L1TTTrackRefCollectionType > trackToken_
ap_ufixed< kPtSize, kPtMagSize, AP_TRN, AP_SAT > pt_t
Definition: TkTripletWord.h:72
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
double b
Definition: hdecay.h:120
ap_int< kDiTrackMaxMassSize > ditrack_maxmass_t
Definition: TkTripletWord.h:78
double a
Definition: hdecay.h:121
ap_int< kDiTrackMaxZ0Size > ditrack_maxz0_t
Definition: TkTripletWord.h:80
const EDGetTokenT< l1t::VertexWordCollection > PVtxToken_
def move(src, dest)
Definition: eostools.py:511
ap_uint< kValidSize > valid_t
Definition: TkTripletWord.h:71

◆ TrackSelector()

bool L1TrackTripletEmulatorProducer::TrackSelector ( L1TrackTripletEmulatorProducer::L1track track,
double  PVz,
double  pt_min_cut,
double  eta_max_cut,
double  mva_min_cut,
double  dz_max_cut,
int  nstub_min_cut 
)
private

Definition at line 356 of file L1TrackTripletEmulatorProducer.cc.

References HLT_2024v14_cff::track.

Referenced by produce().

362  {
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);
365 }

Member Data Documentation

◆ displaced_

const bool L1TrackTripletEmulatorProducer::displaced_
private

Definition at line 80 of file L1TrackTripletEmulatorProducer.cc.

Referenced by L1TrackTripletEmulatorProducer(), and produce().

◆ L1TrkPtrs_

std::vector<edm::Ptr<L1TTTrackType> > L1TrackTripletEmulatorProducer::L1TrkPtrs_
private

Definition at line 60 of file L1TrackTripletEmulatorProducer.cc.

◆ pair1_dzMax_

const double L1TrackTripletEmulatorProducer::pair1_dzMax_
private

Definition at line 94 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair1_dzMin_

const double L1TrackTripletEmulatorProducer::pair1_dzMin_
private

Definition at line 93 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair1_massMax_

const double L1TrackTripletEmulatorProducer::pair1_massMax_
private

Definition at line 90 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair1_massMin_

const double L1TrackTripletEmulatorProducer::pair1_massMin_
private

Definition at line 89 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair2_dzMax_

const double L1TrackTripletEmulatorProducer::pair2_dzMax_
private

Definition at line 96 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair2_dzMin_

const double L1TrackTripletEmulatorProducer::pair2_dzMin_
private

Definition at line 95 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair2_massMax_

const double L1TrackTripletEmulatorProducer::pair2_massMax_
private

Definition at line 92 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ pair2_massMin_

const double L1TrackTripletEmulatorProducer::pair2_massMin_
private

Definition at line 91 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ PVtxToken_

const EDGetTokenT<l1t::VertexWordCollection> L1TrackTripletEmulatorProducer::PVtxToken_
private

Definition at line 117 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ tdtrk_

vector<int> L1TrackTripletEmulatorProducer::tdtrk_
private

Definition at line 61 of file L1TrackTripletEmulatorProducer.cc.

◆ trackToken_

const EDGetTokenT<L1TTTrackRefCollectionType> L1TrackTripletEmulatorProducer::trackToken_
private

Definition at line 116 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_abscharge_

const int L1TrackTripletEmulatorProducer::triplet_abscharge_
private

Definition at line 87 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_etaMax_

const double L1TrackTripletEmulatorProducer::triplet_etaMax_
private

Definition at line 86 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_etaMin_

const double L1TrackTripletEmulatorProducer::triplet_etaMin_
private

Definition at line 85 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_massMax_

const double L1TrackTripletEmulatorProducer::triplet_massMax_
private

Definition at line 82 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_massMin_

const double L1TrackTripletEmulatorProducer::triplet_massMin_
private

Definition at line 81 of file L1TrackTripletEmulatorProducer.cc.

◆ triplet_massOver_

const double L1TrackTripletEmulatorProducer::triplet_massOver_
private

Definition at line 88 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_ptMax_

const double L1TrackTripletEmulatorProducer::triplet_ptMax_
private

Definition at line 84 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ triplet_ptMin_

const double L1TrackTripletEmulatorProducer::triplet_ptMin_
private

Definition at line 83 of file L1TrackTripletEmulatorProducer.cc.

◆ trk1_dz_

const double L1TrackTripletEmulatorProducer::trk1_dz_
private

Definition at line 66 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk1_eta_

const double L1TrackTripletEmulatorProducer::trk1_eta_
private

Definition at line 63 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk1_mass_

const double L1TrackTripletEmulatorProducer::trk1_mass_
private

Definition at line 67 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk1_mva_

const double L1TrackTripletEmulatorProducer::trk1_mva_
private

Definition at line 64 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk1_nstub_

const double L1TrackTripletEmulatorProducer::trk1_nstub_
private

Definition at line 65 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk1_pt_

const double L1TrackTripletEmulatorProducer::trk1_pt_
private

Definition at line 62 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_dz_

const double L1TrackTripletEmulatorProducer::trk2_dz_
private

Definition at line 72 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_eta_

const double L1TrackTripletEmulatorProducer::trk2_eta_
private

Definition at line 69 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_mass_

const double L1TrackTripletEmulatorProducer::trk2_mass_
private

Definition at line 73 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_mva_

const double L1TrackTripletEmulatorProducer::trk2_mva_
private

Definition at line 70 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_nstub_

const double L1TrackTripletEmulatorProducer::trk2_nstub_
private

Definition at line 71 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk2_pt_

const double L1TrackTripletEmulatorProducer::trk2_pt_
private

Definition at line 68 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_dz_

const double L1TrackTripletEmulatorProducer::trk3_dz_
private

Definition at line 78 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_eta_

const double L1TrackTripletEmulatorProducer::trk3_eta_
private

Definition at line 75 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_mass_

const double L1TrackTripletEmulatorProducer::trk3_mass_
private

Definition at line 79 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_mva_

const double L1TrackTripletEmulatorProducer::trk3_mva_
private

Definition at line 76 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_nstub_

const double L1TrackTripletEmulatorProducer::trk3_nstub_
private

Definition at line 77 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ trk3_pt_

const double L1TrackTripletEmulatorProducer::trk3_pt_
private

Definition at line 74 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().

◆ use_float_track_precision_

const bool L1TrackTripletEmulatorProducer::use_float_track_precision_
private

Definition at line 97 of file L1TrackTripletEmulatorProducer.cc.

Referenced by produce().