CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::PrintEventSetupDataRetrieval Class Reference
Inheritance diagram for edm::PrintEventSetupDataRetrieval:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 PrintEventSetupDataRetrieval (edm::ParameterSet const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::map< eventsetup::EventSetupRecordKey, std::pair< unsigned long long, std::map< eventsetup::DataKey, bool > > > RetrievedDataMap
 

Private Member Functions

void check (EventSetup const &)
 

Private Attributes

const bool m_checkDuringBeginLumi
 
const bool m_checkDuringBeginRun
 
const bool m_checkDuringEvent
 
const bool m_printProviders
 
std::vector< eventsetup::EventSetupRecordKeym_recordKeys
 
RetrievedDataMap m_retrievedDataMap
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 31 of file PrintEventSetupDataRetrieval.cc.

Member Typedef Documentation

◆ RetrievedDataMap

typedef std::map<eventsetup::EventSetupRecordKey, std::pair<unsigned long long, std::map<eventsetup::DataKey, bool> > > edm::PrintEventSetupDataRetrieval::RetrievedDataMap
private

Definition at line 51 of file PrintEventSetupDataRetrieval.cc.

Constructor & Destructor Documentation

◆ PrintEventSetupDataRetrieval()

edm::PrintEventSetupDataRetrieval::PrintEventSetupDataRetrieval ( edm::ParameterSet const &  iPS)

Definition at line 71 of file PrintEventSetupDataRetrieval.cc.

72  : m_printProviders(iPS.getUntrackedParameter<bool>("printProviders")),
73  m_checkDuringBeginRun(iPS.getUntrackedParameter<bool>("checkDuringBeginRun")),
74  m_checkDuringBeginLumi(iPS.getUntrackedParameter<bool>("checkDuringBeginLumi")),
75  m_checkDuringEvent(iPS.getUntrackedParameter<bool>("checkDuringEvent")) {}

Member Function Documentation

◆ analyze()

void edm::PrintEventSetupDataRetrieval::analyze ( edm::Event const &  ,
edm::EventSetup const &  iES 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 115 of file PrintEventSetupDataRetrieval.cc.

115  {
116  if (m_checkDuringEvent) {
117  check(iES);
118  }
119  }

References check(), and m_checkDuringEvent.

◆ beginLuminosityBlock()

void edm::PrintEventSetupDataRetrieval::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  iES 
)
override

Definition at line 129 of file PrintEventSetupDataRetrieval.cc.

129  {
131  check(iES);
132  }
133  }

References check(), and m_checkDuringBeginLumi.

◆ beginRun()

void edm::PrintEventSetupDataRetrieval::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iES 
)
override

Definition at line 121 of file PrintEventSetupDataRetrieval.cc.

121  {
122  if (m_checkDuringBeginRun) {
123  check(iES);
124  }
125  }

References check(), and m_checkDuringBeginRun.

◆ check()

void edm::PrintEventSetupDataRetrieval::check ( EventSetup const &  iES)
private

Definition at line 137 of file PrintEventSetupDataRetrieval.cc.

137  {
138  //std::cout <<"postProcessEvent"<<std::endl;
139  m_recordKeys.clear();
140  iES.fillAvailableRecordKeys(m_recordKeys);
141 
142  std::unique_ptr<LogSystem> msg;
143  for (std::vector<eventsetup::EventSetupRecordKey>::const_iterator it = m_recordKeys.begin(),
144  itEnd = m_recordKeys.end();
145  it != itEnd;
146  ++it) {
147  //std::cout <<" "<<it->name()<<std::endl;
148  auto r = iES.find(*it);
149  assert(r);
150 
151  RetrievedDataMap::iterator itRetrievedData = m_retrievedDataMap.find(*it);
152  if (itRetrievedData == m_retrievedDataMap.end()) {
153  itRetrievedData =
155  .insert(std::make_pair(*it, std::pair<unsigned long long, std::map<eventsetup::DataKey, bool> >()))
156  .first;
157  itRetrievedData->second.first = r->cacheIdentifier();
158  std::vector<eventsetup::DataKey> keys;
159  r->fillRegisteredDataKeys(keys);
160  for (std::vector<eventsetup::DataKey>::const_iterator itData = keys.begin(), itDataEnd = keys.end();
161  itData != itDataEnd;
162  ++itData) {
163  itRetrievedData->second.second.insert(std::make_pair(*itData, false));
164  }
165  }
166  RetrievedDataMap::value_type& retrievedData = *itRetrievedData;
167  if (itRetrievedData->second.first != r->cacheIdentifier()) {
168  itRetrievedData->second.first = r->cacheIdentifier();
169  for (std::map<eventsetup::DataKey, bool>::iterator itDatum = retrievedData.second.second.begin(),
170  itDatumEnd = retrievedData.second.second.end();
171  itDatum != itDatumEnd;
172  ++itDatum) {
173  itDatum->second = false;
174  }
175  }
176 
177  for (std::map<eventsetup::DataKey, bool>::iterator itDatum = retrievedData.second.second.begin(),
178  itDatumEnd = retrievedData.second.second.end();
179  itDatum != itDatumEnd;
180  ++itDatum) {
181  bool wasGotten = r->wasGotten(itDatum->first);
182  if (wasGotten != itDatum->second) {
183  if (not msg)
184  msg.reset(new LogSystem("ESContent"));
185  else
186  *msg << "\n";
187  itDatum->second = wasGotten;
188  *msg << "Retrieved> record:" << it->name() << " data:" << itDatum->first.type().name() << " '"
189  << itDatum->first.name().value() << "'";
190  if (m_printProviders) {
191  const edm::eventsetup::ComponentDescription* d = r->providerDescription(itDatum->first);
192  assert(nullptr != d);
193  *msg << " provider:" << d->type_ << " '" << d->label_ << "'";
194  }
195  }
196  }
197  }
198  }

