CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EventSetupRecordKey
m_recordKeys
 
RetrievedDataMap m_retrievedDataMap
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 32 of file PrintEventSetupDataRetrieval.cc.

Member Typedef Documentation

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

Definition at line 48 of file PrintEventSetupDataRetrieval.cc.

Constructor & Destructor Documentation

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

Definition at line 69 of file PrintEventSetupDataRetrieval.cc.

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

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 116 of file PrintEventSetupDataRetrieval.cc.

References check(), and m_checkDuringEvent.

116  {
117  if(m_checkDuringEvent) { check(iES); }
118  }
void edm::PrintEventSetupDataRetrieval::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  iES 
)
override

Definition at line 130 of file PrintEventSetupDataRetrieval.cc.

References check(), and m_checkDuringBeginLumi.

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

Definition at line 121 of file PrintEventSetupDataRetrieval.cc.

References check(), and m_checkDuringBeginRun.

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

Definition at line 138 of file PrintEventSetupDataRetrieval.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), edm::EventSetup::fillAvailableRecordKeys(), edm::eventsetup::EventSetupRecord::fillRegisteredDataKeys(), edm::EventSetup::find(), relativeConstraints::keys, edm::eventsetup::ComponentDescription::label_, m_printProviders, m_recordKeys, m_retrievedDataMap, producerFileCleanner::msg, edm::eventsetup::EventSetupRecord::providerDescription(), alignCSCRings::r, edm::eventsetup::ComponentDescription::type_, and edm::eventsetup::EventSetupRecord::wasGotten().

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

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

Definition at line 135 of file PrintEventSetupDataRetrieval.cc.

135  {
136  }
void edm::PrintEventSetupDataRetrieval::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 126 of file PrintEventSetupDataRetrieval.cc.

126  {
127  }
void edm::PrintEventSetupDataRetrieval::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 86 of file PrintEventSetupDataRetrieval.cc.

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

86  {
88  desc.addUntracked<bool>("printProviders",false)->setComment(
89  "If 'true' also print which ES module provides the data");
90  desc.addUntracked<bool>("checkDuringBeginRun",false)->setComment(
91  "If 'true' check for retrieved data during each begin run is processed");
92  desc.addUntracked<bool>("checkDuringBeginLumi",false)->setComment(
93  "If 'true' check for retrieved data during each begin lumi is processed");
94  desc.addUntracked<bool>("checkDuringEvent",true)->setComment(
95  "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  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringBeginLumi
private

Definition at line 54 of file PrintEventSetupDataRetrieval.cc.

Referenced by beginLuminosityBlock().

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringBeginRun
private

Definition at line 53 of file PrintEventSetupDataRetrieval.cc.

Referenced by beginRun().

const bool edm::PrintEventSetupDataRetrieval::m_checkDuringEvent
private

Definition at line 55 of file PrintEventSetupDataRetrieval.cc.

Referenced by analyze().

const bool edm::PrintEventSetupDataRetrieval::m_printProviders
private

Definition at line 52 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().

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

Definition at line 51 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().

RetrievedDataMap edm::PrintEventSetupDataRetrieval::m_retrievedDataMap
private

Definition at line 50 of file PrintEventSetupDataRetrieval.cc.

Referenced by check().