full_simulation.rst 2.89 KB
Newer Older
Dmitry Romanov's avatar
Dmitry Romanov committed
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
Full simulation
===============

Tutorials
---------

Tutorials are available on a dedicated websites:

Detector simulation
~~~~~~~~~~~~~~~~~~~

- `Full simulation tutorials <https://eic.phy.anl.gov/tutorials/eic_tutorial/getting-started/quickstart>`_
- `Quick start guide <https://eic.phy.anl.gov/tutorials/eic_tutorial/getting-started/quickstart>`_
- `Part I. Simple detecotor <https://eic.phy.anl.gov/tutorials/eic_tutorial/part1/simple_detector>`_
- `Part II. Part 2: Modifying and Adding Detectors <https://eic.phy.anl.gov/tutorials/eic_tutorial/part2/adding_detectors>`_


`Perticipate in feedback! <https://docs.google.com/forms/d/e/1FAIpQLSclPBXv13pVtawt35XeaCDMOcmdo8fhKTapdmjFO_6gPTV-8w/viewform?usp=sf_link>`_

Tracking
~~~~~~~~

- `(in development) ACTS tracking repo <https://eicweb.phy.anl.gov/EIC/documentation/guide_to_tracking>`_



Particle gun
------------


There are at least 2 ways of running a particle gun out of the box:

- using npsim command line
- using geant macro file and invoke gps


Using npsim (wrapper around ddsim) command line: 

.. code:: bash

    # Assumed to run from the root of Athena detector repo
    # no spread
    npsim --compactFile=athena.xml --runType=run -G -N=2 --outputFile=test_gun.root --gun.position "0.0 0.0 1.0*cm" --gun.direction "1.0 0.0 1.0" --gun.energy 100*GeV --part.userParticleHandler='' 

    # uniform spread inside an angle:
Dmitry Romanov's avatar
Dmitry Romanov committed
46
    npsim --compactFile=athena.xml -N=2 --random.seed 1 --enableGun --gun.energy 2*GeV --gun.thetaMin 0*deg --gun.thetaMax 90*deg --gun.distribution uniform --outputFile test.root
Dmitry Romanov's avatar
Dmitry Romanov committed
47
48
49



Dmitry Romanov's avatar
Dmitry Romanov committed
50
51
52
53
54
55
56
57
58
59
Geometry visualization
----------------------

There are many ways to see the geometry and tracks: 

1. Through Geant4 event display
2. geoDisplay (root geoViewer)
3. ddeve (root EVE based event display...)
4. dd_web_display (using browser and jsroot library)

Dmitry Romanov's avatar
Dmitry Romanov committed
60
61
62
63
64
65
66
67
68
69
70
Geant4 event display
~~~~~~~~~~~~~~~~~~~~

Example command: 

.. code:: bash

    # Assumed to run from the root of Athena detector repo
    npsim --runType vis --compactFile athena.xml --macro macro/vis.mac --outputFile test.root --enableG4GPS --enableQtUI


Dmitry Romanov's avatar
Dmitry Romanov committed
71
72
73
74

Geometry conversion
-------------------

Dmitry Romanov's avatar
Dmitry Romanov committed
75
Convert to GDML
Dmitry Romanov's avatar
Dmitry Romanov committed
76
~~~~~~~~~~~~~~~
Dmitry Romanov's avatar
Dmitry Romanov committed
77
78
79
80
81

There is a convert_to_gdml.py script in the detector repository 
(https://eicweb.phy.anl.gov/EIC/detectors/athena/-/blob/master/scripts/convert_to_gdml.py). 
That can be used to export ALL of ATHENA to gdml, but not individual detector systems. 

Dmitry Romanov's avatar
Dmitry Romanov committed
82
This is actually `done <https://eicweb.phy.anl.gov/EIC/detectors/athena/-/blob/master/.gitlab-ci.yml#L168>`_ on every commit
Dmitry Romanov's avatar
Dmitry Romanov committed
83
84
85
86
and the results are saved as job artifacts. 

`The latest athena.gdml from the master branch <https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/athena.gdml?job=report&item=default>`_

Dmitry Romanov's avatar
Dmitry Romanov committed
87
88
89
90
91
92
93
94
95

Convert to root
~~~~~~~~~~~~~~~

One can use dd_web_display to actually just save root geometry

.. code:: bash

    dd_web_display --export athena.xml  # will create a .root file with the geometry