CMS 3D CMS Logo

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 } // namespace edm
36 
38 public:
39  // Using this constructor will require InputTags to be specified in the configuration
41 
42  // Using this constructor will cause it to look for valid InputTags in
43  // the following ways in the specified order until they are found.
44  // 1. The configuration
45  // 2. Search all products from the preferred input tags for the required type
46  // 3. Search all products from any other process for the required type
47  template <typename T>
49 
50  // Using this constructor will cause it to look for valid InputTags in
51  // the following ways in the specified order until they are found.
52  // 1. The constructor arguments
53  // 2. The configuration
54  // 3. Search all products from the preferred input tags for the required type
55  // 4. Search all products from any other process for the required type
56  template <typename T>
60  T& module,
64 
65  // A module defining its fillDescriptions function might want to use this
67 
68  // Callback which will be registered with the Framework if the InputTags
69  // are not specified in the configuration or constructor arguments. It
70  // will get called for each product in the ProductRegistry.
71  void operator()(edm::BranchDescription const& branchDescription);
72 
76 
80  }
82 
83 private:
85 
89 
93 
97 
101 
105 
106  // use vector here, InputTag has no '<' operator to use std::set
107  std::vector<edm::InputTag> m_inputTagsL1GtRecord;
108  std::vector<edm::InputTag> m_inputTagsL1GtReadoutRecord;
109  std::vector<edm::InputTag> m_inputTagsL1GtMenuLite;
110 };
111 
112 template <typename T>
116  T& module)
118 
119 template <typename T>
123  T& module,
127  : m_consumesCollector(iC),
128 
129  // Set InputTags from arguments
130  m_l1GtRecordInputTag(l1GtRecordInputTag),
131  m_l1GtReadoutRecordInputTag(l1GtReadoutRecordInputTag),
132  m_l1GtTriggerMenuLiteInputTag(l1GtTriggerMenuLiteInputTag),
133 
134  m_findRecord(false),
135  m_findReadoutRecord(false),
136  m_findMenuLite(false),
137 
138  m_foundPreferredRecord(false),
139  m_foundPreferredReadoutRecord(false),
140  m_foundPreferredMenuLite(false),
141 
142  m_foundMultipleL1GtRecord(false),
143  m_foundMultipleL1GtReadoutRecord(false),
144  m_foundMultipleL1GtMenuLite(false) {
145  // If the InputTags are not set to valid values by the arguments, then
146  // try to set them from the configuration.
147  if (m_l1GtRecordInputTag.label().empty() && pset.existsAs<edm::InputTag>("l1GtRecordInputTag")) {
148  m_l1GtRecordInputTag = pset.getParameter<edm::InputTag>("l1GtRecordInputTag");
149  }
150  if (m_l1GtReadoutRecordInputTag.label().empty() && pset.existsAs<edm::InputTag>("l1GtReadoutRecordInputTag")) {
151  m_l1GtReadoutRecordInputTag = pset.getParameter<edm::InputTag>("l1GtReadoutRecordInputTag");
152  }
154  pset.existsAs<edm::InputTag>("l1GtTriggerMenuLiteInputTag")) {
155  m_l1GtTriggerMenuLiteInputTag = pset.getParameter<edm::InputTag>("l1GtTriggerMenuLiteInputTag");
156  }
157 
158  // If the InputTags were set to valid values, make the consumes calls.
159  if (!m_l1GtRecordInputTag.label().empty()) {
161  }
162  if (!m_l1GtReadoutRecordInputTag.label().empty()) {
164  }
167  }
168 
169  // Do we still need to search for each InputTag?
173 
174  // Register the callback function with the Framework
175  // if any InputTags still need to be found.
177  module.callWhenNewProductsRegistered(std::ref(*this));
178  }
179 }
180 #endif
l1MenuTree_cfi.l1GtTriggerMenuLiteInputTag
l1GtTriggerMenuLiteInputTag
Definition: l1MenuTree_cfi.py:6
L1GtUtilsHelper::L1GtUtilsHelper
L1GtUtilsHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)
Definition: L1GtUtilsHelper.cc:9
funct::false
false
Definition: Factorize.h:29
edm::EDGetTokenT< L1GlobalTriggerRecord >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
L1GtUtilsHelper
Definition: L1GtUtilsHelper.h:37
L1GtUtilsHelper::m_foundMultipleL1GtReadoutRecord
bool m_foundMultipleL1GtReadoutRecord
Definition: L1GtUtilsHelper.h:103
L1GtTriggerMenuLite.h
edm::InRun
Definition: BranchType.h:11
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
L1GtUtilsHelper::m_l1GtTriggerMenuLiteInputTag
edm::InputTag m_l1GtTriggerMenuLiteInputTag
Definition: L1GtUtilsHelper.h:88
L1GtUtilsHelper::m_inputTagsL1GtMenuLite
std::vector< edm::InputTag > m_inputTagsL1GtMenuLite
Definition: L1GtUtilsHelper.h:109
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
L1GtUtilsHelper::m_foundMultipleL1GtMenuLite
bool m_foundMultipleL1GtMenuLite
Definition: L1GtUtilsHelper.h:104
L1GlobalTriggerRecord.h
L1GtUtilsHelper::m_inputTagsL1GtReadoutRecord
std::vector< edm::InputTag > m_inputTagsL1GtReadoutRecord
Definition: L1GtUtilsHelper.h:108
L1GtUtilsHelper::l1GtReadoutRecordToken
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > const & l1GtReadoutRecordToken() const
Definition: L1GtUtilsHelper.h:78
L1GtUtilsHelper::m_foundMultipleL1GtRecord
bool m_foundMultipleL1GtRecord
Definition: L1GtUtilsHelper.h:102
L1GtUtilsHelper::m_inputTagsL1GtRecord
std::vector< edm::InputTag > m_inputTagsL1GtRecord
Definition: L1GtUtilsHelper.h:107
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
L1GtUtilsHelper::m_l1GtReadoutRecordToken
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
Definition: L1GtUtilsHelper.h:91
EDGetToken.h
useL1GtTriggerMenuLite
static const bool useL1GtTriggerMenuLite(true)
edm::ParameterSet
Definition: ParameterSet.h:47
L1GtUtilsHelper::m_findMenuLite
bool m_findMenuLite
Definition: L1GtUtilsHelper.h:96
L1GtUtilsHelper::m_foundPreferredReadoutRecord
bool m_foundPreferredReadoutRecord
Definition: L1GtUtilsHelper.h:99
L1GtUtilsHelper::l1GtRecordInputTag
edm::InputTag const & l1GtRecordInputTag() const
Definition: L1GtUtilsHelper.h:73
L1GtUtilsHelper::operator()
void operator()(edm::BranchDescription const &branchDescription)
Definition: L1GtUtilsHelper.cc:33
L1GtUtilsHelper::l1GtTriggerMenuLiteInputTag
edm::InputTag const & l1GtTriggerMenuLiteInputTag() const
Definition: L1GtUtilsHelper.h:75
L1GtUtilsHelper::fillDescription
static void fillDescription(edm::ParameterSetDescription &desc)
Definition: L1GtUtilsHelper.cc:27
L1GtUtilsHelper::m_l1GtReadoutRecordInputTag
edm::InputTag m_l1GtReadoutRecordInputTag
Definition: L1GtUtilsHelper.h:87
l1MenuTree_cfi.l1GtRecordInputTag
l1GtRecordInputTag
Definition: l1MenuTree_cfi.py:4
l1MenuTree_cfi.l1GtReadoutRecordInputTag
l1GtReadoutRecordInputTag
Definition: l1MenuTree_cfi.py:5
InputTag.h
L1GtUtilsHelper::m_findRecord
bool m_findRecord
Definition: L1GtUtilsHelper.h:94
L1GtTriggerMenuLite
Definition: L1GtTriggerMenuLite.h:39
L1GtUtilsHelper::m_l1GtTriggerMenuLiteToken
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
Definition: L1GtUtilsHelper.h:92
L1GtUtilsHelper::l1GtReadoutRecordInputTag
edm::InputTag const & l1GtReadoutRecordInputTag() const
Definition: L1GtUtilsHelper.h:74
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
L1GtUtilsHelper::l1GtRecordToken
edm::EDGetTokenT< L1GlobalTriggerRecord > const & l1GtRecordToken() const
Definition: L1GtUtilsHelper.h:77
L1GtUtilsHelper::m_foundPreferredMenuLite
bool m_foundPreferredMenuLite
Definition: L1GtUtilsHelper.h:100
L1GtUtilsHelper::l1GtTriggerMenuLiteToken
edm::EDGetTokenT< L1GtTriggerMenuLite > const & l1GtTriggerMenuLiteToken() const
Definition: L1GtUtilsHelper.h:81
T
long double T
Definition: Basic3DVectorLD.h:48
ParameterSetDescription
L1GtUtilsHelper::m_findReadoutRecord
bool m_findReadoutRecord
Definition: L1GtUtilsHelper.h:95
edm::BranchDescription
Definition: BranchDescription.h:32
L1GtUtilsHelper::m_l1GtRecordToken
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
Definition: L1GtUtilsHelper.h:90
L1GtUtilsHelper::m_consumesCollector
edm::ConsumesCollector m_consumesCollector
Definition: L1GtUtilsHelper.h:84
ConsumesCollector.h
ParameterSet.h
L1GlobalTriggerRecord
Definition: L1GlobalTriggerRecord.h:33
L1GtUtilsHelper::m_foundPreferredRecord
bool m_foundPreferredRecord
Definition: L1GtUtilsHelper.h:98
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
L1GtUtilsHelper::m_l1GtRecordInputTag
edm::InputTag m_l1GtRecordInputTag
Definition: L1GtUtilsHelper.h:86
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27