CMS 3D CMS Logo

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

Writes to file the DAQ mapping loaded by TotemDAQMappingESSourceXML. More...

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

Public Member Functions

 WriteTotemDAQMapping (const edm::ParameterSet &ps)
 
 ~WriteTotemDAQMapping () 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 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
 
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

edm::ESGetToken< TotemDAQMapping, TotemReadoutRcdmappingToken_
 
edm::ESGetToken< TotemAnalysisMask, TotemAnalysisMaskRcdmaskToken_
 
std::ofstream outStream_
 
const bool readMap_
 
const bool readMask_
 
const std::string subSystemName_
 label of the CTPPS sub-system More...
 

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

Writes to file the DAQ mapping loaded by TotemDAQMappingESSourceXML.

Definition at line 19 of file WriteTotemDAQMapping.cc.

Constructor & Destructor Documentation

◆ WriteTotemDAQMapping()

WriteTotemDAQMapping::WriteTotemDAQMapping ( const edm::ParameterSet ps)

Definition at line 35 of file WriteTotemDAQMapping.cc.

References edm::EDConsumerBase::esConsumes(), mappingToken_, maskToken_, readMap_, readMask_, and subSystemName_.

37  outStream_(ps.getUntrackedParameter<std::string>("fileName"), std::ios_base::app),
38  readMap_(ps.getUntrackedParameter<bool>("readMap")),
39  readMask_(ps.getUntrackedParameter<bool>("readMask")) {
40  if (readMap_ == true) {
42  }
43  if (readMask_ == true) {
45  }
46 }
const std::string subSystemName_
label of the CTPPS sub-system
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TotemAnalysisMask, TotemAnalysisMaskRcd > maskToken_
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > mappingToken_

◆ ~WriteTotemDAQMapping()

WriteTotemDAQMapping::~WriteTotemDAQMapping ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 50 of file WriteTotemDAQMapping.cc.

References edm::EventSetup::getHandle(), HPSPFTaus_cff::mapping, mappingToken_, maskToken_, outStream_, readMap_, readMask_, and subSystemName_.

50  {
51  // get mapping
52  if (readMap_ == true) {
53  auto mappingHandle = es.getHandle(mappingToken_);
54  if (mappingHandle.isValid() && !mappingHandle.failedToGet()) {
55  auto const &mapping = *mappingHandle;
57  } else {
58  edm::LogError("WriteTotemDAQMapping mapping") << "WriteTotemDAQMapping: No mapping found";
59  }
60  }
61 
62  // get analysis mask to mask channels
63  if (readMask_ == true) {
64  auto analysisMaskHandle = es.getHandle(maskToken_);
65  if (analysisMaskHandle.isValid() && !analysisMaskHandle.failedToGet()) {
66  auto const &analysisMask = *analysisMaskHandle;
67  outStream_ << analysisMask;
68  } else {
69  edm::LogError("WriteTotemDAQMapping mask") << "WriteTotemDAQMapping: No analysis mask found";
70  }
71  }
72 
73  outStream_.close();
74 }
const std::string subSystemName_
label of the CTPPS sub-system
Log< level::Error, false > LogError
edm::ESGetToken< TotemAnalysisMask, TotemAnalysisMaskRcd > maskToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > mappingToken_

Member Data Documentation

◆ mappingToken_

edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> WriteTotemDAQMapping::mappingToken_
private

Definition at line 30 of file WriteTotemDAQMapping.cc.

Referenced by analyze(), and WriteTotemDAQMapping().

◆ maskToken_

edm::ESGetToken<TotemAnalysisMask, TotemAnalysisMaskRcd> WriteTotemDAQMapping::maskToken_
private

Definition at line 31 of file WriteTotemDAQMapping.cc.

Referenced by analyze(), and WriteTotemDAQMapping().

◆ outStream_

std::ofstream WriteTotemDAQMapping::outStream_
private

Definition at line 27 of file WriteTotemDAQMapping.cc.

Referenced by analyze().

◆ readMap_

const bool WriteTotemDAQMapping::readMap_
private

Definition at line 28 of file WriteTotemDAQMapping.cc.

Referenced by analyze(), and WriteTotemDAQMapping().

◆ readMask_

const bool WriteTotemDAQMapping::readMask_
private

Definition at line 29 of file WriteTotemDAQMapping.cc.

Referenced by analyze(), and WriteTotemDAQMapping().

◆ subSystemName_

const std::string WriteTotemDAQMapping::subSystemName_
private

label of the CTPPS sub-system

Definition at line 26 of file WriteTotemDAQMapping.cc.

Referenced by analyze(), and WriteTotemDAQMapping().