-
Notifications
You must be signed in to change notification settings - Fork 0
/
Podd.h
62 lines (49 loc) · 1.6 KB
/
Podd.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Common include for simplified analyzer demo
#ifndef PPODD_H
#define PPODD_H
#include <vector>
#include <list>
#include <memory>
#include <string>
#include <limits>
#include <chrono>
// Typedefs for variable and detector lists
class Variable;
class Detector;
using varlst_t = std::list<std::unique_ptr<Variable>>;
using detlst_t = std::vector<std::unique_ptr<Detector>>;
using ClockTime_t = std::chrono::duration<double, std::milli>;
// Debug level
extern int debug;
// Program configuration
struct Config {
Config() noexcept
: nev_max(std::numeric_limits<size_t>::max())
, nthreads(0)
, mark(0)
{}
void default_names();
std::string input_file, odef_file, output_file, db_file;
size_t nev_max;
unsigned int nthreads;
unsigned int mark;
} __attribute__((aligned(128)));
extern Config cfg;
// Name, description and value of an analysis result
struct VarDef_t {
std::string name;
std::string note;
const double* loc;
} __attribute__((aligned(64)));
enum { kDefine = false, kRemove = true };
// Define analysis results variables from list of definitions in 'defs'.
// Prepend 'prefix', if any, to all variable names.
// Newly defined variables are placed in the variable list 'varlst'.
// If 'remove' is true, remove any existing variables instead.
// Returns number of variables defined.
int DefineVarsFromList( const std::vector<VarDef_t>& defs,
const std::string& prefix,
const std::shared_ptr<varlst_t>& varlst, bool remove = false );
void PrintVarList( const std::shared_ptr<varlst_t>& varlst );
#define ALL(c) (c).begin(), (c).end()
#endif