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

#include <TargetTracker.h>

Inheritance diagram for TargetTracker:
Collaboration diagram for TargetTracker:

Public Member Functions

 TargetTracker (const char *name, Double_t TTX, Double_t TTY, Double_t TTZ, Bool_t Active, const char *Title="TargetTrackers")
 
 TargetTracker ()
 
void ConstructGeometry () override
 
void SetSciFiParam (Double_t scifimat_width_, Double_t scifimat_hor_, Double_t scifimat_vert_, Double_t scifimat_z_, Double_t support_z_, Double_t honeycomb_z_)
 
void SetNumberSciFi (Int_t n_hor_planes_, Int_t n_vert_planes_)
 
void SetTargetTrackerParam (Double_t TTX, Double_t TTY, Double_t TTZ)
 
void SetBrickParam (Double_t CellW)
 
void SetTotZDimension (Double_t Zdim)
 
void DecodeTTID (Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
 
void SetNumberTT (Int_t n)
 
void SetDesign (Int_t Design)
 
Bool_t ProcessHits (FairVolume *v=0) override
 
 TargetTracker (const TargetTracker &)=delete
 
TargetTrackeroperator= (const TargetTracker &)=delete
 
 ClassDefOverride (TargetTracker, 4)
 
- Public Member Functions inherited from SHiP::Detector< TTPoint >
 Detector ()=default
 
 Detector (const char *Name, Bool_t Active, Int_t detID)
 
 Detector (const char *Name, Bool_t Active)
 
 ~Detector () override=default
 
TTPointAddHit (Args &&... args)
 
void ConstructGeometry () override=0
 
void Initialize () override
 
void Reset () override
 
void EndOfEvent () override
 
void Register () override
 
TClonesArray * GetCollection (Int_t iColl) const override
 
void UpdatePointTrackIndices (const std::map< Int_t, 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 void UpdatePointTrackIndices (const std::map< Int_t, Int_t > &indexMap)=0
 Update track indices in point collection after track filtering.
 
virtual ~ISTLPointContainer ()=default
 

Protected Attributes

Double_t TTrackerX
 
Double_t TTrackerY
 
Double_t TTrackerZ
 
Double_t scifimat_width
 
Double_t scifimat_hor
 
Double_t scifimat_vert
 
Double_t scifimat_z
 
Double_t support_z
 
Double_t honeycomb_z
 
Int_t n_hor_planes
 
Int_t n_vert_planes
 
Double_t CellWidth
 
Double_t ZDimension
 
Int_t fNTT
 
Int_t fDesign
 
- Protected Attributes inherited from SHiP::Detector< TTPoint >
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< TTPoint > * fDetPoints
 energy loss
 
TGeoVolume * fDetector
 

Detailed Description

Definition at line 21 of file TargetTracker.h.

Constructor & Destructor Documentation

◆ TargetTracker() [1/3]

TargetTracker::TargetTracker ( const char *  name,
Double_t  TTX,
Double_t  TTY,
Double_t  TTZ,
Bool_t  Active,
const char *  Title = "TargetTrackers" 
)

Definition at line 60 of file TargetTracker.cxx.

62 : Detector(name, Active, ktauTT) {
63 TTrackerX = TTX;
64 TTrackerY = TTY;
65 TTrackerZ = TTZ;
66}
@ ktauTT
Double_t TTrackerX
Definition: TargetTracker.h:51
Double_t TTrackerY
Definition: TargetTracker.h:52
Double_t TTrackerZ
Definition: TargetTracker.h:53

◆ TargetTracker() [2/3]

TargetTracker::TargetTracker ( )

Definition at line 58 of file TargetTracker.cxx.

58: Detector("TargetTracker", kTRUE, ktauTT) {}

◆ TargetTracker() [3/3]

TargetTracker::TargetTracker ( const TargetTracker )
delete

Member Function Documentation

◆ ClassDefOverride()

TargetTracker::ClassDefOverride ( TargetTracker  ,
 
)

◆ ConstructGeometry()

void TargetTracker::ConstructGeometry ( )
overridevirtual

Create the detector geometry

Implements SHiP::Detector< TTPoint >.

Definition at line 100 of file TargetTracker.cxx.

100 {
101 ShipGeo::InitMedium("vacuum");
102 TGeoMedium* vacuum = gGeoManager->GetMedium("vacuum");
103
104 ShipGeo::InitMedium("CarbonComposite");
105 TGeoMedium* CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
106
107 ShipGeo::InitMedium("SciFiMat");
108 TGeoMedium* SciFiMat = gGeoManager->GetMedium("SciFiMat");
109
110 ShipGeo::InitMedium("Airex");
111 TGeoMedium* Airex = gGeoManager->GetMedium("Airex");
112
113 // Target Tracker
114 TGeoVolume* volTarget = gGeoManager->GetVolume("volTarget");
115
116 TGeoBBox* TT_box =
117 new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
118 TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
119 TT_volume->SetLineColor(kBlue - 1);
120 // TT_volume->SetTransparency(1);
121 TT_volume->SetVisibility(1);
122 TT_volume->SetVisDaughters(1);
123
124 // Support Carbon Composite
125 TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2,
126 TTrackerY / 2, support_z / 2);
127 TGeoVolume* TT_support_volume =
128 new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
129 TT_support_volume->SetLineColor(kGray - 2);
130 TT_support_volume->SetVisibility(1);
131
132 // Honeycomb Airex (or Nomex)
133 TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2,
134 TTrackerY / 2, honeycomb_z / 2);
135 TGeoVolume* TT_honeycomb_volume =
136 new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
137 TT_honeycomb_volume->SetLineColor(kYellow);
138 TT_honeycomb_volume->SetVisibility(1);
139
140 // SciFi planes
141 TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox(
142 "TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
143 TGeoVolume* TT_scifi_plane_hor_volume =
144 new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
145 TT_scifi_plane_hor_volume->SetVisibility(1);
146
147 TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox(
148 "TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
149 TGeoVolume* TT_scifi_plane_vert_volume =
150 new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
151 TT_scifi_plane_vert_volume->SetVisibility(1);
152
153 // SciFi mats for X and Y
154 TGeoBBox* TT_scifimat_hor_box =
155 new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2,
156 scifimat_z / 2);
157 TGeoVolume* TT_scifimat_hor_volume =
158 new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
159 TT_scifimat_hor_volume->SetLineColor(kCyan - 9);
160
161 TGeoBBox* TT_scifimat_vert_box =
162 new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2,
163 scifimat_vert / 2, scifimat_z / 2);
164 TGeoVolume* TT_scifimat_vert_volume =
165 new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
166 TT_scifimat_vert_volume->SetLineColor(kGreen - 7);
167
168 // Add SciFi mat as sensitive unit
169 AddSensitiveVolume(TT_scifimat_hor_volume);
170 AddSensitiveVolume(TT_scifimat_vert_volume);
171
172 // Creating physical volumes and multiply
173 for (int i = 0; i < n_hor_planes; i++) {
174 TT_scifi_plane_hor_volume->AddNode(
175 TT_scifimat_hor_volume, i + 1,
176 new TGeoTranslation(0, (-(n_hor_planes - 1) / 2.0 + i) * scifimat_width,
177 0));
178 }
179 for (int i = 0; i < n_vert_planes; i++) {
180 TT_scifi_plane_vert_volume->AddNode(
181 TT_scifimat_vert_volume, 100 + i + 1,
182 new TGeoTranslation((-(n_vert_planes - 1) / 2.0 + i) * scifimat_width,
183 0, 0));
184 }
185
186 TT_volume->AddNode(TT_support_volume, 0,
187 new TGeoTranslation(0, 0, -TTrackerZ / 2 + support_z / 2));
188 TT_volume->AddNode(
189 TT_scifi_plane_hor_volume, 0,
190 new TGeoTranslation(0, 0, -TTrackerZ / 2 + support_z + scifimat_z / 2));
191 TT_volume->AddNode(
192 TT_scifi_plane_vert_volume, 0,
193 new TGeoTranslation(
194 0, 0, -TTrackerZ / 2 + support_z + scifimat_z + scifimat_z / 2));
195 TT_volume->AddNode(
196 TT_honeycomb_volume, 0,
197 new TGeoTranslation(
198 0, 0, -TTrackerZ / 2 + support_z + 2 * scifimat_z + honeycomb_z / 2));
199 TT_volume->AddNode(
200 TT_support_volume, 1,
201 new TGeoTranslation(0, 0,
202 -TTrackerZ / 2 + support_z + 2 * scifimat_z +
203 honeycomb_z + support_z / 2));
204
205 Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
206
207 // fNTT - number of TT walls
208 for (int l = 0; l < fNTT; ++l) {
209 volTarget->AddNode(
210 TT_volume, 1000 * (l + 1),
211 new TGeoTranslation(0, 0,
212 first_tt_position + l * (TTrackerZ + CellWidth)));
213 }
214}
Double_t ZDimension
Definition: TargetTracker.h:65
Double_t support_z
Definition: TargetTracker.h:59
Int_t n_hor_planes
Definition: TargetTracker.h:61
Double_t scifimat_z
Definition: TargetTracker.h:58
Double_t scifimat_width
Definition: TargetTracker.h:55
Double_t scifimat_vert
Definition: TargetTracker.h:57
Double_t CellWidth
Definition: TargetTracker.h:64
Double_t honeycomb_z
Definition: TargetTracker.h:60
Int_t n_vert_planes
Definition: TargetTracker.h:62
Double_t scifimat_hor
Definition: TargetTracker.h:56
int i
Definition: ShipAna.py:97
Int_t InitMedium(const char *name)
Definition: ShipGeoUtil.h:20

◆ DecodeTTID()

void TargetTracker::DecodeTTID ( Int_t  detID,
Int_t &  NTT,
int &  nplane,
Bool_t &  ishor 
)

Definition at line 263 of file TargetTracker.cxx.

264 {
265 NTT = detID / 1000;
266 int idir = (detID - NTT * 1000) / 100;
267
268 if (idir == 1)
269 ishor = kFALSE;
270 else if (idir == 0)
271 ishor = kTRUE;
272
273 nplane = (detID - NTT * 1000 - idir * 100);
274}

◆ operator=()

TargetTracker & TargetTracker::operator= ( const TargetTracker )
delete

◆ ProcessHits()

Bool_t TargetTracker::ProcessHits ( FairVolume *  v = 0)
override

this method is called for each step during simulation (see FairMCApplication::Stepping())

This method is called from the MC stepping

Definition at line 216 of file TargetTracker.cxx.

216 {
218 // Set parameters at entrance of volume. Reset ELoss.
219 if (gMC->IsTrackEntering()) {
220 fELoss = 0.;
221 fTime = gMC->TrackTime() * 1.0e09;
222 fLength = gMC->TrackLength();
223 gMC->TrackPosition(fPos);
224 gMC->TrackMomentum(fMom);
225 }
226 // Sum energy loss for all steps in the active volume
227 fELoss += gMC->Edep();
228
229 // Create TTPoint at exit of active volume
230 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
231 gMC->IsTrackDisappeared()) {
232 if (fELoss == 0.) {
233 return kFALSE;
234 }
235 TParticle* p = gMC->GetStack()->GetCurrentTrack();
236 Int_t pdgCode = p->GetPdgCode();
237 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
238
239 gMC->CurrentVolID(fVolumeID);
240 Int_t detID = fVolumeID;
241 Int_t TTstationID;
242 gMC->CurrentVolOffID(2, TTstationID);
243 fVolumeID = TTstationID + detID;
244
245 TLorentzVector Pos;
246 gMC->TrackPosition(Pos);
247 Double_t xmean = (fPos.X() + Pos.X()) / 2.;
248 Double_t ymean = (fPos.Y() + Pos.Y()) / 2.;
249 Double_t zmean = (fPos.Z() + Pos.Z()) / 2.;
250
251 AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
252 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength, fELoss,
253 pdgCode);
254
255 // Increment number of muon det points in TParticle
256 ShipStack* stack = dynamic_cast<ShipStack*>(gMC->GetStack());
257 stack->AddPoint(ktauTT);
258 }
259
260 return kTRUE;
261}
Int_t fTrackID
event index
Definition: Detector.h:85
Int_t fVolumeID
track index
Definition: Detector.h:86
TLorentzVector fPos
volume id
Definition: Detector.h:87
Double_t fTime
momentum at entrance
Definition: Detector.h:89
Double_t fELoss
length
Definition: Detector.h:91
TTPoint * AddHit(Args &&... args)
Definition: Detector.h:38
TLorentzVector fMom
position at entrance
Definition: Detector.h:88
Double_t fLength
time
Definition: Detector.h:90
ROOT p
Definition: makeDecay.py:76

◆ SetBrickParam()

void TargetTracker::SetBrickParam ( Double_t  CellW)

Definition at line 92 of file TargetTracker.cxx.

92{ CellWidth = CellW; }

◆ SetDesign()

void TargetTracker::SetDesign ( Int_t  Design)

Definition at line 98 of file TargetTracker.cxx.

98{ fDesign = Design; }

◆ SetNumberSciFi()

void TargetTracker::SetNumberSciFi ( Int_t  n_hor_planes_,
Int_t  n_vert_planes_ 
)

Definition at line 80 of file TargetTracker.cxx.

80 {
81 n_hor_planes = n_hor_planes_;
82 n_vert_planes = n_vert_planes_;
83}

◆ SetNumberTT()

void TargetTracker::SetNumberTT ( Int_t  n)

Definition at line 96 of file TargetTracker.cxx.

96{ fNTT = n; }

◆ SetSciFiParam()

void TargetTracker::SetSciFiParam ( Double_t  scifimat_width_,
Double_t  scifimat_hor_,
Double_t  scifimat_vert_,
Double_t  scifimat_z_,
Double_t  support_z_,
Double_t  honeycomb_z_ 
)

Definition at line 68 of file TargetTracker.cxx.

71 {
72 scifimat_width = scifimat_width_;
73 scifimat_hor = scifimat_hor_;
74 scifimat_vert = scifimat_vert_;
75 scifimat_z = scifimat_z_;
76 support_z = support_z_;
77 honeycomb_z = honeycomb_z_;
78}

