FairShip
Loading...
Searching...
No Matches
MTCDetector.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef SND_MTC_MTCDETECTOR_H_
6#define SND_MTC_MTCDETECTOR_H_
7
8#include <array>
9#include <map>
10#include <string> // for string
11
12#include "Detector.h"
13#include "MTCDetPoint.h"
14#include "TGeoMatrix.h"
15
16class TGeoVolume;
17class TGeoVolumeAssembly;
18class TGeoMedium;
19class FairVolume;
20
21class MTCDetector : public SHiP::Detector<MTCDetPoint> {
22 public:
23 MTCDetector(const char* name, Bool_t Active, const char* Title = "",
24 Int_t DetId = 0);
26
27 void SetMTCParameters(Double_t width, Double_t height,
28 Double_t fiber_tilt_angle, Double_t iron_thickness,
29 Double_t scifi_thickness, Int_t num_of_agg_channels,
30 Double_t scint_cell_size, Double_t scint_thickness,
31 Int_t number_of_layers, Double_t z_position,
32 Double_t field_strength);
33 virtual void CreateScintModule(const char* name,
34 TGeoVolumeAssembly* modMotherVol,
35 Double_t z_shift, Double_t width,
36 Double_t height, Double_t thickness,
37 Double_t cellSizeX, Double_t cellSizeY,
38 TGeoMedium* material, Int_t color,
39 Double_t transparency, Int_t LayerId);
40 virtual void CreateSciFiModule(const char* name,
41 TGeoVolumeAssembly* modMotherVol,
42 Double_t width, Double_t height,
43 Double_t thickness, Int_t LayerId);
44 void ConstructGeometry() override;
46 void GetPosition(Int_t fDetectorID, TVector3& vLeft,
47 TVector3& vRight); // or top and bottom
49 TVector3 GetLocalPos(Int_t fDetectorID, TVector3* glob);
51 void GetSiPMPosition(Int_t SiPMChan, TVector3& A, TVector3& B);
52 void SiPMmapping();
53 std::map<Int_t, std::map<Int_t, std::array<float, 2>>> GetSiPMmapU() {
54 return fibresSiPM_U;
55 }
56 std::map<Int_t, std::map<Int_t, std::array<float, 2>>> GetFibresMapU() {
57 return siPMFibres_U;
58 }
59 std::map<Int_t, std::map<Int_t, std::array<float, 2>>> GetSiPMmapV() {
60 return fibresSiPM_V;
61 }
62 std::map<Int_t, std::map<Int_t, std::array<float, 2>>> GetFibresMapV() {
63 return siPMFibres_V;
64 }
65 std::map<Int_t, float> GetSiPMPos_U() { return SiPMPos_U; }
66 std::map<Int_t, float> GetSiPMPos_V() { return SiPMPos_V; }
67 Int_t Get_NSiPMChan() const { return fNSiPMChan; }
68 Float_t Get_SciFiActiveX() const { return fSciFiActiveX; }
69 virtual void SiPMOverlap();
70 Bool_t ProcessHits(FairVolume* vol = 0) override;
71
72 private:
73 Double_t fWidth;
74 Double_t fHeight;
75 Double_t fSciFiActiveX;
76 Double_t fSciFiActiveY;
78 Double_t fIronThick;
79 Double_t fSciFiThick;
80 Double_t fScintThick;
82 Int_t fLayers;
83 Double_t fZCenter;
84 Double_t fFieldY;
85 Double_t fZEpoxyMat;
86 Double_t fiberMatThick = 0.135; // 1.35 mm
87 Double_t fFiberLength;
88 Double_t fFiberPitch = 0.025; // cm
89 // Define sublayer thicknesses (in cm)
90 // These values mimic the GEANT4 setup:
91 Double_t lowerIronThick = 0.3; // 3 mm
92 Double_t airGap = 0.1; // 1 mm
93 Double_t upperIronThick = 0.3; // 3 mm
94 Double_t zLowerIronInt = -3.5 / 10;
95 Double_t zFiberMat1 = -1.325 / 10;
96 Double_t zAirGap = -0.15 / 10;
97 Double_t zFiberMat2 = 1.025 / 10;
98 Double_t zUpperIronInt = 3.2 / 10;
99 Double_t fFiberRadius = 0.01125;
100 Int_t numFiberLayers = 6; // number of fiber layers in epoxy block
101 Int_t fNSiPMChan; // Number of SiPM channels
102 Int_t fChannelAggregated; // Number of SiPM channels to be aggregated
103 Int_t fNSiPMs = 1; // Default number of SiPMs
104 static constexpr Int_t kMaxChannelsPerSiPM = 1000;
105 // Total module thickness = 0.3 + 0.135 + 0.1 + 0.135 + 0.3 ≈ 1.0 cm
106 Int_t fNMats = 1;
107 std::map<Int_t, std::map<Int_t, std::array<float, 2>>>
109 std::map<Int_t, std::map<Int_t, std::array<float, 2>>>
111 std::map<Int_t, std::map<Int_t, std::array<float, 2>>>
113 std::map<Int_t, std::map<Int_t, std::array<float, 2>>>
115 std::map<Int_t, float> SiPMPos_U, SiPMPos_V;
116
117 MTCDetector(const MTCDetector&) = delete;
119 ClassDefOverride(MTCDetector, 4)
120};
121
122#endif // SND_MTC_MTCDETECTOR_H_
Definition: diagrams_a.h:3
Definition: diagrams_b.h:4
Double_t fIronThick
Definition: MTCDetector.h:78
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > siPMFibres_V
mapping of fibres to SiPM channels
Definition: MTCDetector.h:114
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > fibresSiPM_V
inverse mapping
Definition: MTCDetector.h:112
Double_t fSciFiBendingAngle
Definition: MTCDetector.h:77
Int_t Get_NSiPMChan() const
Definition: MTCDetector.h:67
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > fibresSiPM_U
Definition: MTCDetector.h:108
static constexpr Int_t kMaxChannelsPerSiPM
Definition: MTCDetector.h:104
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > GetSiPMmapV()
Definition: MTCDetector.h:59
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > GetSiPMmapU()
Definition: MTCDetector.h:53
std::map< Int_t, float > GetSiPMPos_V()
Definition: MTCDetector.h:66
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > GetFibresMapV()
Definition: MTCDetector.h:62
Double_t fFiberLength
Definition: MTCDetector.h:87
Double_t fZEpoxyMat
Definition: MTCDetector.h:85
Float_t Get_SciFiActiveX() const
Definition: MTCDetector.h:68
void SiPMmapping()
Int_t fChannelAggregated
Definition: MTCDetector.h:102
Double_t fWidth
Definition: MTCDetector.h:73
void ConstructGeometry() override
Int_t numFiberLayers
Definition: MTCDetector.h:100
Double_t fSciFiThick
Definition: MTCDetector.h:79
Double_t fHeight
Definition: MTCDetector.h:74
std::map< Int_t, float > GetSiPMPos_U()
Definition: MTCDetector.h:65
MTCDetector & operator=(const MTCDetector &)=delete
Double_t upperIronThick
Definition: MTCDetector.h:93
TVector3 GetLocalPos(Int_t fDetectorID, TVector3 *glob)
Double_t fScintCellSize
Definition: MTCDetector.h:81
void SetMTCParameters(Double_t width, Double_t height, Double_t fiber_tilt_angle, Double_t iron_thickness, Double_t scifi_thickness, Int_t num_of_agg_channels, Double_t scint_cell_size, Double_t scint_thickness, Int_t number_of_layers, Double_t z_position, Double_t field_strength)
Double_t zUpperIronInt
Definition: MTCDetector.h:98
virtual void CreateScintModule(const char *name, TGeoVolumeAssembly *modMotherVol, Double_t z_shift, Double_t width, Double_t height, Double_t thickness, Double_t cellSizeX, Double_t cellSizeY, TGeoMedium *material, Int_t color, Double_t transparency, Int_t LayerId)
Int_t fNSiPMs
Definition: MTCDetector.h:103
MTCDetector(const MTCDetector &)=delete
local SiPM channel position
virtual void CreateSciFiModule(const char *name, TGeoVolumeAssembly *modMotherVol, Double_t width, Double_t height, Double_t thickness, Int_t LayerId)
Double_t lowerIronThick
Definition: MTCDetector.h:91
Double_t fiberMatThick
Definition: MTCDetector.h:86
Double_t fSciFiActiveY
Definition: MTCDetector.h:76
Double_t zAirGap
Definition: MTCDetector.h:96
Double_t fScintThick
Definition: MTCDetector.h:80
Double_t zLowerIronInt
Definition: MTCDetector.h:94
Double_t fZCenter
Definition: MTCDetector.h:83
void GetSiPMPosition(Int_t SiPMChan, TVector3 &A, TVector3 &B)
Int_t fLayers
Definition: MTCDetector.h:82
Double_t fFieldY
Definition: MTCDetector.h:84
Double_t fFiberRadius
Definition: MTCDetector.h:99
Double_t fSciFiActiveX
Definition: MTCDetector.h:75
std::map< Int_t, float > SiPMPos_U
inverse mapping
Definition: MTCDetector.h:115
Double_t zFiberMat2
Definition: MTCDetector.h:97
Int_t fNSiPMChan
Definition: MTCDetector.h:101
Double_t fFiberPitch
Definition: MTCDetector.h:88
Int_t fNMats
Definition: MTCDetector.h:106
Double_t airGap
Definition: MTCDetector.h:92
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > GetFibresMapU()
Definition: MTCDetector.h:56
Double_t zFiberMat1
Definition: MTCDetector.h:95
std::map< Int_t, float > SiPMPos_V
Definition: MTCDetector.h:115
std::map< Int_t, std::map< Int_t, std::array< float, 2 > > > siPMFibres_U
mapping of fibres to SiPM channels
Definition: MTCDetector.h:110
void GetPosition(Int_t fDetectorID, TVector3 &vLeft, TVector3 &vRight)