CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoJets/JetProducers/interface/PileupJetIdAlgo.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------------------------------
00002 // $Id $
00003 //
00004 // PileupJetIdAlgo
00005 //
00006 // Author: P. Musella, P. Harris
00007 //--------------------------------------------------------------------------------------------------
00008 
00009 #ifndef RecoJets_JetProducers_plugins_PileupJetIdAlgo_h
00010 #define RecoJets_JetProducers_plugins_PileupJetIdAlgo_h
00011 
00012 #include "DataFormats/JetReco/interface/Jet.h"
00013 #include "DataFormats/JetReco/interface/PFJetCollection.h"
00014 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 
00017 #include "TMVA/Tools.h"
00018 #include "TMVA/Reader.h"
00019 #include "TMVA/Tools.h"
00020 #include "TMVA/Reader.h"
00021 
00022 #include "DataFormats/JetReco/interface/PileupJetIdentifier.h"
00023 
00024 // ----------------------------------------------------------------------------------------------------
00025 class PileupJetIdAlgo {
00026 public:
00027         enum version_t { USER=-1, PHILv0=0 };
00028         
00029         PileupJetIdAlgo(int version=PHILv0, const std::string & tmvaWeight="", const std::string & tmvaMethod="", 
00030                         Float_t impactParTkThreshod_=1., const std::vector<std::string> & tmvaVariables= std::vector<std::string>());
00031         PileupJetIdAlgo(const edm::ParameterSet & ps); 
00032         ~PileupJetIdAlgo(); 
00033         
00034         PileupJetIdentifier computeIdVariables(const reco::Jet * jet, 
00035                                                float jec, const reco::Vertex *, const reco::VertexCollection &,
00036                                                bool calculateMva=false);
00037         
00038         void set(const PileupJetIdentifier &);
00039         PileupJetIdentifier computeMva();
00040         const std::string method() const { return tmvaMethod_; }
00041         
00042         std::string dumpVariables() const;
00043 
00044         typedef std::map<std::string,std::pair<float *,float> > variables_list_t;
00045 
00046         std::pair<int,int> getJetIdKey(float jetPt, float jetEta);
00047         int computeCutIDflag(float betaStarClassic,float dR2Mean,float nvtx, float jetPt, float jetEta);
00048         int computeIDflag   (float mva, float jetPt, float jetEta);
00049         int computeIDflag   (float mva,int ptId,int etaId);
00050 
00052         const variables_list_t & getVariables() const { return variables_; };
00053         
00054 protected:
00055 
00056         void setup(); 
00057         void runMva(); 
00058         void bookReader();      
00059         void resetVariables();
00060         void initVariables();
00061 
00062         
00063         PileupJetIdentifier internalId_;
00064         variables_list_t variables_;
00065 
00066         TMVA::Reader * reader_;
00067         std::string    tmvaWeights_, tmvaMethod_; 
00068         std::vector<std::string>  tmvaVariables_;
00069         std::vector<std::string>  tmvaSpectators_;
00070         std::map<std::string,std::string>  tmvaNames_;
00071         
00072         Int_t   version_;
00073         Float_t impactParTkThreshod_;
00074         bool    cutBased_;
00075         Float_t mvacut_     [3][4][4]; //Keep the array fixed
00076         Float_t rmsCut_     [3][4][4]; //Keep the array fixed
00077         Float_t betaStarCut_[3][4][4]; //Keep the array fixed
00078 
00079 };
00080 
00081 #endif