Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/docs/examples/full_chain_odd.md is written in an unsupported language. File is not indexed.

0001 # Walkthrough of the OpenDataDetector full chain example
0002 
0003 The OpenDataDetector (ODD) is fictitious silicon detector which resides in its own repository on [GitLab](https://gitlab.cern.ch/acts/OpenDataDetector). It is used for testing and as a performance baseline in ACTS.
0004 
0005 Our full chain ODD example is written in Python and can be found [here](https://github.com/acts-project/acts/blob/main/Examples/Scripts/Python/full_chain_odd.py).
0006 
0007 The first step is to load the ODD detector description and to construct the detector. `getOpenDataDetectorDirectory` gives us the ODD folder within the `thirdparty` directory in Acts. We load our preferred material map and provide it to the detector construction `getOpenDataDetector`.
0008 
0009 ```python
0010 oddDir = getOpenDataDetectorDirectory()
0011 
0012 oddMaterialMap = oddDir / "data/odd-material-maps.root"
0013 oddMaterialDeco = acts.IMaterialDecorator.fromFile(oddMaterialMap)
0014 
0015 detector = getOpenDataDetector(mdecorator=oddMaterialDeco)
0016 trackingGeometry = detector.trackingGeometry()
0017 decorators = detector.contextDecorators()
0018 ```
0019 
0020 In our simple example we assume a homogeneous magnetic field along the beam axis with 2 T. The magnetic field is passed to all the different algorithms in our simulation and the reconstruction pipeline.
0021 
0022 ```python
0023 field = acts.ConstantBField(acts.Vector3(0.0, 0.0, 2.0 * u.T))
0024 ```
0025 
0026 The simulation step involves random processes and in order to get the same results across different executions we provide our preferred random number generator with an arbitrary seed.
0027 
0028 ```python
0029 rnd = acts.examples.RandomNumbers(seed=42)
0030 ```
0031 
0032 All simulation and reconstruction pipelines in ACTS begin with a `Sequencer`. It controls the execution of the different algorithms in the chain. We provide the number of events, the number of threads to use (`-1` to use all the machine's cores) and the desired log level.
0033 
0034 ```python
0035 s = acts.examples.Sequencer(events=100, numThreads=-1, logLevel=acts.logging.INFO)
0036 ```
0037 
0038 Our first simulation step is the particle gun.
0039 It spawns particles and their initial parameters, like position and momentum, inside our detector.
0040 
0041 In our simple example we generate a single muon with random charge (i.e. muon or anti-muon) with 1-10 GeV with uniform pseudorapidity from -3 to 3.
0042 
0043 Relativistic muons are hardly deflected in the detector and will keep most of their energy which makes them almost ideal for track reconstruction.
0044 
0045 ```python
0046 addParticleGun(
0047     s,
0048     MomentumConfig(1.0 * u.GeV, 10.0 * u.GeV, transverse=True),
0049     EtaConfig(-3.0, 3.0, uniform=True),
0050     ParticleConfig(1, acts.PdgParticle.eMuon, randomizeCharge=True),
0051     rnd=rnd,
0052 )
0053 ```
0054 
0055 These newly created particles now need to be propagated through our detector. Fatras will do this for us if we provide it the detector geometry and the magnetic field.
0056 
0057 Learn more about Fatras [here](/fatras/fatras).
0058 
0059 ```python
0060 addFatras(
0061     s,
0062     trackingGeometry,
0063     field,
0064     outputDirRoot=outputDir,
0065     rnd=rnd,
0066 )
0067 ```
0068 
0069 The last step in the simulation is the digitization. Here we simulate the readout of the detector after a charged particle interacted with active detector material.
0070 
0071 In the simplest case we use a gaussian smearing of the true hit and displace it slightly.
0072 
0073 ```python
0074 oddDigiConfig = oddDir / "config/odd-digi-smearing-config.json"
0075 
0076 addDigitization(
0077     s,
0078     trackingGeometry,
0079     field,
0080     digiConfigFile=oddDigiConfig,
0081     outputDirRoot=outputDir,
0082     rnd=rnd,
0083 )
0084 ```
0085 
0086 With the last step we completed the simulation and switch the focus to the actual topic: reconstruction.
0087 
0088 The first step in our reconstruction is the track seeding. Here we try to find tracks and estimate their parameters.
0089 
0090 ```python
0091 oddSeedingSel = oddDir / "config/odd-seeding-config.json"
0092 
0093 addSeeding(
0094     s,
0095     trackingGeometry,
0096     field,
0097     geoSelectionConfigFile=oddSeedingSel,
0098     outputDirRoot=outputDir,
0099 )
0100 ```
0101 
0102 The Combinatorial Kalman Filter (CKF) will use the seeds to propagate the trajectory forward and backward in time with the idea to find more measurements along the way.
0103 It combines (i.e. smooths) these measurements and outputs reconstructed tracks which include smoothed track parameters for each measurement.
0104 
0105 ```python
0106 addCKFTracks(
0107     s,
0108     trackingGeometry,
0109     field,
0110     outputDirRoot=outputDir,
0111 )
0112 ```
0113 
0114 Our very last step in the reconstruction is the vertexing. In this step we try to find the origin of our tracks which are usually in the beam pipe at center of our detector.
0115 
0116 ```python
0117 addVertexFitting(
0118     s,
0119     field,
0120     vertexFinder=VertexFinder.AMVF,
0121     outputDirRoot=outputDir,
0122 )
0123 ```