14#include "TGeoCompositeShape.h"
15#include "TGeoManager.h"
16#include "TGeoMaterial.h"
17#include "TGeoMedium.h"
18#include "TGeoVolume.h"
23#include "FairVolume.h"
24#include "TVirtualMC.h"
36 Double_t targetWidth, Double_t targetHeight, Double_t sensorWidth,
37 Double_t sensorLength, Int_t nLayers, Double_t zPosition,
38 Double_t targetThickness, Double_t targetSpacing, Double_t moduleOffset) {
55 Double_t strip_pitch = 75.5 * um;
60 TGeoBBox* SensorShape =
61 new TGeoBBox(
"SensorShape", width / 2, length / 2, 0.3 *
mm / 2);
62 TGeoVolume* SensorVolume =
63 new TGeoVolume(
"SensorVolume", SensorShape, silicon);
64 SensorVolume->SetLineColor(kRed);
65 SensorVolume->SetTransparency(40);
68 SensorVolume->Divide(
"SLICEX", 1, 1298, -width / 2, strip_pitch);
69 AddSensitiveVolume(Strips);
71 TGeoVolumeAssembly* trackingStation =
72 new TGeoVolumeAssembly(
"TrackingStation");
74 for (Int_t plane = 0; plane < nPlanes; plane++) {
75 TGeoVolumeAssembly* trackerPlane =
new TGeoVolumeAssembly(
"TrackerPlane");
77 for (Int_t column = 0; column < nCols; column++) {
78 for (Int_t row = 0; row < nRows; row++) {
80 (layerId << 5) + (plane << 4) + (column << 2) + (row << 1);
82 trackerPlane->AddNode(
83 SensorVolume, sensor_id,
85 (-1.5 * width - 2. *
mm) + (column * width + column * 1 *
mm),
86 (length / 2. + 0.5 *
mm) - row * (length + 1. *
mm), 0));
90 trackingStation->AddNode(trackerPlane, plane);
91 }
else if (plane == 1) {
94 trackingStation->AddNode(
96 new TGeoCombiTrans(TGeoTranslation(0, 0, spacing),
97 TGeoRotation(
"y_rot", 0, 0, 90)));
101 return trackingStation;
105 TGeoMedium* tungsten = gGeoManager->GetMedium(
"tungstensifon");
107 TGeoMedium* air = gGeoManager->GetMedium(
"air");
109 TGeoMedium* Silicon = gGeoManager->GetMedium(
"silicon");
115 auto envBox =
new TGeoBBox(
"SiliconTarget_env",
fTargetWidth / 2.,
117 auto envVol =
new TGeoVolume(
"SiliconTarget", envBox, air);
118 envVol->SetLineColor(kGreen);
119 envVol->SetTransparency(50);
123 auto targetVol =
new TGeoVolume(
"TargetVol", target, tungsten);
124 targetVol->SetLineColor(kGray);
125 targetVol->SetTransparency(40);
127 for (Int_t i = 0; i <
fLayers; i++) {
132 envVol->AddNode(targetVol, i,
145 gGeoManager->GetTopVolume()->AddNode(envVol, 1,
152 if (gMC->IsTrackEntering()) {
154 fTime = gMC->TrackTime() * 1.0e09;
156 gMC->TrackPosition(
fPos);
157 gMC->TrackMomentum(
fMom);
164 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
165 gMC->IsTrackDisappeared()) {
170 TParticle* p = gMC->GetStack()->GetCurrentTrack();
171 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
172 Int_t pdgCode = p->GetPdgCode();
174 gMC->TrackPosition(Pos);
176 gMC->TrackMomentum(Mom);
178 Double_t xmean = (
fPos.X() + Pos.X()) / 2.;
179 Double_t ymean = (
fPos.Y() + Pos.Y()) / 2.;
180 Double_t zmean = (
fPos.Z() + Pos.Z()) / 2.;
184 gMC->CurrentVolID(strip_id);
185 gMC->CurrentVolOffID(1, sensor_id);
186 fVolumeID = (sensor_id << 12) + strip_id;
Int_t fTrackID
event index
Int_t fVolumeID
track index
TLorentzVector fPos
volume id
Double_t fTime
momentum at entrance
SiliconTargetPoint * AddHit(Args &&... args)
TLorentzVector fMom
position at entrance
Bool_t ProcessHits(FairVolume *vol=0) override
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)
Double_t fTargetThickness
TGeoVolume * CreateSiliconPlanes(const char *name, Double_t sensorWidth, Double_t sensorLength, Double_t planeSpacing, TGeoMedium *material, Int_t layerId)
void ConstructGeometry() override
Int_t InitMedium(const char *name)