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
 

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 edm::EDGetTokenT< TTTrackRefCollectionTypel1SelectedTracksEmulationToken_
 
const edm::EDGetTokenT< TTTrackRefCollectionTypel1SelectedTracksToken_
 
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 70 of file L1TrackVertexAssociationProducer.cc.

Member Typedef Documentation

◆ TTTrackCollectionHandle

Definition at line 89 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackCollectionType

Definition at line 88 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackRefCollectionType

Definition at line 90 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackRefCollectionUPtr

Definition at line 91 of file L1TrackVertexAssociationProducer.cc.

◆ TTTrackType

Definition at line 87 of file L1TrackVertexAssociationProducer.cc.

Member Enumeration Documentation

◆ TrackBitWidths

Enumerator
kPtSize 
kPtMagSize 
kEtaSize 
kEtaMagSize 

Definition at line 80 of file L1TrackVertexAssociationProducer.cc.

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

Constructor & Destructor Documentation

◆ L1TrackVertexAssociationProducer()

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

Definition at line 168 of file L1TrackVertexAssociationProducer.cc.

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

169  : processSimulatedTracks_(iConfig.getParameter<bool>("processSimulatedTracks")),
170  processEmulatedTracks_(iConfig.getParameter<bool>("processEmulatedTracks")),
172  ? consumes<l1t::VertexCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesInputTag"))
176  ? consumes<TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>("l1SelectedTracksInputTag"))
180  ? consumes<l1t::VertexWordCollection>(iConfig.getParameter<edm::InputTag>("l1VerticesEmulationInputTag"))
183  ? consumes<TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>(
184  "l1SelectedTracksEmulationInputTag"))
186  outputCollectionName_(iConfig.getParameter<std::string>("outputCollectionName")),
187  cutSet_(iConfig.getParameter<edm::ParameterSet>("cutSet")),
188 
189  deltaZMaxEtaBounds_(cutSet_.getParameter<std::vector<double>>("deltaZMaxEtaBounds")),
190  deltaZMax_(cutSet_.getParameter<std::vector<double>>("deltaZMax")),
191  useDisplacedTracksDeltaZOverride_(iConfig.getParameter<double>("useDisplacedTracksDeltaZOverride")),
192  debug_(iConfig.getParameter<int>("debug")) {
193  // Confirm the the configuration makes sense
195  throw cms::Exception("You must process at least one of the track collections (simulated or emulated).");
196  }
197 
198  if (deltaZMax_.size() != deltaZMaxEtaBounds_.size() - 1) {
199  throw cms::Exception("The number of deltaZ cuts does not match the number of eta bins!");
200  }
201 
203  deltaZMax_ = std::vector<double>(deltaZMax_.size(), useDisplacedTracksDeltaZOverride_);
204  }
205 
206  // Get additional input tags and define the EDM output based on the previous configuration parameters
208  produces<TTTrackRefCollectionType>(outputCollectionName_);
210  produces<TTTrackRefCollectionType>(outputCollectionName_ + "Emulation");
211 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 213 of file L1TrackVertexAssociationProducer.cc.

213 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 402 of file L1TrackVertexAssociationProducer.cc.

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

