CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PileupJetIdAlgo.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------------------------------
2 //
3 // PileupJetIdAlgo
4 //
5 // Author: P. Musella, P. Harris
6 //--------------------------------------------------------------------------------------------------
7 
8 #ifndef RecoJets_JetProducers_plugins_PileupJetIdAlgo_h
9 #define RecoJets_JetProducers_plugins_PileupJetIdAlgo_h
10 
15 
16 #include "TMVA/Tools.h"
17 #include "TMVA/Reader.h"
18 #include "TMVA/Tools.h"
19 #include "TMVA/Reader.h"
20 
22 
23 
24 // ----------------------------------------------------------------------------------------------------
26 public:
27  enum version_t { USER=-1, PHILv0=0 };
28 
29  PileupJetIdAlgo(int version=PHILv0, const std::string & tmvaWeight="", const std::string & tmvaMethod="",
30  Float_t impactParTkThreshod_=1., const std::vector<std::string> & tmvaVariables= std::vector<std::string>());
33 
35  float jec, const reco::Vertex *, const reco::VertexCollection &,
36  bool calculateMva=false);
37 
38  void set(const PileupJetIdentifier &);
40  const std::string method() const { return tmvaMethod_; }
41 
42  std::string dumpVariables() const;
43 
44  typedef std::map<std::string,std::pair<float *,float> > variables_list_t;
45 
46  std::pair<int,int> getJetIdKey(float jetPt, float jetEta);
47  int computeCutIDflag(float betaStarClassic,float dR2Mean,float nvtx, float jetPt, float jetEta);
48  int computeIDflag (float mva, float jetPt, float jetEta);
49  int computeIDflag (float mva,int ptId,int etaId);
50 
52  const variables_list_t & getVariables() const { return variables_; };
53 
54 protected:
55 
56  void setup();
57  void runMva();
58  void bookReader();
59  void resetVariables();
60  void initVariables();
61 
62 
65 
66  TMVA::Reader * reader_;
68  std::vector<std::string> tmvaVariables_;
69  std::vector<std::string> tmvaSpectators_;
70  std::map<std::string,std::string> tmvaNames_;
71 
72  Int_t version_;
74  bool cutBased_;
75  Float_t mvacut_ [3][4][4]; //Keep the array fixed
76  Float_t rmsCut_ [3][4][4]; //Keep the array fixed
77  Float_t betaStarCut_[3][4][4]; //Keep the array fixed
78 };
79 
80 #endif
void set(const PileupJetIdentifier &)
Float_t impactParTkThreshod_
std::vector< std::string > tmvaVariables_
Float_t mvacut_[3][4][4]
TMVA::Reader * reader_
Base class for all types of Jets.
Definition: Jet.h:20
std::pair< int, int > getJetIdKey(float jetPt, float jetEta)
std::map< std::string, std::string > tmvaNames_
std::string tmvaMethod_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const std::string method() const
int computeCutIDflag(float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta)
Float_t betaStarCut_[3][4][4]
const variables_list_t & getVariables() const
const PileupJetIdentifier::variables_list_t &amp; getVariables() const { return variables_; }; ...
PileupJetIdentifier internalId_
std::string dumpVariables() const
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, bool calculateMva=false)
int computeIDflag(float mva, float jetPt, float jetEta)
Float_t rmsCut_[3][4][4]
PileupJetIdAlgo(int version=PHILv0, const std::string &tmvaWeight="", const std::string &tmvaMethod="", Float_t impactParTkThreshod_=1., const std::vector< std::string > &tmvaVariables=std::vector< std::string >())
PileupJetIdentifier computeMva()
std::vector< std::string > tmvaSpectators_
std::string tmvaWeights_
std::map< std::string, std::pair< float *, float > > variables_list_t
variables_list_t variables_