CMS 3D CMS Logo

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

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

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

Classes

struct  TTTrackAbsEtaMaxSelector
 
struct  TTTrackAbsZ0MaxSelector
 
struct  TTTrackBendChi2MaxSelector
 
struct  TTTrackChi2RPhiMaxSelector
 
struct  TTTrackChi2RZMaxSelector
 
struct  TTTrackDeltaZMaxSelector
 
struct  TTTrackNPSStubsMinSelector
 
struct  TTTrackNStubsMinSelector
 
struct  TTTrackPtMinSelector
 
struct  TTTrackWordAbsEtaMaxSelector
 
struct  TTTrackWordAbsZ0MaxSelector
 
struct  TTTrackWordBendChi2MaxSelector
 
struct  TTTrackWordChi2RPhiMaxSelector
 
struct  TTTrackWordChi2RZMaxSelector
 
struct  TTTrackWordDeltaZMaxSelector
 
struct  TTTrackWordNStubsMinSelector
 
struct  TTTrackWordPtMinSelector
 

Public Member Functions

 L1TrackSelectionProducer (const edm::ParameterSet &)
 
 ~L1TrackSelectionProducer () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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

typedef TTTrack< Ref_Phase2TrackerDigi_L1Track
 
enum  TrackBitWidths { kPtSize = TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, kPtMagSize = 9, kEtaSize = TTTrack_TrackWord::TrackBitWidths::kTanlSize, kEtaMagSize = 3 }
 
typedef AndSelector< TTTrackBendChi2MaxSelector, TTTrackChi2RZMaxSelector, TTTrackChi2RPhiMaxSelectorTTTrackBendChi2Chi2RZChi2RPhiMaxSelector
 
typedef std::vector< L1TrackTTTrackCollection
 
typedef edm::Handle< TTTrackCollectionTTTrackCollectionHandle
 
typedef AndSelector< TTTrackPtMinSelector, TTTrackAbsEtaMaxSelector, TTTrackAbsZ0MaxSelector, TTTrackNStubsMinSelectorTTTrackPtMinEtaMaxZ0MaxNStubsMinSelector
 
typedef edm::Ref< TTTrackCollectionTTTrackRef
 
typedef edm::RefVector< TTTrackCollectionTTTrackRefCollection
 
typedef std::unique_ptr< TTTrackRefCollectionTTTrackRefCollectionUPtr
 
typedef AndSelector< TTTrackWordBendChi2MaxSelector, TTTrackWordChi2RZMaxSelector, TTTrackWordChi2RPhiMaxSelectorTTTrackWordBendChi2Chi2RZChi2RPhiMaxSelector
 
typedef AndSelector< TTTrackWordPtMinSelector, TTTrackWordAbsEtaMaxSelector, TTTrackWordAbsZ0MaxSelector, TTTrackWordNStubsMinSelectorTTTrackWordPtMinEtaMaxZ0MaxNStubsMinSelector
 

Private Member Functions

void printDebugInfo (const TTTrackCollectionHandle &l1TracksHandle, const TTTrackRefCollectionUPtr &vTTTrackOutput, const TTTrackRefCollectionUPtr &vTTTrackEmulationOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedEmulationOutput) const
 
void printTrackInfo (edm::LogInfo &log, const L1Track &track, bool printEmulation=false) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const double absEtaMax_
 
const double absZ0Max_
 
const double bendChi2Max_
 
const edm::ParameterSet cutSet_
 
int debug_
 
std::vector< double > deltaZMax_
 
std::vector< double > deltaZMaxEtaBounds_
 
bool doDeltaZCutEmu_
 
bool doDeltaZCutSim_
 
const edm::EDGetTokenT< TTTrackCollectionl1TracksToken_
 
edm::EDGetTokenT< l1t::VertexWordCollectionl1VerticesEmulationToken_
 
edm::EDGetTokenT< l1t::VertexCollectionl1VerticesToken_
 
const int nPSStubsMin_
 
const int nStubsMin_
 
const std::string outputCollectionName_
 
bool processEmulatedTracks_
 
bool processSimulatedTracks_
 
const double ptMin_
 
const double reducedChi2RPhiMax_
 
