CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ProduceDropBoxMetadata Class Reference
Inheritance diagram for ProduceDropBoxMetadata:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 ProduceDropBoxMetadata (const edm::ParameterSet &)
 Constructor. More...
 
 ~ProduceDropBoxMetadata () override
 Destructor. More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
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)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const edm::ESGetToken< DropBoxMetadata, DropBoxMetadataRcddropBoxMetadataToken_
 
std::vector< std::string > fToRead
 
std::vector< edm::ParameterSetfToWrite
 
bool read
 
bool write
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Create an sqlite file containing the DropBoxMetadata needed for the PCL uploads

Date
2011/02/22 11:05:16
Revision
1.4
Author
G. Cerminara - CERN Modifications T. Vami - JHU

Definition at line 31 of file ProduceDropBoxMetadata.cc.

Constructor & Destructor Documentation

◆ ProduceDropBoxMetadata()

ProduceDropBoxMetadata::ProduceDropBoxMetadata ( const edm::ParameterSet pSet)
explicit

Constructor.

Definition at line 55 of file ProduceDropBoxMetadata.cc.

References fToRead, fToWrite, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), read, and write.

56  read = pSet.getUntrackedParameter<bool>("read");
57  write = pSet.getUntrackedParameter<bool>("write");
58 
59  fToWrite = pSet.getParameter<vector<ParameterSet> >("toWrite");
60  fToRead = pSet.getUntrackedParameter<vector<string> >("toRead");
61 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< edm::ParameterSet > fToWrite
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< DropBoxMetadata, DropBoxMetadataRcd > dropBoxMetadataToken_
std::vector< std::string > fToRead

◆ ~ProduceDropBoxMetadata()

ProduceDropBoxMetadata::~ProduceDropBoxMetadata ( )
overridedefault

Destructor.

Member Function Documentation

◆ analyze()

void ProduceDropBoxMetadata::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 65 of file ProduceDropBoxMetadata.cc.

References dropBoxMetadataToken_, fToRead, fToWrite, edm::EventSetup::getData(), edm::Service< T >::isAvailable(), crabWrapper::key, OccupancyTask_cfi::metadata, Skims_PA_cff::name, submitPVValidationJobs::params, read, AlCaHarvesting_cff::record, relativeConstraints::value, write, and cond::service::PoolDBOutputService::writeOneIOV().

65  {
66  // ---------------------------------------------------------------------------------
67  // Write the payload
68  if (write) {
70 
71  edm::LogPrint("ProduceDropBoxMetadata") << "Entering write, to loop over toWrite";
72  // loop over all the pSets for the TF1 that we want to write to DB
73  for (vector<ParameterSet>::const_iterator fSetup = fToWrite.begin(); fSetup != fToWrite.end(); ++fSetup) {
74  string record = (*fSetup).getUntrackedParameter<string>("record");
75  edm::LogPrint("ProduceDropBoxMetadata") << "\n--- record: " << record;
77  vector<string> paramKeys = (*fSetup).getParameterNames();
78  for (vector<string>::const_iterator key = paramKeys.begin(); key != paramKeys.end(); ++key) {
79  if (*key != "record") {
80  string value = (*fSetup).getUntrackedParameter<string>(*key);
81  params.addParameter(*key, value);
82  edm::LogPrint("ProduceDropBoxMetadata") << " key: " << *key << " value: " << value;
83  }
84  }
85  metadata.addRecordParameters(record, params);
86  }
87 
88  // actually write to DB
90  if (dbOut.isAvailable()) {
91  dbOut->writeOneIOV<DropBoxMetadata>(metadata, 1, "DropBoxMetadataRcd");
92  }
93  }
94 
95  if (read) {
96  // Read the objects
97  edm::LogPrint("ProduceDropBoxMetadata") << "Entering read, to loop over toRead";
98  const auto& mdPayload = iSetup.getData(dropBoxMetadataToken_);
99 
100  // loop
101  for (vector<string>::const_iterator name = fToRead.begin(); name != fToRead.end(); ++name) {
102  edm::LogPrint("ProduceDropBoxMetadata") << "\n--- record: " << *name;
103  if (mdPayload.knowsRecord(*name)) {
104  const map<string, string>& params = mdPayload.getRecordParameters(*name).getParameterMap();
105  for (map<string, string>::const_iterator par = params.begin(); par != params.end(); ++par) {
106  edm::LogPrint("ProduceDropBoxMetadata") << " key: " << par->first << " value: " << par->second;
107  }
108  } else {
109  edm::LogPrint("ProduceDropBoxMetadata") << " not in the payload!";
110  }
111  }
112  }
113 }
std::vector< edm::ParameterSet > fToWrite
const edm::ESGetToken< DropBoxMetadata, DropBoxMetadataRcd > dropBoxMetadataToken_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Definition: value.py:1
Log< level::Warning, true > LogPrint
bool isAvailable() const
Definition: Service.h:40
std::vector< std::string > fToRead

Member Data Documentation

◆ dropBoxMetadataToken_

const edm::ESGetToken<DropBoxMetadata, DropBoxMetadataRcd> ProduceDropBoxMetadata::dropBoxMetadataToken_
private

Definition at line 49 of file ProduceDropBoxMetadata.cc.

Referenced by analyze().

◆ fToRead

std::vector<std::string> ProduceDropBoxMetadata::fToRead
private

Definition at line 47 of file ProduceDropBoxMetadata.cc.

Referenced by analyze(), and ProduceDropBoxMetadata().

◆ fToWrite

std::vector<edm::ParameterSet> ProduceDropBoxMetadata::fToWrite
private

Definition at line 46 of file ProduceDropBoxMetadata.cc.

Referenced by analyze(), and ProduceDropBoxMetadata().

◆ read

bool ProduceDropBoxMetadata::read
private

◆ write

bool ProduceDropBoxMetadata::write
private