CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtUtilsHelper.cc
Go to the documentation of this file.
6 
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),
18  m_foundRECOReadoutRecord(false),
19  m_foundRECOMenuLite(false)
20 {
23  if(useL1GtTriggerMenuLite) {
25  }
26 }
27 
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 }
33 
34 void L1GtUtilsHelper::operator()(edm::BranchDescription const& branchDescription) {
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)
BranchType const & branchType() const
edm::InputTag m_l1GtReadoutRecordInputTag
std::string const & processName() const
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTriggerMenuLiteToken
edm::InputTag m_l1GtTriggerMenuLiteInputTag
edm::InputTag m_l1GtRecordInputTag
std::string const & moduleLabel() const
std::string const & productInstanceName() const
TypeID unwrappedTypeID() const
static void fillDescription(edm::ParameterSetDescription &desc)
edm::EDGetTokenT< L1GlobalTriggerRecord > m_l1GtRecordToken
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ConsumesCollector m_consumesCollector
static const bool useL1GtTriggerMenuLite(true)
bool isUninitialized() const
Definition: EDGetToken.h:71
void operator()(edm::BranchDescription const &branchDescription)
volatile std::atomic< bool > shutdown_flag false
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
L1GtUtilsHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC, bool useL1GtTriggerMenuLite)