CMS 3D CMS Logo

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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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, EcalMappingRcdelecMapHandle_
 
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< 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 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

Definition at line 14 of file EcalDQMStatusWriter.h.

Constructor & Destructor Documentation

◆ EcalDQMStatusWriter()

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::~EcalDQMStatusWriter ( )
inlineoverride

Definition at line 17 of file EcalDQMStatusWriter.h.

17 {}

Member Function Documentation

◆ analyze()

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_

◆ beginRun()

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 writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const
void setElectronicsMap(edm::EventSetup const &)
EcalDQMChannelStatus channelStatus_
EcalDQMTowerStatus towerStatus_
EcalElectronicsMapping const * GetElectronicsMap()
void readFromStream(std::istream &, EcalElectronicsMapping const *)

◆ endRun()

void EcalDQMStatusWriter::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 32 of file EcalDQMStatusWriter.cc.

32 {}

◆ GetElectronicsMap()

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_

◆ setElectronicsMap()

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

◆ channelStatus_

EcalDQMChannelStatus EcalDQMStatusWriter::channelStatus_
private

Definition at line 24 of file EcalDQMStatusWriter.h.

Referenced by analyze(), and beginRun().

◆ elecMapHandle_

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

Definition at line 30 of file EcalDQMStatusWriter.h.

Referenced by setElectronicsMap().

◆ electronicsMap_

EcalElectronicsMapping const* EcalDQMStatusWriter::electronicsMap_
private

Definition at line 29 of file EcalDQMStatusWriter.h.

Referenced by GetElectronicsMap(), and setElectronicsMap().

◆ firstRun_

unsigned EcalDQMStatusWriter::firstRun_
private

Definition at line 26 of file EcalDQMStatusWriter.h.

Referenced by analyze().

◆ inputFile_

std::ifstream EcalDQMStatusWriter::inputFile_
private

Definition at line 27 of file EcalDQMStatusWriter.h.

Referenced by beginRun(), and EcalDQMStatusWriter().

◆ towerStatus_

EcalDQMTowerStatus EcalDQMStatusWriter::towerStatus_
private

Definition at line 25 of file EcalDQMStatusWriter.h.

Referenced by analyze(), and beginRun().