CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public 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)
 
void operator() (edm::BranchDescription const &branchDescription)
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &desc)
 

Private Attributes

edm::ConsumesCollector m_consumesCollector
 
bool m_findMenuLite
 
bool m_findReadoutRecord
 
bool m_findRecord
 
bool m_foundRECOMenuLite
 
bool m_foundRECOReadoutRecord
 
bool m_foundRECORecord
 
edm::InputTag m_l1GtReadoutRecordInputTag
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
m_l1GtReadoutRecordToken
 
edm::InputTag m_l1GtRecordInputTag
 
edm::EDGetTokenT
< L1GlobalTriggerRecord
m_l1GtRecordToken
 
edm::InputTag m_l1GtTriggerMenuLiteInputTag
 
edm::EDGetTokenT
< L1GtTriggerMenuLite
m_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::L1GtUtilsHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
bool  useL1GtTriggerMenuLite 
)

Definition at line 7 of file L1GtUtilsHelper.cc.

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

9  :
10  m_consumesCollector(std::move(iC)),
11  m_l1GtRecordInputTag(pset.getParameter<edm::InputTag>("l1GtRecordInputTag")),
12  m_l1GtReadoutRecordInputTag(pset.getParameter<edm::InputTag>("l1GtReadoutRecordInputTag")),
13  m_l1GtTriggerMenuLiteInputTag(pset.getParameter<edm::InputTag>("l1GtTriggerMenuLiteInputTag")),
14  m_findRecord(false),
15  m_findReadoutRecord(false),
16  m_findMenuLite(false),
17  m_foundRECORecord(false),
19  m_foundRECOMenuLite(false)
20 {
25  }
26 }
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
edm::ConsumesCollector m_consumesCollector
static const bool useL1GtTriggerMenuLite(true)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
template<typename T >
L1GtUtilsHelper::L1GtUtilsHelper ( edm::ParameterSet const &  pset,
edm::ConsumesCollector iC,
bool  useL1GtTriggerMenuLite,
T module 
)

Definition at line 110 of file L1GtUtilsHelper.h.

113  :
115 }
static const bool useL1GtTriggerMenuLite(true)
Definition: vlib.h:208
L1GtUtilsHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)
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 118 of file L1GtUtilsHelper.h.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), edm::InRun, edm::InputTag::label(), m_findMenuLite, m_findReadoutRecord, m_findRecord, m_l1GtReadoutRecordInputTag, m_l1GtReadoutRecordToken, m_l1GtRecordInputTag, m_l1GtRecordToken, m_l1GtTriggerMenuLiteInputTag, m_l1GtTriggerMenuLiteToken, and useL1GtTriggerMenuLite().

124  :
125  m_consumesCollector(std::move(iC)),
126 
127  // Set InputTags from arguments
131 
132  m_findRecord(false),
133  m_findReadoutRecord(false),
134  m_findMenuLite(false),
135 
136  m_foundRECORecord(false),
138  m_foundRECOMenuLite(false) {
139 
140  // If the InputTags are not set to valid values by the arguments, then
141  // try to set them from the configuration.
142  if(m_l1GtRecordInputTag.label().empty() &&
143  pset.existsAs<edm::InputTag>("l1GtRecordInputTag")) {
144  m_l1GtRecordInputTag = pset.getParameter<edm::InputTag>("l1GtRecordInputTag");
145  }
146  if(m_l1GtReadoutRecordInputTag.label().empty() &&
147  pset.existsAs<edm::InputTag>("l1GtReadoutRecordInputTag")) {
148  m_l1GtReadoutRecordInputTag = pset.getParameter<edm::InputTag>("l1GtReadoutRecordInputTag");
149  }
152  pset.existsAs<edm::InputTag>("l1GtTriggerMenuLiteInputTag")) {
153  m_l1GtTriggerMenuLiteInputTag = pset.getParameter<edm::InputTag>("l1GtTriggerMenuLiteInputTag");
154  }
155 
156  // If the InputTags were set to valid values, make the consumes calls.
157  if(!m_l1GtRecordInputTag.label().empty()) {
159  }
160  if(!m_l1GtReadoutRecordInputTag.label().empty()) {
162  }
165  }
166 
167  // Do we still need to search for each InputTag?
171 
172  // Register the callback function with the Framework
173  // if any InputTags still need to be found.
175  module.callWhenNewProductsRegistered(std::ref(*this));
176  }
177 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::InputTag const & l1GtReadoutRecordInputTag() const
edm::InputTag m_l1GtReadoutRecordInputTag
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag const & l1GtRecordInputTag() const
edm::InputTag m_l1GtRecordInputTag
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
edm::ConsumesCollector m_consumesCollector
edm::InputTag const & l1GtTriggerMenuLiteInputTag() const
static const bool useL1GtTriggerMenuLite(true)
std::string const & label() const
Definition: InputTag.h:43
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
Definition: vlib.h:208

