CMS 3D CMS Logo

QGLikelihoodDBReader.cc
Go to the documentation of this file.
1 #include <memory>
12 
14 public:
15  explicit QGLikelihoodDBReader(const edm::ParameterSet&);
16  ~QGLikelihoodDBReader() override{};
17 
18 private:
19  void beginJob() override{};
20  void analyze(const edm::Event&, const edm::EventSetup&) override;
21  void endJob() override{};
22 
25 };
26 
27 
29  mPayloadName = iConfig.getUntrackedParameter<std::string>("payloadName");
30  mPrintScreen = iConfig.getUntrackedParameter<bool>("printScreen");
31  mCreateTextFile = iConfig.getUntrackedParameter<bool>("createTextFile");
32 }
33 
34 
36  edm::LogInfo("UserOutput") << "Inspecting QGLikelihood payload with label:" << mPayloadName << std::endl;
38  QGLikelihoodRcd const& rcdhandle = iSetup.get<QGLikelihoodRcd>();
39  rcdhandle.get(mPayloadName, QGLParamsColl);
40 
41  edm::LogInfo("UserOutput") << "Ranges in which the QGTagger could be applied:"
42  << " pt: " << QGLParamsColl->qgValidRange.PtMin << " --> " << QGLParamsColl->qgValidRange.PtMax
43  << ", eta: " << QGLParamsColl->qgValidRange.EtaMin << " --> " << QGLParamsColl->qgValidRange.EtaMax
44  << ", rho: " << QGLParamsColl->qgValidRange.RhoMin << " --> " << QGLParamsColl->qgValidRange.RhoMax << std::endl;
45 
46  std::vector<QGLikelihoodObject::Entry> const& data = QGLParamsColl->data;
47  edm::LogInfo("UserOutput") << "There are " << data.size() << " entries (categories with associated PDF):" << std::endl;
48  for(auto idata = data.begin(); idata != data.end(); ++idata){
49  int varIndex = idata->category.VarIndex;
50  int qgBin = idata->category.QGIndex;
51  double etaMin = idata->category.EtaMin;
52  double etaMax = idata->category.EtaMax;
53  double rhoMin = idata->category.RhoMin;
54  double rhoMax = idata->category.RhoMax;
55  double ptMin = idata->category.PtMin;
56  double ptMax = idata->category.PtMax;
57 
58  char buff[1000];
59  sprintf(buff, "var=%1d, qg=%1d, ptMin=%8.2f, ptMax=%8.2f, etaMin=%3.1f, etaMax=%3.1f, rhoMin=%6.2f, rhoMax=%6.2f", varIndex, qgBin, ptMin, ptMax, etaMin, etaMax, rhoMin, rhoMax);
60  edm::LogVerbatim("UserOutput") << buff << std::endl;
61  }
62 }
63 
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
QGLikelihoodCategory qgValidRange
int iEvent
Definition: GenABIO.cc:230
void get(HolderT &iHolder) const
QGLikelihoodDBReader(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
const T & get() const
Definition: EventSetup.h:59
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< Entry > data