const double reducedChi2RZMax_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 65 of file L1TrackSelectionProducer.cc.

Member Typedef Documentation

◆ L1Track

Definition at line 82 of file L1TrackSelectionProducer.cc.

◆ TTTrackBendChi2Chi2RZChi2RPhiMaxSelector

Definition at line 313 of file L1TrackSelectionProducer.cc.

◆ TTTrackCollection

Definition at line 83 of file L1TrackSelectionProducer.cc.

◆ TTTrackCollectionHandle

Definition at line 84 of file L1TrackSelectionProducer.cc.

◆ TTTrackPtMinEtaMaxZ0MaxNStubsMinSelector

Definition at line 306 of file L1TrackSelectionProducer.cc.

◆ TTTrackRef

Definition at line 85 of file L1TrackSelectionProducer.cc.

◆ TTTrackRefCollection

Definition at line 86 of file L1TrackSelectionProducer.cc.

◆ TTTrackRefCollectionUPtr

Definition at line 87 of file L1TrackSelectionProducer.cc.

◆ TTTrackWordBendChi2Chi2RZChi2RPhiMaxSelector

Definition at line 315 of file L1TrackSelectionProducer.cc.

◆ TTTrackWordPtMinEtaMaxZ0MaxNStubsMinSelector

Definition at line 311 of file L1TrackSelectionProducer.cc.

Member Enumeration Documentation

◆ TrackBitWidths

Enumerator
kPtSize 
kPtMagSize 
kEtaSize 
kEtaMagSize 

Definition at line 75 of file L1TrackSelectionProducer.cc.

75  {
76  kPtSize = TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, // Width of pt
77  kPtMagSize = 9, // Width of pt magnitude (unsigned)
78  kEtaSize = TTTrack_TrackWord::TrackBitWidths::kTanlSize, // Width of eta
79  kEtaMagSize = 3, // Width of eta magnitude (signed)
80  };

Constructor & Destructor Documentation

◆ L1TrackSelectionProducer()

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

Definition at line 335 of file L1TrackSelectionProducer.cc.

References deltaZMax_, deltaZMaxEtaBounds_, doDeltaZCutEmu_, doDeltaZCutSim_, Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), l1VerticesEmulationToken_, l1VerticesToken_, outputCollectionName_, processEmulatedTracks_, processSimulatedTracks_, and useDisplacedTracksDeltaZOverride_.

336  : l1TracksToken_(consumes<TTTrackCollection>(iConfig.getParameter<edm::InputTag>("l1TracksInputTag"))),
337  tTopoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>(edm::ESInputTag("", ""))),
338  outputCollectionName_(iConfig.getParameter<std::string>("outputCollectionName")),
339  cutSet_(iConfig.getParameter<edm::ParameterSet>("cutSet")),
340 
341  ptMin_(cutSet_.getParameter<double>("ptMin")),
342  absEtaMax_(cutSet_.getParameter<double>("absEtaMax")),
343  absZ0Max_(cutSet_.getParameter<double>("absZ0Max")),
344  bendChi2Max_(cutSet_.getParameter<double>("reducedBendChi2Max")),
345  reducedChi2RZMax_(cutSet_.getParameter<double>("reducedChi2RZMax")),
346  reducedChi2RPhiMax_(cutSet_.getParameter<double>("reducedChi2RPhiMax")),
347  nStubsMin_(cutSet_.getParameter<int>("nStubsMin")),
348  nPSStubsMin_(cutSet_.getParameter<int>("nPSStubsMin")),
349  deltaZMaxEtaBounds_(cutSet_.getParameter<std::vector<double>>("deltaZMaxEtaBounds")),
350  deltaZMax_(cutSet_.getParameter<std::vector<double>>("deltaZMax")),
351 
352  useDisplacedTracksDeltaZOverride_(iConfig.getParameter<double>("useDisplacedTracksDeltaZOverride")),
353  processSimulatedTracks_(iConfig.getParameter<bool>("processSimulatedTracks")),
354  processEmulatedTracks_(iConfig.getParameter<bool>("processEmulatedTracks")),
355  debug_(iConfig.getParameter<int>("debug")) {
356  // Confirm the the configuration makes sense
358  throw cms::Exception("You must process at least one of the track collections (simulated or emulated).");
359  }
360 
361  if (deltaZMax_.size() != deltaZMaxEtaBounds_.size() - 1) {
362  throw cms::Exception("The number of deltaZ cuts does not match the number of eta bins!");
363  }
364 
366  deltaZMax_ = std::vector<double>(deltaZMax_.size(), useDisplacedTracksDeltaZOverride_);
367  }
368 
369  // Get additional input tags and define the EDM output based on the previous configuration parameters
370  doDeltaZCutSim_ = false;
371  doDeltaZCutEmu_ = false;
373  produces<TTTrackRefCollection>(outputCollectionName_);
374  if (iConfig.exists("l1VerticesInputTag")) {
375  l1VerticesToken_ = consumes<l1t::VertexCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesInputTag"));
376  doDeltaZCutSim_ = true;
377  produces<TTTrackRefCollection>(outputCollectionName_ + "Associated");
378  }
379  }
381  produces<TTTrackRefCollection>(outputCollectionName_ + "Emulation");
382  if (iConfig.exists("l1VerticesEmulationInputTag")) {
384  consumes<l1t::VertexWordCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesEmulationInputTag"));
385  doDeltaZCutEmu_ = true;
386  produces<TTTrackRefCollection>(outputCollectionName_ + "AssociatedEmulation");
387  }
388  }
389 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< double > deltaZMaxEtaBounds_
edm::EDGetTokenT< l1t::VertexCollection > l1VerticesToken_
const edm::ParameterSet cutSet_
edm::EDGetTokenT< l1t::VertexWordCollection > l1VerticesEmulationToken_
const edm::EDGetTokenT< TTTrackCollection > l1TracksToken_

