CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edmtest::RunLumiESAnalyzer Class Reference
Inheritance diagram for edmtest::RunLumiESAnalyzer:
edm::global::EDAnalyzer< edm::StreamCache< UnsafeCache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache > > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::StreamID, edm::Event const &, edm::EventSetup const &) const override
 
std::unique_ptr< UnsafeCache > beginStream (edm::StreamID) const override
 
std::shared_ptr< Cache > globalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
std::shared_ptr< Cache > globalBeginRun (edm::Run const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &iLB, edm::EventSetup const &) const override
 
void globalEndRun (edm::Run const &iRun, edm::EventSetup const &) const override
 
 RunLumiESAnalyzer (edm::ParameterSet const &)
 
void streamBeginLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamBeginRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
void streamEndLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamEndRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::StreamCache< UnsafeCache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache > >
 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 Member Functions

void checkIOVInfo (edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const
 

Private Attributes

edm::ESGetToken< IOVTestInfo, ESTestRecordC > const esToken_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginLumi_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginRun_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndLumi_
 
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndRun_
 

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 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 EventSetup system, particularly testing its support of Run and Lumi transitions.

Definition at line 47 of file RunLumiESAnalyzer.cc.

Constructor & Destructor Documentation

◆ RunLumiESAnalyzer()

edmtest::RunLumiESAnalyzer::RunLumiESAnalyzer ( edm::ParameterSet const &  )
explicit

Definition at line 83 of file RunLumiESAnalyzer.cc.

References edm::EDConsumerBase::esConsumes().

85  tokenBeginRun_{esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", ""))},
86  tokenBeginLumi_{esConsumes<edm::Transition::BeginLuminosityBlock>(edm::ESInputTag("", ""))},
87  tokenEndLumi_{esConsumes<edm::Transition::EndLuminosityBlock>(edm::ESInputTag("", ""))},
88  tokenEndRun_{esConsumes<edm::Transition::EndRun>(edm::ESInputTag("", ""))} {}
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const esToken_
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndLumi_
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginRun_
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginLumi_
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndRun_

Member Function Documentation

◆ analyze()

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

Implements edm::global::EDAnalyzerBase.

Definition at line 179 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), esToken_, options_cfi::eventSetup, and writedatasetfile::run.

179  {
180  auto run = event.eventAuxiliary().run();
181  auto lumiNumber = event.eventAuxiliary().luminosityBlock();
182  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(esToken_);
183  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::analyzer");
184  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const esToken_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ beginStream()

std::unique_ptr< UnsafeCache > edmtest::RunLumiESAnalyzer::beginStream ( edm::StreamID  iID) const
override

Definition at line 90 of file RunLumiESAnalyzer.cc.

90  {
91  return std::make_unique<UnsafeCache>();
92  }

◆ checkIOVInfo()

void edmtest::RunLumiESAnalyzer::checkIOVInfo ( edm::EventSetup const &  eventSetup,
unsigned int  run,
unsigned int  lumiNumber,
edm::ESHandle< IOVTestInfo > const &  iovTestInfo,
const char *  functionName 
) const
private

Definition at line 94 of file RunLumiESAnalyzer.cc.

References options_cfi::eventSetup, Exception, edmtest::IOVTestInfo::iovEndLumi_, edmtest::IOVTestInfo::iovEndRun_, edmtest::IOVTestInfo::iovStartLumi_, edmtest::IOVTestInfo::iovStartRun_, writedatasetfile::run, and edm::eventsetup::EventSetupRecord::validityInterval().

Referenced by analyze(), globalBeginLuminosityBlock(), globalBeginRun(), globalEndLuminosityBlock(), globalEndRun(), streamBeginLuminosityBlock(), streamBeginRun(), streamEndLuminosityBlock(), and streamEndRun().

98  {
99  ESTestRecordC recordC = eventSetup.get<ESTestRecordC>();
100  edm::ValidityInterval iov = recordC.validityInterval();
101 
102  if (iovTestInfo->iovStartRun_ != run || iovTestInfo->iovEndRun_ != run ||
103  iovTestInfo->iovStartLumi_ != lumiNumber || iovTestInfo->iovEndLumi_ != lumiNumber) {
104  throw cms::Exception("TestFailure")
105  << functionName << ": values read from EventSetup do not agree with auxiliary";
106  }
107 
108  if (iov.first().eventID().run() != run || iov.last().eventID().run() != run ||
109  iov.first().luminosityBlockNumber() != lumiNumber || iov.last().luminosityBlockNumber() != lumiNumber) {
110  throw cms::Exception("TestFailure") << functionName << ": values from EventSetup IOV do not agree with auxiliary";
111  }
112  }
unsigned int iovEndLumi_
Definition: IOVTestInfo.h:24
unsigned int iovEndRun_
Definition: IOVTestInfo.h:23
unsigned int iovStartLumi_
Definition: IOVTestInfo.h:22
unsigned int iovStartRun_
Definition: IOVTestInfo.h:21
ValidityInterval validityInterval() const

◆ fillDescriptions()

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

◆ globalBeginLuminosityBlock()

std::shared_ptr< Cache > edmtest::RunLumiESAnalyzer::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 162 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), writedatasetfile::run, edm::LuminosityBlockAuxiliary::run(), and tokenBeginLumi_.

163  {
164  auto run = iLumi.luminosityBlockAuxiliary().run();
165  unsigned int lumiNumber = iLumi.luminosityBlockAuxiliary().luminosityBlock();
166  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenBeginLumi_);
167  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::globalBeginLuminosityBlock");
168  return std::make_shared<Cache>();
169  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginLumi_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ globalBeginRun()

std::shared_ptr< Cache > edmtest::RunLumiESAnalyzer::globalBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 146 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, writedatasetfile::run, edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), and tokenBeginRun_.

