forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#3582 from UAEDF-tomc/QGTagger
Qg tagger
- Loading branch information
Showing
24 changed files
with
955 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
CondFormats/DataRecord/interface/QGLikelihoodSystematicsRcd.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef QGLikelihoodSystematicsRcd_QGLikelihoodSystematicsRcd_h | ||
#define QGLikelihoodSystematicsRcd_QGLikelihoodSystematicsRcd_h | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/JetMETObjects | ||
// Class : QGLikelihoodSystematicsRcd | ||
// | ||
/**\class QGLikelihoodSystematicsRcd QGLikelihoodSystematicsRcd.h CondFormats/JetMETObjects/interface/QGLikelihoodSystematicsRcd.h | ||
Description: [one line class summary] | ||
Usage: | ||
<usage> | ||
*/ | ||
// | ||
// Author: Salvatore Rappoccio | ||
// Created: Thu, 13 Mar 2014 15:14:40 GMT | ||
// | ||
|
||
#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" | ||
|
||
class QGLikelihoodSystematicsRcd : public edm::eventsetup::EventSetupRecordImplementation<QGLikelihoodSystematicsRcd> {}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: CondFormats/JetMETObjects | ||
// Class : QGLikelihoodSystematicsRcd | ||
// | ||
// Implementation: | ||
// [Notes on implementation] | ||
// | ||
// Author: Salvatore Rappoccio | ||
// Created: Thu, 13 Mar 2014 15:14:40 GMT | ||
|
||
#include "CondFormats/DataRecord/interface/QGLikelihoodSystematicsRcd.h" | ||
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" | ||
|
||
EVENTSETUP_RECORD_REG(QGLikelihoodSystematicsRcd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,55 @@ | ||
#ifndef QGLikelihoodObject_h | ||
#define QGLikelihoodObject_h | ||
|
||
#include "CondFormats/BTauObjects/interface/CombinedSVCategoryData.h" | ||
#include "CondFormats/PhysicsToolsObjects/interface/Histogram.h" | ||
|
||
|
||
|
||
#include <vector> | ||
|
||
|
||
struct QGLikelihoodCategory { | ||
float RhoVal, PtMin, PtMax; | ||
int EtaBin; | ||
int QGIndex; | ||
int VarIndex; | ||
/// Category structure: ranges associated with QGLikelihood histograms | ||
struct QGLikelihoodCategory{ | ||
float RhoMin, RhoMax, PtMin, PtMax, EtaMin, EtaMax; | ||
int QGIndex, VarIndex; | ||
}; | ||
|
||
/// Parameters structure | ||
struct QGLikelihoodParameters{ | ||
float Rho, Pt, Eta; | ||
int QGIndex, VarIndex; | ||
}; | ||
|
||
|
||
struct QGLikelihoodObject | ||
{ | ||
/// QGLikelihoodObject containing valid range and entries with category, histogram and mean | ||
struct QGLikelihoodObject{ | ||
typedef PhysicsTools::Calibration::HistogramF Histogram; | ||
|
||
struct Entry | ||
{ | ||
struct Entry{ | ||
QGLikelihoodCategory category; | ||
Histogram histogram; | ||
float mean; | ||
}; | ||
|
||
std::vector<Entry> data; | ||
|
||
QGLikelihoodCategory qgValidRange; | ||
std::vector<Entry> data; | ||
}; | ||
|
||
/// QGLikelihoodSystematicsObject containing the parameters for the systematic smearing | ||
struct QGLikelihoodSystematicsObject{ | ||
struct Entry{ | ||
QGLikelihoodCategory systCategory; | ||
float a, b, lmin, lmax; | ||
}; | ||
std::vector<Entry> data; | ||
}; | ||
|
||
#endif //QGLikelihoodObject_h | ||
/// Test if parameters are compatible with category | ||
inline bool operator==(const QGLikelihoodParameters& lhs, const QGLikelihoodCategory& rhs){ | ||
if(lhs.QGIndex != rhs.QGIndex) return false; | ||
if(lhs.VarIndex != rhs.VarIndex) return false; | ||
if(lhs.Eta < rhs.EtaMin) return false; | ||
if(lhs.Eta > rhs.EtaMax) return false; | ||
if(lhs.Rho < rhs.RhoMin) return false; | ||
if(lhs.Rho > rhs.RhoMax) return false; | ||
if(lhs.Pt < rhs.PtMin) return false; | ||
if(lhs.Pt > rhs.PtMax) return false; | ||
return true; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
JetMETCorrections/Modules/interface/QGLikelihoodSystematicsESProducer.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef JetMETCorrections_Modules_QGLikelihoodSystematicsESProducer_h | ||
#define JetMETCorrections_Modules_QGLikelihoodSystematicsESProducer_h | ||
|
||
// system include files | ||
#include <memory> | ||
#include "boost/shared_ptr.hpp" | ||
|
||
// user include files | ||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
|
||
#include "FWCore/Framework/interface/ESProducts.h" | ||
#include "CondFormats/JetMETObjects/interface/QGLikelihoodObject.h" | ||
#include "CondFormats/DataRecord/interface/QGLikelihoodSystematicsRcd.h" | ||
|
||
|
||
class QGLikelihoodSystematicsESProducer : public edm::ESProducer{ | ||
public: | ||
QGLikelihoodSystematicsESProducer(const edm::ParameterSet&); | ||
~QGLikelihoodSystematicsESProducer(){}; | ||
|
||
boost::shared_ptr<QGLikelihoodSystematicsObject> produce(const QGLikelihoodSystematicsRcd&); | ||
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &); | ||
private: | ||
std::string mAlgo; | ||
}; | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.