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 
17 
18 #include "TMVA/Tools.h"
19 #include "TMVA/Reader.h"
20 #include "TMVA/Tools.h"
21 #include "TMVA/Reader.h"
22 
24 
25 
26 // ----------------------------------------------------------------------------------------------------
28 public:
29  enum version_t { USER=-1, PHILv0=0 };
30 
31  PileupJetIdAlgo(int version=PHILv0, const std::string & tmvaWeight="", const std::string & tmvaMethod="",
32  Float_t impactParTkThreshod_=1., const std::vector<std::string> & tmvaVariables= std::vector<std::string>());
35 
37  float jec, const reco::Vertex *, const reco::VertexCollection &,
38  bool calculateMva=false);
39 
40  void set(const PileupJetIdentifier &);
42  const std::string method() const { return tmvaMethod_; }
43 
44  std::string dumpVariables() const;
45 
46  typedef std::map<std::string,std::pair<float *,float> > variables_list_t;
47 
48  std::pair<int,int> getJetIdKey(float jetPt, float jetEta);
49  int computeCutIDflag(float betaStarClassic,float dR2Mean,float nvtx, float jetPt, float jetEta);
50  int computeIDflag (float mva, float jetPt, float jetEta);
51  int computeIDflag (float mva,int ptId,int etaId);
52 
54  const variables_list_t & getVariables() const { return variables_; };
55 
56 protected:
57 
58  void setup();
59  void runMva();
60  void bookReader();
61  void resetVariables();
62  void initVariables();
63 
64 
67 
68  TMVA::Reader * reader_;
70  std::vector<std::string> tmvaVariables_;
71  std::vector<std::string> tmvaSpectators_;
72  std::map<std::string,std::string> tmvaNames_;
73 
74  Int_t version_;
76  bool cutBased_;
77  Float_t mvacut_ [3][4][4]; //Keep the array fixed
78  Float_t rmsCut_ [3][4][4]; //Keep the array fixed
79  Float_t betaStarCut_[3][4][4]; //Keep the array fixed
80 };
81 
82 #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_