File indexing completed on 2023-03-17 10:42:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015
0016 #include "CondFormats/DataRecord/interface/TotemReadoutRcd.h"
0017 #include "CondFormats/PPSObjects/interface/TotemDAQMapping.h"
0018 #include "CondFormats/PPSObjects/interface/TotemAnalysisMask.h"
0019
0020
0021
0022
0023
0024
0025 class PrintTotemDAQMapping : public edm::one::EDAnalyzer<> {
0026 public:
0027 PrintTotemDAQMapping(const edm::ParameterSet &ps);
0028 ~PrintTotemDAQMapping() override {}
0029
0030 private:
0031
0032 std::string subSystemName;
0033 edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> mappingToken_;
0034 edm::ESGetToken<TotemAnalysisMask, TotemReadoutRcd> maskToken_;
0035 void analyze(const edm::Event &e, const edm::EventSetup &es) override;
0036 };
0037
0038 PrintTotemDAQMapping::PrintTotemDAQMapping(const edm::ParameterSet &ps)
0039 : subSystemName(ps.getUntrackedParameter<std::string>("subSystem")),
0040 mappingToken_(esConsumes(edm::ESInputTag("", subSystemName))),
0041 maskToken_(esConsumes(edm::ESInputTag("", subSystemName))) {}
0042
0043
0044
0045 void PrintTotemDAQMapping::analyze(const edm::Event &, edm::EventSetup const &es) {
0046
0047 auto const &mapping = es.getData(mappingToken_);
0048
0049
0050 auto const &analysisMask = es.getData(maskToken_);
0051
0052
0053 for (const auto &p : mapping.VFATMapping)
0054 edm::LogInfo("PrintTotemDAQMapping mapping") << " " << p.first << " -> " << p.second;
0055
0056
0057 for (const auto &p : analysisMask.analysisMask)
0058 edm::LogInfo("PrintTotemDAQMapping mask") << " " << p.first << ": fullMask=" << p.second.fullMask
0059 << ", number of masked channels " << p.second.maskedChannels.size();
0060 }
0061
0062
0063
0064 DEFINE_FWK_MODULE(PrintTotemDAQMapping);