forked from ikrav/ElectronID
-
Notifications
You must be signed in to change notification settings - Fork 2
/
optimize.hh
40 lines (33 loc) · 1.32 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
#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/DataLoader.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 configureVariables(TMVA::DataLoader *factory);
TString getTrainAndTestOptions(bool useBarrel);
void configureCuts(TCut &signalCuts, TCut &backgroundCuts, bool useBarrel);
TString getMethodOptions(TString cutMaxFileName, VarLims::VariableLimits **userDefinedCutLimits);
// Output
void writeWorkingPoints(const TMVA::Factory *factory, TString cutsOutFileNameBase, bool useBarrel);
// 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, bool useBarrel = true);
#endif