CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
WriteCTPPSTotemDAQMappingMask Class Reference

Prints and writes to SQLite the DAQ mapping loaded by TotemDAQMappingESSourceXML. More...

Inheritance diagram for WriteCTPPSTotemDAQMappingMask:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 WriteCTPPSTotemDAQMappingMask (const edm::ParameterSet &ps)
 
 ~WriteCTPPSTotemDAQMappingMask () override=default
 
- 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 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 (const edm::Event &e, const edm::EventSetup &es) override
 

Private Attributes

const cond::Time_t daqMappingIov_
 
const std::string label_
 
const std::string recordMap_
 
const std::string recordMask_
 
const edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcdtokenAnalysisMask_
 
const edm::ESGetToken< TotemDAQMapping, TotemReadoutRcdtokenMapping_
 

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

Prints and writes to SQLite the DAQ mapping loaded by TotemDAQMappingESSourceXML.

Definition at line 30 of file WriteCTPPSTotemDAQMappingMask.cc.

Constructor & Destructor Documentation

◆ WriteCTPPSTotemDAQMappingMask()

WriteCTPPSTotemDAQMappingMask::WriteCTPPSTotemDAQMappingMask ( const edm::ParameterSet ps)

Definition at line 48 of file WriteCTPPSTotemDAQMappingMask.cc.

49  : daqMappingIov_(ps.getParameter<unsigned long long>("daqMappingIov")),
50  recordMap_(ps.getParameter<std::string>("recordMap")),
51  recordMask_(ps.getParameter<std::string>("recordMask")),
52  label_(ps.getParameter<std::string>("label")),
53  tokenMapping_(esConsumes<TotemDAQMapping, TotemReadoutRcd>(edm::ESInputTag("", label_))),
54  tokenAnalysisMask_(esConsumes<TotemAnalysisMask, TotemReadoutRcd>(edm::ESInputTag("", label_))) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcd > tokenAnalysisMask_
const edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > tokenMapping_

◆ ~WriteCTPPSTotemDAQMappingMask()

WriteCTPPSTotemDAQMappingMask::~WriteCTPPSTotemDAQMappingMask ( )
overridedefault

Member Function Documentation

◆ analyze()

void WriteCTPPSTotemDAQMappingMask::analyze ( const edm::Event e,
const edm::EventSetup es 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 56 of file WriteCTPPSTotemDAQMappingMask.cc.

References mappings_PPSObjects_XML_cfi::analysisMask, daqMappingIov_, edm::EventSetup::getData(), edm::EventSetup::getHandle(), edm::Service< T >::isAvailable(), label_, HPSPFTaus_cff::mapping, convertSQLitetoXML_cfg::output, recordMap_, recordMask_, tokenAnalysisMask_, tokenMapping_, and cond::service::PoolDBOutputService::writeOneIOV().

56  {
58 
59  auto mappingHandle = es.getHandle(tokenMapping_);
60  if (!recordMap_.empty() && mappingHandle.isValid() && !mappingHandle.failedToGet()) {
61  const auto &mapping = es.getData(tokenMapping_);
62  std::stringstream output;
63  mapping.print(output, label_);
64  edm::LogInfo("WriteCTPPSTotemDAQMappingMask mapping") << output.str();
65 
66  if (poolDbService.isAvailable()) {
67  poolDbService->writeOneIOV(mapping, daqMappingIov_, recordMap_);
68  } else {
69  edm::LogError("WriteCTPPSTotemDAQMappingMask mapping")
70  << "WriteCTPPSTotemDAQMappingMask: PoolDBService not availible. Data not written.";
71  }
72 
73  } else {
74  edm::LogWarning("WriteCTPPSTotemDAQMappingMask mapping") << "WriteCTPPSTotemDAQMappingMask: No mapping found";
75  }
76 
77  auto maskHandle = es.getHandle(tokenAnalysisMask_);
78  if (!recordMask_.empty() && maskHandle.isValid() && !maskHandle.failedToGet()) {
79  const auto &analysisMask = es.getData(tokenAnalysisMask_);
80  edm::LogInfo("WriteCTPPSTotemDAQMappingMask mask") << analysisMask;
81 
82  if (poolDbService.isAvailable()) {
84  } else {
85  edm::LogError("WriteCTPPSTotemDAQMappingMask mask")
86  << "WriteCTPPSTotemDAQMappingMask: PoolDBService not availible. Data not written.";
87  }
88  } else {
89  edm::LogWarning("WriteCTPPSTotemDAQMappingMask mask") << "WriteCTPPSTotemDAQMappingMask: No analysis mask found";
90  }
91 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Log< level::Error, false > LogError
const edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcd > tokenAnalysisMask_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
Log< level::Info, false > LogInfo
const edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > tokenMapping_
bool isAvailable() const
Definition: Service.h:40
Definition: output.py:1
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ daqMappingIov_

const cond::Time_t WriteCTPPSTotemDAQMappingMask::daqMappingIov_
private

Definition at line 36 of file WriteCTPPSTotemDAQMappingMask.cc.

Referenced by analyze().

◆ label_

const std::string WriteCTPPSTotemDAQMappingMask::label_
private

◆ recordMap_

const std::string WriteCTPPSTotemDAQMappingMask::recordMap_
private

Definition at line 37 of file WriteCTPPSTotemDAQMappingMask.cc.

Referenced by analyze().

◆ recordMask_

const std::string WriteCTPPSTotemDAQMappingMask::recordMask_
private

Definition at line 38 of file WriteCTPPSTotemDAQMappingMask.cc.

Referenced by analyze().

◆ tokenAnalysisMask_

const edm::ESGetToken<TotemAnalysisMask, TotemReadoutRcd> WriteCTPPSTotemDAQMappingMask::tokenAnalysisMask_
private

Definition at line 41 of file WriteCTPPSTotemDAQMappingMask.cc.

Referenced by analyze().

◆ tokenMapping_

const edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> WriteCTPPSTotemDAQMappingMask::tokenMapping_
private

Definition at line 40 of file WriteCTPPSTotemDAQMappingMask.cc.

Referenced by analyze().