10 : m_l1tAlgBlkInputTag(
pset.getParameter<
edm::
InputTag>(
"l1tAlgBlkInputTag")),
11 m_l1tExtBlkInputTag(
pset.getParameter<
edm::
InputTag>(
"l1tExtBlkInputTag")),
12 m_readPrescalesFromFile(
pset.getParameter<
bool>(
"ReadPrescalesFromFile")) {
20 bool readPrescalesFromFile) {
23 desc.add<
bool>(
"ReadPrescalesFromFile", readPrescalesFromFile);
27 template <
typename C,
typename T>
29 C const& iPreferredTags,
33 const char* iTypeForErrorMessage) {
34 if (ioTag.
label().empty()) {
38 ioToken = iCollector.
consumes(ioTag);
40 <<
"Input tag found for " << iTypeForErrorMessage <<
" product.\n Input tag set to " << (ioTag) <<
"\n Tag is" 41 << ((iPreferredTags.end() !=
std::find(iPreferredTags.begin(), iPreferredTags.end(), ioTag.
label())) ?
"" 43 <<
" found in preferred tags list " << std::endl;
46 bool alreadyFoundPreferred =
47 iPreferredTags.end() !=
std::find(iPreferredTags.begin(), iPreferredTags.end(), ioTag.
label());
48 if (alreadyFoundPreferred) {
49 if (
std::find(iPreferredTags.begin(), iPreferredTags.end(), iDesc.
moduleLabel()) != iPreferredTags.end()) {
51 <<
"Found multiple preferred input tags for " << iTypeForErrorMessage <<
" product, " 52 <<
"\nwith different instaces or processes." 53 <<
"\nTag already found: " << (ioTag) <<
"\nOther tag: " 60 if (itFound != iPreferredTags.end()) {
65 ioToken = iCollector.
consumes(ioTag);
66 edm::LogWarning(
"L1GtUtils") <<
"Found preferred tag " << (ioTag) <<
"\n after having set unpreferred tag (" 67 << oldTag <<
") for " << iTypeForErrorMessage
68 <<
".\n Please change configuration to explicitly use the tag given above.\n " 69 "This will avoid unnecessary prefetching of data not used.";
72 edm::LogWarning(
"L1GtUtils") <<
"Found multiple input tags for " << iTypeForErrorMessage <<
" product." 73 <<
"\nNone is in the preferred input tags - no safe choice." 74 <<
"\nTag already found: " << (ioTag) <<
"\nOther tag: " 77 <<
"\nToken set to invalid." << std::endl;
111 if (branchDescription.
dropped()) {
115 std::vector<edm::InputTag> preferredL1TAlgBlkInputTag = {
edm::InputTag(
"gtStage2Digis"),
118 std::vector<edm::InputTag> preferredL1TExtBlkInputTag = {
edm::InputTag(
"gtStage2Digis"),
125 setConsumesAndCheckAmbiguities(branchDescription,
126 preferredL1TAlgBlkInputTag,
130 "GlobalAlgBlkBxCollection");
137 setConsumesAndCheckAmbiguities(branchDescription,
138 preferredL1TExtBlkInputTag,
142 "GlobalExtBlkBxCollection");
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
BranchType const & branchType() const
TypeID unwrappedTypeID() const
std::string const & processName() const
L1TGlobalUtilHelper(edm::ParameterSet const &pset, edm::ConsumesCollector &iC)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< GlobalExtBlkBxCollection > m_l1tExtBlkToken
static void fillDescription(edm::ParameterSetDescription &desc, edm::InputTag const &iAlg, edm::InputTag const &iExt, bool readPrescalesFromFile)
std::string const & productInstanceName() const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tAlgBlkToken
edm::InputTag m_l1tAlgBlkInputTag
void checkToUpdateTags(edm::BranchDescription const &branchDescription, edm::ConsumesCollector, bool findL1TAlgBlk, bool findL1TExtBlk)
edm::InputTag m_l1tExtBlkInputTag
Log< level::Warning, false > LogWarning
std::string const & moduleLabel() const