Member Function Documentation

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

Definition at line 28 of file L1GtUtilsHelper.cc.

References edm::ParameterSetDescription::add(), and HLT_25ns14e33_v1_cff::InputTag.

Referenced by L1GtUtils::fillDescription().

28  {
29  desc.add<edm::InputTag>("l1GtRecordInputTag", edm::InputTag());
30  desc.add<edm::InputTag>("l1GtReadoutRecordInputTag", edm::InputTag());
31  desc.add<edm::InputTag>("l1GtTriggerMenuLiteInputTag", edm::InputTag());
32 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::InputTag const& L1GtUtilsHelper::l1GtReadoutRecordInputTag ( ) const
inline

Definition at line 81 of file L1GtUtilsHelper.h.

References m_l1GtReadoutRecordInputTag.

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

Definition at line 85 of file L1GtUtilsHelper.h.

References m_l1GtReadoutRecordToken.

85 { return m_l1GtReadoutRecordToken; }
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
edm::InputTag const& L1GtUtilsHelper::l1GtRecordInputTag ( ) const
inline

Definition at line 80 of file L1GtUtilsHelper.h.

References m_l1GtRecordInputTag.

80 { return m_l1GtRecordInputTag; }
edm::InputTag m_l1GtRecordInputTag
edm::EDGetTokenT<L1GlobalTriggerRecord> const& L1GtUtilsHelper::l1GtRecordToken ( ) const
inline

Definition at line 84 of file L1GtUtilsHelper.h.

References m_l1GtRecordToken.

84 { return m_l1GtRecordToken; }
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
edm::InputTag const& L1GtUtilsHelper::l1GtTriggerMenuLiteInputTag ( ) const
inline

Definition at line 82 of file L1GtUtilsHelper.h.

References m_l1GtTriggerMenuLiteInputTag.

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

Definition at line 86 of file L1GtUtilsHelper.h.

References m_l1GtTriggerMenuLiteToken.

edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
void L1GtUtilsHelper::operator() ( edm::BranchDescription const &  branchDescription)

Definition at line 34 of file L1GtUtilsHelper.cc.

References edm::BranchDescription::branchType(), edm::ConsumesCollector::consumes(), edm::InEvent, edm::InRun, edm::EDGetTokenT< T >::isUninitialized(), m_consumesCollector, m_findMenuLite, m_findReadoutRecord, m_findRecord, m_foundRECOMenuLite, m_foundRECOReadoutRecord, m_foundRECORecord, m_l1GtReadoutRecordInputTag, m_l1GtReadoutRecordToken, m_l1GtRecordInputTag, m_l1GtRecordToken, m_l1GtTriggerMenuLiteInputTag, m_l1GtTriggerMenuLiteToken, edm::BranchDescription::moduleLabel(), edm::BranchDescription::processName(), edm::BranchDescription::productInstanceName(), GlobalPosition_Frontier_DevDB_cff::tag, and edm::BranchDescription::unwrappedTypeID().

34  {
35 
36  // This is only used if required InputTags were not specified already.
37  // This is called early in the process, once for each product in the ProductRegistry.
38  // The callback is registered when callWhenNewProductsRegistered is called.
39  // It finds products by type and sets the token so that it can be used
40  // later when getting the product.
41  // This code assumes there is at most one product from the RECO process
42  // and at most one product from some other process. It selects a product
43  // from the RECO process if it is present and a product from some other process
44  // if it is not. This is a bit unsafe because if there is more than one from
45  // RECO or none from RECO and more than one from other processes it is somewhat
46  // arbitrary which one is selected. I'm leaving this behavior in to maintain
47  // consistency with the previous behavior. It is supposed to not happen and if
48  // it does the products might be identical anyway. To avoid this risk or select
49  // different products, specify the InputTags either in the configuration or the
50  // arguments to the constructor.
51 
52  if (m_findRecord &&
54  branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GlobalTriggerRecord)) &&
55  branchDescription.branchType() == edm::InEvent) {
56  edm::InputTag tag{branchDescription.moduleLabel(),
57  branchDescription.productInstanceName(),
58  branchDescription.processName()};
59  if(branchDescription.processName() == "RECO") {
62  m_foundRECORecord = true;
63  } else if (m_l1GtRecordToken.isUninitialized()) {
66  }
67  }
68 
69  if (m_findReadoutRecord &&
71  branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GlobalTriggerReadoutRecord)) &&
72  branchDescription.branchType() == edm::InEvent) {
73  edm::InputTag tag{branchDescription.moduleLabel(),
74  branchDescription.productInstanceName(),
75  branchDescription.processName()};
76  if(branchDescription.processName() == "RECO") {
83  }
84  }
85 
86  if (m_findMenuLite &&
88  branchDescription.branchType() == edm::InRun &&
89  branchDescription.unwrappedTypeID() == edm::TypeID(typeid(L1GtTriggerMenuLite))) {
90  edm::InputTag tag{branchDescription.moduleLabel(),
91  branchDescription.productInstanceName(),
92  branchDescription.processName()};
93  if(branchDescription.processName() == "RECO") {
96  m_foundRECOMenuLite = true;
100  }
101  }
102 }
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
edm::ConsumesCollector m_consumesCollector
bool isUninitialized() const
Definition: EDGetToken.h:71
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken

Member Data Documentation

edm::ConsumesCollector L1GtUtilsHelper::m_consumesCollector
private

Definition at line 90 of file L1GtUtilsHelper.h.

Referenced by operator()().

bool L1GtUtilsHelper::m_findMenuLite
private

Definition at line 102 of file L1GtUtilsHelper.h.

Referenced by L1GtUtilsHelper(), and operator()().

bool L1GtUtilsHelper::m_findReadoutRecord
private

Definition at line 101 of file L1GtUtilsHelper.h.

Referenced by L1GtUtilsHelper(), and operator()().

bool L1GtUtilsHelper::m_findRecord
private

Definition at line 100 of file L1GtUtilsHelper.h.

Referenced by L1GtUtilsHelper(), and operator()().

bool L1GtUtilsHelper::m_foundRECOMenuLite
private

Definition at line 106 of file L1GtUtilsHelper.h.

Referenced by operator()().

bool L1GtUtilsHelper::m_foundRECOReadoutRecord
private

Definition at line 105 of file L1GtUtilsHelper.h.

Referenced by operator()().

bool L1GtUtilsHelper::m_foundRECORecord
private

Definition at line 104 of file L1GtUtilsHelper.h.

Referenced by operator()().

edm::InputTag L1GtUtilsHelper::m_l1GtReadoutRecordInputTag
private

Definition at line 93 of file L1GtUtilsHelper.h.

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

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

Definition at line 97 of file L1GtUtilsHelper.h.

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

edm::InputTag L1GtUtilsHelper::m_l1GtRecordInputTag
private

Definition at line 92 of file L1GtUtilsHelper.h.

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

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

Definition at line 96 of file L1GtUtilsHelper.h.

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

edm::InputTag L1GtUtilsHelper::m_l1GtTriggerMenuLiteInputTag
private

Definition at line 94 of file L1GtUtilsHelper.h.

Referenced by l1GtTriggerMenuLiteInputTag(), L1GtUtilsHelper(), and operator()().

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

Definition at line 98 of file L1GtUtilsHelper.h.

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