CMS 3D CMS Logo

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

Public Member Functions

void analyze (edm::StreamID, edm::Event const &iEvent, edm::EventSetup const &) const final
 
 TableTestAnalyzer (edm::ParameterSet const &iConfig)
 
- 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
 
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)
 

Private Attributes

const std::vector< float > aFloats_
 
const std::vector< int > anInts_
 
const std::vector< std::string > aStrings_
 
edm::EDGetTokenT< edmtest::TableTest > tableToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 45 of file TableTestModules.cc.

Constructor & Destructor Documentation

◆ TableTestAnalyzer()

edmtest::TableTestAnalyzer::TableTestAnalyzer ( edm::ParameterSet const &  iConfig)
inline

Definition at line 47 of file TableTestModules.cc.

References aFloats_, anInts_, aStrings_, Exception, edm::ParameterSet::getUntrackedParameter(), or, and tableToken_.

48  : anInts_(iConfig.getUntrackedParameter<std::vector<int>>("anInts")),
49  aFloats_(doublesToFloats(iConfig.getUntrackedParameter<std::vector<double>>("aFloats"))),
50  aStrings_(iConfig.getUntrackedParameter<std::vector<std::string>>("aStrings")) {
51  tableToken_ = consumes<edmtest::TableTest>(iConfig.getUntrackedParameter<edm::InputTag>("table"));
52  if (anInts_.size() != aFloats_.size() or anInts_.size() != aStrings_.size()) {
53  throw cms::Exception("Configuration") << "anInts_, aFloats_, and aStrings_ must have the same length";
54  }
55  }
edm::EDGetTokenT< edmtest::TableTest > tableToken_
const std::vector< float > aFloats_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const std::vector< std::string > aStrings_
const std::vector< int > anInts_

Member Function Documentation

◆ analyze()

void edmtest::TableTestAnalyzer::analyze ( edm::StreamID  ,
edm::Event const &  iEvent,
edm::EventSetup const &   
) const
inlinefinalvirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 57 of file TableTestModules.cc.

References aFloats_, anInts_, aStrings_, Exception, iEvent, submitPVValidationJobs::t, and tableToken_.

57  {
58  auto const& t = iEvent.get(tableToken_);
59 
60  auto size = t.size();
61  if (size != anInts_.size()) {
62  throw cms::Exception("RuntimeError")
63  << "Table size (" << size << ") does not equal expected size (" << anInts_.size() << ")";
64  }
65 
66  unsigned int index = 0;
67  for (auto const& row : t) {
68  if (anInts_[index] != row.get<edmtest::AnInt>()) {
69  throw cms::Exception("RuntimeError")
70  << "index " << index << " anInt =" << row.get<edmtest::AnInt>() << " expected " << anInts_[index];
71  }
72  if (aFloats_[index] != row.get<edmtest::AFloat>()) {
73  throw cms::Exception("RuntimeError")
74  << "index " << index << " aFloat =" << row.get<edmtest::AFloat>() << " expected " << aFloats_[index];
75  }
76  if (aStrings_[index] != row.get<edmtest::AString>()) {
77  throw cms::Exception("RuntimeError")
78  << "index " << index << " aString =" << row.get<edmtest::AString>() << " expected " << aStrings_[index];
79  }
80  ++index;
81  }
82  }
size
Write out results.
edm::EDGetTokenT< edmtest::TableTest > tableToken_
int iEvent
Definition: GenABIO.cc:224
const std::vector< float > aFloats_
const std::vector< std::string > aStrings_
const std::vector< int > anInts_

Member Data Documentation

◆ aFloats_

const std::vector<float> edmtest::TableTestAnalyzer::aFloats_
private

Definition at line 86 of file TableTestModules.cc.

Referenced by analyze(), and TableTestAnalyzer().

◆ anInts_

const std::vector<int> edmtest::TableTestAnalyzer::anInts_
private

Definition at line 85 of file TableTestModules.cc.

Referenced by analyze(), and TableTestAnalyzer().

◆ aStrings_

const std::vector<std::string> edmtest::TableTestAnalyzer::aStrings_
private

Definition at line 87 of file TableTestModules.cc.

Referenced by analyze(), and TableTestAnalyzer().

◆ tableToken_

edm::EDGetTokenT<edmtest::TableTest> edmtest::TableTestAnalyzer::tableToken_
private

Definition at line 88 of file TableTestModules.cc.

Referenced by analyze(), and TableTestAnalyzer().