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 
26 
28  : label_(iConfig.getUntrackedParameter<string>("label", "RPix")),
29  daqmappingiov_(iConfig.getParameter<unsigned long long>("daqmappingiov")),
30  analysismaskiov_(iConfig.getParameter<unsigned long long>("analysismaskiov")),
35  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
36 };
37 
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  //this part gets the handle of the event source and the record (i.e. the Database)
48  if (e.id().run() == daqmappingiov_) {
49  ESHandle<CTPPSPixelDAQMapping> mapping = context.getHandle(tokenMapping_);
50 
51  // print mapping
52  /*printf("* DAQ mapping\n");
53  for (const auto &p : mapping->ROCMapping)
54  std::cout << " " << p.first << " -> " << p.second << std::endl;*/
55  }
56 
57  //edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelAnalysisMaskRcd"));
58  //if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
59  //record not found
60  //std::cout <<"Record \"CTPPSPixelAnalysisMaskRcd"<<"\" does not exist "<<std::endl;
61  //}
62 
63  if (e.id().run() == analysismaskiov_) {
64  // get analysis mask to mask channels
65  ESHandle<CTPPSPixelAnalysisMask> analysisMask = context.getHandle(tokenMask_);
66 
67  // print mask
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 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenMask_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned long long Time_t
Definition: Time.h:14
Channel-mask mapping.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HLT enums.
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > tokenMapping_
CTPPSPixelDAQMappingAnalyzer(edm::ParameterSet const &iConfig)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
The mapping between FramePosition and ROCInfo.