Skip to content

Commit 170092c

Browse files
committed
Allow the user to change the material of the surrounding volume from
air to whatever is required. Is an optional parameter to the telescope constructor.
1 parent 5dc798c commit 170092c

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This small collection of scripts provides a simple interface for the simulation
1111
* Error propagation of track extrapolation uncertainty using GBL
1212
* Includes scattering in material, estimated via the PDG Highland formula
1313
* Automatically accounts for air between the telescope planes
14+
* Allows to exchange the volume material considered for scattering (Air, vacuum, Helium...)
1415
* Automatic placement of the thin scatterers at correct positions
1516
* Planes ordered automatically in `z` for correct GBL trajectory building
1617
* Radiation length for some common materials are defined in `utils/materials.h`
@@ -69,4 +70,10 @@ This small collection of scripts provides a simple interface for the simulation
6970
double MIM26 = 50e-3 / X0_Si + 50e-3 / X0_Kapton;
7071
```
7172

72-
* The resolution is always given as intrinsic resolution of the respective sensor in units of micrometer.
73+
* The resolution should always be given as intrinsic resolution of the respective sensor in units of micrometer.
74+
75+
* The constructor of the telescope class takes the radiation length of the surrounding volume as optional parameter:
76+
77+
`telescope(std::vector<gblsim::plane> planes, double beam_energy, double material = X0_Air);`
78+
79+
It defaults to the radiation length of dry air but can be replaced with other materials or with vacuum (`X0 = 0`) for comparison.

telescope/assembly.cc

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ plane::plane(double position, double material, bool measurement, double resoluti
2525
m_position(position) {}
2626

2727

28-
telescope::telescope(std::vector<gblsim::plane> planes, double beam_energy) :
28+
telescope::telescope(std::vector<gblsim::plane> planes, double beam_energy, double material) :
29+
m_volumeMaterial(material),
2930
m_listOfPoints(),
3031
m_listOfLabels()
3132
{
@@ -63,24 +64,32 @@ telescope::telescope(std::vector<gblsim::plane> planes, double beam_energy) :
6364
// Let's first add the air:
6465
double plane_distance = pl->m_position - oldpos;
6566
LOG(logDEBUG2) << "Distance to next plane: " << plane_distance;
67+
double distance = 0;
6668

67-
// Propagate [mm] from 0 to 0.21 = 0.5 - 1/sqrt(12)
68-
double distance = 0.21 * plane_distance; arclength += distance;
69+
// Check if a volume scatterer with radiation length != 0 has been defined:
70+
if(m_volumeMaterial > 0.0) {
71+
// Propagate [mm] from 0 to 0.21 = 0.5 - 1/sqrt(12)
72+
distance = 0.21 * plane_distance; arclength += distance;
6973

70-
// Add air:
71-
m_listOfPoints.push_back(getPoint(distance,getScatterer(beam_energy,0.5*plane_distance/X0_Air,total_materialbudget)));
72-
LOG(logDEBUG3) << "Added air scat at " << arclength;
74+
// Add volume scatterer:
75+
m_listOfPoints.push_back(getPoint(distance,getScatterer(beam_energy,0.5*plane_distance/m_volumeMaterial,total_materialbudget)));
76+
LOG(logDEBUG3) << "Added volume scat at " << arclength;
7377

74-
// Propagate [mm] 0.58 = from 0.21 to 0.79 = 0.5 + 1/sqrt(12)
75-
distance = 0.58 * plane_distance; arclength += distance;
78+
// Propagate [mm] 0.58 = from 0.21 to 0.79 = 0.5 + 1/sqrt(12)
79+
distance = 0.58 * plane_distance; arclength += distance;
7680

77-
// Factor 0.5 for the air as it is split into two scatterers:
78-
m_listOfPoints.push_back(getPoint(distance,getScatterer(beam_energy,0.5*plane_distance/X0_Air,total_materialbudget)));
79-
LOG(logDEBUG3) << "Added air scat at " << arclength;
81+
// Factor 0.5 for the volume as it is split into two scatterers:
82+
m_listOfPoints.push_back(getPoint(distance,getScatterer(beam_energy,0.5*plane_distance/m_volumeMaterial,total_materialbudget)));
83+
LOG(logDEBUG3) << "Added volume scat at " << arclength;
8084

81-
// Propagate [mm] from 0 to 0.21 = 0.5 - 1/sqrt(12)
82-
distance = 0.21 * plane_distance; arclength += distance;
83-
LOG(logDEBUG) << "Added air scatterers.";
85+
// Propagate [mm] from 0 to 0.21 = 0.5 - 1/sqrt(12)
86+
distance = 0.21 * plane_distance; arclength += distance;
87+
LOG(logDEBUG) << "Added volume scatterers.";
88+
}
89+
else {
90+
// No volume scatterer defined (vacuum), simply propagate to the next plane:
91+
distance = plane_distance;
92+
}
8493

8594
if(pl->m_measurement) {
8695
m_listOfPoints.push_back(getPoint(distance,pl->m_resolution,getScatterer(beam_energy,pl->m_materialbudget,total_materialbudget)));
@@ -111,11 +120,13 @@ double telescope::getTotalMaterialBudget(std::vector<gblsim::plane> planes) {
111120
total_materialbudget += p->m_materialbudget;
112121
}
113122

114-
// Add the air as scattering material:
115-
double total_distance = (planes.back().m_position - planes.front().m_position);
116-
LOG(logDEBUG2) << "Adding x/X0=" << (total_distance/X0_Air) << " (air)";
117-
total_materialbudget += total_distance/X0_Air;
118-
123+
if(m_volumeMaterial > 0.0) {
124+
// Add the air as scattering material:
125+
double total_distance = (planes.back().m_position - planes.front().m_position);
126+
LOG(logDEBUG2) << "Adding x/X0=" << (total_distance/m_volumeMaterial) << " (air)";
127+
total_materialbudget += total_distance/m_volumeMaterial;
128+
}
129+
119130
LOG(logDEBUG) << "Total track material budget x/X0=" << total_materialbudget;
120131
return total_materialbudget;
121132
}

telescope/assembly.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "GblTrajectory.h"
2+
#include "materials.h"
23

34
namespace gblsim {
45
class plane {
@@ -25,7 +26,7 @@ namespace gblsim {
2526

2627
class telescope {
2728
public:
28-
telescope(std::vector<gblsim::plane> planes, double beam_energy);
29+
telescope(std::vector<gblsim::plane> planes, double beam_energy, double material = X0_Air);
2930

3031
// Return the trajectory
3132
gbl::GblTrajectory getTrajectory();
@@ -35,6 +36,9 @@ namespace gblsim {
3536

3637
void printLabels();
3738
private:
39+
// Radiationlength of the material of the surrounding volume, defaults to dry air:
40+
double m_volumeMaterial;
41+
3842
double getTotalMaterialBudget(std::vector<gblsim::plane> planes);
3943
std::vector<gbl::GblPoint> m_listOfPoints;
4044
std::vector<int> m_listOfLabels;

0 commit comments

Comments
 (0)