CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::ConcurrentIOVAnalyzer Class Reference
Inheritance diagram for edmtest::ConcurrentIOVAnalyzer:
edm::global::EDAnalyzer<> edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::StreamID, edm::Event const &, edm::EventSetup const &) const override
 
 ConcurrentIOVAnalyzer (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::global::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool checkExpectedValues_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESProducer_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESSource_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Used in tests of the concurrent IOV features of the EventSetup system

Definition at line 31 of file ConcurrentIOVAnalyzer.cc.

Constructor & Destructor Documentation

◆ ConcurrentIOVAnalyzer()

edmtest::ConcurrentIOVAnalyzer::ConcurrentIOVAnalyzer ( edm::ParameterSet const &  pset)
explicit

Definition at line 45 of file ConcurrentIOVAnalyzer.cc.

References muonDTDigis_cfi::pset.

46  : checkExpectedValues_{pset.getUntrackedParameter<bool>("checkExpectedValues")},
47  esTokenFromESSource_{esConsumes(pset.getUntrackedParameter<edm::ESInputTag>("fromSource"))},
48  esTokenFromESProducer_{esConsumes(edm::ESInputTag("", "fromESProducer"))} {}
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESProducer_
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESSource_

Member Function Documentation

◆ analyze()

void edmtest::ConcurrentIOVAnalyzer::analyze ( edm::StreamID  ,
edm::Event const &  event,
edm::EventSetup const &  eventSetup 
) const
overridevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 50 of file ConcurrentIOVAnalyzer.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), edmtest::IOVTestInfo::cacheIdentifier_, checkExpectedValues_, esTokenFromESProducer_, esTokenFromESSource_, options_cfi::eventSetup, Exception, edmtest::IOVTestInfo::iovEndLumi_, edm::eventsetup::EventSetupRecord::iovIndex(), edmtest::IOVTestInfo::iovIndex_, edmtest::IOVTestInfo::iovStartLumi_, and edm::eventsetup::EventSetupRecord::validityInterval().

