CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 ESTestAnalyzerA (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::stream::EDAnalyzer<>
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
 EDAnalyzerBase (const EDAnalyzerBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDAnalyzerBaseoperator= (const EDAnalyzerBase &)=delete
 
 ~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::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< int > const expectedValues_
 
std::vector< int > const runsToGetDataFor_
 
edm::ESGetToken< ESTestDataA, ESTestRecordA > const token_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase 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 23 of file ESTestAnalyzers.cc.

Constructor & Destructor Documentation

◆ ESTestAnalyzerA()

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

Definition at line 36 of file ESTestAnalyzers.cc.

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

37  : runsToGetDataFor_(pset.getParameter<std::vector<int>>("runsToGetDataFor")),
38  expectedValues_(pset.getUntrackedParameter<std::vector<int>>("expectedValues")),
39  token_(esConsumes()) {
40  assert(expectedValues_.empty() or expectedValues_.size() == runsToGetDataFor_.size());
41  }
std::vector< int > const expectedValues_
std::vector< int > const runsToGetDataFor_
assert(be >=bs)
edm::ESGetToken< ESTestDataA, ESTestRecordA > const token_
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

Member Function Documentation

◆ analyze()

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 43 of file ESTestAnalyzers.cc.

References makeMEIFBenchmarkPlots::ev, Exception, expectedValues_, spr::find(), newFWLiteAna::found, edm::EventSetup::getData(), edm::stream::EDAnalyzerBase::moduleDescription(), edm::ModuleDescription::processName(), runsToGetDataFor_, and token_.

43  {
44  auto found = std::find(runsToGetDataFor_.begin(), runsToGetDataFor_.end(), ev.run());
45  if (found != runsToGetDataFor_.end()) {
46  auto const& dataA = es.getData(token_);
47  edm::LogAbsolute("ESTestAnalyzerA")
48  << "ESTestAnalyzerA: process = " << moduleDescription().processName() << ": Data value = " << dataA.value();
49  if (not expectedValues_.empty()) {
50  if (expectedValues_[found - runsToGetDataFor_.begin()] != dataA.value()) {
51  throw cms::Exception("TestError") << "Exptected value " << expectedValues_[found - runsToGetDataFor_.begin()]
52  << " but saw " << dataA.value();
53  }
54  }
55  }
56  }
std::vector< int > const expectedValues_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
ModuleDescription const & moduleDescription() const
std::vector< int > const runsToGetDataFor_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::ESGetToken< ESTestDataA, ESTestRecordA > const token_
std::string const & processName() const
Log< level::System, true > LogAbsolute

◆ fillDescriptions()

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

Definition at line 58 of file ESTestAnalyzers.cc.

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

58  {
59  //The following says we do not know what parameters are allowed so do no validation
60  // Please change this to state exactly what you do use, even if it is no parameters
62  desc.setComment("Test module for the EventSetup");
63  desc.add<std::vector<int>>("runsToGetDataFor")
64  ->setComment("ID number for each Run for which we should get EventSetup data.");
65  desc.addUntracked<std::vector<int>>("expectedValues", std::vector<int>())
66  ->setComment("EventSetup value expected for each Run. If empty, no values compared.");
67  descriptions.addDefault(desc);
68  }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ expectedValues_

std::vector<int> const edmtest::ESTestAnalyzerA::expectedValues_
private

Definition at line 32 of file ESTestAnalyzers.cc.

Referenced by analyze(), and ESTestAnalyzerA().

◆ runsToGetDataFor_

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

Definition at line 31 of file ESTestAnalyzers.cc.

Referenced by analyze(), and ESTestAnalyzerA().

◆ token_

edm::ESGetToken<ESTestDataA, ESTestRecordA> const edmtest::ESTestAnalyzerA::token_
private

Definition at line 33 of file ESTestAnalyzers.cc.

Referenced by analyze().