CMS 3D CMS Logo

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

#include <L1GtUtilsHelper.h>

Public Member Functions

edm::InputTag const & l1GtReadoutRecordInputTag () const
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > const & l1GtReadoutRecordToken () const
 
edm::InputTag const & l1GtRecordInputTag () const
 
edm::EDGetTokenT< L1GlobalTriggerRecord > const & l1GtRecordToken () const
 
edm::InputTag const & l1GtTriggerMenuLiteInputTag () const
 
edm::EDGetTokenT< L1GtTriggerMenuLite > const & l1GtTriggerMenuLiteToken () const
 
 L1GtUtilsHelper (edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)
 
template<typename T >
 L1GtUtilsHelper (edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite, T &module)
 
template<typename T >
 L1GtUtilsHelper (edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite, T &module, edm::InputTag const &l1GtRecordInputTag, edm::InputTag const &l1GtReadoutRecordInputTag, edm::InputTag const &l1GtTriggerMenuLiteInputTag)
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &desc)
 

Private Member Functions

void checkToUpdateTags (edm::BranchDescription const &branchDescription, edm::ConsumesCollector, bool findRecord, bool findReadoutRecord, bool findMenuLite)
 

Private Attributes

edm::InputTag m_l1GtReadoutRecordInputTag
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordm_l1GtReadoutRecordToken
 
edm::InputTag m_l1GtRecordInputTag
 
edm::EDGetTokenT< L1GlobalTriggerRecordm_l1GtRecordToken
 
edm::InputTag m_l1GtTriggerMenuLiteInputTag
 
edm::EDGetTokenT< L1GtTriggerMenuLitem_l1GtTriggerMenuLiteToken
 

Detailed Description

Description: Gets tokens for L1GtUtils to use when getting products from the Event and Run. This class was introduced when the consumes function calls were added for L1GtUtils. It preserves the special feature of L1GtUtils that allows it to run without configuration of InputTags, although it allows InputTags to be configured optionally or passed in via the constructor arguments.

Author
: W.David Dagenhart - Fermilab 30 April 2015

Definition at line 37 of file L1GtUtilsHelper.h.

Constructor & Destructor Documentation

◆ L1GtUtilsHelper() [1/3]

L1GtUtilsHelper::L1GtUtilsHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
bool  useL1GtTriggerMenuLite 
)

Definition at line 9 of file L1GtUtilsHelper.cc.

References edm::ConsumesCollector::consumes(), edm::InRun, m_l1GtReadoutRecordInputTag, m_l1GtReadoutRecordToken, m_l1GtRecordInputTag, m_l1GtRecordToken, m_l1GtTriggerMenuLiteInputTag, m_l1GtTriggerMenuLiteToken, and useL1GtTriggerMenuLite().

10  : m_l1GtRecordInputTag(pset.getParameter<edm::InputTag>("l1GtRecordInputTag")),
11  m_l1GtReadoutRecordInputTag(pset.getParameter<edm::InputTag>("l1GtReadoutRecordInputTag")),
12  m_l1GtTriggerMenuLiteInputTag(pset.getParameter<edm::InputTag>("l1GtTriggerMenuLiteInputTag")) {
17  }
18 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::InputTag m_l1GtReadoutRecordInputTag
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag m_l1GtRecordInputTag
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
static const bool useL1GtTriggerMenuLite(true)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken

◆ L1GtUtilsHelper() [2/3]

template<typename T >
L1GtUtilsHelper::L1GtUtilsHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
bool  useL1GtTriggerMenuLite,
T module 
)

Definition at line 98 of file L1GtUtilsHelper.h.

static const bool useL1GtTriggerMenuLite(true)
L1GtUtilsHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)

◆ L1GtUtilsHelper() [3/3]

