CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtUtilsHelper.h
Go to the documentation of this file.
1 #ifndef GlobalTriggerAnalyzer_L1GtUtilsHelper_h
2 #define GlobalTriggerAnalyzer_L1GtUtilsHelper_h
3 
23 
28 
29 #include <string>
30 #include <utility>
31 
32 namespace edm {
33  class BranchDescription;
35 }
36 
38 
39 public:
40 
41  // Using this constructor will require InputTags to be specified in the configuration
45 
46  // Using this constructor will cause it to look for valid InputTags in
47  // the following ways in the specified order until they are found.
48  // 1. The configuration
49  // 2. Search all products from the RECO process for the required type
50  // 3. Search all products from any other process for the required type
51  template <typename T>
54  bool useL1GtTriggerMenuLite,
55  T& module);
56 
57  // Using this constructor will cause it to look for valid InputTags in
58  // the following ways in the specified order until they are found.
59  // 1. The constructor arguments
60  // 2. The configuration
61  // 3. Search all products from the RECO process for the required type
62  // 4. Search all products from any other process for the required type
63  template <typename T>
66  bool useL1GtTriggerMenuLite,
67  T& module,
71 
72  // A module defining its fillDescriptions function might want to use this
74 
75  // Callback which will be registered with the Framework if the InputTags
76  // are not specified in the configuration or constructor arguments. It
77  // will get called for each product in the ProductRegistry.
78  void operator()(edm::BranchDescription const& branchDescription);
79 
83 
87 
88 private:
89 
91 
95 
99 
103 
107 };
108 
109 template <typename T>
113  T& module) :
114  L1GtUtilsHelper(pset, iC, useL1GtTriggerMenuLite, module, edm::InputTag(), edm::InputTag(), edm::InputTag()) {
115 }
116 
117 template <typename T>
121  T& module,
122  edm::InputTag const& l1GtRecordInputTag,
123  edm::InputTag const& l1GtReadoutRecordInputTag,
124  edm::InputTag const& l1GtTriggerMenuLiteInputTag) :
125  m_consumesCollector(std::move(iC)),
126 
127  // Set InputTags from arguments
128  m_l1GtRecordInputTag(l1GtRecordInputTag),
129  m_l1GtReadoutRecordInputTag(l1GtReadoutRecordInputTag),
130  m_l1GtTriggerMenuLiteInputTag(l1GtTriggerMenuLiteInputTag),
131 
132  m_findRecord(false),
133  m_findReadoutRecord(false),
134  m_findMenuLite(false),
135 
136  m_foundRECORecord(false),
137  m_foundRECOReadoutRecord(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  }
150  if(useL1GtTriggerMenuLite &&
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  }
163  if(useL1GtTriggerMenuLite && !m_l1GtTriggerMenuLiteInputTag.label().empty()) {
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 }
178 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::InputTag const & l1GtReadoutRecordInputTag() const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
edm::InputTag m_l1GtReadoutRecordInputTag
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
edm::EDGetTokenT< L1GlobalTriggerRecord > const & l1GtRecordToken() const
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag const & l1GtRecordInputTag() const
edm::InputTag m_l1GtRecordInputTag
static void fillDescription(edm::ParameterSetDescription &desc)
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
void operator()(edm::BranchDescription const &branchDescription)
volatile std::atomic< bool > shutdown_flag false
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
long double T
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > const & l1GtReadoutRecordToken() const
Definition: vlib.h:208
edm::EDGetTokenT< L1GtTriggerMenuLite > const & l1GtTriggerMenuLiteToken() const
L1GtUtilsHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)