CMS 3D CMS Logo

MVAJetPuId.h
Go to the documentation of this file.
1 #ifndef RecoJets_JetProducers_plugins_MVAJetPuId_h
2 #define RecoJets_JetProducers_plugins_MVAJetPuId_h
3 
8 
9 #include "TMVA/Tools.h"
10 #include "TMVA/Reader.h"
11 #include "TMVA/Tools.h"
12 #include "TMVA/Reader.h"
13 
15 
16 class MVAJetPuId {
17  static constexpr int NWPs = 3;
18  static constexpr int NPts = 4;
19  static constexpr int NEtas = 4;
20 
21 public:
22  enum version_t { USER = -1, CATEv0 = 0 };
23 
25  const std::string &tmvaWeight = "",
26  const std::string &tmvaMethod = "",
27  Float_t impactParTkThreshod_ = 1.,
28  const std::vector<std::string> &tmvaVariables = std::vector<std::string>());
29  MVAJetPuId(const edm::ParameterSet &ps);
30  ~MVAJetPuId();
31 
33  float jec,
34  const reco::Vertex *,
35  const reco::VertexCollection &,
36  double rho,
37  bool calculateMva = false);
38 
39  void set(const PileupJetIdentifier &);
41  const std::string method() const { return tmvaMethod_; }
42 
43  std::string dumpVariables() const;
44 
45  typedef std::map<std::string, std::pair<float *, float> > variables_list_t;
46 
47  std::pair<int, int> getJetIdKey(float jetPt, float jetEta);
48  int computeCutIDflag(float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta);
49  int computeIDflag(float mva, float jetPt, float jetEta);
50  int computeIDflag(float mva, int ptId, int etaId);
51 
52  const variables_list_t &getVariables() const { return variables_; };
53 
54 protected:
55  void setup();
56  void runMva();
57  void bookReader();
58  void resetVariables();
59  void initVariables();
60 
63 
64  TMVA::Reader *reader_;
66  std::vector<std::string> tmvaVariables_;
67  std::vector<std::string> tmvaSpectators_;
68  std::map<std::string, std::string> tmvaNames_;
69 
70  Int_t version_;
72  bool cutBased_;
73  Float_t mvacut_[NWPs][NEtas][NPts]; //Keep the array fixed
74  Float_t rmsCut_[NWPs][NEtas][NPts]; //Keep the array fixed
75  Float_t betaStarCut_[NWPs][NEtas][NPts]; //Keep the array fixed
76 };
77 
78 #endif
reco::btau::jetPt
Definition: TaggingVariable.h:32
MVAJetPuId::getVariables
const variables_list_t & getVariables() const
Definition: MVAJetPuId.h:52
MVAJetPuId::computeCutIDflag
int computeCutIDflag(float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta)
MVAJetPuId::initVariables
void initVariables()
Definition: MVAJetPuId.cc:500
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
MVAJetPuId::computeIdVariables
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, double rho, bool calculateMva=false)
Definition: MVAJetPuId.cc:196
hltPUIdAlgo_cff.tmvaMethod
tmvaMethod
Definition: hltPUIdAlgo_cff.py:32
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
PFJetCollection.h
Jet.h
MVAJetPuId::tmvaNames_
std::map< std::string, std::string > tmvaNames_
Definition: MVAJetPuId.h:68
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:132
MVAJetPuId::computeMva
PileupJetIdentifier computeMva()
Definition: MVAJetPuId.cc:191
MVAJetPuId::version_t
version_t
Definition: MVAJetPuId.h:22
PileupJetIdentifier.h
MVAJetPuId::tmvaWeights_
std::string tmvaWeights_
Definition: MVAJetPuId.h:65
hltPUIdAlgo_cff.tmvaVariables
tmvaVariables
Definition: hltPUIdAlgo_cff.py:34
MVAJetPuId::reader_
TMVA::Reader * reader_
Definition: MVAJetPuId.h:64
MVAJetPuId::betaStarCut_
Float_t betaStarCut_[NWPs][NEtas][NPts]
Definition: MVAJetPuId.h:75
MVAJetPuId::set
void set(const PileupJetIdentifier &)
Definition: MVAJetPuId.cc:143
MVAJetPuId::tmvaMethod_
std::string tmvaMethod_
Definition: MVAJetPuId.h:65
MVAJetPuId::internalId_
PileupJetIdentifier internalId_
Definition: MVAJetPuId.h:61
MVAJetPuId::variables_list_t
std::map< std::string, std::pair< float *, float > > variables_list_t
Definition: MVAJetPuId.h:45
MVAJetPuId::impactParTkThreshod_
Float_t impactParTkThreshod_
Definition: MVAJetPuId.h:71
MVAJetPuId::resetVariables
void resetVariables()
Definition: MVAJetPuId.cc:489
MVAJetPuId::MVAJetPuId
MVAJetPuId(int version=CATEv0, const std::string &tmvaWeight="", const std::string &tmvaMethod="", Float_t impactParTkThreshod_=1., const std::vector< std::string > &tmvaVariables=std::vector< std::string >())
Definition: MVAJetPuId.cc:50
MVAJetPuId::setup
void setup()
Definition: MVAJetPuId.cc:66
MVAJetPuId::dumpVariables
std::string dumpVariables() const
Definition: MVAJetPuId.cc:480
MVAJetPuId::getJetIdKey
std::pair< int, int > getJetIdKey(float jetPt, float jetEta)
Definition: MVAJetPuId.cc:156
DDAxes::rho
MVAJetPuId::computeIDflag
int computeIDflag(float mva, float jetPt, float jetEta)
Definition: MVAJetPuId.cc:175
MVAJetPuId::tmvaSpectators_
std::vector< std::string > tmvaSpectators_
Definition: MVAJetPuId.h:67
reco::btau::jetEta
Definition: TaggingVariable.h:34
edm::ParameterSet
Definition: ParameterSet.h:47
MVAJetPuId::bookReader
void bookReader()
Definition: MVAJetPuId.cc:125
MVAJetPuId::NWPs
static constexpr int NWPs
Definition: MVAJetPuId.h:17
PileupJetIdentifier
Definition: PileupJetIdentifier.h:74
MVAJetPuId::runMva
void runMva()
Definition: MVAJetPuId.cc:145
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MVAJetPuId::tmvaVariables_
std::vector< std::string > tmvaVariables_
Definition: MVAJetPuId.h:66
VertexFwd.h
MVAJetPuId::NEtas
static constexpr int NEtas
Definition: MVAJetPuId.h:19
MVAJetPuId::mvacut_
Float_t mvacut_[NWPs][NEtas][NPts]
Definition: MVAJetPuId.h:73
metsig::jet
Definition: SignAlgoResolutions.h:47
MVAJetPuId::rmsCut_
Float_t rmsCut_[NWPs][NEtas][NPts]
Definition: MVAJetPuId.h:74
MVAJetPuId::CATEv0
Definition: MVAJetPuId.h:22
MVAJetPuId::version_
Int_t version_
Definition: MVAJetPuId.h:70
MVAJetPuId::~MVAJetPuId
~MVAJetPuId()
Definition: MVAJetPuId.cc:105
jetMETDQMOfflineSource_cff.jec
jec
Definition: jetMETDQMOfflineSource_cff.py:27
MVAJetPuId::method
const std::string method() const
Definition: MVAJetPuId.h:41
ParameterSet.h
MVAJetPuId::cutBased_
bool cutBased_
Definition: MVAJetPuId.h:72
MVAJetPuId::NPts
static constexpr int NPts
Definition: MVAJetPuId.h:18
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
MVAJetPuId::variables_
variables_list_t variables_
Definition: MVAJetPuId.h:62
MVAJetPuId
Definition: MVAJetPuId.h:16
MVAJetPuId::USER
Definition: MVAJetPuId.h:22
reco::Vertex
Definition: Vertex.h:35