CMS 3D CMS Logo

CTPPSPixelDAQMappingAnalyzer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
10 
15 
16 using namespace std;
17 
19 public:
20  string label_;
23 
25  : label_(iConfig.getUntrackedParameter<string>("label", "RPix")),
26  daqmappingiov_(iConfig.getParameter<unsigned long long>("daqmappingiov")),
27  analysismaskiov_(iConfig.getParameter<unsigned long long>("analysismaskiov")) {}
30  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
31 };
32 
34  using namespace edm;
35 
36  /*edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelDAQMappingRcd"));
37  if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
38  //record not found
39  std::cout <<"Record \"CTPPSPixelDAQMappingRcd"<<"\" does not exist "<<std::endl;
40  }*/
41 
42  //this part gets the handle of the event source and the record (i.e. the Database)
43  if (e.id().run() == daqmappingiov_) {
45  context.get<CTPPSPixelDAQMappingRcd>().get("RPix", mapping);
46 
47  // print mapping
48  /*printf("* DAQ mapping\n");
49  for (const auto &p : mapping->ROCMapping)
50  std::cout << " " << p.first << " -> " << p.second << std::endl;*/
51  }
52 
53  //edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelAnalysisMaskRcd"));
54  //if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
55  //record not found
56  //std::cout <<"Record \"CTPPSPixelAnalysisMaskRcd"<<"\" does not exist "<<std::endl;
57  //}
58 
59  if (e.id().run() == analysismaskiov_) {
60  // get analysis mask to mask channels
62  context.get<CTPPSPixelAnalysisMaskRcd>().get(label_, analysisMask);
63 
64  // print mask
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 }
RunNumber_t run() const
Definition: EventID.h:38
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned long long Time_t
Definition: Time.h:14
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
T get() const
Definition: EventSetup.h:73
CTPPSPixelDAQMappingAnalyzer(edm::ParameterSet const &iConfig)
void analyze(const edm::Event &e, const edm::EventSetup &c) override