template<typename T >
L1GtUtilsHelper::L1GtUtilsHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
bool  useL1GtTriggerMenuLite,
T module,
edm::InputTag const &  l1GtRecordInputTag,
edm::InputTag const &  l1GtReadoutRecordInputTag,
edm::InputTag const &  l1GtTriggerMenuLiteInputTag 
)

Definition at line 105 of file L1GtUtilsHelper.h.

References checkToUpdateTags(), edm::ConsumesCollector::consumes(), edm::InRun, edm::InputTag::label(), m_l1GtReadoutRecordInputTag, m_l1GtReadoutRecordToken, m_l1GtRecordInputTag, m_l1GtRecordToken, m_l1GtTriggerMenuLiteInputTag, m_l1GtTriggerMenuLiteToken, muonDTDigis_cfi::pset, and useL1GtTriggerMenuLite().

112  : // Set InputTags from arguments
116  // If the InputTags are not set to valid values by the arguments, then
117  // try to set them from the configuration.
118  if (m_l1GtRecordInputTag.label().empty() && pset.existsAs<edm::InputTag>("l1GtRecordInputTag")) {
119  m_l1GtRecordInputTag = pset.getParameter<edm::InputTag>("l1GtRecordInputTag");
120  }
121  if (m_l1GtReadoutRecordInputTag.label().empty() && pset.existsAs<edm::InputTag>("l1GtReadoutRecordInputTag")) {
122  m_l1GtReadoutRecordInputTag = pset.getParameter<edm::InputTag>("l1GtReadoutRecordInputTag");
123  }
125  pset.existsAs<edm::InputTag>("l1GtTriggerMenuLiteInputTag")) {
126  m_l1GtTriggerMenuLiteInputTag = pset.getParameter<edm::InputTag>("l1GtTriggerMenuLiteInputTag");
127  }
128 
129  // If the InputTags were set to valid values, make the consumes calls.
130  if (!m_l1GtRecordInputTag.label().empty()) {
132  }
133  if (!m_l1GtReadoutRecordInputTag.label().empty()) {
135  }
138  }
139 
140  // Do we still need to search for each InputTag?
141  bool findRecord = m_l1GtRecordInputTag.label().empty();
142  bool findReadoutRecord = m_l1GtReadoutRecordInputTag.label().empty();
143  bool findMenuLite = m_l1GtTriggerMenuLiteInputTag.label().empty() && useL1GtTriggerMenuLite;
144 
145  // Register the callback function with the Framework
146  // if any InputTags still need to be found.
147  if (findRecord || findReadoutRecord || findMenuLite) {
148  module.callWhenNewProductsRegistered([this, findRecord, findReadoutRecord, findMenuLite, iC](auto iBranch) {
149  checkToUpdateTags(iBranch, iC, findRecord, findReadoutRecord, findMenuLite);
150  });
151  }
152 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::InputTag m_l1GtReadoutRecordInputTag
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
std::string const & label() const
Definition: InputTag.h:36
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag m_l1GtRecordInputTag
edm::InputTag const & l1GtRecordInputTag() const
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
edm::InputTag const & l1GtTriggerMenuLiteInputTag() const
void checkToUpdateTags(edm::BranchDescription const &branchDescription, edm::ConsumesCollector, bool findRecord, bool findReadoutRecord, bool findMenuLite)
static const bool useL1GtTriggerMenuLite(true)
edm::InputTag const & l1GtReadoutRecordInputTag() const
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken

Member Function Documentation

◆ checkToUpdateTags()

void L1GtUtilsHelper::checkToUpdateTags ( edm::BranchDescription const &  branchDescription,
edm::ConsumesCollector  consumesCollector,
bool  findRecord,
bool  findReadoutRecord,
bool  findMenuLite 
)
private

Definition at line 88 of file L1GtUtilsHelper.cc.

