FairShip
Loading...
Searching...
No Matches
SiliconTarget Class Reference

#include <SiliconTarget.h>

Inheritance diagram for SiliconTarget:
[legend]
Collaboration diagram for SiliconTarget:
[legend]

Public Member Functions

 SiliconTarget (const char *name, Bool_t Active, const char *Title="")
 SiliconTarget ()
void SetSiliconTargetParameters (Double_t targetWidth, Double_t targetHeight, Double_t sensorWidth, Double_t sensorLength, Int_t nLayers, Double_t zPosition, Double_t targetThickness, Double_t targetSpacing, Double_t moduleOffset)
TGeoVolume * CreateSiliconPlanes (const char *name, Double_t sensorWidth, Double_t sensorLength, Double_t planeSpacing, TGeoMedium *material, Int_t layerId)
void ConstructGeometry () override
Bool_t ProcessHits (FairVolume *vol=nullptr) override
Public Member Functions inherited from SHiP::Detector< SiliconTargetPoint >
 Detector ()=default
 ~Detector () override=default
SiliconTargetPoint * AddHit (Args &&... args)
void Initialize () override
void Reset () override
void EndOfEvent () override
void Register () override
TClonesArray * GetCollection (Int_t iColl) const override
void UpdatePointTrackIndices (const std::vector< Int_t > &indexMap) override
 Update track indices in point collection after track filtering.
void SetSpecialPhysicsCuts () override
void FinishPrimary () override
void FinishRun () override
void BeginPrimary () override
void PostTrack () override
void PreTrack () override
void BeginEvent () override
void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset) override
Public Member Functions inherited from ISTLPointContainer
virtual ~ISTLPointContainer ()=default

Private Member Functions

 SiliconTarget (const SiliconTarget &)=delete
SiliconTarget & operator= (const SiliconTarget &)=delete

Private Attributes

Double_t fTargetWidth
Double_t fTargetHeight
Double_t fSensorWidth
Double_t fSensorLength
Int_t fLayers
Double_t fZPosition
Double_t fTargetThickness
Double_t fTargetSpacing
Double_t fModuleOffset

Additional Inherited Members

Protected Attributes inherited from SHiP::Detector< SiliconTargetPoint >
Int_t fEventID
Int_t fTrackID
 event index
Int_t fVolumeID
 track index
TLorentzVector fPos
 volume id
TLorentzVector fMom
 position at entrance
Double_t fTime
 momentum at entrance
Double_t fLength
 time
Double_t fELoss
 length
std::vector< SiliconTargetPoint > * fDetPoints
 energy loss
TGeoVolume * fDetector

Detailed Description

Definition at line 14 of file SiliconTarget.h.

Constructor & Destructor Documentation

◆ SiliconTarget() [1/3]

SiliconTarget::SiliconTarget ( const char * name,
Bool_t Active,
const char * Title = "" )

Definition at line 32 of file SiliconTarget.cxx.

34 : Detector(name, Active, kSiliconTarget) {}
@ kSiliconTarget

◆ SiliconTarget() [2/3]

SiliconTarget::SiliconTarget ( )

Definition at line 29 of file SiliconTarget.cxx.

30 : Detector("SiliconTarget", kTRUE, kSiliconTarget) {}

◆ SiliconTarget() [3/3]

SiliconTarget::SiliconTarget ( const SiliconTarget & )
privatedelete

Member Function Documentation

◆ ConstructGeometry()

void SiliconTarget::ConstructGeometry ( )
overridevirtual

Create the detector geometry

Implements SHiP::Detector< SiliconTargetPoint >.

Definition at line 104 of file SiliconTarget.cxx.

