-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainSimulation.py
More file actions
40 lines (23 loc) · 795 Bytes
/
Copy pathMainSimulation.py
File metadata and controls
40 lines (23 loc) · 795 Bytes
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
import numpy as np
import sys
import ROOT
import FiberSetup
import Sipm
import GenerateEvent
import AngularDistribution
#import TestModule
import unittest
class Parameters:
"""This class has as attributes all the parameters used in the simulation.
These parameter are stored in a config.py file that has to be passed when
the execution comand is given.
Es: python MainSimulation.py config.py"""
def __init__(self, filename):
with open(filename, 'r') as f:
for line in f:
exec 'self.'+line
if __name__== "__main__":
"""In this main an object of the class Parameter is instanced. """
parameter = Parameters(sys.argv[1])
simul=GenerateEvent.Event(parameter)
simul.writeDataRoot()