References edm::BranchDescription::branchType(), edm::BranchDescription::dropped(), edm::InEvent, ProducerED_cfi::InputTag, m_l1GtReadoutRecordInputTag, m_l1GtReadoutRecordToken, m_l1GtRecordInputTag, m_l1GtRecordToken, m_l1GtTriggerMenuLiteInputTag, m_l1GtTriggerMenuLiteToken, and edm::BranchDescription::unwrappedTypeID().

Referenced by L1GtUtilsHelper().

92  {
93  if (branchDescription.dropped()) {
94  return;
95  }
96  // This is only used if required InputTags were not specified already.
97  // This is called early in the process, once for each product in the ProductRegistry.
98  // The callback is registered when callWhenNewProductsRegistered is called.
99  // It finds products by type and sets the token so that it can be used
100  // later when getting the product.
101 
102  // The code will look for the corresponding product in ProductRegistry.
103  // If the product is found, it checks the product label in
104  // a vector of preferred input tags (hardwired now to "gtDigis" and
105  // "hltGtDigis"). The first input tag from the vector of preferred input tags, with the
106  // same label as the input tag found from provenance, is kept as input tag, if there are no
107  // multiple products with the same label.
108 
109  // If multiple products are found and no one has a label in the vector of preferred input tags,
110  // or if multiple products are found with the label in the vector of preferred input tags
111  // (with different instance or process) the input tag is set to empty input tag, and L1GtUtil
112  // will produce an error, as it is not possible to safely choose a product. In this case, one must
113  // provide explicitly the correct input tag via configuration or in the constructor.
114 
115  // TODO decide if the preferred input tags must be given as input parameters
116  // or stay hardwired
117 
118  std::vector<edm::InputTag> preferredL1GtRecordInputTag = {edm::InputTag("gtDigis"), edm::InputTag("hltGtDigis")};
119 
120  std::vector<edm::InputTag> preferredL1GtReadoutRecordInputTag = {edm::InputTag("gtDigis"),
121  edm::InputTag("hltGtDigis")};
122 
123  std::vector<edm::InputTag> preferredL1GtTriggerMenuLiteInputTag = {edm::InputTag("gtDigis"),
124  edm::InputTag("hltGtDigis")};
125 
126  // L1GlobalTriggerRecord
127 
128  if (findRecord && (branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GlobalTriggerRecord))) &&
129  (branchDescription.branchType() == edm::InEvent)) {
130  setConsumesAndCheckAmbiguities(branchDescription,
131  preferredL1GtRecordInputTag,
134  consumesCollector,
135  "L1GlobalTriggerRecord");
136  }
137 
138  // L1GlobalTriggerReadoutRecord
139 
140  if (findReadoutRecord && (branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GlobalTriggerReadoutRecord))) &&
141  (branchDescription.branchType() == edm::InEvent)) {
142  setConsumesAndCheckAmbiguities(branchDescription,
143  preferredL1GtReadoutRecordInputTag,
146  consumesCollector,
147  "L1GlobalTriggerReadoutRecord");
148  }
149 
150  // L1GtTriggerMenuLite
151 
152  if (findMenuLite && (branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GtTriggerMenuLite))) &&
153  (branchDescription.branchType() == edm::InEvent)) {
154  setConsumesAndCheckAmbiguities(branchDescription,
155  preferredL1GtTriggerMenuLiteInputTag,
158  consumesCollector,
159  "L1GtTriggerMenuLite");
160  }
161 }
edm::InputTag m_l1GtReadoutRecordInputTag
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag m_l1GtRecordInputTag
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken

◆ fillDescription()

void L1GtUtilsHelper::fillDescription ( edm::ParameterSetDescription desc)
static

Definition at line 20 of file L1GtUtilsHelper.cc.

References submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

Referenced by L1GtUtils::fillDescription().

20  {
21  desc.add<edm::InputTag>("l1GtRecordInputTag", edm::InputTag());
22  desc.add<edm::InputTag>("l1GtReadoutRecordInputTag", edm::InputTag());
23  desc.add<edm::InputTag>("l1GtTriggerMenuLiteInputTag", edm::InputTag());
24 }

