HackAnalysis  2
running.h
1 #pragma once
2 
3 
4 
5 using namespace std;
6 #include <iostream>
7 
8 #include <stdlib.h>
9 
10 
11 
12 
13 
14 #include "heputil.h"
15 
16 #include "fillPileUp.h"
17 
18 
19 #include <iostream>
20 #include <sstream>
21 #include <fstream>
22 #include <zlib.h>
23 #include <stdio.h>
24 #include <string.h>
25 #include <omp.h>
26 #include <chrono>
27 #include <iomanip>
28 
29 #include "include/BaseAnalysis.h"
30 #include "analysislist.h"
31 
32 
33 #include "include/ReadWriteEvent.h"
34 
35 
37 #include <sys/ioctl.h>
38 #include <unistd.h>
39 #include "yaml-cpp/yaml.h"
40 
41 
42 #define IF_X_RTN_CREATE_ANA_X(A) \
43  if (name == #A) return new A();
44 
45 #define APPEND_ANALYSIS_TO_LIST(A) \
46  analysislist.push_back(#A);
47 
48 
49 
50 
51 BaseAnalysis* mkAnalysis(const std::string name);
52 
53 void CreateAnalysisList(vector<string> &analysislist);
54 
55 
56 
57 
58 
59 int shellWidth=80;
60 
61 void progressbar(float progress, string message);
62 
65 {
66  public:
67  int ncores;
68  int nevents;
69  int npileup;
70  string outfile;
71  string cfgfile;
72  string lhefile;
73  string histofile;
74  string cutflowfile;
75  string hepmcfile;
76  string jsonfile;
77 
78  bool writehistos;
79  bool includePileUp;
80  bool checkconvergence;
81  double convergencemargin;
82 
83  bool store_events;
84  bool store_hadrons;
85  vector<std::string> Analyses_To_Run;
86 
87  vector<std::string> pythia_strings;
88  string pileupfilename;
89  double xs;
90  double Rjet;
91 
92 
93  void SetDefaults();
95  SettingsContainer(std::string & YAMLfname);
96 
97  void ReadYAML(std::string & YAMLfname);
98  template<typename T1> void SetValue(T1 & var,const string& varname, YODA_YAML::Node & config)
99  {
100  //string vname = (string) varname;
101  YODA_YAML::Node result = config["settings"][varname];
102  if(result)
103  {
104  var=result.as<T1>();
105  }
106  }
107  template<typename T1> void SetValue(T1 & var,YODA_YAML::Node & result)
108  {
109 
110  if(result)
111  {
112  var=result.as<T1>();
113  }
114  }
115 
116 };
117 
118 
119 
Definition: BaseAnalysis.h:106
Class to hold settings, read from the YAML file, such as number of cores, deltaR for the jets,...
Definition: running.h:65