CMS 3D CMS Logo

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

Public Member Functions

void analyze (edm::StreamID, const edm::Event &, const edm::EventSetup &) const override
 
 ESTestAnalyzerAZ (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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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 &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 Attributes

edm::ESGetToken< ESTestDataA, ESTestRecordAdataAToken_
 
edm::ESGetToken< ESTestDataZ, ESTestRecordZdataZToken_
 
std::vector< int > const expectedValuesA_
 
std::vector< int > const expectedValuesZ_
 
std::vector< int > const runsToGetDataFor_
 

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

Definition at line 137 of file ESTestAnalyzers.cc.

Constructor & Destructor Documentation

◆ ESTestAnalyzerAZ()

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

Definition at line 152 of file ESTestAnalyzers.cc.

References cms::cuda::assert(), expectedValuesA_, expectedValuesZ_, or, and runsToGetDataFor_.

153  : runsToGetDataFor_(pset.getParameter<std::vector<int>>("runsToGetDataFor")),
154  expectedValuesA_(pset.getUntrackedParameter<std::vector<int>>("expectedValuesA")),
155  expectedValuesZ_(pset.getUntrackedParameter<std::vector<int>>("expectedValuesZ")),
157  dataZToken_(esConsumes(edm::ESInputTag("", "foo"))) {
158  assert(expectedValuesA_.empty() or expectedValuesA_.size() == runsToGetDataFor_.size());
159  assert(expectedValuesZ_.empty() or expectedValuesZ_.size() == runsToGetDataFor_.size());
160  }
edm::ESGetToken< ESTestDataZ, ESTestRecordZ > dataZToken_
assert(be >=bs)
std::vector< int > const expectedValuesZ_
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
edm::ESGetToken< ESTestDataA, ESTestRecordA > dataAToken_
std::vector< int > const expectedValuesA_
std::vector< int > const runsToGetDataFor_

Member Function Documentation

◆ analyze()

void edmtest::ESTestAnalyzerAZ::analyze ( edm::StreamID  ,
const edm::Event ev,
const edm::EventSetup es 
) const
overridevirtual

Implements edm::global::EDAnalyzerBase.

Definition at line 162 of file ESTestAnalyzers.cc.

References dataAToken_, dataZToken_, makeMEIFBenchmarkPlots::ev, Exception, expectedValuesA_, expectedValuesZ_, spr::find(), newFWLiteAna::found, edm::EventSetup::getData(), edm::global::EDAnalyzerBase::moduleDescription(), edm::ModuleDescription::processName(), runsToGetDataFor_, edmtest::ESTestDataA::value(), and edmtest::ESTestDataZ::value().

162  {
163  auto found = std::find(runsToGetDataFor_.begin(), runsToGetDataFor_.end(), ev.run());
164 
165  if (found != runsToGetDataFor_.end()) {
166  ESTestDataA const& dataA = es.getData(dataAToken_);
167 
168  ESTestDataZ const& dataZ = es.getData(dataZToken_);
169 
170  edm::LogAbsolute("ESTestAnalyzerAZ") << "ESTestAnalyzerAZ: process = " << moduleDescription().processName()
171  << ": Data values = " << dataA.value() << " " << dataZ.value();
172 
173  if (not expectedValuesA_.empty()) {
174  if (expectedValuesA_[found - runsToGetDataFor_.begin()] != dataA.value()) {
175  throw cms::Exception("TestError")
176  << "Exptected value for A " << expectedValuesA_[found - runsToGetDataFor_.begin()] << " but saw "
177  << dataA.value();
178  }
179  }
180 
181  if (not expectedValuesZ_.empty()) {
182  if (expectedValuesZ_[found - runsToGetDataFor_.begin()] != dataZ.value()) {
183  throw cms::Exception("TestError")
184  << "Exptected value for Z " << expectedValuesZ_[found - runsToGetDataFor_.begin()] << " but saw "
185  << dataZ.value();
186  }
187  }
188  }
189  }
edm::ESGetToken< ESTestDataZ, ESTestRecordZ > dataZToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< int > const expectedValuesZ_
std::string const & processName() const
edm::ESGetToken< ESTestDataA, ESTestRecordA > dataAToken_
ModuleDescription const & moduleDescription() const
Log< level::System, true > LogAbsolute
std::vector< int > const expectedValuesA_
std::vector< int > const runsToGetDataFor_

◆ fillDescriptions()

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

Definition at line 191 of file ESTestAnalyzers.cc.

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

191  {
193  desc.setComment("Test module for the EventSetup");
194  desc.add<std::vector<int>>("runsToGetDataFor")
195  ->setComment("ID number for each Run for which we should get EventSetup data.");
196  desc.addUntracked<std::vector<int>>("expectedValuesA", std::vector<int>())
197  ->setComment("EventSetup value for ESTestDataA:foo expected for each Run. If empty, no values compared.");
198  desc.addUntracked<std::vector<int>>("expectedValuesZ", std::vector<int>())
199  ->setComment("EventSetup value for ESTestDataZ:foo expected for each Run. If empty, no values compared.");
200  descriptions.addDefault(desc);
201  }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ dataAToken_

edm::ESGetToken<ESTestDataA, ESTestRecordA> edmtest::ESTestAnalyzerAZ::dataAToken_
private

Definition at line 148 of file ESTestAnalyzers.cc.

Referenced by analyze().

◆ dataZToken_

edm::ESGetToken<ESTestDataZ, ESTestRecordZ> edmtest::ESTestAnalyzerAZ::dataZToken_
private

Definition at line 149 of file ESTestAnalyzers.cc.

Referenced by analyze().

◆ expectedValuesA_

std::vector<int> const edmtest::ESTestAnalyzerAZ::expectedValuesA_
private

Definition at line 146 of file ESTestAnalyzers.cc.

Referenced by analyze(), and ESTestAnalyzerAZ().

◆ expectedValuesZ_

std::vector<int> const edmtest::ESTestAnalyzerAZ::expectedValuesZ_
private

Definition at line 147 of file ESTestAnalyzers.cc.

Referenced by analyze(), and ESTestAnalyzerAZ().

◆ runsToGetDataFor_

std::vector<int> const edmtest::ESTestAnalyzerAZ::runsToGetDataFor_
private

Definition at line 145 of file ESTestAnalyzers.cc.

Referenced by analyze(), and ESTestAnalyzerAZ().