GEMC  2.3
Geant4 Monte-Carlo Framework
gbank.h
Go to the documentation of this file.
1 #ifndef gbank_H
7 #define gbank_H 1
8 
9 // gemc headers
10 #include "options.h"
11 
12 // C++ headers
13 #include <sstream>
14 #include <set>
15 using namespace std;
16 
17 
18 // Banks. Let's put these in DB?
19 
20 // simulation conditions NUM is 0 for the mother bank, 1 for the data bank
21 #define SIMULATION_CONDITIONS_BANK_TAG 5
22 
23 // header bank
24 #define HEADER_BANK_TAG 10
25 
26 // simulation conditions NUM is 0 for the mother bank, 1 for the data bank
27 #define GENERATED_PARTICLES_BANK_TAG 20
28 
29 // simulation conditions NUM is 0 for the mother bank, 1 for the data bank
30 #define GENERATED_SUMMARY_BANK_TAG 21
31 
32 // FLUX Bank
33 #define FLUX_BANK_TAG 50
34 
35 // Mirrors Bank
36 #define MIRRORS_BANK_TAG 60
37 
38 // These Bank Types ID can be left hardcoded here
39 #define DETECTOR_BANK_ID 0
40 
41 // true information, integrated over the hit
42 // this number adds to the TAG of the mother bank
43 // and it's added to the tag of the variables
44 // example:
45 // DC (100, 0)
46 // - DC Raw (100 + RAWINT_ID, 0)
47 // - DC pid (100 + RAWINT_ID, variable ID)
48 // identified by "R" in the variable type
49 // Variable ID must be different from zero
50 #define RAWINT_ID 1
51 
52 // digitized information, integrated over the hit
53 // this number adds to the TAG of the mother bank
54 // and it's added to the tag of the variables
55 // example:
56 // DC (100, 0)
57 // - DC Raw (100 + DGTINT_ID, 0)
58 // - DC pid (100 + DGTINT_ID, variable ID)
59 // identified by "D" in the variable type
60 // Variable ID must be different from zero
61 #define DGTINT_ID 2
62 
63 // true information, step by step
64 // identified by "D" in the variable type
65 #define RAWSTEP_ID 3
66 
67 // digitized information, multi hit (step by step)
68 // identified by "M" in the variable type
69 #define DGTMULTI_ID 4
70 
71 // voltage versus time info
72 // identified by "V" in the variable type
73 #define VOLTAGETIME_ID 5
74 
75 // quantum signal: it's the processed signal every # nanoseconds
76 // (bunch time parameter given by user)
77 // identified by "Q" in the variable type
78 #define QUANTUM_SIGNAL_ID 6
79 
80 
86 class gBank
87 {
88  public:
89  gBank(){;}
90  gBank(int i, string bname, string d)
91  {
92  idtag = i;
93  bdescription = d;
94  name.clear();
95  id.clear();
96  description.clear();
97  bankName = bname;
98  }
99  ~gBank(){;}
100 
101  string bankName;
102  int idtag;
103  string bdescription;
104 
105  public:
106  vector<string> name;
107  vector<int> id;
108  // variable type is 2 chars. The first char represent the type of bank:
109  // N is for no level banks, the rest are defined above (N, R, D, S, M, V).
110  // "i"nt , "d"ouble, "s"tring
111  vector<string> type;
112  vector<string> description;
113 
114  void load_variable(string, int, string, string); // Load a variable in the bank definition
115 
116  // these two function return id and type
117  // first occurance of string in the vector
118  // there should be only one (not enforced right now)
119  int getVarId(string);
120  string getVarType(string);
121 
122  // returns the type of variable (rawInt, dgtInt, etc)
123  int getVarBankType(string);
124 
125  // vector of names ordered by ID
126  map<int, string> orderedNames;
127  void orderNames();
128 
129 
130  friend ostream &operator<<(ostream &stream, gBank);
131 
132 };
133 
134 
135 // get bank definitions (all)
136 gBank getBankFromMap(string, map<string, gBank>*);
137 
138 // get dgt bank definitions
139 gBank getDgtBankFromMap(string, map<string, gBank>*);
140 
141 // creates maps of banks based on sensitivity
142 map<string, gBank> read_banks(goptions gemcOpt, map<string, string> allSystems);
143 
144 
145 #endif
146 
147 
148 
149 
150 
gBank getDgtBankFromMap(string, map< string, gBank > *)
Definition: gbank.cc:438
gBank getBankFromMap(string, map< string, gBank > *)
Definition: gbank.cc:424
ostream & operator<<(ostream &stream, detector Detector)
Definition: detector.cc:1119
map< string, gBank > read_banks(goptions gemcOpt, map< string, string > allSystems)
Definition: gbank.cc:30
STL namespace.
int idtag
unique id for the bank
Definition: gbank.h:102
vector< string > type
Variable type.
Definition: gbank.h:111
string bankName
name of the bank, it&#39;s also key in the map but we store it here as well
Definition: gbank.h:101
map< int, string > orderedNames
Definition: gbank.h:126
vector< string > name
Variable name.
Definition: gbank.h:106
gBank(int i, string bname, string d)
Definition: gbank.h:90
vector< int > id
Output variable identifier.
Definition: gbank.h:107
Definition: gbank.h:86
~gBank()
Definition: gbank.h:99
gBank()
Definition: gbank.h:89
vector< string > description
Variable description.
Definition: gbank.h:112
string bdescription
bank description
Definition: gbank.h:103