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 
28  mPayloadName = iConfig.getUntrackedParameter<std::string>("payloadName");
29  mPrintScreen = iConfig.getUntrackedParameter<bool>("printScreen");
30  mCreateTextFile = iConfig.getUntrackedParameter<bool>("createTextFile");
31 }
32 
34  edm::LogInfo("UserOutput") << "Inspecting QGLikelihood payload with label:" << mPayloadName << std::endl;
36  QGLikelihoodRcd const& rcdhandle = iSetup.get<QGLikelihoodRcd>();
37  rcdhandle.get(mPayloadName, QGLParamsColl);
38 
39  edm::LogInfo("UserOutput") << "Ranges in which the QGTagger could be applied:"
40  << " pt: " << QGLParamsColl->qgValidRange.PtMin << " --> "
41  << QGLParamsColl->qgValidRange.PtMax << ", eta: " << QGLParamsColl->qgValidRange.EtaMin
42  << " --> " << QGLParamsColl->qgValidRange.EtaMax
43  << ", rho: " << QGLParamsColl->qgValidRange.RhoMin << " --> "
44  << QGLParamsColl->qgValidRange.RhoMax << std::endl;
45 
46  std::vector<QGLikelihoodObject::Entry> const& data = QGLParamsColl->data;
47  edm::LogInfo("UserOutput") << "There are " << data.size()
48  << " entries (categories with associated PDF):" << std::endl;
49  for (auto idata = data.begin(); idata != data.end(); ++idata) {
50  int varIndex = idata->category.VarIndex;
51  int qgBin = idata->category.QGIndex;
52  double etaMin = idata->category.EtaMin;
53  double etaMax = idata->category.EtaMax;
54  double rhoMin = idata->category.RhoMin;
55  double rhoMax = idata->category.RhoMax;
56  double ptMin = idata->category.PtMin;
57  double ptMax = idata->category.PtMax;
58 
59  char buff[1000];
60  sprintf(buff,
61  "var=%1d, qg=%1d, ptMin=%8.2f, ptMax=%8.2f, etaMin=%3.1f, etaMax=%3.1f, rhoMin=%6.2f, rhoMax=%6.2f",
62  varIndex,
63  qgBin,
64  ptMin,
65  ptMax,
66  etaMin,
67  etaMax,
68  rhoMin,
69  rhoMax);
70  edm::LogVerbatim("UserOutput") << buff << std::endl;
71  }
72 }
73 
QGLikelihoodObject::data
std::vector< Entry > data
Definition: QGLikelihoodObject.h:33
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
QGLikelihoodDBReader::QGLikelihoodDBReader
QGLikelihoodDBReader(const edm::ParameterSet &)
Definition: QGLikelihoodDBReader.cc:27
ESHandle.h
QGLikelihoodCategory::PtMin
float PtMin
Definition: QGLikelihoodObject.h:10
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
QGLikelihoodDBReader::beginJob
void beginJob() override
Definition: QGLikelihoodDBReader.cc:19
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
QGLikelihoodRcd
Definition: QGLikelihoodRcd.h:23
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
JetCorrectionsRecord.h
QGLikelihoodCategory::EtaMin
float EtaMin
Definition: QGLikelihoodObject.h:10
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition: AlignmentTrackSelector_cfi.py:12
edm::ESHandle
Definition: DTSurvey.h:22
QGLikelihoodDBReader::mPayloadName
std::string mPayloadName
Definition: QGLikelihoodDBReader.cc:21
QGLikelihoodDBReader
Definition: QGLikelihoodDBReader.cc:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
QGLikelihoodCategory::RhoMax
float RhoMax
Definition: QGLikelihoodObject.h:10
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
QGLikelihoodDBReader::~QGLikelihoodDBReader
~QGLikelihoodDBReader() override
Definition: QGLikelihoodDBReader.cc:16
HLT_FULL_cff.rhoMax
rhoMax
Definition: HLT_FULL_cff.py:15050
iEvent
int iEvent
Definition: GenABIO.cc:224
QGLikelihoodObject::qgValidRange
QGLikelihoodCategory qgValidRange
Definition: QGLikelihoodObject.h:32
QGLikelihoodObject.h
QGLikelihoodDBReader::mCreateTextFile
bool mCreateTextFile
Definition: QGLikelihoodDBReader.cc:24
edm::EventSetup
Definition: EventSetup.h:57
QGLikelihoodDBReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: QGLikelihoodDBReader.cc:33
QGLikelihoodCategory::RhoMin
float RhoMin
Definition: QGLikelihoodObject.h:10
QGLikelihoodDBReader::endJob
void endJob() override
Definition: QGLikelihoodDBReader.cc:21
Frameworkfwd.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
QGLikelihoodDBReader::mPrintScreen
bool mPrintScreen
Definition: QGLikelihoodDBReader.cc:24
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
QGLikelihoodRcd.h
EventSetup.h
QGLikelihoodCategory::EtaMax
float EtaMax
Definition: QGLikelihoodObject.h:10
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
ParameterSet.h
edm::Event
Definition: Event.h:73
QGLikelihoodCategory::PtMax
float PtMax
Definition: QGLikelihoodObject.h:10
electronConversionRejectionValidator.rhoMin
rhoMin
Definition: electronConversionRejectionValidator.py:59