CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalDQMStatusWriter Class Reference

#include <EcalDQMStatusWriter.h>

Inheritance diagram for EcalDQMStatusWriter:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EcalDQMStatusWriter (edm::ParameterSet const &)
 
 ~EcalDQMStatusWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 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 (edm::Event const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
void setElectronicsMap (edm::EventSetup const &)
 

Private Attributes

EcalDQMChannelStatus channelStatus_
 
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandle_
 
EcalElectronicsMapping const * electronicsMap_
 
unsigned firstRun_
 
std::ifstream inputFile_
 
EcalDQMTowerStatus towerStatus_
 

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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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

Definition at line 14 of file EcalDQMStatusWriter.h.

Constructor & Destructor Documentation

EcalDQMStatusWriter::EcalDQMStatusWriter ( edm::ParameterSet const &  _ps)

Definition at line 12 of file EcalDQMStatusWriter.cc.

References inputFile_.

13  : channelStatus_(),
14  towerStatus_(),
15  firstRun_(_ps.getUntrackedParameter<unsigned>("firstRun")),
16  inputFile_(_ps.getUntrackedParameter<std::string>("inputFile")),
17  electronicsMap_(nullptr),
18  elecMapHandle_(esConsumes<edm::Transition::BeginRun>()) {
19  if (!inputFile_.is_open())
20  throw cms::Exception("Invalid input for EcalDQMStatusWriter");
21 }
EcalDQMChannelStatus channelStatus_
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > elecMapHandle_
EcalDQMTowerStatus towerStatus_
EcalElectronicsMapping const * electronicsMap_
EcalDQMStatusWriter::~EcalDQMStatusWriter ( )
inlineoverride

Definition at line 17 of file EcalDQMStatusWriter.h.

17 {}

Member Function Documentation

void EcalDQMStatusWriter::analyze ( edm::Event const &  ,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 34 of file EcalDQMStatusWriter.cc.

References channelStatus_, cond::service::PoolDBOutputService::endOfTime(), firstRun_, towerStatus_, and cond::service::PoolDBOutputService::writeOneIOV().

34  {
36  if (firstRun_ == dbOutput.endOfTime())
37  return;
38 
39  dbOutput.writeOneIOV(channelStatus_, firstRun_, "EcalDQMChannelStatusRcd");
40  dbOutput.writeOneIOV(towerStatus_, firstRun_, "EcalDQMTowerStatusRcd");
41 
42  firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions
43 }
EcalDQMChannelStatus channelStatus_
EcalDQMTowerStatus towerStatus_
void EcalDQMStatusWriter::beginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 23 of file EcalDQMStatusWriter.cc.

References channelStatus_, GetElectronicsMap(), inputFile_, ecaldqm::StatusManager::readFromStream(), setElectronicsMap(), towerStatus_, and ecaldqm::StatusManager::writeToObj().

23  {
24  setElectronicsMap(_es);
25 
26  ecaldqm::StatusManager statusManager;
27 
29  statusManager.writeToObj(channelStatus_, towerStatus_);
30 }
void setElectronicsMap(edm::EventSetup const &)
EcalDQMChannelStatus channelStatus_
EcalDQMTowerStatus towerStatus_
EcalElectronicsMapping const * GetElectronicsMap()
void readFromStream(std::istream &, EcalElectronicsMapping const *)
void writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const
void EcalDQMStatusWriter::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 32 of file EcalDQMStatusWriter.cc.

32 {}
EcalElectronicsMapping const * EcalDQMStatusWriter::GetElectronicsMap ( )
private

Definition at line 49 of file EcalDQMStatusWriter.cc.

References electronicsMap_, and Exception.

Referenced by beginRun().

49  {
50  if (!electronicsMap_)
51  throw cms::Exception("InvalidCall") << "Electronics Mapping not initialized";
52  return electronicsMap_;
53 }
EcalElectronicsMapping const * electronicsMap_
void EcalDQMStatusWriter::setElectronicsMap ( edm::EventSetup const &  _es)
private

Definition at line 45 of file EcalDQMStatusWriter.cc.

References elecMapHandle_, electronicsMap_, and edm::EventSetup::getData().

Referenced by beginRun().

45  {
46  electronicsMap_ = &_es.getData(elecMapHandle_);
47 }
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > elecMapHandle_
EcalElectronicsMapping const * electronicsMap_

Member Data Documentation

EcalDQMChannelStatus EcalDQMStatusWriter::channelStatus_
private

Definition at line 24 of file EcalDQMStatusWriter.h.

Referenced by analyze(), and beginRun().

edm::ESGetToken<EcalElectronicsMapping, EcalMappingRcd> EcalDQMStatusWriter::elecMapHandle_
private

Definition at line 30 of file EcalDQMStatusWriter.h.

Referenced by setElectronicsMap().

EcalElectronicsMapping const* EcalDQMStatusWriter::electronicsMap_
private

Definition at line 29 of file EcalDQMStatusWriter.h.

Referenced by GetElectronicsMap(), and setElectronicsMap().

unsigned EcalDQMStatusWriter::firstRun_
private

Definition at line 26 of file EcalDQMStatusWriter.h.

Referenced by analyze().

std::ifstream EcalDQMStatusWriter::inputFile_
private

Definition at line 27 of file EcalDQMStatusWriter.h.

Referenced by beginRun(), and EcalDQMStatusWriter().

EcalDQMTowerStatus EcalDQMStatusWriter::towerStatus_
private

Definition at line 25 of file EcalDQMStatusWriter.h.

Referenced by analyze(), and beginRun().