50  {
51  auto lumiNumber = event.eventAuxiliary().luminosityBlock();
52 
53  edm::ESHandle<IOVTestInfo> iovTestInfoFromESSource = eventSetup.getHandle(esTokenFromESSource_);
54  edm::ESHandle<IOVTestInfo> iovTestInfoFromESProducer = eventSetup.getHandle(esTokenFromESProducer_);
55 
56  ESTestRecordI esTestRecordI = eventSetup.get<ESTestRecordI>();
57  edm::ValidityInterval iov = esTestRecordI.validityInterval();
58 
59  if (iovTestInfoFromESSource->iovStartLumi_ != iov.first().luminosityBlockNumber() ||
60  iovTestInfoFromESSource->iovEndLumi_ != iov.last().luminosityBlockNumber() ||
61  iovTestInfoFromESSource->iovIndex_ != esTestRecordI.iovIndex() ||
62  iovTestInfoFromESSource->cacheIdentifier_ != esTestRecordI.cacheIdentifier()) {
63  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
64  << " values read from ESSource do not agree with record";
65  }
66 
67  if (iovTestInfoFromESProducer->iovStartLumi_ != iov.first().luminosityBlockNumber() ||
68  iovTestInfoFromESProducer->iovEndLumi_ != iov.last().luminosityBlockNumber() ||
69  iovTestInfoFromESProducer->iovIndex_ != esTestRecordI.iovIndex() ||
70  iovTestInfoFromESProducer->cacheIdentifier_ != esTestRecordI.cacheIdentifier()) {
71  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
72  << " values read from ESProducer do not agree with record";
73  }
74 
75  if (!checkExpectedValues_) {
76  return;
77  }
78 
79  // cacheIdentifier starts at 2 for beginRun and 3 is next here for the first lumi
80  if (lumiNumber == 1) {
81  if (iovTestInfoFromESProducer->iovStartLumi_ != 1 || iovTestInfoFromESProducer->iovEndLumi_ != 3 ||
82  iovTestInfoFromESProducer->cacheIdentifier_ != 3) {
83  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
84  << " values read from ESProducer do not agree with expected values";
85  }
86  }
87  if (lumiNumber == 2) {
88  if (iovTestInfoFromESProducer->iovStartLumi_ != 1 || iovTestInfoFromESProducer->iovEndLumi_ != 3 ||
89  iovTestInfoFromESProducer->cacheIdentifier_ != 3) {
90  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
91  << " values read from ESProducer do not agree with expected values";
92  }
93  }
94  if (lumiNumber == 3) {
95  if (iovTestInfoFromESProducer->iovStartLumi_ != 1 || iovTestInfoFromESProducer->iovEndLumi_ != 3 ||
96  iovTestInfoFromESProducer->cacheIdentifier_ != 3) {
97  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
98  << " values read from ESProducer do not agree with expected values";
99  }
100  }
101  if (lumiNumber == 4) {
102  if (iovTestInfoFromESProducer->iovStartLumi_ != 4 || iovTestInfoFromESProducer->iovEndLumi_ != 5 ||
103  iovTestInfoFromESProducer->cacheIdentifier_ != 4) {
104  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
105  << " values read from ESProducer do not agree with expected values";
106  }
107  }
108  if (lumiNumber == 5) {
109  if (iovTestInfoFromESProducer->iovStartLumi_ != 4 || iovTestInfoFromESProducer->iovEndLumi_ != 5 ||
110  iovTestInfoFromESProducer->cacheIdentifier_ != 4) {
111  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
112  << " values read from ESProducer do not agree with expected values";
113  }
114  }
115  if (lumiNumber == 6) {
116  if (iovTestInfoFromESProducer->iovStartLumi_ != 6 || iovTestInfoFromESProducer->iovEndLumi_ != 6 ||
117  iovTestInfoFromESProducer->cacheIdentifier_ != 5) {
118  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
119  << " values read from ESProducer do not agree with expected values";
120  }
121  }
122  if (lumiNumber == 7) {
123  if (iovTestInfoFromESProducer->iovStartLumi_ != 7 || iovTestInfoFromESProducer->iovEndLumi_ != 7 ||
124  iovTestInfoFromESProducer->cacheIdentifier_ != 6) {
125  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
126  << " values read from ESProducer do not agree with expected values";
127  }
128  }
129  if (lumiNumber == 8) {
130  if (iovTestInfoFromESProducer->iovStartLumi_ != 8 || iovTestInfoFromESProducer->iovEndLumi_ != 8 ||
131  iovTestInfoFromESProducer->cacheIdentifier_ != 7) {
132  throw cms::Exception("TestFailure") << "ConcurrentIOVAnalyzer::analyze,"
133  << " values read from ESProducer do not agree with expected values";
134  }
135  }
136  }
unsigned int iovEndLumi_
Definition: IOVTestInfo.h:24
unsigned int iovIndex_
Definition: IOVTestInfo.h:25
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESProducer_
unsigned long long cacheIdentifier() const
edm::ESGetToken< IOVTestInfo, ESTestRecordI > const esTokenFromESSource_
unsigned int iovStartLumi_
Definition: IOVTestInfo.h:22
unsigned long long cacheIdentifier_
Definition: IOVTestInfo.h:26
ValidityInterval validityInterval() const

◆ fillDescriptions()

void edmtest::ConcurrentIOVAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 138 of file ConcurrentIOVAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

138  {
140  desc.addUntracked<bool>("checkExpectedValues", true);
141  desc.addUntracked<edm::ESInputTag>("fromSource", edm::ESInputTag("", ""));
142  descriptions.addDefault(desc);
143  }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ checkExpectedValues_

bool edmtest::ConcurrentIOVAnalyzer::checkExpectedValues_
private

Definition at line 40 of file ConcurrentIOVAnalyzer.cc.

Referenced by analyze().

◆ esTokenFromESProducer_

edm::ESGetToken<IOVTestInfo, ESTestRecordI> const edmtest::ConcurrentIOVAnalyzer::esTokenFromESProducer_
private

Definition at line 42 of file ConcurrentIOVAnalyzer.cc.

Referenced by analyze().

◆ esTokenFromESSource_

edm::ESGetToken<IOVTestInfo, ESTestRecordI> const edmtest::ConcurrentIOVAnalyzer::esTokenFromESSource_
private

Definition at line 41 of file ConcurrentIOVAnalyzer.cc.

Referenced by analyze().