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 &&)=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 (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
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 42 of file PrintEventSetupContent.cc.

Constructor & Destructor Documentation

◆ PrintEventSetupContent()

PrintEventSetupContent::PrintEventSetupContent ( ParameterSet const &  config)
explicit

Definition at line 78 of file PrintEventSetupContent.cc.

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

◆ ~PrintEventSetupContent()

PrintEventSetupContent::~PrintEventSetupContent ( )
override

Definition at line 85 of file PrintEventSetupContent.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 95 of file PrintEventSetupContent.cc.

95 { print(iSetup); }

References print().

◆ beginJob()

void PrintEventSetupContent::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 172 of file PrintEventSetupContent.cc.

172 {}

◆ beginLuminosityBlock()

void PrintEventSetupContent::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 101 of file PrintEventSetupContent.cc.

101 { print(iSetup); }

References print().

◆ beginRun()

void PrintEventSetupContent::beginRun ( Run const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 97 of file PrintEventSetupContent.cc.

97 { print(iSetup); }

References print().

◆ endJob()

void PrintEventSetupContent::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 175 of file PrintEventSetupContent.cc.

175 {}

◆ endLuminosityBlock()

void PrintEventSetupContent::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 103 of file PrintEventSetupContent.cc.

103 {}

◆ endRun()

void PrintEventSetupContent::endRun ( Run const &  ,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 99 of file PrintEventSetupContent.cc.

99 {}

◆ fillDescriptions()

void PrintEventSetupContent::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 178 of file PrintEventSetupContent.cc.

178  {
179  descriptions.setComment(
180  "Print what data is available in each available EventSetup Record in the job.\n"
181  "As part of the data is the C++ class type, label and which module makes that data.");
183  desc.addUntracked<bool>("compact", false)
184  ->setComment("If 'true' produces a more compact view, similar to the one used by PrintEventSetupDataRetrieval");
185  desc.addUntracked<bool>("printProviders", true)
186  ->setComment("If 'true' also print which ES module provides the data");
187  descriptions.add("printEventSetupContent", desc);
188  }

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

◆ print()

void PrintEventSetupContent::print ( EventSetup const &  iSetup)
private

Definition at line 105 of file PrintEventSetupContent.cc.

105  {
106  typedef std::vector<eventsetup::EventSetupRecordKey> Records;
107  typedef std::vector<eventsetup::DataKey> Data;
108 
109  Records records;
110  Data data;
111  iSetup.fillAvailableRecordKeys(records);
112  std::unique_ptr<LogSystem> msg;
113 
114  for (Records::iterator itrecords = records.begin(), itrecordsend = records.end(); itrecords != itrecordsend;
115  ++itrecords) {
116  auto rec = iSetup.find(*itrecords);
117 
118  if (rec && cacheIdentifiers_[*itrecords] != rec->cacheIdentifier()) {
119  cacheIdentifiers_[*itrecords] = rec->cacheIdentifier();
120  rec->fillRegisteredDataKeys(data);
121  if (compact_) {
122  for (Data::iterator itdata = data.begin(), itdataend = data.end(); itdata != itdataend; ++itdata) {
123  if (not msg)
124  msg.reset(new LogSystem("ESContent"));
125  else
126  *msg << '\n';
127  *msg << "ESContent> "
128  << "record:" << itrecords->name() << " data:" << itdata->type().name() << " '"
129  << itdata->name().value() << "'";
130  if (printProviders_) {
131  edm::eventsetup::ComponentDescription const* cd = rec->providerDescription(*itdata);
132  *msg << " provider:" << cd->type_ << " '" << cd->label_ << "'";
133  }
134  }
135  } else {
136  if (not msg) {
137  msg.reset(new LogSystem("ESContent"));
138  *msg << "Changed Record"
139  << "\n "
140  << "<datatype>"
141  << " "
142  << "'label' provider: 'provider label' <provider module type>";
143  }
144  *msg << "\n" << itrecords->name();
145  *msg << "\n start: " << rec->validityInterval().first().eventID()
146  << " time: " << rec->validityInterval().first().time().value();
147  *msg << "\n end: " << rec->validityInterval().last().eventID()
148  << " time: " << rec->validityInterval().last().time().value();
149  for (Data::iterator itdata = data.begin(), itdataend = data.end(); itdata != itdataend; ++itdata) {
150  *msg << "\n " << itdata->type().name() << " '" << itdata->name().value() << "'";
151  if (printProviders_) {
152  edm::eventsetup::ComponentDescription const* cd = rec->providerDescription(*itdata);
153  *msg << " provider:" << cd->type_ << " '" << cd->label_ << "'";
154  }
155  }
156  }
157  }
158  }
159  }

References cacheIdentifiers_, hippyaddtobaddatafiles::cd(), compact_, data, edm::EventSetup::fillAvailableRecordKeys(), edm::EventSetup::find(), mps_check::msg, and printProviders_.

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

Member Data Documentation

◆ cacheIdentifiers_

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

Definition at line 64 of file PrintEventSetupContent.cc.

Referenced by print().

◆ compact_

const bool edm::PrintEventSetupContent::compact_
private

Definition at line 63 of file PrintEventSetupContent.cc.

Referenced by print().

◆ printProviders_

const bool edm::PrintEventSetupContent::printProviders_
private

Definition at line 62 of file PrintEventSetupContent.cc.

Referenced by print().

mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::PrintEventSetupContent::compact_
const bool compact_
Definition: PrintEventSetupContent.cc:63
config
Definition: config.py:1
edm::eventsetup::ComponentDescription
Definition: ComponentDescription.h:30
edm::PrintEventSetupContent::cacheIdentifiers_
std::map< eventsetup::EventSetupRecordKey, unsigned long long > cacheIdentifiers_
Definition: PrintEventSetupContent.cc:64
ParameterSetDescription
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
hippyaddtobaddatafiles.cd
def cd(newdir)
Definition: hippyaddtobaddatafiles.py:40
edm::PrintEventSetupContent::print
void print(EventSetup const &)
Definition: PrintEventSetupContent.cc:105
edm::PrintEventSetupContent::printProviders_
const bool printProviders_
Definition: PrintEventSetupContent.cc:62