402  {
404  desc.add<edm::InputTag>("l1SelectedTracksInputTag",
405  edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelected"));
406  desc.add<edm::InputTag>("l1SelectedTracksEmulationInputTag",
407  edm::InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation"));
408  desc.add<edm::InputTag>("l1VerticesInputTag", edm::InputTag("l1tVertexFinder", "L1Vertices"));
409  desc.add<edm::InputTag>("l1VerticesEmulationInputTag",
410  edm::InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation"));
411  desc.add<std::string>("outputCollectionName", "Level1TTTracksSelectedAssociated");
412  {
413  edm::ParameterSetDescription descCutSet;
414  descCutSet.add<std::vector<double>>("deltaZMaxEtaBounds", {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4})
415  ->setComment("these values define the bin boundaries in |eta|");
416  descCutSet.add<std::vector<double>>("deltaZMax", {0.37, 0.50, 0.60, 0.75, 1.00, 1.60})
417  ->setComment(
418  "delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, "
419  "[cm]");
420  desc.add<edm::ParameterSetDescription>("cutSet", descCutSet);
421  }
422  desc.add<double>("useDisplacedTracksDeltaZOverride", -1.0)
423  ->setComment("override the deltaZ cut value for displaced tracks");
424  desc.add<bool>("processSimulatedTracks", true)
425  ->setComment("return selected tracks after cutting on the floating point values");
426  desc.add<bool>("processEmulatedTracks", true)
427  ->setComment("return selected tracks after cutting on the bitwise emulated values");
428  desc.add<int>("debug", 0)->setComment("Verbosity levels: 0, 1, 2, 3");
429  descriptions.addWithDefaultLabel(desc);
430 }
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 219 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_2023v12_cff::track.

Referenced by produce().

223  {
224  edm::LogInfo log("L1TrackVertexAssociationProducer");
226  log << "The original selected track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) values are "
227  "... \n";
228  for (const auto& track : *l1SelectedTracksHandle) {
229  printTrackInfo(log, *track, debug_ >= 4);
230  }
231  log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksHandle->size() << "\n\n";
232  }
234  log << "The original selected emulated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, chi2rphi, z0) "
235  "values are ... \n";
236  for (const auto& track : *l1SelectedTracksEmulationHandle) {
237  printTrackInfo(log, *track, debug_ >= 4);
238  }
239  log << "\t---\n\tNumber of tracks in this selection = " << l1SelectedTracksEmulationHandle->size() << "\n\n";
240  }
242  TTTrackRefCollectionType inSimButNotEmu;
243  TTTrackRefCollectionType inEmuButNotSim;
244  std::set_difference(l1SelectedTracksHandle->begin(),
245  l1SelectedTracksHandle->end(),
246  l1SelectedTracksEmulationHandle->begin(),
247  l1SelectedTracksEmulationHandle->end(),
248  std::back_inserter(inSimButNotEmu));
249  std::set_difference(l1SelectedTracksEmulationHandle->begin(),
250  l1SelectedTracksEmulationHandle->end(),
251  l1SelectedTracksHandle->begin(),
252  l1SelectedTracksHandle->end(),
253  std::back_inserter(inEmuButNotSim));
254  log << "The set of tracks selected via cuts on the simulated values which are not in the set of tracks selected "
255  "by cutting on the emulated values ... \n";
256  for (const auto& track : inSimButNotEmu) {
257  printTrackInfo(log, *track, debug_ >= 3);
258  }
259  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
260  << "The set of tracks selected via cuts on the emulated values which are not in the set of tracks selected "
261  "by cutting on the simulated values ... \n";
262  for (const auto& track : inEmuButNotSim) {
263  printTrackInfo(log, *track, debug_ >= 3);
264  }
265  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
266  }
268  log << "The selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, chi2rz, "
269  "chi2rphi, z0) values are ... \n";
270  for (const auto& track : *vTTTrackAssociatedOutput) {
271  printTrackInfo(log, *track, debug_ >= 4);
272  }
273  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedOutput->size() << "\n\n";
274  }
276  log << "The emulation selected and leading vertex associated track collection (pt, eta, phi, nstub, bendchi2, "
277  "chi2rz, chi2rphi, z0) values are "
278  "... \n";
279  for (const auto& track : *vTTTrackAssociatedEmulationOutput) {
280  printTrackInfo(log, *track, debug_ >= 4);
281  }
282  log << "\t---\n\tNumber of tracks in this selection = " << vTTTrackAssociatedEmulationOutput->size() << "\n\n";
283  }
285  TTTrackRefCollectionType inSimButNotEmu;
286  TTTrackRefCollectionType inEmuButNotSim;
287  std::set_difference(vTTTrackAssociatedOutput->begin(),
288  vTTTrackAssociatedOutput->end(),
289  vTTTrackAssociatedEmulationOutput->begin(),
290  vTTTrackAssociatedEmulationOutput->end(),
291  std::back_inserter(inSimButNotEmu));
292  std::set_difference(vTTTrackAssociatedEmulationOutput->begin(),
293  vTTTrackAssociatedEmulationOutput->end(),
294  vTTTrackAssociatedOutput->begin(),
295  vTTTrackAssociatedOutput->end(),
296  std::back_inserter(inEmuButNotSim));
297  log << "The set of vertex associated tracks selected via cuts on the simulated values which are not in the set of "
298  "tracks selected "
299  "by cutting on the emulated values ... \n";
300  for (const auto& track : inSimButNotEmu) {
301  printTrackInfo(log, *track, debug_ >= 3);
302  }
303  log << "\t---\n\tNumber of tracks in this selection = " << inSimButNotEmu.size() << "\n\n"
304  << "The set of vertex associated tracks selected via cuts on the emulated values which are not in the set of "
305  "tracks selected "
306  "by cutting on the simulated values ... \n";
307  for (const auto& track : inEmuButNotSim) {
308  printTrackInfo(log, *track, debug_ >= 3);
309  }
310  log << "\t---\n\tNumber of tracks in this selection = " << inEmuButNotSim.size() << "\n\n";
311  }
312 }
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 314 of file L1TrackVertexAssociationProducer.cc.

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

Referenced by printDebugInfo().

316  {
317  log << "\t(" << track.momentum().perp() << ", " << track.momentum().eta() << ", " << track.momentum().phi() << ", "
318  << track.getStubRefs().size() << ", " << track.stubPtConsistency() << ", " << track.chi2ZRed() << ", "
319  << track.chi2XYRed() << ", " << track.z0() << ")\n";
320 
321  if (printEmulation) {
322  ap_uint<TrackBitWidths::kPtSize> ptEmulationBits = track.getTrackWord()(
323  TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB);
324  ap_ufixed<TrackBitWidths::kPtSize, TrackBitWidths::kPtMagSize> ptEmulation;
325  ptEmulation.V = ptEmulationBits.range();
326  TTTrack_TrackWord::tanl_t etaEmulationBits = track.getTanlWord();
327  ap_fixed<TrackBitWidths::kEtaSize, TrackBitWidths::kEtaMagSize> etaEmulation;
328  etaEmulation.V = etaEmulationBits.range();
329  double floatTkZ0 = track.undigitizeSignedValue(
330  track.getZ0Bits(), TTTrack_TrackWord::TrackBitWidths::kZ0Size, TTTrack_TrackWord::stepZ0, 0.0);
331  double floatTkPhi = track.undigitizeSignedValue(
332  track.getPhiBits(), TTTrack_TrackWord::TrackBitWidths::kPhiSize, TTTrack_TrackWord::stepPhi0, 0.0);
333  log << "\t\t(" << ptEmulation.to_double() << ", " << etaEmulation.to_double() << ", " << floatTkPhi << ", "
334  << track.getNStubs() << ", " << track.getBendChi2() << ", " << track.getChi2RZ() << ", " << track.getChi2RPhi()
335  << ", " << floatTkZ0 << ")\n";
336  }
337 }
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 340 of file L1TrackVertexAssociationProducer.cc.

References debug_, deltaZMax_, deltaZMaxEtaBounds_, iEvent, l1SelectedTracksEmulationToken_, l1SelectedTracksToken_, l1VerticesEmulationToken_, l1VerticesToken_, eostools::move(), outputCollectionName_, printDebugInfo(), processEmulatedTracks_, processSimulatedTracks_, edm::refToPtr(), edm::RefVector< C, T, F >::size(), HLT_2023v12_cff::track, l1t::Vertex::z0(), and l1t::VertexWord::z0().