104 {
105 ShipGeo::InitMedium("tungstensifon");
106 TGeoMedium* tungsten = gGeoManager->GetMedium("tungstensifon");
107 ShipGeo::InitMedium("air");
108 TGeoMedium* air = gGeoManager->GetMedium("air");
109 ShipGeo::InitMedium("silicon");
110 TGeoMedium* Silicon = gGeoManager->GetMedium("silicon");
111
112 Double_t totalLength = fLayers * fTargetSpacing;
113
114 // --- Create an envelope volume for the detector (green, semi-transparent)
115 // ---
116 auto envBox = new TGeoBBox("SiliconTarget_env", fTargetWidth / 2.,
117 fTargetHeight / 2., totalLength / 2.);
118 auto envVol = new TGeoVolume("SiliconTarget", envBox, air);
119 envVol->SetLineColor(kGreen);
120 envVol->SetTransparency(50);
121
122 auto target = new TGeoBBox("Target", fTargetWidth / 2., fTargetHeight / 2.,
123 fTargetThickness / 2.);
124 auto targetVol = new TGeoVolume("TargetVol", target, tungsten);
125 targetVol->SetLineColor(kGray);
126 targetVol->SetTransparency(40);
127
128 for (Int_t i = 0; i < fLayers; i++) {
129 // Compute the center position (z) for the current W layer
130 Double_t zPos = -totalLength / 2 + i * fTargetSpacing;
131
132 // Place the tungsten layer
133 envVol->AddNode(targetVol, i,
134 new TGeoTranslation(0, 0, zPos + fTargetThickness / 2.));
135
136 TGeoVolume* siliconPlanes = CreateSiliconPlanes(
137 "TrackerPlane", fSensorWidth, fSensorLength,
138 fTargetSpacing - fTargetThickness - 2. * fModuleOffset, Silicon, i);
139 envVol->AddNode(
140 siliconPlanes, i,
141 new TGeoTranslation(0, 0, zPos + fTargetThickness + fModuleOffset));
142 }
143
144 // Finally, add the envelope to the top volume with the global z offset
145 // fZCenter
146 gGeoManager->GetTopVolume()->AddNode(envVol, 1,
147 new TGeoTranslation(0, 0, fZPosition));
148}
Double_t fModuleOffset
Double_t fSensorLength
Double_t fTargetWidth
Double_t fTargetHeight
Double_t fSensorWidth
Double_t fZPosition
Double_t fTargetSpacing
Double_t fTargetThickness
TGeoVolume * CreateSiliconPlanes(const char *name, Double_t sensorWidth, Double_t sensorLength, Double_t planeSpacing, TGeoMedium *material, Int_t layerId)
int i
Definition ShipAna.py:108
Int_t InitMedium(const char *name)
Definition ShipGeoUtil.h:22

◆ CreateSiliconPlanes()

TGeoVolume * SiliconTarget::CreateSiliconPlanes ( const char * name,
Double_t sensorWidth,
Double_t sensorLength,
Double_t planeSpacing,
TGeoMedium * material,
Int_t layerId )

Definition at line 51 of file SiliconTarget.cxx.

55 {
56 Double_t strip_pitch = 75.5 * um;
57 Int_t nRows = 2;
58 Int_t nCols = 4;
59 Int_t nPlanes = 2;
60
61 TGeoBBox* SensorShape =
62 new TGeoBBox("SensorShape", width / 2, length / 2, 0.3 * mm / 2);
63 TGeoVolume* SensorVolume =
64 new TGeoVolume("SensorVolume", SensorShape, silicon);
65 SensorVolume->SetLineColor(kRed);
66 SensorVolume->SetTransparency(40);
67
68 auto* Strips =
69 SensorVolume->Divide("SLICEX", 1, 1298, -width / 2, strip_pitch);
70 AddSensitiveVolume(Strips);
71
72 TGeoVolumeAssembly* trackingStation =
73 new TGeoVolumeAssembly("TrackingStation");
74 // Each tracking station consists of X and Y planes
75 for (Int_t plane = 0; plane < nPlanes; plane++) {
76 TGeoVolumeAssembly* trackerPlane = new TGeoVolumeAssembly("TrackerPlane");
77 // Each plane consists of 8 modules
78 for (Int_t column = 0; column < nCols; column++) {
79 for (Int_t row = 0; row < nRows; row++) {
80 Int_t sensor_id =
81 (layerId << 5) + (plane << 4) + (column << 2) + (row << 1);
82 // Add 1mm gap between sensors for realistic placement
83 trackerPlane->AddNode(
84 SensorVolume, sensor_id,
85 new TGeoTranslation(
86 (-1.5 * width - 2. * mm) + (column * width + column * 1 * mm),
87 (length / 2. + 0.5 * mm) - row * (length + 1. * mm), 0));
88 }
89 }
90 if (plane == 0) {
91 trackingStation->AddNode(trackerPlane, plane);
92 } else if (plane == 1) {
93 // Rotate the second plane by 90 degrees and translate such that the
94 // planes are evenly spaced.
95 trackingStation->AddNode(
96 trackerPlane, plane,
97 new TGeoCombiTrans(TGeoTranslation(0, 0, spacing),
98 TGeoRotation("y_rot", 0, 0, 90)));
99 }
100 }
101
102 return trackingStation;
103}
constexpr double um
Definition ShipUnit.h:26
constexpr double mm
Definition ShipUnit.h:25

