ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/interface/bdtiface.h
(Generate patch)

Comparing UserCode/MitHzz4l/LeptonSelection/interface/bdtiface.h (file contents):
Revision 1.1 by khahn, Mon Feb 13 09:35:31 2012 UTC vs.
Revision 1.2 by dkralph, Sat Apr 21 22:45:01 2012 UTC

# Line 1 | Line 1
1 + #ifndef BDTIFACE
2 + #define BDTIFACE
3 +
4   #include <TFile.h>                   // file handle class
5   #include <TString.h>
6   #include <TTree.h>                   // class to access ntuples
7   #include <TChain.h>                  // class to access ntuples
8 + #include <TRegexp.h>
9 + #include <stdio.h>
10   #include <iostream>                  // standard I/O
11   #include <iomanip>                   // functions to format standard I/O
12   #include <fstream>                   // functions for file I/O
# Line 16 | Line 21 | using namespace std;
21   class bdtiface
22   {
23   public:
24 <  bdtiface(TString weightDir="./data", TString cutfile="./data/bdtcuts.txt");
24 >  bdtiface(TString weightDir="", TString cutfile="", TString method="BDTG", TString varfile="");
25    void    readBDTCuts(TString file);
26 <  TString getBinName(double pt, double eta);
27 <  double  getBDTCut(double pt, double eta, TString tightness);
28 <  Bool_t  passBDT(Double_t pt, Double_t eta, TString tightness);
29 <
30 <  void setSigmaIEtaIEta         (double x) { bdtvarEleSigmaIEtaIEta             = x; };
31 <  void setDEtaIn                (double x) { bdtvarEleDEtaIn                    = x; };
32 <  void setDPhiIn                (double x) { bdtvarEleDPhiIn                    = x; };
33 <  void setD0                    (double x) { bdtvarEleD0                        = x; };
34 <  void setFBrem                 (double x) { bdtvarEleFBrem                     = x; };
35 <  void setEOverP                (double x) { bdtvarEleEOverP                    = x; };
36 <  void setESeedClusterOverPout  (double x) { bdtvarEleESeedClusterOverPout      = x; };
32 <  void setSigmaIPhiIPhi         (double x) { bdtvarEleSigmaIPhiIPhi             = x; };
33 <  void setNBrem                 (double x) { bdtvarEleNBrem                     = x; };
34 <  void setOneOverEMinusOneOverP (double x) { bdtvarEleOneOverEMinusOneOverP     = x; };
35 <  void setESeedClusterOverPIn   (double x) { bdtvarEleESeedClusterOverPIn       = x; };
26 >  void    getxmlvars(); // get list of variables declared in the xml files
27 >  void    readbins(TString varfile);
28 >  void    readvars(TString varfile);
29 >  void    readlimits(TString varfile);
30 >  TString getBinName(double pt, double eta, TString era="");
31 >  double  getBDTCut(double pt, double eta, TString tightness, TString era="");
32 >  double  getBDTCut(TString binname, TString tightness);
33 >  double  getBDTval(Double_t pt, Double_t eta, TString era, TString method="BDTG");
34 >  Bool_t  passBDT(Double_t pt, Double_t eta, TString tightness, TString era="", TString method="BDTG");
35 >  void    setVals(map<TString,Float_t> floatvals);
36 >  void    print();
37  
38   private:
39 <  map<TString,TMVA::Reader*> readers;
40 <  vector<TString> binnamev;
41 <  map<TString,double> loosecuts,mediumcuts,tightcuts;
42 <
43 <  Float_t                 bdtvarEleSigmaIEtaIEta;
44 <  Float_t                 bdtvarEleDEtaIn;
45 <  Float_t                 bdtvarEleDPhiIn;
46 <  Float_t                 bdtvarEleD0;
47 <  Float_t                 bdtvarEleFBrem;
48 <  Float_t                 bdtvarEleEOverP;
49 <  Float_t                 bdtvarEleESeedClusterOverPout;
49 <  Float_t                 bdtvarEleSigmaIPhiIPhi;
50 <  Float_t                 bdtvarEleNBrem;
51 <  Float_t                 bdtvarEleOneOverEMinusOneOverP;
52 <  Float_t                 bdtvarEleESeedClusterOverPIn;    
53 <
54 <  Float_t                 bdtvarEleIP3d;
55 <  Float_t                 bdtvarEleIP3dSig;
56 <  Float_t                 bdtvarStandardLikelihood;
57 <  Float_t                 bdtvarCicPass;
58 <  Float_t                 bdtvarPt;
59 <  Float_t                 bdtvarEta;
60 <  Float_t                 bdtvarSCeta;
61 <  Float_t                 bdtvarPFIso;
62 <  Float_t                 bdtvarIsConv;
63 <  Float_t                 bdtvarWeight;
64 <  Float_t                 bdtvarNExpHits;
65 <  
39 >  TString weightdir_,varfile_;
40 >  map<TString,TMVA::Reader*>      readers_;                             // one tmva reader for each pt/eta/era bin
41 >  map<TString,TString>            xml_names_;                           // weight file name for each bin
42 >  unsigned                        max_nfloats;                          // maximum number of variables used in any one bin
43 >  map<TString,Float_t>            floatvals_;                           // value for each input float variable (includes spectators)
44 >  vector<TString>                 binnamev_;                            // pt/eta/era bin names
45 >  vector<float>                   ptbin_highs_,etabin_highs_;           // high edges for each pt/eta bin
46 >  map<TString,double>             loosecuts_,mediumcuts_,tightcuts_;    // cut values
47 >  // variables names: a vector of names for each bin
48 >  map<TString,vector<TString> >   floatvar_names_,floatvar_expressions_,floatspec_names_;
49 >  map<TString,double>             minima_,maxima_;
50   };
51 +
52 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines