CMS 3D CMS Logo

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

Public Member Functions

 PrintEventSetupContent (ParameterSet const &)
 
 ~PrintEventSetupContent () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< one::WatchRuns, 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (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 Member Functions

void analyze (Event const &, EventSetup const &) override
 
void beginJob () override
 
void beginLuminosityBlock (LuminosityBlock const &, EventSetup const &) override
 
void beginRun (Run const &, EventSetup const &) override
 
void endJob () override
 
void endLuminosityBlock (LuminosityBlock const &, EventSetup const &) override
 
void endRun (Run const &, EventSetup const &) override
 
void print (EventSetup const &)
 

Private Attributes

std::map< eventsetup::EventSetupRecordKey, unsigned long long > cacheIdentifiers_
 
const bool compact_
 
const bool printProviders_
 

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
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 42 of file PrintEventSetupContent.cc.

Constructor & Destructor Documentation

PrintEventSetupContent::PrintEventSetupContent ( ParameterSet const &  config)
explicit

Definition at line 78 of file PrintEventSetupContent.cc.

78  :
79  printProviders_(config.getUntrackedParameter<bool>("printProviders")),
80  compact_(config.getUntrackedParameter<bool>("compact"))
81  {
82  //now do what ever initialization is neededEventSetupRecordDataGetter::EventSetupRecordDataGetter(ParameterSet const& iConfig):
83  // getter = new EventSetupRecordDataGetter::EventSetupRecordDataGetter(iConfig);
84  }
Definition: config.py:1
PrintEventSetupContent::~PrintEventSetupContent ( )
override

Definition at line 86 of file PrintEventSetupContent.cc.

86  {
87  // do anything here that needs to be done at desctruction time
88  // (e.g. close files, deallocate resources etc.)
89  }

Member Function Documentation

void PrintEventSetupContent::analyze ( Event const &  ,
EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 97 of file PrintEventSetupContent.cc.

References print().

97  {
98  print(iSetup);
99  }
void print(EventSetup const &)
void PrintEventSetupContent::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 181 of file PrintEventSetupContent.cc.

181  {
182  }
void PrintEventSetupContent::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 111 of file PrintEventSetupContent.cc.

References print().

111  {
112  print(iSetup);
113  }
void print(EventSetup const &)
void PrintEventSetupContent::beginRun ( Run const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 102 of file PrintEventSetupContent.cc.

References print().

102  {
103  print(iSetup);
104  }
void print(EventSetup const &)
void PrintEventSetupContent::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 186 of file PrintEventSetupContent.cc.

186  {
187  }
void PrintEventSetupContent::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 116 of file PrintEventSetupContent.cc.

116  {
117  }
void PrintEventSetupContent::endRun ( Run const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 107 of file PrintEventSetupContent.cc.

107  {
108  }
void PrintEventSetupContent::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 191 of file PrintEventSetupContent.cc.

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

191  {
192  descriptions.setComment("Print what data is available in each available EventSetup Record in the job.\n"
193  "As part of the data is the C++ class type, label and which module makes that data.");
195  desc.addUntracked<bool>( "compact", false )->setComment(
196  "If 'true' produces a more compact view, similar to the one used by PrintEventSetupDataRetrieval");
197  desc.addUntracked<bool>("printProviders", true)->setComment(
198  "If 'true' also print which ES module provides the data");
199  descriptions.add("printEventSetupContent", desc);
200  }
void PrintEventSetupContent::print ( EventSetup const &  iSetup)
private

Definition at line 120 of file PrintEventSetupContent.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), cacheIdentifiers_, compact_, data, edm::IOVSyncValue::eventID(), edm::EventSetup::fillAvailableRecordKeys(), edm::eventsetup::EventSetupRecord::fillRegisteredDataKeys(), edm::EventSetup::find(), edm::ValidityInterval::first(), edm::eventsetup::ComponentDescription::label_, edm::ValidityInterval::last(), mps_check::msg, printProviders_, edm::eventsetup::EventSetupRecord::providerDescription(), edm::IOVSyncValue::time(), edm::eventsetup::ComponentDescription::type_, edm::eventsetup::EventSetupRecord::validityInterval(), and edm::Timestamp::value().

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

120  {
121  typedef std::vector<eventsetup::EventSetupRecordKey> Records;
122  typedef std::vector<eventsetup::DataKey> Data;
123 
124  Records records;
125  Data data;
126  iSetup.fillAvailableRecordKeys(records);
127  std::unique_ptr<LogSystem> msg;
128 
129  for(Records::iterator itrecords = records.begin(), itrecordsend = records.end();
130  itrecords != itrecordsend; ++itrecords ) {
131 
132  eventsetup::EventSetupRecord const* rec = iSetup.find(*itrecords);
133 
134  if (nullptr != rec && cacheIdentifiers_[*itrecords] != rec->cacheIdentifier()) {
135  cacheIdentifiers_[*itrecords] = rec->cacheIdentifier();
136  rec->fillRegisteredDataKeys(data);
137  if (compact_) {
138  for (Data::iterator itdata = data.begin(), itdataend = data.end(); itdata != itdataend; ++itdata) {
139  if (not msg)
140  msg.reset(new LogSystem("ESContent"));
141  else
142  *msg << '\n';
143  *msg << "ESContent> " << "record:" << itrecords->name() << " data:" << itdata->type().name() << " '" << itdata->name().value() << "'";
144  if (printProviders_) {
145  edm::eventsetup::ComponentDescription const* cd = rec->providerDescription(*itdata);
146  *msg << " provider:" << cd->type_ << " '" << cd->label_ << "'";
147  }
148  }
149  } else {
150  if (not msg) {
151  msg.reset(new LogSystem("ESContent"));
152  *msg << "Changed Record" << "\n " << "<datatype>" << " " << "'label' provider: 'provider label' <provider module type>";
153  }
154  *msg << "\n" << itrecords->name();
155  *msg << "\n start: " << rec->validityInterval().first().eventID() << " time: " << rec->validityInterval().first().time().value();
156  *msg << "\n end: " << rec->validityInterval().last().eventID() << " time: " << rec->validityInterval().last().time().value();
157  for (Data::iterator itdata = data.begin(), itdataend = data.end(); itdata != itdataend; ++itdata) {
158  *msg << "\n " << itdata->type().name() << " '" << itdata->name().value() << "'";
159  if (printProviders_) {
160  edm::eventsetup::ComponentDescription const* cd = rec->providerDescription(*itdata);
161  *msg << " provider:" << cd->type_ << " '" << cd->label_ << "'";
162  }
163  }
164  }
165  }
166  }
167  }
tuple msg
Definition: mps_check.py:277
std::map< eventsetup::EventSetupRecordKey, unsigned long long > cacheIdentifiers_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Member Data Documentation

std::map<eventsetup::EventSetupRecordKey, unsigned long long > edm::PrintEventSetupContent::cacheIdentifiers_
private

Definition at line 64 of file PrintEventSetupContent.cc.

Referenced by print().

const bool edm::PrintEventSetupContent::compact_
private

Definition at line 63 of file PrintEventSetupContent.cc.

Referenced by print().

const bool edm::PrintEventSetupContent::printProviders_
private

Definition at line 62 of file PrintEventSetupContent.cc.

Referenced by print().