CMS 3D CMS Logo

PrintTotemDAQMapping.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of TOTEM offline software.
4  * Authors:
5  * Jan Kašpar (jan.kaspar@gmail.com)
6  *
7  ****************************************************************************/
8 
19 
20 //----------------------------------------------------------------------------------------------------
21 
26 public:
28  ~PrintTotemDAQMapping() override {}
29 
30 private:
35  void analyze(const edm::Event &e, const edm::EventSetup &es) override;
36 };
37 
39  : subSystemName_(ps.getUntrackedParameter<std::string>("subSystem")),
40  mappingToken_(esConsumes(edm::ESInputTag("", subSystemName_))),
41  maskToken_(esConsumes(edm::ESInputTag("", subSystemName_))) {}
42 
43 //----------------------------------------------------------------------------------------------------
44 
46  // get mapping
47  if (auto mappingHandle = es.getHandle(mappingToken_)) {
48  auto const &mapping = *mappingHandle;
49  edm::LogInfo("PrintTotemDAQMapping mapping");
51  } else {
52  edm::LogError("PrintTotemDAQMapping mapping") << "PrintTotemDAQMapping: No mapping found";
53  }
54 
55  // get analysis mask to mask channels
56  if (auto analysisMaskHandle = es.getHandle(maskToken_)) {
57  auto const &analysisMask = *analysisMaskHandle;
58  edm::LogPrint("PrintTotemDAQMapping") << analysisMask;
59  } else {
60  edm::LogError("PrintTotemDAQMapping mask") << "PrintTotemDAQMapping: No analysis mask found";
61  }
62 }
63 
64 //----------------------------------------------------------------------------------------------------
65 
Prints the DAQ mapping loaded by TotemDAQMappingESSourceXML.
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const std::string subSystemName_
label of the CTPPS sub-system
Log< level::Error, false > LogError
const edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > mappingToken_
void analyze(const edm::Event &e, const edm::EventSetup &es) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
Log< level::Info, false > LogInfo
PrintTotemDAQMapping(const edm::ParameterSet &ps)
const edm::ESGetToken< TotemAnalysisMask, TotemAnalysisMaskRcd > maskToken_
HLT enums.