CMS 3D CMS Logo

WriteCTPPSPixelAnalysisMask.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * Offline analyzer for writing CTPPS Analysis Mask sqlite file
4 * H. Malbouisson
5 * based on TOTEM code from Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
16 
18 
21 
26 
27 #include <cstdint>
28 
29 //----------------------------------------------------------------------------------------------------
30 
35 public:
38 
39 private:
40  void analyze(const edm::Event &e, const edm::EventSetup &es) override;
44 
46 };
47 
48 using namespace std;
49 using namespace edm;
50 
51 //----------------------------------------------------------------------------------------------------
52 
54  : analysismaskiov_(ps.getParameter<unsigned long long>("analysismaskiov")),
55  record_(ps.getParameter<string>("record")),
56  label_(ps.getParameter<string>("label")),
57  tokenAnalysisMask_(esConsumes<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>(edm::ESInputTag("", label_))) {}
58 
60  /*// print analysisMask
61  printf("* mask\n");
62  for (const auto &p : analysisMask->analysisMask)
63  cout << " " << p.first
64  << ": fullMask=" << p.second.fullMask
65  << ", number of masked channels " << p.second.maskedPixels.size() << endl;
66  */
67 
68  // Write Analysis Mask to sqlite file:
69 
70  const auto &analysisMask = es.getData(tokenAnalysisMask_);
72  if (poolDbService.isAvailable()) {
73  poolDbService->writeOneIOV(analysisMask, analysismaskiov_, record_);
74  }
75 }
76 
77 //----------------------------------------------------------------------------------------------------
78 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void analyze(const edm::Event &e, const edm::EventSetup &es) override
unsigned long long Time_t
Definition: Time.h:14
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Channel-mask mapping.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
WriteCTPPSPixelAnalysisMask(const edm::ParameterSet &ps)
Prints the Analysis Mask loaded by TotemDAQMappingESSourceXML.
HLT enums.
bool isAvailable() const
Definition: Service.h:40
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenAnalysisMask_