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 
19 
22 
27 
28 #include <cstdint>
29 
30 //----------------------------------------------------------------------------------------------------
31 
36 {
37  public:
40 
41  private:
42  void analyze(const edm::Event &e, const edm::EventSetup &es) override;
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 {}
58 
59 
61 {
62 
63  // get analysis mask to mask channels
65  es.get<CTPPSPixelAnalysisMaskRcd>().get(label_, analysisMask);
66 
67  /*// print analysisMask
68  printf("* mask\n");
69  for (const auto &p : analysisMask->analysisMask)
70  cout << " " << p.first
71  << ": fullMask=" << p.second.fullMask
72  << ", number of masked channels " << p.second.maskedPixels.size() << endl;
73  */
74 
75  // Write Analysis Mask to sqlite file:
76  const CTPPSPixelAnalysisMask* pCTPPSPixelAnalysisMask = analysisMask.product(); // Analysis Mask
78  if( poolDbService.isAvailable() ){
79  poolDbService->writeOne( pCTPPSPixelAnalysisMask, analysismaskiov_, /*m_record*/ record_ );
80  }
81 
82 
83 }
84 
85 //----------------------------------------------------------------------------------------------------
86 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void analyze(const edm::Event &e, const edm::EventSetup &es) override
unsigned long long Time_t
Definition: Time.h:16
bool isAvailable() const
Definition: Service.h:46
Channel-mask mapping.
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
WriteCTPPSPixelAnalysisMask(const edm::ParameterSet &ps)
const T & get() const
Definition: EventSetup.h:59
Prints the Analysis Mask loaded by TotemDAQMappingESSourceXML.
HLT enums.
T const * product() const
Definition: ESHandle.h:86