GEMC  2.3
Geant4 Monte-Carlo Framework
run_conditions.h
Go to the documentation of this file.
1 
13 #ifndef run_conditions_H
14 #define run_conditions_H
15 
16 // G4 headers
17 #include "G4ThreeVector.hh"
18 #include "G4RotationMatrix.hh"
19 
20 // Qt headers
21 #include <QDomDocument>
22 
23 // gemc headers
24 #include "options.h"
25 
26 // C++ headers
27 #include <iostream>
28 using namespace std;
29 
30 
37 {
38  private:
39  G4ThreeVector pos; // Shift relative to the nominal position
40  G4RotationMatrix rot; // Rotation relative to the nominal position
41  G4ThreeVector vrot; // Rotation Vector (ordered X,Y,Z)
42 
43  int is_present; // by default set to 1. Can be set to 0 to remove a detector from the simulation
44  string system; // detector system
45  string factory; // factory that builds the detector
46  string variation; // variation of the detector. Default is "main"
47  int run_number; // Run Number selected for this detector
48 
49  public:
50  detectorCondition(){is_present = 1;}
52  {
53  factory = f;
54  is_present = 1;
55  variation = "main";
56  run_number = 1;
57  }
59 
60  void set_position(string X, string Y, string Z);
61  void set_rotation(string X, string Y, string Z);
62  void set_existance(string exist);
63  void set_factory(string f) {factory = f;}
64  void set_variation(string v) {variation = v;}
65  void set_system(string s) {system = s;}
66  void set_run_number(int r) {run_number = r;}
67 
68  G4ThreeVector get_position() {return pos;}
69  G4ThreeVector get_vrotation() {return vrot;}
70  G4RotationMatrix get_rotation() {return rot;}
71  int get_existance() {return is_present;}
72  string get_factory() {return factory;}
73  string get_variation() {return variation;}
74  string get_system() {return system;}
75  int get_run_number(){return run_number;}
76 };
77 
78 
84 {
85  public:
88  ~runConditions();
89 
90  // Map of detectorCondition. Map Key = detector name.
91  map<string, detectorCondition> detectorConditionsMap;
92 
93  // Returns a map<string, string> with the detector systems present in gemc
94  // This map is then written in the output stream
95  map<string, string> getDetectorConditionsMap();
96 
97 
98  int get_run_number(string detector);
99  string get_variation(string detector);
100  string get_system(string detector);
101 
102  map<string, string> get_systems();
103 
104  private:
105  QDomDocument domDocument;
106 
107 };
108 
109 int check_if_factory_is_needed(map<string, detectorCondition>, string);
110 
111 
112 
114 {
115  public:
119 
120  int runNo;
121  int getRunNumber(int n);
122  bool isNewRun;
124 
125  private:
126  // map with weights as coming from the file
127  map<int, double> w;
128 
129  // fill the number of events map
130  void randomize();
131 
132  // map with numnber of events for each run, based on weight map
133  map<int, int> n;
134 
135  int startEvent;
136 
137 
138 };
139 
140 
141 
142 
143 #endif
144 
145 
146 
147 
148 
149 
detectorCondition(string f)
void set_system(string s)
STL namespace.
void set_factory(string f)
int defaultRunNumber
string get_variation(string var)
parse variation name from string
map< string, detectorCondition > detectorConditionsMap
string get_variation()
G4RotationMatrix get_rotation()
G4ThreeVector get_position()
int check_if_factory_is_needed(map< string, detectorCondition >, string)
G4ThreeVector get_vrotation()
void set_variation(string v)
void set_run_number(int r)