References cms::cuda::assert(), ztail::d, edm::EventSetup::fillAvailableRecordKeys(), edm::EventSetup::find(), relativeConstraints::keys, m_printProviders, m_recordKeys, m_retrievedDataMap, mps_check::msg, and alignCSCRings::r.

Referenced by analyze(), beginLuminosityBlock(), and beginRun().

◆ endLuminosityBlock()

void edm::PrintEventSetupDataRetrieval::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
override

Definition at line 135 of file PrintEventSetupDataRetrieval.cc.

135 {}

◆ endRun()

void edm::PrintEventSetupDataRetrieval::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 127 of file PrintEventSetupDataRetrieval.cc.

127 {}

◆ fillDescriptions()

void edm::PrintEventSetupDataRetrieval::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 86 of file PrintEventSetupDataRetrieval.cc.

86  {
88  desc.addUntracked<bool>("printProviders", false)
89  ->setComment("If 'true' also print which ES module provides the data");
90  desc.addUntracked<bool>("checkDuringBeginRun", false)
91  ->setComment("If 'true' check for retrieved data during each begin run is processed");
92  desc.addUntracked<bool>("checkDuringBeginLumi", false)
93  ->setComment("If 'true' check for retrieved data during each begin lumi is processed");
94  desc.addUntracked<bool>("checkDuringEvent", true)
95  ->setComment("If 'true' check for retrieved data during an event is processed");
96  descriptions.add("PrintEventSetupDataRetrieval", desc);
97  descriptions.setComment("This analyzer reports when EventSetup data is retrieved by a module in the job.");
98  }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), and edm::ConfigurationDescriptions::setComment().

Member Data Documentation

◆ m_checkDuringBeginLumi

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringBeginLumi
private

Definition at line 57 of file PrintEventSetupDataRetrieval.cc.

Referenced by beginLuminosityBlock().

◆ m_checkDuringBeginRun

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringBeginRun
private

Definition at line 56 of file PrintEventSetupDataRetrieval.cc.

Referenced by beginRun().

◆ m_checkDuringEvent

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringEvent
private

Definition at line 58 of file PrintEventSetupDataRetrieval.cc.

Referenced by analyze().

◆ m_printProviders

const bool edm::PrintEventSetupDataRetrieval::m_printProviders
private

Definition at line 55 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().

◆ m_recordKeys

std::vector<eventsetup::EventSetupRecordKey> edm::PrintEventSetupDataRetrieval::m_recordKeys
private

Definition at line 54 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().

◆ m_retrievedDataMap

RetrievedDataMap edm::PrintEventSetupDataRetrieval::m_retrievedDataMap
private

Definition at line 53 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().

edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
mps_check.msg
tuple msg
Definition: mps_check.py:285
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
edm::PrintEventSetupDataRetrieval::m_recordKeys
std::vector< eventsetup::EventSetupRecordKey > m_recordKeys
Definition: PrintEventSetupDataRetrieval.cc:54
edm::PrintEventSetupDataRetrieval::m_checkDuringBeginRun
const bool m_checkDuringBeginRun
Definition: PrintEventSetupDataRetrieval.cc:56
edm::PrintEventSetupDataRetrieval::m_checkDuringEvent
const bool m_checkDuringEvent
Definition: PrintEventSetupDataRetrieval.cc:58
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::PrintEventSetupDataRetrieval::m_printProviders
const bool m_printProviders
Definition: PrintEventSetupDataRetrieval.cc:55
edm::eventsetup::ComponentDescription
Definition: ComponentDescription.h:30
edm::PrintEventSetupDataRetrieval::m_checkDuringBeginLumi
const bool m_checkDuringBeginLumi
Definition: PrintEventSetupDataRetrieval.cc:57
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::PrintEventSetupDataRetrieval::m_retrievedDataMap
RetrievedDataMap m_retrievedDataMap
Definition: PrintEventSetupDataRetrieval.cc:53
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::PrintEventSetupDataRetrieval::check
void check(EventSetup const &)
Definition: PrintEventSetupDataRetrieval.cc:137
ztail.d
d
Definition: ztail.py:151