CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
L1TrackVertexAssociationProducer Class Reference

#include <L1Trigger/L1TTrackMatch/plugins/L1TrackVertexAssociationProducer.cc>

Inheritance diagram for L1TrackVertexAssociationProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  TTTrackDeltaZMaxSelector
 
struct  TTTrackWordDeltaZMaxSelector
 
struct  TTTrackWordLinkLimitSelector
 

Public Member Functions

 L1TrackVertexAssociationProducer (const edm::ParameterSet &)
 
 ~L1TrackVertexAssociationProducer () override
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

enum  TrackBitWidths { kPtSize = TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, kPtMagSize = 9, kEtaSize = TTTrack_TrackWord::TrackBitWidths::kTanlSize, kEtaMagSize = 3 }
 
typedef edm::Handle< TTTrackCollectionTypeTTTrackCollectionHandle
 
typedef std::vector< TTTrackTypeTTTrackCollectionType
 
typedef edm::RefVector< TTTrackCollectionTypeTTTrackRefCollectionType
 
typedef std::unique_ptr< TTTrackRefCollectionTypeTTTrackRefCollectionUPtr
 
typedef TTTrack< Ref_Phase2TrackerDigi_TTTrackType
 

Private Member Functions

void printDebugInfo (const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksHandle, const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksEmulationHandle, const TTTrackRefCollectionUPtr &vTTTrackAssociatedOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedEmulationOutput) const
 
void printTrackInfo (edm::LogInfo &log, const TTTrackType &track, bool printEmulation=false) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const edm::ParameterSet cutSet_
 
int debug_
 
std::vector< double > deltaZMax_
 
std::vector< double > deltaZMaxEtaBounds_
 
const unsigned int fwNTrackSetsTVA_
 
const edm::EDGetTokenT< TTTrackRefCollectionTypel1SelectedTracksEmulationToken_
 
const edm::EDGetTokenT< TTTrackRefCollectionTypel1SelectedTracksToken_
 
const edm::EDGetTokenT< TTTrackCollectionTypel1TracksToken_
 
const edm::EDGetTokenT< l1t::VertexWordCollectionl1VerticesEmulationToken_
 
const edm::EDGetTokenT< l1t::VertexCollectionl1VerticesToken_
 
const std::string outputCollectionName_
 
const bool processEmulatedTracks_
 
const bool processSimulatedTracks_
 
const double useDisplacedTracksDeltaZOverride_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Selects a set of L1Tracks based on a set of predefined criteria.

Implementation: Inputs: std::vector<TTTrack> - Each floating point TTTrack inside this collection inherits from a bit-accurate TTTrack_TrackWord, used for emulation purposes. Outputs: std::vector<TTTrack> - A collection of TTTracks selected from cuts on the TTTrack properties std::vector<TTTrack> - A collection of TTTracks selected from cuts on the TTTrack_TrackWord properties

Definition at line 71 of file L1TrackVertexAssociationProducer.cc.

Member Typedef Documentation

◆ TTTrackCollectionHandle

Definition at line 90 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackCollectionType

Definition at line 89 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackRefCollectionType

Definition at line 91 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackRefCollectionUPtr

Definition at line 92 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackType

Definition at line 88 of file L1TrackVertexAssociationProducer.cc.

Member Enumeration Documentation

◆ TrackBitWidths

Enumerator
kPtSize 
kPtMagSize 
kEtaSize 
kEtaMagSize 

Definition at line 81 of file L1TrackVertexAssociationProducer.cc.

81  {
82  kPtSize = TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, // Width of pt
83  kPtMagSize = 9, // Width of pt magnitude (unsigned)
84  kEtaSize = TTTrack_TrackWord::TrackBitWidths::kTanlSize, // Width of eta
85  kEtaMagSize = 3, // Width of eta magnitude (signed)
86  };

Constructor & Destructor Documentation

◆ L1TrackVertexAssociationProducer()

L1TrackVertexAssociationProducer::L1TrackVertexAssociationProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 218 of file L1TrackVertexAssociationProducer.cc.

References deltaZMax_, deltaZMaxEtaBounds_, Exception, outputCollectionName_, processEmulatedTracks_, processSimulatedTracks_, and useDisplacedTracksDeltaZOverride_.

