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 public:
38  ~WriteCTPPSPixelAnalysisMask() override {}
39 
40 private:
41  void analyze(const edm::Event &e, const edm::EventSetup &es) override;
45 };
46 
47 using namespace std;
48 using namespace edm;
49 
50 //----------------------------------------------------------------------------------------------------
51 
53  : analysismaskiov_(ps.getParameter<unsigned long long>("analysismaskiov")),
54  record_(ps.getParameter<string>("record")),
55  label_(ps.getParameter<string>("label")) {}
56 
58  // get analysis mask to mask channels
60  es.get<CTPPSPixelAnalysisMaskRcd>().get(label_, analysisMask);
61 
62  /*// print analysisMask
63  printf("* mask\n");
64  for (const auto &p : analysisMask->analysisMask)
65  cout << " " << p.first
66  << ": fullMask=" << p.second.fullMask
67  << ", number of masked channels " << p.second.maskedPixels.size() << endl;
68  */
69 
70  // Write Analysis Mask to sqlite file:
71  const CTPPSPixelAnalysisMask *pCTPPSPixelAnalysisMask = analysisMask.product(); // Analysis Mask
73  if (poolDbService.isAvailable()) {
74  poolDbService->writeOne(pCTPPSPixelAnalysisMask, analysismaskiov_, /*m_record*/ record_);
75  }
76 }
77 
78 //----------------------------------------------------------------------------------------------------
79 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
CTPPSPixelAnalysisMaskRcd.h
EDAnalyzer.h
WriteCTPPSPixelAnalysisMask::record_
std::string record_
Definition: WriteCTPPSPixelAnalysisMask.cc:47
CTPPSPixelDAQMappingRcd.h
EDProducer.h
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
MakerMacros.h
WriteCTPPSPixelAnalysisMask::analyze
void analyze(const edm::Event &e, const edm::EventSetup &es) override
Definition: WriteCTPPSPixelAnalysisMask.cc:56
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition: CTPPSPixelAnalysisMask.h:34
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
edm::ESHandle
Definition: DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelAnalysisMaskRcd
Definition: CTPPSPixelAnalysisMaskRcd.h:23
CTPPSPixelAnalysisMask.h
Time.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
WriteCTPPSPixelAnalysisMask::analysismaskiov_
cond::Time_t analysismaskiov_
Definition: WriteCTPPSPixelAnalysisMask.cc:46
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
WriteCTPPSPixelAnalysisMask::WriteCTPPSPixelAnalysisMask
WriteCTPPSPixelAnalysisMask(const edm::ParameterSet &ps)
Definition: WriteCTPPSPixelAnalysisMask.cc:51
std
Definition: JetResolutionObject.h:76
CTPPSPixelDAQMapping.h
WriteCTPPSPixelAnalysisMask::~WriteCTPPSPixelAnalysisMask
~WriteCTPPSPixelAnalysisMask() override
Definition: WriteCTPPSPixelAnalysisMask.cc:42
Frameworkfwd.h
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
WriteCTPPSPixelAnalysisMask::label_
std::string label_
Definition: WriteCTPPSPixelAnalysisMask.cc:48
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73
WriteCTPPSPixelAnalysisMask
Prints the Analysis Mask loaded by TotemDAQMappingESSourceXML.
Definition: WriteCTPPSPixelAnalysisMask.cc:34
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37