CMS 3D CMS Logo

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 
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 &);
40  std::unique_ptr<const GBRForest> getMVA(const std::vector<std::string> &, const std::string &);
41  float getMVAval(const std::vector<std::string> &, const std::unique_ptr<const GBRForest> &);
43  const std::string method() const { return tmvaMethod_; }
44 
45  std::string dumpVariables() const;
46 
47  typedef std::map<std::string,std::pair<float *,float> > variables_list_t;
48 
49  std::pair<int,int> getJetIdKey(float jetPt, float jetEta);
50  int computeCutIDflag(float betaStarClassic,float dR2Mean,float nvtx, float jetPt, float jetEta);
51  int computeIDflag (float mva, float jetPt, float jetEta);
52  int computeIDflag (float mva,int ptId,int etaId);
53 
55  const variables_list_t & getVariables() const { return variables_; };
56 
57 protected:
58 
59  void setup();
60  void runMva();
61  void bookReader();
62  void resetVariables();
63  void initVariables();
64 
65 
67  variables_list_t variables_;
68 
69  std::unique_ptr<const GBRForest> reader_;
70  std::vector<std::unique_ptr<const GBRForest>> etaReader_;
72  std::vector<std::string> tmvaEtaWeights_;
73  std::vector<std::string> tmvaVariables_;
74  std::vector<std::vector<std::string>> tmvaEtaVariables_;
75  std::vector<std::string> tmvaSpectators_;
76  std::map<std::string,std::string> tmvaNames_;
77 
78  int version_;
80  bool cutBased_;
82  int nEtaBins_;
83  std::vector<double> jEtaMin_;
84  std::vector<double> jEtaMax_;
85  bool runMvas_;
86  float mvacut_ [3][4][4]; //Keep the array fixed
87  float rmsCut_ [3][4][4]; //Keep the array fixed
88  float betaStarCut_[3][4][4]; //Keep the array fixed
89 };
90 
91 #endif
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::unique_ptr< const GBRForest > getMVA(const std::vector< std::string > &, const std::string &)
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 & getVariables() const { return variables_; }; ...
std::vector< std::unique_ptr< const GBRForest > > etaReader_
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)
std::unique_ptr< const GBRForest > reader_
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::string tmvaWeights_
std::vector< double > jEtaMax_
std::map< std::string, std::pair< float *, float > > variables_list_t
variables_list_t variables_
float getMVAval(const std::vector< std::string > &, const std::unique_ptr< const GBRForest > &)