◆ l1GtReadoutRecordInputTag()

edm::InputTag const& L1GtUtilsHelper::l1GtReadoutRecordInputTag ( ) const
inline

Definition at line 69 of file L1GtUtilsHelper.h.

References m_l1GtReadoutRecordInputTag.

edm::InputTag m_l1GtReadoutRecordInputTag

◆ l1GtReadoutRecordToken()

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> const& L1GtUtilsHelper::l1GtReadoutRecordToken ( ) const
inline

Definition at line 73 of file L1GtUtilsHelper.h.

References m_l1GtReadoutRecordToken.

73  {
75  }
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken

◆ l1GtRecordInputTag()

edm::InputTag const& L1GtUtilsHelper::l1GtRecordInputTag ( ) const
inline

Definition at line 68 of file L1GtUtilsHelper.h.

References m_l1GtRecordInputTag.

68 { return m_l1GtRecordInputTag; }
edm::InputTag m_l1GtRecordInputTag

◆ l1GtRecordToken()

edm::EDGetTokenT<L1GlobalTriggerRecord> const& L1GtUtilsHelper::l1GtRecordToken ( ) const
inline

Definition at line 72 of file L1GtUtilsHelper.h.

References m_l1GtRecordToken.

72 { return m_l1GtRecordToken; }
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken

◆ l1GtTriggerMenuLiteInputTag()

edm::InputTag const& L1GtUtilsHelper::l1GtTriggerMenuLiteInputTag ( ) const
inline

Definition at line 70 of file L1GtUtilsHelper.h.

References m_l1GtTriggerMenuLiteInputTag.

edm::InputTag m_l1GtTriggerMenuLiteInputTag

◆ l1GtTriggerMenuLiteToken()

edm::EDGetTokenT<L1GtTriggerMenuLite> const& L1GtUtilsHelper::l1GtTriggerMenuLiteToken ( ) const
inline

Definition at line 76 of file L1GtUtilsHelper.h.

References m_l1GtTriggerMenuLiteToken.

edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken

Member Data Documentation

◆ m_l1GtReadoutRecordInputTag

edm::InputTag L1GtUtilsHelper::m_l1GtReadoutRecordInputTag
private

Definition at line 89 of file L1GtUtilsHelper.h.

Referenced by checkToUpdateTags(), l1GtReadoutRecordInputTag(), and L1GtUtilsHelper().

◆ m_l1GtReadoutRecordToken

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> L1GtUtilsHelper::m_l1GtReadoutRecordToken
private

Definition at line 93 of file L1GtUtilsHelper.h.

Referenced by checkToUpdateTags(), l1GtReadoutRecordToken(), and L1GtUtilsHelper().

◆ m_l1GtRecordInputTag

edm::InputTag L1GtUtilsHelper::m_l1GtRecordInputTag
private

Definition at line 88 of file L1GtUtilsHelper.h.

Referenced by checkToUpdateTags(), l1GtRecordInputTag(), and L1GtUtilsHelper().

◆ m_l1GtRecordToken

edm::EDGetTokenT<L1GlobalTriggerRecord> L1GtUtilsHelper::m_l1GtRecordToken
private

Definition at line 92 of file L1GtUtilsHelper.h.

Referenced by checkToUpdateTags(), l1GtRecordToken(), and L1GtUtilsHelper().

◆ m_l1GtTriggerMenuLiteInputTag

edm::InputTag L1GtUtilsHelper::m_l1GtTriggerMenuLiteInputTag
private

◆ m_l1GtTriggerMenuLiteToken

edm::EDGetTokenT<L1GtTriggerMenuLite> L1GtUtilsHelper::m_l1GtTriggerMenuLiteToken
private

Definition at line 94 of file L1GtUtilsHelper.h.

Referenced by checkToUpdateTags(), l1GtTriggerMenuLiteToken(), and L1GtUtilsHelper().