340  {
341  auto vTTTrackAssociatedOutput = std::make_unique<TTTrackRefCollectionType>();
342  auto vTTTrackAssociatedEmulationOutput = std::make_unique<TTTrackRefCollectionType>();
343 
344  // TTTrackCollectionHandle l1TracksHandle;
345  edm::Handle<TTTrackRefCollectionType> l1SelectedTracksHandle;
346  edm::Handle<TTTrackRefCollectionType> l1SelectedTracksEmulationHandle;
347  edm::Handle<l1t::VertexCollection> l1VerticesHandle;
348  edm::Handle<l1t::VertexWordCollection> l1VerticesEmulationHandle;
349 
350  l1t::Vertex leadingVertex;
351  l1t::VertexWord leadingEmulationVertex;
352 
353  TTTrackDeltaZMaxSelector deltaZSel(deltaZMaxEtaBounds_, deltaZMax_);
354  TTTrackWordDeltaZMaxSelector deltaZSelEmu(deltaZMaxEtaBounds_, deltaZMax_);
355 
357  iEvent.getByToken(l1SelectedTracksToken_, l1SelectedTracksHandle);
358  iEvent.getByToken(l1VerticesToken_, l1VerticesHandle);
359  size_t nOutputApproximate = l1SelectedTracksHandle->size();
360  leadingVertex = l1VerticesHandle->at(0);
361  if (debug_ >= 2) {
362  edm::LogInfo("L1TrackVertexAssociationProducer") << "leading vertex z0 = " << leadingVertex.z0();
363  }
364  vTTTrackAssociatedOutput->reserve(nOutputApproximate);
365  for (const auto& trackword : *l1SelectedTracksHandle) {
366  auto track = l1tVertexFinder::L1Track(edm::refToPtr(trackword));
367  // Select tracks based on the floating point TTTrack
368  if (deltaZSel(*trackword, leadingVertex)) {
369  vTTTrackAssociatedOutput->push_back(trackword);
370  }
371  }
372  iEvent.put(std::move(vTTTrackAssociatedOutput), outputCollectionName_);
373  }
375  iEvent.getByToken(l1SelectedTracksEmulationToken_, l1SelectedTracksEmulationHandle);
376  iEvent.getByToken(l1VerticesEmulationToken_, l1VerticesEmulationHandle);
377  size_t nOutputApproximateEmulation = l1SelectedTracksEmulationHandle->size();
378  leadingEmulationVertex = l1VerticesEmulationHandle->at(0);
379  if (debug_ >= 2) {
380  edm::LogInfo("L1TrackVertexAssociationProducer")
381  << "leading emulation vertex z0 = " << leadingEmulationVertex.z0();
382  }
383  vTTTrackAssociatedEmulationOutput->reserve(nOutputApproximateEmulation);
384  for (const auto& trackword : *l1SelectedTracksEmulationHandle) {
385  // Select tracks based on the bitwise accurate TTTrack_TrackWord
386  if (deltaZSelEmu(*trackword, leadingEmulationVertex)) {
387  vTTTrackAssociatedEmulationOutput->push_back(trackword);
388  }
389  }
390  iEvent.put(std::move(vTTTrackAssociatedEmulationOutput), outputCollectionName_ + "Emulation");
391  }
392 
394  printDebugInfo(l1SelectedTracksHandle,
395  l1SelectedTracksEmulationHandle,
396  vTTTrackAssociatedOutput,
397  vTTTrackAssociatedEmulationOutput);
398  }
399 }
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
const edm::EDGetTokenT< l1t::VertexCollection > l1VerticesToken_
const edm::EDGetTokenT< TTTrackRefCollectionType > l1SelectedTracksToken_
int iEvent
Definition: GenABIO.cc:224
Log< level::Info, false > LogInfo
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
void printDebugInfo(const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksHandle, const edm::Handle< TTTrackRefCollectionType > &l1SelectedTracksEmulationHandle, const TTTrackRefCollectionUPtr &vTTTrackAssociatedOutput, const TTTrackRefCollectionUPtr &vTTTrackAssociatedEmulationOutput) const
TTTrack< Ref_Phase2TrackerDigi_ > L1Track
Definition: L1Track.h:8
double z0() const
Definition: VertexWord.h:158
const edm::EDGetTokenT< l1t::VertexWordCollection > l1VerticesEmulationToken_
float z0() const
Definition: Vertex.h:21
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 159 of file L1TrackVertexAssociationProducer.cc.

◆ debug_

int L1TrackVertexAssociationProducer::debug_
private

Definition at line 162 of file L1TrackVertexAssociationProducer.cc.

Referenced by printDebugInfo(), and produce().

◆ deltaZMax_

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

◆ deltaZMaxEtaBounds_

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

◆ l1SelectedTracksEmulationToken_

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

Definition at line 157 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1SelectedTracksToken_

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

Definition at line 155 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1VerticesEmulationToken_

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

Definition at line 156 of file L1TrackVertexAssociationProducer.cc.

Referenced by produce().

◆ l1VerticesToken_

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

Definition at line 154 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