CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TGlobalUtilHelper.h
Go to the documentation of this file.
1 #ifndef L1TGlobal_l1TGlobalUtilHelper_h
2 #define L1TGlobal_l1TGlobalUtilHelper_h
3 
23 
28 
29 #include <string>
30 #include <utility>
31 
32 namespace edm {
33  class BranchDescription;
35 }
36 
37 namespace l1t {
38 
40 
41  public:
42 
43  // Using this constructor will require InputTags to be specified in the configuration
46 
47  // Using this constructor will cause it to look for valid InputTags in
48  // the following ways in the specified order until they are found.
49  // 1. The configuration
50  // 2. Search all products from the preferred input tags for the required type
51  // 3. Search all products from any other process for the required type
52  template <typename T>
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 preferred input tags for the required type
62  // 4. Search all products from any other process for the required type
63  template <typename T>
66  T& module,
69 
70  // A module defining its fillDescriptions function might want to use this
72 
73  // Callback which will be registered with the Framework if the InputTags
74  // are not specified in the configuration or constructor arguments. It
75  // will get called for each product in the ProductRegistry.
76  void operator()(edm::BranchDescription const& branchDescription);
77 
80 
83 
84  private:
85 
87 
90 
93 
96 
99 
102 
103  // use vector here, InputTag has no '<' operator to use std::set
104  std::vector<edm::InputTag> m_inputTagsL1TAlgBlk;
105  std::vector<edm::InputTag> m_inputTagsL1TExtBlk;
106 
107  };
108 
109  template <typename T>
112  T& module) :
113  L1TGlobalUtilHelper(pset, iC, module, edm::InputTag(), edm::InputTag()) {
114  }
115 
116  template <typename T>
119  T& module,
120  edm::InputTag const& l1tAlgBlkInputTag,
121  edm::InputTag const& l1tExtBlkInputTag) :
122  m_consumesCollector(std::move(iC)),
123 
124  // Set InputTags from arguments
125  m_l1tAlgBlkInputTag(l1tAlgBlkInputTag),
126  m_l1tExtBlkInputTag(l1tExtBlkInputTag),
127 
128  m_findL1TAlgBlk(false),
129  m_findL1TExtBlk(false),
130 
131  m_foundPreferredL1TAlgBlk(false),
132  m_foundPreferredL1TExtBlk(false),
133 
134  m_foundMultipleL1TAlgBlk(false),
135  m_foundMultipleL1TExtBlk(false) {
136 
137  // If the InputTags are not set to valid values by the arguments, then
138  // try to set them from the configuration.
139  if(m_l1tAlgBlkInputTag.label().empty() &&
140  pset.existsAs<edm::InputTag>("l1tAlgBlkInputTag")) {
141  m_l1tAlgBlkInputTag = pset.getParameter<edm::InputTag>("l1tAlgBlkInputTag");
142  }
143  if(m_l1tExtBlkInputTag.label().empty() &&
144  pset.existsAs<edm::InputTag>("l1tExtBlkInputTag")) {
145  m_l1tExtBlkInputTag = pset.getParameter<edm::InputTag>("l1tExtBlkInputTag");
146  }
147 
148  // If the InputTags were set to valid values, make the consumes calls.
149  if(!m_l1tAlgBlkInputTag.label().empty()) {
151  }
152  if(!m_l1tExtBlkInputTag.label().empty()) {
154  }
155 
156  // Do we still need to search for each InputTag?
159 
160  // Register the callback function with the Framework
161  // if any InputTags still need to be found.
163  module.callWhenNewProductsRegistered(std::ref(*this));
164  }
165  }
166 
167 }
168 
169 #endif
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< GlobalAlgBlkBxCollection > const & l1tAlgBlkToken() const
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::vector< edm::InputTag > m_inputTagsL1TAlgBlk
L1TGlobalUtilHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
std::vector< edm::InputTag > m_inputTagsL1TExtBlk
edm::EDGetTokenT< GlobalExtBlkBxCollection > m_l1tExtBlkToken
edm::InputTag const & l1tExtBlkInputTag() const
def move
Definition: eostools.py:510
edm::EDGetTokenT< GlobalExtBlkBxCollection > const & l1tExtBlkToken() const
edm::ConsumesCollector m_consumesCollector
static void fillDescription(edm::ParameterSetDescription &desc)
edm::InputTag const & l1tAlgBlkInputTag() const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tAlgBlkToken
std::string const & label() const
Definition: InputTag.h:36
void operator()(edm::BranchDescription const &branchDescription)
volatile std::atomic< bool > shutdown_flag false
long double T
Definition: vlib.h:208