◆ ~L1TrackSelectionProducer()

L1TrackSelectionProducer::~L1TrackSelectionProducer ( )
override

Definition at line 391 of file L1TrackSelectionProducer.cc.

391 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 611 of file L1TrackSelectionProducer.cc.

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

611  {
612  //L1TrackSelectionProducer
614  desc.add<edm::InputTag>("l1TracksInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
615  desc.addOptional<edm::InputTag>("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "l1vertices"));
616  desc.addOptional<edm::InputTag>("l1VerticesEmulationInputTag",
617  edm::InputTag("l1tVertexFinderEmulator", "l1verticesEmulation"));
618  desc.add<std::string>("outputCollectionName", "Level1TTTracksSelected");
619  {
620  edm::ParameterSetDescription descCutSet;
621  descCutSet.add<double>("ptMin", 2.0)->setComment("pt must be greater than this value, [GeV]");
622  descCutSet.add<double>("absEtaMax", 2.4)->setComment("absolute value of eta must be less than this value");
623  descCutSet.add<double>("absZ0Max", 15.0)->setComment("z0 must be less than this value, [cm]");
624  descCutSet.add<int>("nStubsMin", 4)->setComment("number of stubs must be greater than or equal to this value");
625  descCutSet.add<int>("nPSStubsMin", 0)
626  ->setComment("number of stubs in the PS Modules must be greater than or equal to this value");
627 
628  descCutSet.add<double>("reducedBendChi2Max", 2.25)->setComment("bend chi2 must be less than this value");
629  descCutSet.add<double>("reducedChi2RZMax", 5.0)->setComment("chi2rz/dof must be less than this value");
630  descCutSet.add<double>("reducedChi2RPhiMax", 20.0)->setComment("chi2rphi/dof must be less than this value");
631 
632  descCutSet.add<std::vector<double>>("deltaZMaxEtaBounds", {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4})
633  ->setComment("these values define the bin boundaries in |eta|");
634  descCutSet.add<std::vector<double>>("deltaZMax", {0.37, 0.50, 0.60, 0.75, 1.00, 1.60})
635  ->setComment(
636  "delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, "
637  "[cm]");
638  desc.add<edm::ParameterSetDescription>("cutSet", descCutSet);
639  }
640  desc.add<double>("useDisplacedTracksDeltaZOverride", -1.0)
641  ->setComment("override the deltaZ cut value for displaced tracks");
642  desc.add<bool>("processSimulatedTracks", true)
643  ->setComment("return selected tracks after cutting on the floating point values");
644  desc.add<bool>("processEmulatedTracks", true)
645  ->setComment("return selected tracks after cutting on the bitwise emulated values");
646  desc.add<int>("debug", 0)->setComment("Verbosity levels: 0, 1, 2, 3");
647  descriptions.addWithDefaultLabel(desc);
648 }
void setComment(std::string const &value)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ printDebugInfo()

void L1TrackSelectionProducer::printDebugInfo ( const TTTrackCollectionHandle l1TracksHandle,
const TTTrackRefCollectionUPtr vTTTrackOutput,
const TTTrackRefCollectionUPtr vTTTrackEmulationOutput,
const TTTrackRefCollectionUPtr vTTTrackAssociatedOutput,
const TTTrackRefCollectionUPtr vTTTrackAssociatedEmulationOutput 
) const
private

Definition at line 397 of file L1TrackSelectionProducer.cc.

References debug_, dqm-mbProfile::log, printTrackInfo(), processEmulatedTracks_, processSimulatedTracks_, DBoxMetadataHelper::set_difference(), and HLT_2022v15_cff::track.

Referenced by produce().

401  {
402  edm::LogInfo log("L1TrackSelectionProducer");
403  log << "The original track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are ... \n";
404  for (const auto& track : *l1TracksHandle) {
405  printTrackInfo(log, track, debug_ >= 4);
406  }
407  log << "\t---\n\tNumber of tracks in this selection = " << l1TracksHandle->size() << "\n\n";
409  log << "The selected track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are ... \n";
410  for (const auto& track : *vTTTrackOutput) {
411  printTrackInfo(log, *track, debug_ >= 4);
412  }
413  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackOutput->size() << "\n\n";
414  }
416  log << "The emulation selected track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are "
417  "... \n";
418  for (const auto& track : *vTTTrackEmulationOutput) {
419  printTrackInfo(log, *track, debug_ >= 4);
420  }
421  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackEmulationOutput->size() << "\n\n";
422  }
424  TTTrackRefCollection inSimButNotEmu;
425  TTTrackRefCollection inEmuButNotSim;
426  std::set_difference(vTTTrackOutput->begin(),
427  vTTTrackOutput->end(),
428  vTTTrackEmulationOutput->begin(),
429  vTTTrackEmulationOutput->end(),
430  std::back_inserter(inSimButNotEmu));
431  std::set_difference(vTTTrackEmulationOutput->begin(),
432  vTTTrackEmulationOutput->end(),
433  vTTTrackOutput->begin(),
434  vTTTrackOutput->end(),
435  std::back_inserter(inEmuButNotSim));
436  log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected "
437  "by cutting on the emulated values ... \n";
438  for (const auto& track : inSimButNotEmu) {
439  printTrackInfo(log, *track, debug_ >= 3);
440  }
441  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
442  << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected "
443  "by cutting on the simulated values ... \n";
444  for (const auto& track : inEmuButNotSim) {
445  printTrackInfo(log, *track, debug_ >= 3);
446  }
447  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
448  }
450  log << "The selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, "
451  "chi2rphi, z0) values are ... \n";
452  for (const auto& track : *vTTTrackAssociatedOutput) {
453  printTrackInfo(log, *track, debug_ >= 4);
454  }
455  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedOutput->size() << "\n\n";
456  }
458  log << "The emulation selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, "
459  "chi2rz, chi2rphi, z0) values are "
460  "... \n";
461  for (const auto& track : *vTTTrackAssociatedEmulationOutput) {
462  printTrackInfo(log, *track, debug_ >= 4);
463  }
464  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedEmulationOutput->size() << "\n\n";
465  }
467  TTTrackRefCollection inSimButNotEmu;
468  TTTrackRefCollection inEmuButNotSim;
469  std::set_difference(vTTTrackAssociatedOutput->begin(),
470  vTTTrackAssociatedOutput->end(),
471  vTTTrackAssociatedEmulationOutput->begin(),
472  vTTTrackAssociatedEmulationOutput->end(),
473  std::back_inserter(inSimButNotEmu));
474  std::set_difference(vTTTrackAssociatedEmulationOutput->begin(),
475  vTTTrackAssociatedEmulationOutput->end(),
476  vTTTrackAssociatedOutput->begin(),
477  vTTTrackAssociatedOutput->end(),
478  std::back_inserter(inEmuButNotSim));
479  log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected "
480  "by cutting on the emulated values ... \n";
481  for (const auto& track : inSimButNotEmu) {
482  printTrackInfo(log, *track, debug_ >= 3);
483  }
484  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
485  << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected "
486  "by cutting on the simulated values ... \n";
487  for (const auto& track : inEmuButNotSim) {
488  printTrackInfo(log, *track, debug_ >= 3);
489  }
490  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
491  }
492 }
void printTrackInfo(edm::LogInfo &log, const L1Track &track, bool printEmulation=false) const
edm::RefVector< TTTrackCollection > TTTrackRefCollection
std::vector< std::string > set_difference(std::vector< std::string > const &v1, std::vector< std::string > const &v2)

