forked from RemKamal/ElectronID
-
Notifications
You must be signed in to change notification settings - Fork 1
/
optimize.hh
43 lines (37 loc) · 1.26 KB
/
optimize.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef OPTIMIZE_HH
#define OPTIMIZE_HH
#include "TFile.h"
#include "TTree.h"
#include "TString.h"
#include "Variables.hh"
#include "VariableLimits.hh"
#include "VarCut.hh"
#include "OptimizationConstants.hh"
#if not defined(__CINT__) || defined(__MAKECINT__)
// needs to be included when makecint runs (ACLIC)
#include "TMVA/Config.h"
#include "TMVA/Factory.h"
#include "TMVA/Tools.h"
#include "TMVA/MethodCuts.h"
#endif
// Forward declarations
// Input
TTree * getTreeFromFile(TString fname, TString tname, TFile **fileHandle);
// Configuration for TMVA
void configureFactoryVariables(TMVA::Factory *factory);
TString getTrainAndTestOptions();
void configureCuts(TCut &signalCuts, TCut &backgroundCuts);
TString getMethodOptions(TString cutMaxFileName,
VarLims::VariableLimits **userDefinedCutLimits);
// Output
void writeWorkingPoints(const TMVA::Factory *factory,
TString cutsOutFileNameBase);
// Main method
void optimize(TString cutMaxFileName
= "cuts_barrel_eff_0999_20140727_165000.root",
TString cutsOutFileNameBase
= "cuts_barrel_xxxx_99999999_999999",
TString trainingDataOutputBase
= "training_xxxx_results_99999999_999999",
VarLims::VariableLimits **userDefinedCutLimits = VarLims::limitsNoRestrictions);
#endif