SoftwareHints » History » Version 1
Dobbs, Adam, 02 February 2013 16:03
1 | 1 | Dobbs, Adam | h1. Software Hints and Tips |
---|---|---|---|
2 | |||
3 | h2. Running a tracker simulation |
||
4 | |||
5 | There is a dedicated directory holding top level scripts for producing tracker data within MAUS at: |
||
6 | |||
7 | <pre> |
||
8 | bin/user/scifi |
||
9 | </pre> |
||
10 | |||
11 | For example to run a MAUS simulation of the tracker in the presence of a magnetic field do the following from the MAUS root directory: |
||
12 | |||
13 | <pre> |
||
14 | source env.sh |
||
15 | cd bin/user/scifi |
||
16 | ./simulate_scifi.py --configuration_file datacard_mc_helical |
||
17 | </pre> |
||
18 | |||
19 | The equivalent command for no magnetic field (straight tracks) is: |
||
20 | |||
21 | <pre> |
||
22 | ./simulate_scifi.py --configuration_file datacard_mc_straight |
||
23 | </pre> |
||
24 | |||
25 | h2. Datacard variables |
||
26 | |||
27 | Datacard variables control the various parameters passed to MAUS. The variables assume the default values set in src/common_py/ConfigurationDefaults.py unless overridden in a datacard or elsewhere. Here are a few common variables: |
||
28 | |||
29 | * Number of spills. The number of spills to simulate can be set by editing the relevant datacard file and changing the variable 'spill_generator_number_of_spills'. |
||
30 | * The number of particles per spill is controlled by the beam variable. This has a number of sub-variables, two of which can be set to alter the number of particles per spill: |
||
31 | ** 'binomial_n' is the number of attempts at generating a track |
||
32 | ** 'binomial_p' is the probability an attempt succeeds |
||
33 | |||
34 | h2. Accessing the output data |
||
35 | |||
36 | Data is output by MAUS either as ROOT or JSON documents. In order for ROOT to understand the classes we have written a ROOT dictionary, built automatically by MAUS must first be loaded. In an interactive ROOT session this done with following command: |
||
37 | |||
38 | <pre> |
||
39 | .L $MAUS_ROOT_DIR/build/libMausCpp.so |
||
40 | </pre> |
||
41 | |||
42 | The equivalent command if using "PyROOT":http://root.cern.ch/drupal/content/pyroot is |
||
43 | |||
44 | <pre> |
||
45 | import libMausCpp |
||
46 | </pre> |
||
47 | |||
48 | An example ROOT session to open a data file would be: |
||
49 | |||
50 | <pre> |
||
51 | > .L $MAUS_ROOT_DIR/build/libMausCpp.so |
||
52 | > TFile f1("maus_output.root") |
||
53 | > TBrowser b |
||
54 | </pre> |
||
55 | |||
56 | The equivalent PyROOT session would be: |
||
57 | |||
58 | <pre> |
||
59 | > from ROOT import * |
||
60 | > import libMausCpp |
||
61 | > f1 = TFile("maus_output.root") |
||
62 | > b = TBrowser() |
||
63 | </pre> |
||
64 | |||
65 | The tracker MC data can the be found by browsing to |