CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
HLT2L1TkMuonL1TkMuonMuRefDR Class Reference

#include <HLT2L1TkMuonL1TkMuonMuRefDR.h>

Inheritance diagram for HLT2L1TkMuonL1TkMuonMuRefDR:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool computeDR (edm::Event &iEvent, l1t::TrackerMuonRef &c1, l1t::TrackerMuonRef &c2) const
 
bool getCollections (edm::Event &iEvent, std::vector< l1t::TrackerMuonRef > &coll1, std::vector< l1t::TrackerMuonRef > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
 
 HLT2L1TkMuonL1TkMuonMuRefDR (const edm::ParameterSet &)
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 ~HLT2L1TkMuonL1TkMuonMuRefDR () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=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::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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 HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::InputTag inputTag1_
 
const edm::InputTag inputTag2_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsinputToken1_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsinputToken2_
 
const int min_N_
 
const double minDR_
 
const std::vector< edm::InputTagoriginTag1_
 
const std::vector< edm::InputTagoriginTag2_
 
const bool same_
 

Static Private Attributes

static constexpr unsigned int emtfRegion_ {3}
 
static constexpr float etaScale_ {0.010875}
 
static constexpr float phiScale_ {2. * M_PI / 576.}
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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

Definition at line 22 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Constructor & Destructor Documentation

◆ HLT2L1TkMuonL1TkMuonMuRefDR()

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

Definition at line 18 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

19  : HLTFilter(iConfig),
20  originTag1_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag1")),
21  originTag2_(iConfig.getParameter<std::vector<edm::InputTag>>("originTag2")),
22  inputTag1_(iConfig.getParameter<edm::InputTag>("inputTag1")),
23  inputTag2_(iConfig.getParameter<edm::InputTag>("inputTag2")),
24  inputToken1_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag1_)),
25  inputToken2_(consumes<trigger::TriggerFilterObjectWithRefs>(inputTag2_)),
26  minDR_(iConfig.getParameter<double>("MinDR")),
27  min_N_(iConfig.getParameter<int>("MinN")),
28  same_(inputTag1_.encode() == inputTag2_.encode()) {} // same collections to be compared?
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string encode() const
Definition: InputTag.cc:159
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
const std::vector< edm::InputTag > originTag1_
const std::vector< edm::InputTag > originTag2_
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_

◆ ~HLT2L1TkMuonL1TkMuonMuRefDR()

HLT2L1TkMuonL1TkMuonMuRefDR::~HLT2L1TkMuonL1TkMuonMuRefDR ( )
override

Definition at line 30 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

30 {}

Member Function Documentation

◆ computeDR()

bool HLT2L1TkMuonL1TkMuonMuRefDR::computeDR ( edm::Event iEvent,
l1t::TrackerMuonRef c1,
l1t::TrackerMuonRef c2 
) const

Definition at line 98 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

References reco::deltaR2(), minDR_, diffTwoXMLs::r1, and diffTwoXMLs::r2.

Referenced by hltFilter().