◆ printTrackInfo()

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

Definition at line 494 of file L1TrackSelectionProducer.cc.

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

Referenced by printDebugInfo().

494  {
495  log << "\t(" << track.momentum().perp() << ", " << track.momentum().eta() << ", " << track.momentum().phi() << ", "
496  << track.getStubRefs().size() << ", " << track.stubPtConsistency() << ", " << track.chi2ZRed() << ", "
497  << track.chi2XYRed() << ", " << track.z0() << ")\n";
498 
499  if (printEmulation) {
500  ap_uint<TrackBitWidths::kPtSize> ptEmulationBits = track.getTrackWord()(
501  TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB);
502  ap_ufixed<TrackBitWidths::kPtSize, TrackBitWidths::kPtMagSize> ptEmulation;
503  ptEmulation.V = ptEmulationBits.range();
504  TTTrack_TrackWord::tanl_t etaEmulationBits = track.getTanlWord();
505  ap_fixed<TrackBitWidths::kEtaSize, TrackBitWidths::kEtaMagSize> etaEmulation;
506  etaEmulation.V = etaEmulationBits.range();
507  double floatTkZ0 = track.undigitizeSignedValue(
508  track.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0);
509  double floatTkPhi = track.undigitizeSignedValue(
510  track.getPhiBits(), TTTrack_TrackWord::TrackBitWidths::kPhiSize, TTTrack_TrackWord::stepPhi0, 0.0);
511  log << "\t\t(" << ptEmulation.to_double() << ", " << etaEmulation.to_double() << ", " << floatTkPhi << ", "
512  << track.getNStubs() << ", " << track.getBendChi2() << ", " << track.getChi2RZ() << ", " << track.getChi2RPhi()
513  << ", " << floatTkZ0 << ")\n";
514  }
515 }
static constexpr double stepPhi0
ap_uint< TrackBitWidths::kTanlSize > tanl_t
static constexpr double stepZ0

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 518 of file L1TrackSelectionProducer.cc.

