Skip to content
Snippets Groups Projects
Commit 50d50ea6 authored by Dowling_Wong's avatar Dowling_Wong
Browse files

added a bit

parent eaa9800e
Branches
No related tags found
No related merge requests found
%% Cell type:markdown id:a1c50278 tags:
# Particle Physics 1
## Exercise 3: EMCAL in a Nutshell
**Institut für Experimentelle Teilchenphysik** <br>
Lecture: Prof. Dr. M. Klute, Dr. P. Goldenzweig <br>
Exercise: Dr. G. De Pietro <br>
Assistance: L. Reuter, J. Eppelt, S. Giappichini, dwong <br>
Hand-In: Nov, 21st, 2023
<h3>Navigation</h3>
<table style="width:100%; table-layout: fixed;">
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt; width: 50%;"><a href="#section_4_1">Electron–photon cascades</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt; width: 50%;">
<a href="#problems_4_1">EMCal dimension estimation</a><br>
<a href="#problems_4_1">Muon hits</a><br>
<a href="#problems_4_1">EMCal proposal</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_3">Calorimetry and reconstruction</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_3">Low-level reco</a><br>
<a href="#problems_4_3">Statistical moments</a><br>
<a href="#problems_4_3">Statistical moments</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_3">Clustering, bit about K-Means</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_3">P4.3</a><br>
<a href="#problems_4_3">K-Means clustering</a><br>
<a href="#problems_4_3">Elbow method</a><br>
<a href="#problems_4_3">Silhouette method</a><br>
<a href="#problems_4_3">Energy seeds</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Clustering: About K-Means</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Bonus: Spin-0 photon</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_4">P4.4 Problems</a><br>
<a href="#problems_4_4">Decay rate</a><br>
<a href="#problems_4_4">Conservation of helicity</a><br>
<a href="#problems_4_4">Trace techniques</a><br>
<a href="#problems_4_4">Life time calculation</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Intro to Geant4</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Introduction to Geant4</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_4">P4.4 Problems</a><br>
</td>
</tr>
</table>
%% Cell type:markdown id:b82039ad tags:
### Setup
We will give a brief introduction to EMCAL and clustering. In the process, numpy, sklearn, uproot will be used.
%% Cell type:code id:b3619d05 tags:
``` python
# !pip install sklearn
# !pip install uproot
import numpy as np
from sklearn.cluster import KMeans
import uproot
import matplotlib.pyplot as plt
import geant4_simulation as g4sim
```
%% Cell type:code id:329972a6 tags:
``` python
```
%% Cell type:code id:eea2907e tags:
``` python
```
%% Cell type:markdown id:ad70f3aa-e25b-4929-b97b-b33325e649d8 tags:
<a name='section_1_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Introduction to Geant4</h2>
%% Cell type:code id:78f00792-6cdd-4419-b204-cae3a4dd9a1f tags:
``` python
# Create an instance of the ApplicationManager class.
g4 = g4sim.ApplicationManager()
```
%% Output
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[1], line 2
1 # Create an instance of the ApplicationManager class.
----> 2 g4 = g4sim.ApplicationManager()
NameError: name 'g4sim' is not defined
%% Cell type:markdown id:47058a39 tags:
%% Cell type:markdown id:cce470a2 tags:
<a name='section_1_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Introduction to EMCAL</h2>
%% Cell type:code id:bb598536 tags:
``` python
```
%% Cell type:code id:e4377339 tags:
``` python
```
%% Cell type:code id:5fc30d71 tags:
``` python
```
%% Cell type:code id:7b666775 tags:
``` python
```
%% Cell type:markdown id:123fc926 tags:
<a name='section_2_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Particle hit shapes</h2>
%% Cell type:code id:edcf44c5 tags:
``` python
```
%% Cell type:markdown id:47da65a9 tags:
### Moments in statistics
The moments of a distribution provide useful information about its shape and spread. Below are the formulas for different moments:
- **1st order(raw)**$$\text{mean: }\mu := \mathbb{E}[X] = \frac{\mu_1}{1}
$$
- **2nd order(central)**: $$\text{variance: }\sigma^2 = \mathbb{E}[(X - \mu)^2] = \frac{\mu_2}{1^2} = \mu_2
$$
- **3rd order(standardized)**:$$\text{Skewness} = \mathbb{E} \left[ \left( \frac{X - \mu}{\sigma} \right)^3 \right] = \frac{\mathbb{E}[(X - \mu)^3]}{(\mathbb{E}[(X - \mu)^2])^{3/2}}
$$
- **4th order(standardized)**:$$\text{Kurtosis}g = \mathbb{E} \left[ \left( \frac{X - \mu}{\sigma} \right)^4 \right] = \frac{\mathbb{E}[(X - \mu)^4]}{(\mathbb{E}[(X - \mu)^2])^2}
$$
<span style="color:red">Bonus: What does Skewness/Kurtosis represent, why two expressions are equivalent?</span>
ans: hits on EMCAL plane also form a discrete probability distribution
%% Cell type:code id:627b99e7 tags:
``` python
```
%% Cell type:code id:00f7acae tags:
``` python
```
%% Cell type:code id:7fe9430c tags:
``` python
```
%% Cell type:markdown id:f7312bba tags:
<a name='section_3_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Clustering</h2>
%% Cell type:code id:8a84f2d5 tags:
``` python
```
%% Cell type:code id:47a42966 tags:
``` python
```
%% Cell type:markdown id:7807528d tags:
<a name='section_4_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Linkage methods</h2>
%% Cell type:code id:22c9d725 tags:
``` python
```
%% Cell type:code id:32c1dfac tags:
``` python
```
%% Cell type:code id:92f7c3b2 tags:
``` python
```
%% Cell type:code id:9cff34cf tags:
``` python
```
%% Cell type:code id:899dd92a tags:
``` python
```
%% Cell type:code id:1d5618ae tags:
``` python
```
%% Cell type:markdown id:139e1880 tags:
<a name='section_5_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Reading: ECAL at CMS</h2>
%% Cell type:markdown id:ebbcd7a3 tags:
<h3>CM-Solenoid: deal with cylindrical coordinates</h3>
%% Cell type:code id:454fe7c6 tags:
``` python
```
%% Cell type:code id:d1832fb7 tags:
``` python
```
%% Cell type:code id:822889bf tags:
``` python
```
%% Cell type:code id:af985ef4 tags:
``` python
```
%% Cell type:code id:fdc6e26b tags:
``` python
```
%% Cell type:code id:c881c954 tags:
``` python
```
%% Cell type:code id:61dad576 tags:
``` python
```
......
%% Cell type:markdown id:a1c50278 tags:
# Particle Physics 1
## Exercise 3: EMCAL in a Nutshell
**Institut für Experimentelle Teilchenphysik** <br>
Lecture: Prof. Dr. M. Klute, Dr. P. Goldenzweig <br>
Exercise: Dr. G. De Pietro <br>
Assistance: L. Reuter, J. Eppelt, S. Giappichini, dwong <br>
Hand-In: Nov, 21st, 2023
<h3>Navigation</h3>
<table style="width:100%; table-layout: fixed;">
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt; width: 50%;"><a href="#section_4_1">Electron–photon cascades</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt; width: 50%;">
<a href="#problems_4_1">EMCal dimension estimation</a><br>
<a href="#problems_4_1">Muon hits</a><br>
<a href="#problems_4_1">EMCal proposal</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_3">Calorimetry and reconstruction</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_3">Low-level reco</a><br>
<a href="#problems_4_3">Statistical moments</a><br>
<a href="#problems_4_3">Statistical moments</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_3">Clustering, bit about K-Means</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_3">P4.3</a><br>
<a href="#problems_4_3">K-Means clustering</a><br>
<a href="#problems_4_3">Elbow method</a><br>
<a href="#problems_4_3">Silhouette method</a><br>
<a href="#problems_4_3">Energy seeds</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Clustering: About K-Means</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Bonus: Spin-0 photon</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_4">P4.4 Problems</a><br>
<a href="#problems_4_4">Decay rate</a><br>
<a href="#problems_4_4">Conservation of helicity</a><br>
<a href="#problems_4_4">Trace techniques</a><br>
<a href="#problems_4_4">Life time calculation</a><br>
</td>
</tr>
<tr>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Intro to Geant4</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;"><a href="#section_4_4">Introduction to Geant4</a></td>
<td style="text-align: left; vertical-align: top; font-size: 10pt;">
<a href="#problems_4_4">P4.4 Problems</a><br>
</td>
</tr>
</table>
%% Cell type:markdown id:b82039ad tags:
### Setup
We will give a brief introduction to EMCAL and clustering. In the process, numpy, sklearn, uproot will be used.
%% Cell type:code id:b3619d05 tags:
``` python
# !pip install sklearn
# !pip install uproot
import numpy as np
from sklearn.cluster import KMeans
import uproot
import matplotlib.pyplot as plt
import geant4_simulation as g4sim
```
%% Cell type:code id:329972a6 tags:
``` python
```
%% Cell type:code id:eea2907e tags:
``` python
```
%% Cell type:markdown id:ad70f3aa-e25b-4929-b97b-b33325e649d8 tags:
<a name='section_1_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Introduction to Geant4</h2>
%% Cell type:code id:78f00792-6cdd-4419-b204-cae3a4dd9a1f tags:
``` python
# Create an instance of the ApplicationManager class.
g4 = g4sim.ApplicationManager()
```
%% Output
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[1], line 2
1 # Create an instance of the ApplicationManager class.
----> 2 g4 = g4sim.ApplicationManager()
NameError: name 'g4sim' is not defined
%% Cell type:markdown id:47058a39 tags:
%% Cell type:markdown id:cce470a2 tags:
<a name='section_1_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Introduction to EMCAL</h2>
%% Cell type:code id:bb598536 tags:
``` python
```
%% Cell type:code id:e4377339 tags:
``` python
```
%% Cell type:code id:5fc30d71 tags:
``` python
```
%% Cell type:code id:7b666775 tags:
``` python
```
%% Cell type:markdown id:123fc926 tags:
<a name='section_2_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Particle hit shapes</h2>
%% Cell type:code id:edcf44c5 tags:
``` python
```
%% Cell type:markdown id:47da65a9 tags:
### Moments in statistics
The moments of a distribution provide useful information about its shape and spread. Below are the formulas for different moments:
- **1st order(raw)**$$\text{mean: }\mu := \mathbb{E}[X] = \frac{\mu_1}{1}
$$
- **2nd order(central)**: $$\text{variance: }\sigma^2 = \mathbb{E}[(X - \mu)^2] = \frac{\mu_2}{1^2} = \mu_2
$$
- **3rd order(standardized)**:$$\text{Skewness} = \mathbb{E} \left[ \left( \frac{X - \mu}{\sigma} \right)^3 \right] = \frac{\mathbb{E}[(X - \mu)^3]}{(\mathbb{E}[(X - \mu)^2])^{3/2}}
$$
- **4th order(standardized)**:$$\text{Kurtosis}g = \mathbb{E} \left[ \left( \frac{X - \mu}{\sigma} \right)^4 \right] = \frac{\mathbb{E}[(X - \mu)^4]}{(\mathbb{E}[(X - \mu)^2])^2}
$$
<span style="color:red">Bonus: What does Skewness/Kurtosis represent, why two expressions are equivalent?</span>
ans: hits on EMCAL plane also form a discrete probability distribution
%% Cell type:code id:627b99e7 tags:
``` python
```
%% Cell type:code id:00f7acae tags:
``` python
```
%% Cell type:code id:7fe9430c tags:
``` python
```
%% Cell type:markdown id:f7312bba tags:
<a name='section_3_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Clustering</h2>
%% Cell type:code id:8a84f2d5 tags:
``` python
```
%% Cell type:code id:47a42966 tags:
``` python
```
%% Cell type:markdown id:7807528d tags:
<a name='section_4_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Linkage methods</h2>
%% Cell type:code id:22c9d725 tags:
``` python
```
%% Cell type:code id:32c1dfac tags:
``` python
```
%% Cell type:code id:92f7c3b2 tags:
``` python
```
%% Cell type:code id:9cff34cf tags:
``` python
```
%% Cell type:code id:899dd92a tags:
``` python
```
%% Cell type:code id:1d5618ae tags:
``` python
```
%% Cell type:markdown id:139e1880 tags:
<a name='section_5_0'></a>
<hr style="height: 1px;">
## <h2 style="border:1px; border-style:solid; padding: 0.25em; color: #FFFFFF; background-color: #FFA500">Reading: ECAL at CMS</h2>
%% Cell type:markdown id:ebbcd7a3 tags:
<h3>CM-Solenoid: deal with cylindrical coordinates</h3>
%% Cell type:code id:454fe7c6 tags:
``` python
```
%% Cell type:code id:d1832fb7 tags:
``` python
```
%% Cell type:code id:822889bf tags:
``` python
```
%% Cell type:code id:af985ef4 tags:
``` python
```
%% Cell type:code id:fdc6e26b tags:
``` python
```
%% Cell type:code id:c881c954 tags:
``` python
```
%% Cell type:code id:61dad576 tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment