-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoAll.C
46 lines (36 loc) · 1.08 KB
/
doAll.C
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
44
45
46
#include "TString.h"
#include "ScanChain.C"
#include "DefineDatasets.C"
#include "ConfigParser.C"
#include "makePtReweightHisto.C"
void runScanChain(ConfigParser* conf){
cout<<"Using config:"<<endl;
conf->print();
if (conf->get("vpt_reweight") == "true"){
cout<<"Making Reweight Histogram"<<endl;
makePtReweightHisto(conf);
}
ScanChain(getTChain(conf->get("data_set")), conf);
}
void doAll ( TString config_name, TString config_file="configs/run_modes.conf" ) {
ConfigParser *conf = new ConfigParser(config_file.Data());
if (config_name == "all") {
while ( conf->loadNextConfig() )
{
runScanChain(conf);
}
}
else if ( conf->loadConfig(config_name.Data()) ){
runScanChain(conf);
}
else{
cout<<"Configuration "<<config_name<<" could not be loaded, please check the name and config file, "<<config_file<<"and try again."<<endl;
exit(1);
}
}
int main(int argC, char** argV) {
TString config_name="GammaZtoNuNu";
TString config_file="configs/gamma_mu_studies/SingleMuon_ttg/run_modes.conf";
doAll(config_name, config_file);
return 0;
}