219  : processSimulatedTracks_(iConfig.getParameter<bool>("processSimulatedTracks")),
220  processEmulatedTracks_(iConfig.getParameter<bool>("processEmulatedTracks")),
221  l1TracksToken_(consumes<TTTrackCollectionType>(iConfig.getParameter<edm::InputTag>("l1TracksInputTag"))),
223  ? consumes<l1t::VertexCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesInputTag"))
227  ? consumes<TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>("l1SelectedTracksInputTag"))
231  ? consumes<l1t::VertexWordCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesEmulationInputTag"))
234  ? consumes<TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>(
235  "l1SelectedTracksEmulationInputTag"))
237  outputCollectionName_(iConfig.getParameter<std::string>("outputCollectionName")),
238  cutSet_(iConfig.getParameter<edm::ParameterSet>("cutSet")),
239 
240  deltaZMaxEtaBounds_(cutSet_.getParameter<std::vector<double>>("deltaZMaxEtaBounds")),
241  deltaZMax_(cutSet_.getParameter<std::vector<double>>("deltaZMax")),
242  useDisplacedTracksDeltaZOverride_(iConfig.getParameter<double>("useDisplacedTracksDeltaZOverride")),
243  fwNTrackSetsTVA_(iConfig.getParameter<unsigned int>("fwNTrackSetsTVA")),
244  debug_(iConfig.getParameter<int>("debug")) {
245  // Confirm the the configuration makes sense
247  throw cms::Exception("You must process at least one of the track collections (simulated or emulated).");
248  }
249 
250  if (deltaZMax_.size() != deltaZMaxEtaBounds_.size() - 1) {
251  throw cms::Exception("The number of deltaZ cuts does not match the number of eta bins!");
252  }
253 
255  deltaZMax_ = std::vector<double>(deltaZMax_.size(), useDisplacedTracksDeltaZOverride_);
256  }
257 
258  // Get additional input tags and define the EDM output based on the previous configuration parameters
260  produces<TTTrackRefCollectionType>(outputCollectionName_);
262  produces<TTTrackRefCollectionType>(outputCollectionName_ + "Emulation");
263 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< TTTrackCollectionType > l1TracksToken_
const edm::EDGetTokenT< l1t::VertexCollection > l1VerticesToken_
const edm::EDGetTokenT< TTTrackRefCollectionType > l1SelectedTracksToken_
const edm::EDGetTokenT< l1t::VertexWordCollection > l1VerticesEmulationToken_
const edm::EDGetTokenT< TTTrackRefCollectionType > l1SelectedTracksEmulationToken_

◆ ~L1TrackVertexAssociationProducer()

L1TrackVertexAssociationProducer::~L1TrackVertexAssociationProducer ( )
override

Definition at line 265 of file L1TrackVertexAssociationProducer.cc.

265 {}

Member Function Documentation

◆ fillDescriptions()

void L1TrackVertexAssociationProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 482 of file L1TrackVertexAssociationProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

482  {
484  desc.add<edm::InputTag>("l1TracksInputTag", edm::InputTag("l1tGTTInputProducer", "Level1TTTracksConverted"));
485  desc.add<edm::InputTag>("l1SelectedTracksInputTag",
486  edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"));
487  desc.add<edm::InputTag>("l1SelectedTracksEmulationInputTag",
488  edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"));
489  desc.add<edm::InputTag>("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "L1Vertices"));
490  desc.add<edm::InputTag>("l1VerticesEmulationInputTag",
491  edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"));
492  desc.add<std::string>("outputCollectionName", "Level1TTTracksSelectedAssociated");
493  {
494  edm::ParameterSetDescription descCutSet;
495  descCutSet.add<std::vector<double>>("deltaZMaxEtaBounds", {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4})
496  ->setComment("these values define the bin boundaries in |eta|");
497  descCutSet.add<std::vector<double>>("deltaZMax", {0.37, 0.50, 0.60, 0.75, 1.00, 1.60})
498  ->setComment(
499  "delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, "
500  "[cm]");
501  desc.add<edm::ParameterSetDescription>("cutSet", descCutSet);
502  }
503  desc.add<double>("useDisplacedTracksDeltaZOverride", -1.0)
504  ->setComment("override the deltaZ cut value for displaced tracks");
505  desc.add<bool>("processSimulatedTracks", true)
506  ->setComment("return selected tracks after cutting on the floating point values");
507  desc.add<bool>("processEmulatedTracks", true)
508  ->setComment("return selected tracks after cutting on the bitwise emulated values");
509  desc.add<unsigned int>("fwNTrackSetsTVA", 94)->setComment("firmware limit on processed tracks per GTT input link");
510  desc.add<int>("debug", 0)->setComment("Verbosity levels: 0, 1, 2, 3");
511  descriptions.addWithDefaultLabel(desc);
512 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ printDebugInfo()

void L1TrackVertexAssociationProducer::printDebugInfo ( const edm::Handle< TTTrackRefCollectionType > &  l1SelectedTracksHandle,
const edm::Handle< TTTrackRefCollectionType > &  l1SelectedTracksEmulationHandle,
const TTTrackRefCollectionUPtr vTTTrackAssociatedOutput,
const TTTrackRefCollectionUPtr vTTTrackAssociatedEmulationOutput 
) const
private

Definition at line 271 of file L1TrackVertexAssociationProducer.cc.

References edm::RefVector< C, T, F >::begin(), debug_, edm::RefVector< C, T, F >::end(), dqm-mbProfile::log, printTrackInfo(), processEmulatedTracks_, processSimulatedTracks_, DBoxMetadataHelper::set_difference(), and HLT_2024v14_cff::track.

Referenced by produce().

275  {
276  edm::LogInfo log("L1TrackVertexAssociationProducer");
278  log << "The original selected track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are "
279  "... \n";
280  for (const auto& track : *l1SelectedTracksHandle) {
281  printTrackInfo(log, *track, debug_ >= 4);
282  }
283  log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksHandle->size() << "\n\n";
284  }
286  log << "The original selected emulated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) "
287  "values are ... \n";
288  for (const auto& track : *l1SelectedTracksEmulationHandle) {
289  printTrackInfo(log, *track, debug_ >= 4);
290  }
291  log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksEmulationHandle->size() << "\n\n";
292  }
294  TTTrackRefCollectionType inSimButNotEmu;
295  TTTrackRefCollectionType inEmuButNotSim;
296  std::set_difference(l1SelectedTracksHandle->begin(),
297  l1SelectedTracksHandle->end(),
298  l1SelectedTracksEmulationHandle->begin(),
299  l1SelectedTracksEmulationHandle->end(),
300  std::back_inserter(inSimButNotEmu));
301  std::set_difference(l1SelectedTracksEmulationHandle->begin(),
302  l1SelectedTracksEmulationHandle->end(),
303  l1SelectedTracksHandle->begin(),
304  l1SelectedTracksHandle->end(),
305  std::back_inserter(inEmuButNotSim));
306  log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected "
307  "by cutting on the emulated values ... \n";
308  for (const auto& track : inSimButNotEmu) {
309  printTrackInfo(log, *track, debug_ >= 3);
310  }
311  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
312  << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected "
313  "by cutting on the simulated values ... \n";
314  for (const auto& track : inEmuButNotSim) {
315  printTrackInfo(log, *track, debug_ >= 3);
316  }
317  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
318  }
320  log << "The selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, "
321  "chi2rphi, z0) values are ... \n";
322  for (const auto& track : *vTTTrackAssociatedOutput) {
323  printTrackInfo(log, *track, debug_ >= 4);
324  }
325  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedOutput->size() << "\n\n";
326  }
328  log << "The emulation selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, "
329  "chi2rz, chi2rphi, z0) values are "
330  "... \n";
331  for (const auto& track : *vTTTrackAssociatedEmulationOutput) {
332  printTrackInfo(log, *track, debug_ >= 4);
333  }
334  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedEmulationOutput->size() << "\n\n";
335  }
337  TTTrackRefCollectionType inSimButNotEmu;
338  TTTrackRefCollectionType inEmuButNotSim;
339  std::set_difference(vTTTrackAssociatedOutput->begin(),
340  vTTTrackAssociatedOutput->end(),
341  vTTTrackAssociatedEmulationOutput->begin(),
342  vTTTrackAssociatedEmulationOutput->end(),
343  std::back_inserter(inSimButNotEmu));
344  std::set_difference(vTTTrackAssociatedEmulationOutput->begin(),
345  vTTTrackAssociatedEmulationOutput->end(),
346  vTTTrackAssociatedOutput->begin(),
347  vTTTrackAssociatedOutput->end(),
348  std::back_inserter(inEmuButNotSim));
349  log << "The set of vertex associated tracks selected via cuts on the simulated values which are not in the set of "
350  "tracks selected "
351  "by cutting on the emulated values ... \n";
352  for (const auto& track : inSimButNotEmu) {
353  printTrackInfo(log, *track, debug_ >= 3);
354  }
355  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
356  << "The set of vertex associated tracks selected via cuts on the emulated values which are not in the set of "
357  "tracks selected "
358  "by cutting on the simulated values ... \n";
359  for (const auto& track : inEmuButNotSim) {
360  printTrackInfo(log, *track, debug_ >= 3);
361  }
362  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
363  }
364 }
void printTrackInfo(edm::LogInfo &log, const TTTrackType &track, bool printEmulation=false) const
edm::RefVector< TTTrackCollectionType > TTTrackRefCollectionType
std::vector< std::string > set_difference(std::vector< std::string > const &v1, std::vector< std::string > const &v2)