147  {
148  auto run = iRun.runAuxiliary().run();
149  unsigned int lumiNumber = 0;
150  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenBeginRun_);
151  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::globalBeginRun");
152  return std::make_shared<Cache>();
153  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginRun_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ globalEndLuminosityBlock()

void edmtest::RunLumiESAnalyzer::globalEndLuminosityBlock ( edm::LuminosityBlock const &  iLB,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 171 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), writedatasetfile::run, edm::LuminosityBlockAuxiliary::run(), and tokenEndLumi_.

172  {
173  auto run = iLumi.luminosityBlockAuxiliary().run();
174  unsigned int lumiNumber = iLumi.luminosityBlockAuxiliary().luminosityBlock();
175  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenEndLumi_);
176  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::globalEndLuminosityBlock");
177  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndLumi_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ globalEndRun()

void edmtest::RunLumiESAnalyzer::globalEndRun ( edm::Run const &  iRun,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 155 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, writedatasetfile::run, edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), and tokenEndRun_.

155  {
156  auto run = iRun.runAuxiliary().run();
157  unsigned int lumiNumber = 4294967295;
158  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenEndRun_);
159  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::globalEndRun");
160  }
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndRun_

◆ streamBeginLuminosityBlock()

void edmtest::RunLumiESAnalyzer::streamBeginLuminosityBlock ( edm::StreamID  ,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 121 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), writedatasetfile::run, edm::LuminosityBlockAuxiliary::run(), and tokenBeginLumi_.

123  {
124  auto run = iLumi.luminosityBlockAuxiliary().run();
125  unsigned int lumiNumber = iLumi.luminosityBlockAuxiliary().luminosityBlock();
126  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenBeginLumi_);
127  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::streamBeginLuminosityBlock");
128  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginLumi_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ streamBeginRun()

void edmtest::RunLumiESAnalyzer::streamBeginRun ( edm::StreamID  ,
edm::Run const &  iRun,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 114 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, writedatasetfile::run, edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), and tokenBeginRun_.

114  {
115  auto run = iRun.runAuxiliary().run();
116  unsigned int lumiNumber = 0;
117  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenBeginRun_);
118  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::streamBeginRun");
119  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenBeginRun_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ streamEndLuminosityBlock()

void edmtest::RunLumiESAnalyzer::streamEndLuminosityBlock ( edm::StreamID  ,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 130 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), writedatasetfile::run, edm::LuminosityBlockAuxiliary::run(), and tokenEndLumi_.

132  {
133  auto run = iLumi.luminosityBlockAuxiliary().run();
134  unsigned int lumiNumber = iLumi.luminosityBlockAuxiliary().luminosityBlock();
135  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenEndLumi_);
136  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::streamEndLuminosityBlock");
137  }
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndLumi_
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const

◆ streamEndRun()

void edmtest::RunLumiESAnalyzer::streamEndRun ( edm::StreamID  ,
edm::Run const &  iRun,
edm::EventSetup const &  eventSetup 
) const
override

Definition at line 139 of file RunLumiESAnalyzer.cc.

References checkIOVInfo(), options_cfi::eventSetup, writedatasetfile::run, edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), and tokenEndRun_.

139  {
140  auto run = iRun.runAuxiliary().run();
141  unsigned int lumiNumber = 4294967295;
142  edm::ESHandle<IOVTestInfo> iovTestInfo = eventSetup.getHandle(tokenEndRun_);
143  checkIOVInfo(eventSetup, run, lumiNumber, iovTestInfo, "RunLumiESAnalyzer::streamEndRun");
144  }
void checkIOVInfo(edm::EventSetup const &eventSetup, unsigned int run, unsigned int lumiNumber, edm::ESHandle< IOVTestInfo > const &iovTestInfo, const char *functionName) const
edm::ESGetToken< IOVTestInfo, ESTestRecordC > const tokenEndRun_

Member Data Documentation

◆ esToken_

edm::ESGetToken<IOVTestInfo, ESTestRecordC> const edmtest::RunLumiESAnalyzer::esToken_
private

Definition at line 76 of file RunLumiESAnalyzer.cc.

Referenced by analyze().

◆ tokenBeginLumi_

edm::ESGetToken<IOVTestInfo, ESTestRecordC> const edmtest::RunLumiESAnalyzer::tokenBeginLumi_
private

Definition at line 78 of file RunLumiESAnalyzer.cc.

Referenced by globalBeginLuminosityBlock(), and streamBeginLuminosityBlock().

◆ tokenBeginRun_

edm::ESGetToken<IOVTestInfo, ESTestRecordC> const edmtest::RunLumiESAnalyzer::tokenBeginRun_
private

Definition at line 77 of file RunLumiESAnalyzer.cc.

Referenced by globalBeginRun(), and streamBeginRun().

◆ tokenEndLumi_

edm::ESGetToken<IOVTestInfo, ESTestRecordC> const edmtest::RunLumiESAnalyzer::tokenEndLumi_
private

Definition at line 79 of file RunLumiESAnalyzer.cc.

Referenced by globalEndLuminosityBlock(), and streamEndLuminosityBlock().

◆ tokenEndRun_

edm::ESGetToken<IOVTestInfo, ESTestRecordC> const edmtest::RunLumiESAnalyzer::tokenEndRun_
private

Definition at line 80 of file RunLumiESAnalyzer.cc.

Referenced by globalEndRun(), and streamEndRun().