◆ SetTargetTrackerParam()

void TargetTracker::SetTargetTrackerParam ( Double_t  TTX,
Double_t  TTY,
Double_t  TTZ 
)

Definition at line 85 of file TargetTracker.cxx.

86 {
87 TTrackerX = TTX;
88 TTrackerY = TTY;
89 TTrackerZ = TTZ;
90}

◆ SetTotZDimension()

void TargetTracker::SetTotZDimension ( Double_t  Zdim)

Definition at line 94 of file TargetTracker.cxx.

94{ ZDimension = Zdim; }

Member Data Documentation

◆ CellWidth

Double_t TargetTracker::CellWidth
protected

Definition at line 64 of file TargetTracker.h.

◆ fDesign

Int_t TargetTracker::fDesign
protected

Definition at line 69 of file TargetTracker.h.

◆ fNTT

Int_t TargetTracker::fNTT
protected

Definition at line 67 of file TargetTracker.h.

◆ honeycomb_z

Double_t TargetTracker::honeycomb_z
protected

Definition at line 60 of file TargetTracker.h.

◆ n_hor_planes

Int_t TargetTracker::n_hor_planes
protected

Definition at line 61 of file TargetTracker.h.

◆ n_vert_planes

Int_t TargetTracker::n_vert_planes
protected

Definition at line 62 of file TargetTracker.h.

◆ scifimat_hor

Double_t TargetTracker::scifimat_hor
protected

Definition at line 56 of file TargetTracker.h.

◆ scifimat_vert

Double_t TargetTracker::scifimat_vert
protected

Definition at line 57 of file TargetTracker.h.

◆ scifimat_width

Double_t TargetTracker::scifimat_width
protected

Definition at line 55 of file TargetTracker.h.

◆ scifimat_z

Double_t TargetTracker::scifimat_z
protected

Definition at line 58 of file TargetTracker.h.

◆ support_z

Double_t TargetTracker::support_z
protected

Definition at line 59 of file TargetTracker.h.

◆ TTrackerX

Double_t TargetTracker::TTrackerX
protected

Definition at line 51 of file TargetTracker.h.

◆ TTrackerY

Double_t TargetTracker::TTrackerY
protected

Definition at line 52 of file TargetTracker.h.

◆ TTrackerZ

Double_t TargetTracker::TTrackerZ
protected

Definition at line 53 of file TargetTracker.h.

◆ ZDimension

Double_t TargetTracker::ZDimension
protected

Definition at line 65 of file TargetTracker.h.


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