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 
21  string label_;
24 
26  label_(iConfig.getUntrackedParameter<string>("label", "RPix")),
27  daqmappingiov_(iConfig.getParameter<unsigned long long>("daqmappingiov")),
28  analysismaskiov_(iConfig.getParameter<unsigned long long>("analysismaskiov"))
29  {}
32  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
33  };
34 
35 
36  void
38 
39  using namespace edm;
40 
41  /*edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelDAQMappingRcd"));
42  if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
43  //record not found
44  std::cout <<"Record \"CTPPSPixelDAQMappingRcd"<<"\" does not exist "<<std::endl;
45  }*/
46 
47 
48  //this part gets the handle of the event source and the record (i.e. the Database)
49  if (e.id().run() == daqmappingiov_){
51  context.get<CTPPSPixelDAQMappingRcd>().get("RPix", mapping);
52 
53  // print mapping
54  /*printf("* DAQ mapping\n");
55  for (const auto &p : mapping->ROCMapping)
56  std::cout << " " << p.first << " -> " << p.second << std::endl;*/
57  }
58 
59  //edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelAnalysisMaskRcd"));
60  //if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
61  //record not found
62  //std::cout <<"Record \"CTPPSPixelAnalysisMaskRcd"<<"\" does not exist "<<std::endl;
63  //}
64 
65  if (e.id().run() == analysismaskiov_){
66  // get analysis mask to mask channels
68  context.get<CTPPSPixelAnalysisMaskRcd>().get(label_, analysisMask);
69 
70  // print mask
71  /*printf("* mask\n");
72  for (const auto &p : analysisMask->analysisMask)
73  cout << " " << p.first
74  << ": fullMask=" << p.second.fullMask
75  << ", number of masked channels " << p.second.maskedPixels.size() << endl;
76  */
77  }
78 
79  }
RunNumber_t run() const
Definition: EventID.h:39
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
unsigned long long Time_t
Definition: Time.h:16
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
T get() const
Definition: EventSetup.h:63
CTPPSPixelDAQMappingAnalyzer(edm::ParameterSet const &iConfig)
void analyze(const edm::Event &e, const edm::EventSetup &c) override