test
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>(), bool runMvas=true);
33  PileupJetIdAlgo(const edm::ParameterSet & ps, bool runMvas);
35 
37  float jec, const reco::Vertex *, const reco::VertexCollection &, double rho);
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 
53  const variables_list_t & getVariables() const { return variables_; };
54 
55 protected:
56 
57  void setup();
58  void runMva();
59  void bookReader();
60  void resetVariables();
61  void initVariables();
62 
63 
66 
67  std::unique_ptr<TMVA::Reader> reader_;
68  std::vector<std::unique_ptr<TMVA::Reader>> etaReader_;
70  std::vector<std::string> tmvaEtaWeights_;
71  std::vector<std::string> tmvaVariables_;
72  std::vector<std::vector<std::string>> tmvaEtaVariables_;
73  std::vector<std::string> tmvaSpectators_;
74  std::map<std::string,std::string> tmvaNames_;
75 
76  int version_;
78  bool cutBased_;
80  int nEtaBins_;
81  std::vector<double> jEtaMin_;
82  std::vector<double> jEtaMax_;
83  bool runMvas_;
84  float mvacut_ [3][4][4]; //Keep the array fixed
85  float rmsCut_ [3][4][4]; //Keep the array fixed
86  float betaStarCut_[3][4][4]; //Keep the array fixed
87 };
88 
89 #endif
void set(const PileupJetIdentifier &)
float mvacut_[3][4][4]
std::vector< std::string > tmvaEtaWeights_
std::vector< std::string > tmvaVariables_
float rmsCut_[3][4][4]
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< double > jEtaMin_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
float impactParTkThreshod_
const std::string method() const
int computeCutIDflag(float betaStarClassic, float dR2Mean, float nvtx, float jetPt, float jetEta)
const variables_list_t & getVariables() const
const PileupJetIdentifier::variables_list_t &amp; getVariables() const { return variables_; }; ...
float betaStarCut_[3][4][4]
PileupJetIdentifier internalId_
std::string dumpVariables() const
std::vector< std::vector< std::string > > tmvaEtaVariables_
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 >(), bool runMvas=true)
int computeIDflag(float mva, float jetPt, float jetEta)
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, double rho)
PileupJetIdentifier computeMva()
std::vector< std::string > tmvaSpectators_
std::unique_ptr< TMVA::Reader > reader_
std::string tmvaWeights_
std::vector< double > jEtaMax_
std::map< std::string, std::pair< float *, float > > variables_list_t
variables_list_t variables_
std::vector< std::unique_ptr< TMVA::Reader > > etaReader_