CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
19 
22 
27 
28 #include <cstdint>
29 
30 //----------------------------------------------------------------------------------------------------
31 
36 public:
39 
40 private:
41  void analyze(const edm::Event &e, const edm::EventSetup &es) override;
45 
47 };
48 
49 using namespace std;
50 using namespace edm;
51 
52 //----------------------------------------------------------------------------------------------------
53 
55  : analysismaskiov_(ps.getParameter<unsigned long long>("analysismaskiov")),
56  record_(ps.getParameter<string>("record")),
57  label_(ps.getParameter<string>("label")),
58  tokenAnalysisMask_(esConsumes<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>(edm::ESInputTag("", label_))) {}
59 
61  // get analysis mask to mask channels
63 
64  /*// print analysisMask
65  printf("* mask\n");
66  for (const auto &p : analysisMask->analysisMask)
67  cout << " " << p.first
68  << ": fullMask=" << p.second.fullMask
69  << ", number of masked channels " << p.second.maskedPixels.size() << endl;
70  */
71 
72  // Write Analysis Mask to sqlite file:
73  const CTPPSPixelAnalysisMask *pCTPPSPixelAnalysisMask = hAnalysisMask.product(); // Analysis Mask
75  if (poolDbService.isAvailable()) {
76  poolDbService->writeOneIOV(*pCTPPSPixelAnalysisMask, analysismaskiov_, /*m_record*/ record_);
77  }
78 }
79 
80 //----------------------------------------------------------------------------------------------------
81 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void analyze(const edm::Event &e, const edm::EventSetup &es) override
unsigned long long Time_t
Definition: Time.h:14
bool isAvailable() const
Definition: Service.h:40
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Channel-mask mapping.
WriteCTPPSPixelAnalysisMask(const edm::ParameterSet &ps)
Prints the Analysis Mask loaded by TotemDAQMappingESSourceXML.
T const * product() const
Definition: ESHandle.h:86
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenAnalysisMask_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283