References absEtaMax_, absZ0Max_, bendChi2Max_, debug_, deltaZMax_, deltaZMaxEtaBounds_, doDeltaZCutEmu_, doDeltaZCutSim_, edm::EventSetup::getData(), mps_fire::i, iEvent, l1TracksToken_, l1VerticesEmulationToken_, l1VerticesToken_, eostools::move(), nPSStubsMin_, nStubsMin_, outputCollectionName_, printDebugInfo(), processEmulatedTracks_, processSimulatedTracks_, ptMin_, reducedChi2RPhiMax_, reducedChi2RZMax_, HLT_2022v15_cff::track, tTopoToken_, l1t::Vertex::z0(), and l1t::VertexWord::z0().

518  {
519  auto vTTTrackOutput = std::make_unique<TTTrackRefCollection>();
520  auto vTTTrackAssociatedOutput = std::make_unique<TTTrackRefCollection>();
521  auto vTTTrackEmulationOutput = std::make_unique<TTTrackRefCollection>();
522  auto vTTTrackAssociatedEmulationOutput = std::make_unique<TTTrackRefCollection>();
523 
524  // Tracker Topology
525  const TrackerTopology& tTopo = iSetup.getData(tTopoToken_);
526 
527  TTTrackCollectionHandle l1TracksHandle;
528  edm::Handle<l1t::VertexCollection> l1VerticesHandle;
529  edm::Handle<l1t::VertexWordCollection> l1VerticesEmulationHandle;
530 
531  l1t::Vertex leadingVertex;
532  l1t::VertexWord leadingEmulationVertex;
533 
534  iEvent.getByToken(l1TracksToken_, l1TracksHandle);
535  size_t nOutputApproximate = l1TracksHandle->size();
537  if (doDeltaZCutSim_) {
538  iEvent.getByToken(l1VerticesToken_, l1VerticesHandle);
539  leadingVertex = l1VerticesHandle->at(0);
540  if (debug_ >= 2) {
541  edm::LogInfo("L1TrackSelectionProducer") << "leading vertex z0 = " << leadingVertex.z0();
542  }
543  }
544  vTTTrackOutput->reserve(nOutputApproximate);
545  vTTTrackAssociatedOutput->reserve(nOutputApproximate);
546  }
548  if (doDeltaZCutEmu_) {
549  iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle);
550  leadingEmulationVertex = l1VerticesEmulationHandle->at(0);
551  if (debug_ >= 2) {
552  edm::LogInfo("L1TrackSelectionProducer") << "leading emulation vertex z0 = " << leadingEmulationVertex.z0();
553  }
554  }
555  vTTTrackEmulationOutput->reserve(nOutputApproximate);
556  vTTTrackAssociatedEmulationOutput->reserve(nOutputApproximate);
557  }
558 
563  TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_);
564  TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_);
565  TTTrackNPSStubsMinSelector nPSStubsSel(nPSStubsMin_, tTopo);
566 
567  for (size_t i = 0; i < nOutputApproximate; i++) {
568  const auto& track = l1TracksHandle->at(i);
569 
570  // Select tracks based on the floating point TTTrack
571  if (processSimulatedTracks_ && kinSel(track) && nPSStubsSel(track) && chi2Sel(track)) {
572  vTTTrackOutput->push_back(TTTrackRef(l1TracksHandle, i));
573  if (doDeltaZCutSim_ && deltaZSel(track, leadingVertex)) {
574  vTTTrackAssociatedOutput->push_back(TTTrackRef(l1TracksHandle, i));
575  }
576  }
577 
578  // Select tracks based on the bitwise accurate TTTrack_TrackWord
579  if (processEmulatedTracks_ && kinSelEmu(track) && chi2SelEmu(track)) {
580  vTTTrackEmulationOutput->push_back(TTTrackRef(l1TracksHandle, i));
581  if (doDeltaZCutEmu_ && deltaZSelEmu(track, leadingEmulationVertex)) {
582  vTTTrackAssociatedEmulationOutput->push_back(TTTrackRef(l1TracksHandle, i));
583  }
584  }
585  }
586 
587  if (debug_ >= 2) {
588  printDebugInfo(l1TracksHandle,
589  vTTTrackOutput,
590  vTTTrackEmulationOutput,
591  vTTTrackAssociatedOutput,
592  vTTTrackAssociatedEmulationOutput);
593  }
594 
595  // Put the outputs into the event
597  iEvent.put(std::move(vTTTrackOutput), outputCollectionName_);
598  if (doDeltaZCutSim_) {
599  iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_ + "Associated");
600  }
601  }
603  iEvent.put(std::move(vTTTrackEmulationOutput), outputCollectionName_ + "Emulation");
604  if (doDeltaZCutEmu_) {
605  iEvent.put(std::move(vTTTrackAssociatedEmulationOutput), outputCollectionName_ + "AssociatedEmulation");
606  }
607  }
608 }
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::Handle< TTTrackCollection > TTTrackCollectionHandle
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
AndSelector< TTTrackBendChi2MaxSelector, TTTrackChi2RZMaxSelector, TTTrackChi2RPhiMaxSelector > TTTrackBendChi2Chi2RZChi2RPhiMaxSelector
AndSelector< TTTrackWordBendChi2MaxSelector, TTTrackWordChi2RZMaxSelector, TTTrackWordChi2RPhiMaxSelector > TTTrackWordBendChi2Chi2RZChi2RPhiMaxSelector
AndSelector< TTTrackWordPtMinSelector, TTTrackWordAbsEtaMaxSelector, TTTrackWordAbsZ0MaxSelector, TTTrackWordNStubsMinSelector > TTTrackWordPtMinEtaMaxZ0MaxNStubsMinSelector
void printDebugInfo(const TTTrackCollectionHandle &l1TracksHandle, const TTTrackRefCollectionUPtr &vTTTrackOutput, const TTTrackRefCollectionUPtr &vTTTrackEmulationOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedEmulationOutput) const
AndSelector< TTTrackPtMinSelector, TTTrackAbsEtaMaxSelector, TTTrackAbsZ0MaxSelector, TTTrackNStubsMinSelector > TTTrackPtMinEtaMaxZ0MaxNStubsMinSelector
int iEvent
Definition: GenABIO.cc:224
std::vector< double > deltaZMaxEtaBounds_
edm::EDGetTokenT< l1t::VertexCollection > l1VerticesToken_
edm::Ref< TTTrackCollection > TTTrackRef
Log< level::Info, false > LogInfo
double z0() const
Definition: VertexWord.h:158
edm::EDGetTokenT< l1t::VertexWordCollection > l1VerticesEmulationToken_
float z0() const
Definition: Vertex.h:21
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< TTTrackCollection > l1TracksToken_

Member Data Documentation

◆ absEtaMax_

const double L1TrackSelectionProducer::absEtaMax_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ absZ0Max_

const double L1TrackSelectionProducer::absZ0Max_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ bendChi2Max_

const double L1TrackSelectionProducer::bendChi2Max_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ cutSet_

const edm::ParameterSet L1TrackSelectionProducer::cutSet_
private

Definition at line 323 of file L1TrackSelectionProducer.cc.

◆ debug_

int L1TrackSelectionProducer::debug_
private

Definition at line 329 of file L1TrackSelectionProducer.cc.

Referenced by printDebugInfo(), and produce().

◆ deltaZMax_

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

Definition at line 326 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ deltaZMaxEtaBounds_

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

Definition at line 326 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ doDeltaZCutEmu_

bool L1TrackSelectionProducer::doDeltaZCutEmu_
private

Definition at line 328 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ doDeltaZCutSim_

bool L1TrackSelectionProducer::doDeltaZCutSim_
private

Definition at line 328 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ l1TracksToken_

const edm::EDGetTokenT<TTTrackCollection> L1TrackSelectionProducer::l1TracksToken_
private

Definition at line 318 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ l1VerticesEmulationToken_

edm::EDGetTokenT<l1t::VertexWordCollection> L1TrackSelectionProducer::l1VerticesEmulationToken_
private