◆ printTrackInfo()

void L1TrackVertexAssociationProducer::printTrackInfo ( edm::LogInfo log,
const TTTrackType track,
bool  printEmulation = false 
) const
private

Definition at line 366 of file L1TrackVertexAssociationProducer.cc.

References dqm-mbProfile::log, TTTrack_TrackWord::stepPhi0, TTTrack_TrackWord::stepZ0, and HLT_2024v14_cff::track.

Referenced by printDebugInfo().

368  {
369  log << "\t(" << track.momentum().perp() << ", " << track.momentum().eta() << ", " << track.momentum().phi() << ", "
370  << track.getStubRefs().size() << ", " << track.stubPtConsistency() << ", " << track.chi2ZRed() << ", "
371  << track.chi2XYRed() << ", " << track.z0() << ")\n";
372 
373  if (printEmulation) {
374  ap_uint<TrackBitWidths::kPtSize> ptEmulationBits = track.getTrackWord()(
375  TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB);
376  ap_ufixed<TrackBitWidths::kPtSize, TrackBitWidths::kPtMagSize> ptEmulation;
377  ptEmulation.V = ptEmulationBits.range();
378  TTTrack_TrackWord::tanl_t etaEmulationBits = track.getTanlWord();
379  ap_fixed<TrackBitWidths::kEtaSize, TrackBitWidths::kEtaMagSize> etaEmulation;
380  etaEmulation.V = etaEmulationBits.range();
381  double floatTkZ0 = track.undigitizeSignedValue(
382  track.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0);
383  double floatTkPhi = track.undigitizeSignedValue(
384  track.getPhiBits(), TTTrack_TrackWord::TrackBitWidths::kPhiSize, TTTrack_TrackWord::stepPhi0, 0.0);
385  log << "\t\t(" << ptEmulation.to_double() << ", " << etaEmulation.to_double() << ", " << floatTkPhi << ", "
386  << track.getNStubs() << ", " << track.getBendChi2() << ", " << track.getChi2RZ() << ", " << track.getChi2RPhi()
387  << ", " << floatTkZ0 << ")\n";
388  }
389 }
static constexpr double stepPhi0
ap_uint< TrackBitWidths::kTanlSize > tanl_t
static constexpr double stepZ0

◆ produce()

void L1TrackVertexAssociationProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 392 of file L1TrackVertexAssociationProducer.cc.

References edm::RefVector< C, T, F >::begin(), debug_, deltaZMax_, deltaZMaxEtaBounds_, edm::RefVector< C, T, F >::end(), fwNTrackSetsTVA_, mps_fire::i, iEvent, l1SelectedTracksEmulationToken_, l1SelectedTracksToken_, l1TracksToken_, l1VerticesEmulationToken_, l1VerticesToken_, L1TrackVertexAssociationProducer::TTTrackWordLinkLimitSelector::log(), eostools::move(), outputCollectionName_, printDebugInfo(), processEmulatedTracks_, processSimulatedTracks_, HLT_2024v14_cff::track, l1t::Vertex::z0(), and l1t::VertexWord::z0().

