CMS 3D CMS Logo

SiPixelCalibConfigurationReadDb.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelCalibConfigurationReadDb
4 // Class: SiPixelCalibConfigurationReadDb
5 //
13 //
14 // Original Author: Freya Blekman
15 // Created: Thu Sep 20 12:13:20 CEST 2007
16 // $Id: SiPixelCalibConfigurationReadDb.cc,v 1.2 2009/02/10 09:27:50 fblekman Exp $
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
28 
32 #include <iostream>
33 //
34 // class decleration
35 //
36 
38 public:
41 
42 private:
44  void analyze(const edm::Event&, const edm::EventSetup&) override;
45 
46  // ----------member data ---------------------------
47  bool verbose_;
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62  : calibConfigToken(esConsumes()), verbose_(iConfig.getParameter<bool>("verbosity")) {
63  //now do what ever initialization is needed
64 }
65 
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to for each event ------------
74  using namespace edm;
75 
76  LogInfo("") << " examining SiPixelCalibConfiguration database object..." << std::endl;
77 
79  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "calibration type: " << calib->getCalibrationMode() << std::endl;
80  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "number of triggers: " << calib->getNTriggers() << std::endl;
81  std::vector<short> vcalvalues = calib->getVCalValues();
82  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "number of VCAL: " << vcalvalues.size() << std::endl;
83  int ngoodcols = 0;
84  int ngoodrows = 0;
85  for (uint32_t i = 0; i < vcalvalues.size(); ++i) {
86  if (verbose_) {
87  edm::LogPrint("SiPixelCalibConfigurationReadDb")
88  << "Vcal values " << i << "," << i + 1 << " : " << vcalvalues[i] << ",";
89  }
90  ++i;
91  if (verbose_) {
92  if (i < vcalvalues.size())
93  edm::LogPrint("SiPixelCalibConfigurationReadDb") << vcalvalues[i];
94  edm::LogPrint("SiPixelCalibConfigurationReadDb") << std::endl;
95  }
96  }
97  if (verbose_)
98  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "column patterns:" << std::endl;
99  for (uint32_t i = 0; i < calib->getColumnPattern().size(); ++i) {
100  if (calib->getColumnPattern()[i] != -1) {
101  if (verbose_)
102  edm::LogPrint("SiPixelCalibConfigurationReadDb") << calib->getColumnPattern()[i];
103  ngoodcols++;
104  }
105  if (verbose_) {
106  if (i != 0)
107  edm::LogPrint("SiPixelCalibConfigurationReadDb") << " ";
108  if (calib->getColumnPattern()[i] == -1)
109  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "- ";
110  }
111  }
112  if (verbose_) {
113  edm::LogPrint("SiPixelCalibConfigurationReadDb") << std::endl;
114  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "row patterns:" << std::endl;
115  }
116  for (uint32_t i = 0; i < calib->getRowPattern().size(); ++i) {
117  if (calib->getRowPattern()[i] != -1) {
118  if (verbose_)
119  edm::LogPrint("SiPixelCalibConfigurationReadDb") << calib->getRowPattern()[i];
120  ngoodrows++;
121  }
122  if (verbose_) {
123  if (i != 0)
124  edm::LogPrint("SiPixelCalibConfigurationReadDb") << " ";
125  if (calib->getRowPattern()[i] == -1)
126  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "- ";
127  }
128  }
129  if (verbose_) {
130  edm::LogPrint("SiPixelCalibConfigurationReadDb") << std::endl;
131  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "number of row patterns: " << ngoodrows << std::endl;
132  edm::LogPrint("SiPixelCalibConfigurationReadDb") << "number of column patterns: " << ngoodcols << std::endl;
133  }
134  edm::LogPrint("SiPixelCalibConfigurationReadDb")
135  << "this payload is designed to run on " << vcalvalues.size() * ngoodcols * ngoodrows * calib->getNTriggers()
136  << " events." << std::endl;
137 }
138 
139 //define this as a plug-in
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > calibConfigToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Warning, true > LogPrint
Log< level::Info, false > LogInfo
void analyze(const edm::Event &, const edm::EventSetup &) override
HLT enums.
SiPixelCalibConfigurationReadDb(const edm::ParameterSet &)