HerdSoftware  0.1.1
DistributionChannelTool.h
Go to the documentation of this file.
1 /*
2  * DistributionChannelTool.h
3  *
4  * This tool calculates the fraction of the total path length
5  * of a track in the core of each fibre that was hit along with
6  * the position of the fibre.
7  *
8  * Created on 03 Mar 2020
9  * Author: Valerio Formato (based on code by Junjing Wang)
10  */
11 
12 // clang-format off
13  // sipm setup parameters
14 
15  // Mat and SiPMs
16  // -----------------------------------------------------------
17  // |---------------| |---------------| |---------------|
18  // | | | | | |
19  // | SiPM0 |0.09| SiPM1 |0.09| SiPM2 |
20  // | 32.54mm | mm | 32.54mm | mm | 32.54mm |
21  // | | | | | |
22  // |---------------| |---------------| |---------------|
23  // -----------------------------------------------------------
24  // \_________________________97.8mm__________________________/
25  //
26  //
27  // SiPM structure
28  //
29  // ==================================================
30  // | | | | | |
31  // | | | | | |
32  // | | active die0 | | active die0 | |
33  // |0.16| |0.22| |0.16|
34  // | mm | 0.25mm*64 | mm | 0.25mm*64 | mm |
35  // | | | | | |
36  // | | | | | |
37  // | | | | | |
38  // ==================================================
39  // \__________________32.54mm_______________________/
40  //
41  //
42  // gap between SiPMs is actually determined by FitGeoParams dynamically
43 // clang-format on
44 
45 #ifndef HERD_DISTRIBUTIONCHANNELTOOL_H_
46 #define HERD_DISTRIBUTIONCHANNELTOOL_H_
47 
49 
50 // this in c++17 will become
51 // namespace Herd::FitDigitizationTools {
52 namespace Herd {
53 namespace FitDigitizationTools {
54 
56 public:
57  /*
58  G4int targetChannel(double posX, double posZ,
59  double dXdY, double dZdY);
60  */
61  static int targetChannel(double posX, double posZ, double dXdY, double dZdY, const FitGeoParams &geoParams);
62 
63 private:
64  // members for detailed simulation
65  static constexpr double m_channelSizeZ = 0.1625; //"Channel width in z direction (local coordinates)"
66  static constexpr double m_epoxyWidth = 0.01; // "Thickness of the epoxy layer between fibre ends and SiPMs"
67  static constexpr double m_airWidth = 0.002; // "Thickness of the air layer between fibre ends and SiPMs"
68  static constexpr double m_refractionIndex = 1.52; // refraction index of sipm's epoxy
69 
70  // gcc marks this function as unused, even if it is not (maybe because it's used in a try block)
71  static std::pair<int, double> calculateChannelAndFrac(double localX, const FitGeoParams &geoParams);
72 
74  static double findFinalPosSlope(double pos, double slope) { return pos + m_epoxyWidth * slope; }
75 };
76 } // namespace FitDigitizationTools
77 } // namespace Herd
78 #endif // DISTRIBUTIONCHANNELTOOL_H
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
static constexpr double m_airWidth
Definition: DistributionChannelTool.h:67
static double findFinalPosSlope(double pos, double slope)
Calculate the final x position of a photon based on its slope at the fibre.
Definition: DistributionChannelTool.h:74
static constexpr double m_refractionIndex
Definition: DistributionChannelTool.h:68
Data structure for single silicon layer geometry parameters.
Definition: FitGeoParams.h:64
static std::pair< int, double > calculateChannelAndFrac(double localX, const FitGeoParams &geoParams)
Definition: DistributionChannelTool.cpp:24
static int targetChannel(double posX, double posZ, double dXdY, double dZdY, const FitGeoParams &geoParams)
Definition: DistributionChannelTool.cpp:51
Definition: DistributionChannelTool.h:55
static constexpr double m_channelSizeZ
Definition: DistributionChannelTool.h:65
static constexpr double m_epoxyWidth
Definition: DistributionChannelTool.h:66