392  {
393  auto vTTTrackAssociatedOutput = std::make_unique<TTTrackRefCollectionType>();
394  auto vTTTrackAssociatedEmulationOutput = std::make_unique<TTTrackRefCollectionType>();
395 
396  TTTrackCollectionHandle l1TracksHandle;
397  edm::Handle<TTTrackRefCollectionType> l1SelectedTracksHandle;
398  edm::Handle<TTTrackRefCollectionType> l1SelectedTracksEmulationHandle;
399  edm::Handle<l1t::VertexCollection> l1VerticesHandle;
400  edm::Handle<l1t::VertexWordCollection> l1VerticesEmulationHandle;
401 
402  l1t::Vertex leadingVertex;
403  l1t::VertexWord leadingEmulationVertex;
404 
405  TTTrackWordLinkLimitSelector linkLimitSel(fwNTrackSetsTVA_); //stateful functor for simulated tracks
406  TTTrackWordLinkLimitSelector linkLimitSelEmu(fwNTrackSetsTVA_); //stateful functor for emulated tracks
407 
408  TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_);
409  TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_);
410 
411  iEvent.getByToken(l1TracksToken_, l1TracksHandle);
412  size_t nOutputApproximate = l1TracksHandle->size();
413 
415  iEvent.getByToken(l1SelectedTracksToken_, l1SelectedTracksHandle);
416  iEvent.getByToken(l1VerticesToken_, l1VerticesHandle);
417  leadingVertex = l1VerticesHandle->at(0);
418  if (debug_ >= 2) {
419  edm::LogInfo("L1TrackVertexAssociationProducer") << "leading vertex z0 = " << leadingVertex.z0();
420  }
421  vTTTrackAssociatedOutput->reserve(nOutputApproximate);
422  }
424  iEvent.getByToken(l1SelectedTracksEmulationToken_, l1SelectedTracksEmulationHandle);
425  iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle);
426  leadingEmulationVertex = l1VerticesEmulationHandle->at(0);
427  if (debug_ >= 2) {
428  edm::LogInfo("L1TrackVertexAssociationProducer")
429  << "leading emulation vertex z0 = " << leadingEmulationVertex.z0();
430  }
431  vTTTrackAssociatedEmulationOutput->reserve(nOutputApproximate);
432  }
433  for (size_t i = 0; i < nOutputApproximate; i++) {
434  const auto& track = l1TracksHandle->at(i);
436  // Limit the number of processed tracks according to the firmware capability: must be run on non-selected tracks (i.e. GTTConverted tracks)
437  bool passLinkLimit = linkLimitSel(track);
438  // Only match Selected tracks, by testing that the track is in the SelectedTracks collection
439  auto itr = std::find_if(l1SelectedTracksHandle->begin(), l1SelectedTracksHandle->end(), [track](const auto& ref) {
440  return (*ref).getTrackWord() == track.getTrackWord();
441  });
442  bool passSelection = (itr != l1SelectedTracksHandle->end());
443  // Associate tracks based on the simulation delta Z
444  if (passLinkLimit && passSelection && deltaZSel(track, leadingVertex)) {
445  vTTTrackAssociatedOutput->push_back(TTTrackRef(l1TracksHandle, i));
446  }
447  } //end if (processSimulatedTracks_)
449  // Limit the number of processed tracks according to the firmware capability: must be run on non-selected tracks (i.e. GTTConverted tracks)
450  bool passLinkLimitEmu = linkLimitSelEmu(track);
451  // Only match Selected tracks, by testing that the track is in the SelectedTracks collection
452  auto itrEmu = std::find_if(l1SelectedTracksEmulationHandle->begin(),
453  l1SelectedTracksEmulationHandle->end(),
454  [track](const auto& ref) { return (*ref).getTrackWord() == track.getTrackWord(); });
455  bool passSelectionEmu = (itrEmu != l1SelectedTracksEmulationHandle->end());
456  // Associated tracks based on the bitwise accurate TTTrack_TrackWord
457  if (passLinkLimitEmu && passSelectionEmu && deltaZSelEmu(track, l1VerticesEmulationHandle->at(0))) {
458  vTTTrackAssociatedEmulationOutput->push_back(TTTrackRef(l1TracksHandle, i));
459  } //end block for satisfying LinkLimitEmu and SelectionEmu criteria
460  } //end if (processEmulatedTracks_)
461  } //end loop over input converted tracks
462 
464  iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_);
465  }
466 
468  iEvent.put(std::move(vTTTrackAssociatedEmulationOutput), outputCollectionName_ + "Emulation");
469  if (debug_ >= 2)
470  linkLimitSelEmu.log();
471  }
472 
474  printDebugInfo(l1SelectedTracksHandle,
475  l1SelectedTracksEmulationHandle,
476  vTTTrackAssociatedOutput,
477  vTTTrackAssociatedEmulationOutput);
478  }
479 }
const edm::EDGetTokenT< TTTrackCollectionType > l1TracksToken_
const edm::EDGetTokenT< l1t::VertexCollection > l1VerticesToken_
const edm::EDGetTokenT< TTTrackRefCollectionType > l1SelectedTracksToken_
int iEvent
Definition: GenABIO.cc:224
edm::Handle< TTTrackCollectionType > TTTrackCollectionHandle
Log< level::Info, false > LogInfo
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
void printDebugInfo(const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksHandle, const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksEmulationHandle, const TTTrackRefCollectionUPtr &vTTTrackAssociatedOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedEmulationOutput) const
double z0() const
Definition: VertexWord.h:158
const edm::EDGetTokenT< l1t::VertexWordCollection > l1VerticesEmulationToken_
float z0() const
Definition: Vertex.h:21
edm::Ref< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > >, TTTrack< Ref_Phase2TrackerDigi_ > > TTTrackRef
Definition: TTTypes.h:51
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
const edm::EDGetTokenT< TTTrackRefCollectionType > l1SelectedTracksEmulationToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ cutSet_

const edm::ParameterSet L1TrackVertexAssociationProducer::cutSet_
private

Definition at line 207 of file L1TrackVertexAssociationProducer.cc.

◆ debug_

int L1TrackVertexAssociationProducer::debug_
private

Definition at line 212 of file L1TrackVertexAssociationProducer.cc.

Referenced by printDebugInfo(), and produce().

◆ deltaZMax_

std::vector<double> L1TrackVertexAssociationProducer::deltaZMax_
private

◆ deltaZMaxEtaBounds_

std::vector<double> L1TrackVertexAssociationProducer::deltaZMaxEtaBounds_
private

◆ fwNTrackSetsTVA_

const unsigned int L1TrackVertexAssociationProducer::fwNTrackSetsTVA_
private

Definition at line 211 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1SelectedTracksEmulationToken_

const edm::EDGetTokenT<TTTrackRefCollectionType> L1TrackVertexAssociationProducer::l1SelectedTracksEmulationToken_
private

Definition at line 205 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1SelectedTracksToken_

const edm::EDGetTokenT<TTTrackRefCollectionType> L1TrackVertexAssociationProducer::l1SelectedTracksToken_
private

Definition at line 203 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1TracksToken_

const edm::EDGetTokenT<TTTrackCollectionType> L1TrackVertexAssociationProducer::l1TracksToken_
private

Definition at line 201 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1VerticesEmulationToken_

const edm::EDGetTokenT<l1t::VertexWordCollection> L1TrackVertexAssociationProducer::l1VerticesEmulationToken_
private

Definition at line 204 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1VerticesToken_

const edm::EDGetTokenT<l1t::VertexCollection> L1TrackVertexAssociationProducer::l1VerticesToken_
private

Definition at line 202 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ outputCollectionName_

const std::string L1TrackVertexAssociationProducer::outputCollectionName_
private

◆ processEmulatedTracks_

const bool L1TrackVertexAssociationProducer::processEmulatedTracks_
private

◆ processSimulatedTracks_

const bool L1TrackVertexAssociationProducer::processSimulatedTracks_
private

◆ useDisplacedTracksDeltaZOverride_

const double L1TrackVertexAssociationProducer::useDisplacedTracksDeltaZOverride_
private