Definition at line 320 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ l1VerticesToken_

edm::EDGetTokenT<l1t::VertexCollection> L1TrackSelectionProducer::l1VerticesToken_
private

Definition at line 319 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ nPSStubsMin_

const int L1TrackSelectionProducer::nPSStubsMin_
private

Definition at line 325 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ nStubsMin_

const int L1TrackSelectionProducer::nStubsMin_
private

Definition at line 325 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ outputCollectionName_

const std::string L1TrackSelectionProducer::outputCollectionName_
private

Definition at line 322 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), and produce().

◆ processEmulatedTracks_

bool L1TrackSelectionProducer::processEmulatedTracks_
private

Definition at line 328 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), printDebugInfo(), and produce().

◆ processSimulatedTracks_

bool L1TrackSelectionProducer::processSimulatedTracks_
private

Definition at line 328 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer(), printDebugInfo(), and produce().

◆ ptMin_

const double L1TrackSelectionProducer::ptMin_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ reducedChi2RPhiMax_

const double L1TrackSelectionProducer::reducedChi2RPhiMax_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ reducedChi2RZMax_

const double L1TrackSelectionProducer::reducedChi2RZMax_
private

Definition at line 324 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> L1TrackSelectionProducer::tTopoToken_
private

Definition at line 321 of file L1TrackSelectionProducer.cc.

Referenced by produce().

◆ useDisplacedTracksDeltaZOverride_

const double L1TrackSelectionProducer::useDisplacedTracksDeltaZOverride_
private

Definition at line 327 of file L1TrackSelectionProducer.cc.

Referenced by L1TrackSelectionProducer().