100  {
101  if (minDR_ < 0.)
102  return true;
103 
104  return (reco::deltaR2(r1->phEta(), r1->phPhi(), r2->phEta(), r2->phPhi()) > minDR_ * minDR_);
105 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ fillDescriptions()

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

Definition at line 32 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, HLTFilter::makeHLTFilterDescription(), HLT_2023v12_cff::originTag1, and HLT_2023v12_cff::originTag2.

32  {
35  std::vector<edm::InputTag> originTag1(1, edm::InputTag("hltOriginal1"));
36  std::vector<edm::InputTag> originTag2(1, edm::InputTag("hltOriginal2"));
37  desc.add<std::vector<edm::InputTag>>("originTag1", originTag1);
38  desc.add<std::vector<edm::InputTag>>("originTag2", originTag2);
39  desc.add<edm::InputTag>("inputTag1", edm::InputTag("hltFiltered1"));
40  desc.add<edm::InputTag>("inputTag2", edm::InputTag("hltFiltered2"));
41  desc.add<double>("MinDR", -1.0);
42  desc.add<int>("MinN", 1);
43 
44  descriptions.add("hlt2L1TkMuonL1TkMuonMuRefDR", desc);
45 }
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getCollections()

bool HLT2L1TkMuonL1TkMuonMuRefDR::getCollections ( edm::Event iEvent,
std::vector< l1t::TrackerMuonRef > &  coll1,
std::vector< l1t::TrackerMuonRef > &  coll2,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const

Definition at line 47 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

References trigger::TriggerFilterObjectWithRefs::addCollectionTag(), edm::InputTag::encode(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iEvent, ProducerED_cfi::InputTag, inputToken1_, inputToken2_, instance, label, originTag1_, originTag2_, LaserDQM_cfg::process, HLTFilter::saveTags(), AlCaHLTBitMon_QueryRunRegistry::string, and trigger::TriggerL1TkMu.

Referenced by hltFilter().

50  {
52  if (iEvent.getByToken(inputToken1_, handle1) and iEvent.getByToken(inputToken2_, handle2)) {
53  // get hold of pre-filtered object collections
56  const trigger::size_type n1(coll1.size());
57  const trigger::size_type n2(coll2.size());
58 
59  if (saveTags()) {
60  edm::InputTag tagOld;
61  for (unsigned int i = 0; i < originTag1_.size(); ++i) {
62  filterproduct.addCollectionTag(originTag1_[i]);
63  }
64  tagOld = edm::InputTag();
65  for (trigger::size_type i1 = 0; i1 != n1; ++i1) {
66  const edm::ProductID pid(coll1[i1].id());
67  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
68  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
69  const std::string& process(iEvent.getProvenance(pid).processName());
71  if (tagOld.encode() != tagNew.encode()) {
72  filterproduct.addCollectionTag(tagNew);
73  tagOld = tagNew;
74  }
75  }
76  for (unsigned int i = 0; i < originTag2_.size(); ++i) {
77  filterproduct.addCollectionTag(originTag2_[i]);
78  }
79  tagOld = edm::InputTag();
80  for (trigger::size_type i2 = 0; i2 != n2; ++i2) {
81  const edm::ProductID pid(coll2[i2].id());
82  const std::string& label(iEvent.getProvenance(pid).moduleLabel());
83  const std::string& instance(iEvent.getProvenance(pid).productInstanceName());
84  const std::string& process(iEvent.getProvenance(pid).processName());
86  if (tagOld.encode() != tagNew.encode()) {
87  filterproduct.addCollectionTag(tagNew);
88  tagOld = tagNew;
89  }
90  }
91  }
92 
93  return true;
94  } else
95  return false;
96 }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
static PFTauRenderPlugin instance
std::string encode() const
Definition: InputTag.cc:159
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken1_
const std::vector< edm::InputTag > originTag1_
uint16_t size_type
char const * label
const std::vector< edm::InputTag > originTag2_
int iEvent
Definition: GenABIO.cc:224
bool saveTags() const
Definition: HLTFilter.h:46
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > inputToken2_

◆ hltFilter()

bool HLT2L1TkMuonL1TkMuonMuRefDR::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 108 of file HLT2L1TkMuonL1TkMuonMuRefDR.cc.

References accept(), trigger::TriggerRefsCollections::addObject(), computeDR(), getCollections(), Exhume::I, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, iEvent, min_N_, dqmiodumpmetadata::n, diffTwoXMLs::r1, diffTwoXMLs::r2, same_, and trigger::TriggerL1TkMu.

110  {
111  // All HLT filters must create and fill an HLT filter object,
112  // recording any reconstructed physics objects satisfying (or not)
113  // this HLT filter, and place it in the Event.
114  bool accept(false);
115 
116  std::vector<l1t::TrackerMuonRef> coll1;
117  std::vector<l1t::TrackerMuonRef> coll2;
118 
119  if (getCollections(iEvent, coll1, coll2, filterproduct)) {
120  int n(0);
123 
124  for (unsigned int i1 = 0; i1 != coll1.size(); i1++) {
125  r1 = coll1[i1];
126  unsigned int I(0);
127  if (same_) {
128  I = i1 + 1;
129  }
130  for (unsigned int i2 = I; i2 != coll2.size(); i2++) {
131  r2 = coll2[i2];
132 
133  if (!computeDR(iEvent, r1, r2))
134  continue;
135 
136  n++;
139  }
140  }
141 
142  accept = accept || (n >= min_N_);
143  }
144 
145  return accept;
146 }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
int iEvent
Definition: GenABIO.cc:224
bool getCollections(edm::Event &iEvent, std::vector< l1t::TrackerMuonRef > &coll1, std::vector< l1t::TrackerMuonRef > &coll2, trigger::TriggerFilterObjectWithRefs &filterproduct) const
const std::complex< double > I
Definition: I.h:8
bool computeDR(edm::Event &iEvent, l1t::TrackerMuonRef &c1, l1t::TrackerMuonRef &c2) const

Member Data Documentation

◆ emtfRegion_

constexpr unsigned int HLT2L1TkMuonL1TkMuonMuRefDR::emtfRegion_ {3}
staticprivate

Definition at line 49 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

◆ etaScale_

constexpr float HLT2L1TkMuonL1TkMuonMuRefDR::etaScale_ {0.010875}
staticprivate

Definition at line 50 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

◆ inputTag1_

const edm::InputTag HLT2L1TkMuonL1TkMuonMuRefDR::inputTag1_
private

Definition at line 40 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

◆ inputTag2_

const edm::InputTag HLT2L1TkMuonL1TkMuonMuRefDR::inputTag2_
private

Definition at line 41 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

◆ inputToken1_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLT2L1TkMuonL1TkMuonMuRefDR::inputToken1_
private

Definition at line 42 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by getCollections().

◆ inputToken2_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLT2L1TkMuonL1TkMuonMuRefDR::inputToken2_
private

Definition at line 43 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by getCollections().

◆ min_N_

const int HLT2L1TkMuonL1TkMuonMuRefDR::min_N_
private

Definition at line 45 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by hltFilter().

◆ minDR_

const double HLT2L1TkMuonL1TkMuonMuRefDR::minDR_
private

Definition at line 44 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by computeDR().

◆ originTag1_

const std::vector<edm::InputTag> HLT2L1TkMuonL1TkMuonMuRefDR::originTag1_
private

Definition at line 38 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by getCollections().

◆ originTag2_

const std::vector<edm::InputTag> HLT2L1TkMuonL1TkMuonMuRefDR::originTag2_
private

Definition at line 39 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by getCollections().

◆ phiScale_

constexpr float HLT2L1TkMuonL1TkMuonMuRefDR::phiScale_ {2. * M_PI / 576.}
staticprivate

Definition at line 51 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

◆ same_

const bool HLT2L1TkMuonL1TkMuonMuRefDR::same_
private

Definition at line 46 of file HLT2L1TkMuonL1TkMuonMuRefDR.h.

Referenced by hltFilter().