CMS 3D CMS Logo

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

Public Member Functions

void analyze (edm::StreamID, edm::Event const &, edm::EventSetup const &) const final
 
std::shared_ptr< EmptyglobalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const final
 
std::shared_ptr< EmptyglobalBeginRun (edm::Run const &, edm::EventSetup const &) const final
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const final
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const final
 
 ThingAnalyzer (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< Empty >, edm::LuminosityBlockCache< Empty > >
 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 &descriptions)
 
- 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 shouldBeInvalid (edm::Handle< ThingCollection > const &) const
 

Private Attributes

edm::EDGetTokenT< ThingCollection > beginLumi_
 
edm::EDGetTokenT< ThingCollection > beginRun_
 
edm::EDGetTokenT< ThingCollection > endLumi_
 
edm::EDGetTokenT< ThingCollection > endRun_
 
edm::EDGetTokenT< ThingCollection > event_
 

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

Definition at line 27 of file ThingAnalyzer.cc.

Constructor & Destructor Documentation

◆ ThingAnalyzer()

edmtest::ThingAnalyzer::ThingAnalyzer ( edm::ParameterSet const &  iPSet)

Definition at line 49 of file ThingAnalyzer.cc.

50  : beginRun_(consumes<edm::InRun>(iPSet.getUntrackedParameter<edm::InputTag>("beginRun"))),
51  beginLumi_(consumes<edm::InLumi>(iPSet.getUntrackedParameter<edm::InputTag>("beginLumi"))),
52  event_(consumes(iPSet.getUntrackedParameter<edm::InputTag>("event"))),
53  endLumi_(consumes<edm::InLumi>(iPSet.getUntrackedParameter<edm::InputTag>("endLumi"))),
54  endRun_(consumes<edm::InRun>(iPSet.getUntrackedParameter<edm::InputTag>("endRun"))) {}
edm::EDGetTokenT< ThingCollection > endLumi_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< ThingCollection > beginLumi_
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_
edm::EDGetTokenT< ThingCollection > event_

Member Function Documentation

◆ analyze()

void edmtest::ThingAnalyzer::analyze ( edm::StreamID  ,
edm::Event const &  iEvent,
edm::EventSetup const &   
) const
finalvirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 68 of file ThingAnalyzer.cc.

References beginLumi_, beginRun_, endLumi_, endRun_, event_, iEvent, writedatasetfile::run, shouldBeInvalid(), and funct::void.

68  {
69  auto const& lumi = iEvent.getLuminosityBlock();
70 
71  auto const& run = lumi.getRun();
72 
73  (void)run.get(beginRun_);
74 
75  shouldBeInvalid(run.getHandle(endRun_));
76 
77  (void)lumi.get(beginLumi_);
78 
79  shouldBeInvalid(lumi.getHandle(endLumi_));
80 
81  (void)iEvent.get(event_);
82  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::EDGetTokenT< ThingCollection > endLumi_
int iEvent
Definition: GenABIO.cc:224
void shouldBeInvalid(edm::Handle< ThingCollection > const &) const
edm::EDGetTokenT< ThingCollection > beginLumi_
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_
edm::EDGetTokenT< ThingCollection > event_

◆ fillDescriptions()

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

Definition at line 56 of file ThingAnalyzer.cc.

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

56  {
58  desc.addUntracked("beginRun", edm::InputTag{"thing", "beginRun"})->setComment("Collection to get from Run");
59  desc.addUntracked("beginLumi", edm::InputTag{"thing", "beginLumi"})->setComment("Collection to get from Lumi");
60  desc.addUntracked("event", edm::InputTag{"thing", ""})->setComment("Collection to get from event");
61  desc.addUntracked("endLumi", edm::InputTag{"thing", "endLumi"})
62  ->setComment("Collection to get from Lumi but only available at end");
63  desc.addUntracked("endRun", edm::InputTag{"thing", "endRun"})
64  ->setComment("Collection to get from Run but only available at end");
65  descriptions.add("thingAnalyzer", desc);
66  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalBeginLuminosityBlock()

std::shared_ptr< Empty > edmtest::ThingAnalyzer::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &   
) const
final

Definition at line 98 of file ThingAnalyzer.cc.

References beginLumi_, beginRun_, endLumi_, endRun_, edm::LuminosityBlock::get(), edm::LuminosityBlock::getHandle(), edm::LuminosityBlock::getRun(), writedatasetfile::run, shouldBeInvalid(), and funct::void.

99  {
100  auto const& run = iLumi.getRun();
101 
102  (void)run.get(beginRun_);
103 
104  shouldBeInvalid(run.getHandle(endRun_));
105 
106  (void)iLumi.get(beginLumi_);
107 
108  shouldBeInvalid(iLumi.getHandle(endLumi_));
109 
110  return std::shared_ptr<Empty>();
111  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::EDGetTokenT< ThingCollection > endLumi_
void shouldBeInvalid(edm::Handle< ThingCollection > const &) const
edm::EDGetTokenT< ThingCollection > beginLumi_
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_

◆ globalBeginRun()

std::shared_ptr< Empty > edmtest::ThingAnalyzer::globalBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &   
) const
final

Definition at line 84 of file ThingAnalyzer.cc.

References beginRun_, endRun_, edm::Run::get(), edm::Run::getHandle(), shouldBeInvalid(), and funct::void.

84  {
85  (void)iRun.get(beginRun_);
86 
87  shouldBeInvalid(iRun.getHandle(endRun_));
88 
89  return std::shared_ptr<Empty>();
90  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
void shouldBeInvalid(edm::Handle< ThingCollection > const &) const
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_

◆ globalEndLuminosityBlock()

void edmtest::ThingAnalyzer::globalEndLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &   
) const
final

Definition at line 113 of file ThingAnalyzer.cc.

References beginLumi_, beginRun_, endLumi_, endRun_, edm::LuminosityBlock::get(), edm::LuminosityBlock::getRun(), writedatasetfile::run, shouldBeInvalid(), and funct::void.

113  {
114  auto const& run = iLumi.getRun();
115 
116  (void)run.get(beginRun_);
117 
118  shouldBeInvalid(run.getHandle(endRun_));
119 
120  (void)iLumi.get(beginLumi_);
121 
122  (void)iLumi.get(endLumi_);
123  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::EDGetTokenT< ThingCollection > endLumi_
void shouldBeInvalid(edm::Handle< ThingCollection > const &) const
edm::EDGetTokenT< ThingCollection > beginLumi_
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_

◆ globalEndRun()

void edmtest::ThingAnalyzer::globalEndRun ( edm::Run const &  iRun,
edm::EventSetup const &   
) const
final

Definition at line 92 of file ThingAnalyzer.cc.

References beginRun_, endRun_, edm::Run::get(), and funct::void.

92  {
93  (void)iRun.get(beginRun_);
94 
95  (void)iRun.get(endRun_);
96  }
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
edm::EDGetTokenT< ThingCollection > endRun_
edm::EDGetTokenT< ThingCollection > beginRun_

◆ shouldBeInvalid()

void edmtest::ThingAnalyzer::shouldBeInvalid ( edm::Handle< ThingCollection > const &  iHandle) const
private

Definition at line 125 of file ThingAnalyzer.cc.

References Exception, and edm::HandleBase::isValid().

Referenced by analyze(), globalBeginLuminosityBlock(), globalBeginRun(), and globalEndLuminosityBlock().

125  {
126  if (iHandle.isValid()) {
127  throw cms::Exception("ShouldNotBeValid") << "handle was valid when it should not have been";
128  }
129  }
bool isValid() const
Definition: HandleBase.h:70

Member Data Documentation

◆ beginLumi_

edm::EDGetTokenT<ThingCollection> edmtest::ThingAnalyzer::beginLumi_
private

Definition at line 43 of file ThingAnalyzer.cc.

Referenced by analyze(), globalBeginLuminosityBlock(), and globalEndLuminosityBlock().

◆ beginRun_

edm::EDGetTokenT<ThingCollection> edmtest::ThingAnalyzer::beginRun_
private

◆ endLumi_

edm::EDGetTokenT<ThingCollection> edmtest::ThingAnalyzer::endLumi_
private

Definition at line 45 of file ThingAnalyzer.cc.

Referenced by analyze(), globalBeginLuminosityBlock(), and globalEndLuminosityBlock().

◆ endRun_

edm::EDGetTokenT<ThingCollection> edmtest::ThingAnalyzer::endRun_
private

◆ event_

edm::EDGetTokenT<ThingCollection> edmtest::ThingAnalyzer::event_
private

Definition at line 44 of file ThingAnalyzer.cc.

Referenced by analyze().