◆ operator=()

SiliconTarget & SiliconTarget::operator= ( const SiliconTarget & )
privatedelete

◆ ProcessHits()

Bool_t SiliconTarget::ProcessHits ( FairVolume * vol = nullptr)
override

This method is called from the MC stepping

Definition at line 150 of file SiliconTarget.cxx.

150 {
152 // Set parameters at entrance of volume. Reset ELoss.
153 if (gMC->IsTrackEntering()) {
154 fELoss = 0.;
155 fTime = gMC->TrackTime() * 1.0e09;
156 fLength = gMC->TrackLength();
157 gMC->TrackPosition(fPos);
158 gMC->TrackMomentum(fMom);
159 }
160
161 // Sum energy loss for all steps in the active volume
162 fELoss += gMC->Edep();
163
164 // Create SiliconTargetPoint at exit of active volume
165 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
166 gMC->IsTrackDisappeared()) {
167 if (fELoss == 0.) {
168 return kFALSE;
169 }
170
171 TParticle* p = gMC->GetStack()->GetCurrentTrack();
172 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
173 Int_t pdgCode = p->GetPdgCode();
174 TLorentzVector Pos;
175 gMC->TrackPosition(Pos);
176 TLorentzVector Mom;
177 gMC->TrackMomentum(Mom);
178
179 Double_t xmean = (fPos.X() + Pos.X()) / 2.;
180 Double_t ymean = (fPos.Y() + Pos.Y()) / 2.;
181 Double_t zmean = (fPos.Z() + Pos.Z()) / 2.;
182
183 Int_t strip_id = 0;
184 Int_t sensor_id = 0;
185 gMC->CurrentVolID(strip_id);
186 gMC->CurrentVolOffID(1, sensor_id);
187 fVolumeID = (sensor_id << 12) + strip_id;
188
189 AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
190 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength, fELoss,
191 pdgCode);
192
193 ShipStack* stack = dynamic_cast<ShipStack*>(gMC->GetStack());
194 stack->AddPoint(kSiliconTarget);
195 }
196 return kTRUE;
197}
SiliconTargetPoint * AddHit(Args &&... args)
Definition Detector.h:38

◆ SetSiliconTargetParameters()

void SiliconTarget::SetSiliconTargetParameters ( Double_t targetWidth,
Double_t targetHeight,
Double_t sensorWidth,
Double_t sensorLength,
Int_t nLayers,
Double_t zPosition,
Double_t targetThickness,
Double_t targetSpacing,
Double_t moduleOffset )

Definition at line 36 of file SiliconTarget.cxx.

39 {
40 fTargetWidth = targetWidth;
41 fTargetHeight = targetHeight;
42 fSensorWidth = sensorWidth;
43 fSensorLength = sensorLength;
44 fLayers = nLayers;
45 fZPosition = zPosition;
46 fTargetThickness = targetThickness;
47 fTargetSpacing = targetSpacing;
48 fModuleOffset = moduleOffset;
49}

Member Data Documentation

◆ fLayers

Int_t SiliconTarget::fLayers
private

Definition at line 39 of file SiliconTarget.h.

◆ fModuleOffset

Double_t SiliconTarget::fModuleOffset
private

Definition at line 43 of file SiliconTarget.h.

◆ fSensorLength

Double_t SiliconTarget::fSensorLength
private

Definition at line 38 of file SiliconTarget.h.

◆ fSensorWidth

Double_t SiliconTarget::fSensorWidth
private

Definition at line 37 of file SiliconTarget.h.

◆ fTargetHeight

Double_t SiliconTarget::fTargetHeight
private

Definition at line 36 of file SiliconTarget.h.

◆ fTargetSpacing

Double_t SiliconTarget::fTargetSpacing
private

Definition at line 42 of file SiliconTarget.h.

◆ fTargetThickness

Double_t SiliconTarget::fTargetThickness
private

Definition at line 41 of file SiliconTarget.h.

◆ fTargetWidth

Double_t SiliconTarget::fTargetWidth
private

Definition at line 35 of file SiliconTarget.h.

◆ fZPosition

Double_t SiliconTarget::fZPosition
private

Definition at line 40 of file SiliconTarget.h.


The documentation for this class was generated from the following files: