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

#include <strawtubes.h>

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

Public Member Functions

 strawtubes (const char *Name, Bool_t Active)
 strawtubes (std::string medium)
 strawtubes ()
Bool_t ProcessHits (FairVolume *v=nullptr) override
void SetzPositions (Double_t z1, Double_t z2, Double_t z3, Double_t z4)
void SetApertureArea (Double_t width, Double_t height)
void SetStrawDiameter (Double_t outer_straw_diameter, Double_t wall_thickness)
void SetStrawPitch (Double_t straw_pitch, Double_t layer_offset)
void SetDeltazLayer (Double_t delta_z_layer)
void SetStereoAngle (Double_t stereo_angle)
void SetWireThickness (Double_t wire_thickness)
void SetFrameMaterial (TString frame_material)
void SetDeltazView (Double_t delta_z_view)
void SetStationEnvelope (Double_t x, Double_t y, Double_t z)
void SetStrawResolution (Double_t a, Double_t b)
Double_t StrawVdrift ()
Double_t StrawSigmaSpatial ()
void ConstructGeometry () override
Public Member Functions inherited from SHiP::Detector< strawtubesPoint >
 Detector ()=default
 ~Detector () override=default
strawtubesPoint * 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

Static Public Member Functions

static std::array< Int_t, 4 > StrawDecode (Int_t detID)
static void StrawEndPoints (Int_t detID, TVector3 &bot, TVector3 &top)

Private Member Functions

 strawtubes (const strawtubes &)=delete
 vacuum box medium
strawtubes & operator= (const strawtubes &)=delete

Private Attributes

Double_t f_T1_z
Double_t f_T2_z
 z-position of tracking station 1
Double_t f_T3_z
 z-position of tracking station 2
Double_t f_T4_z
 z-position of tracking station 3
Double_t f_aperture_width
 z-position of tracking station 4
Double_t f_aperture_height
 Aperture width (x).
Double_t f_inner_straw_diameter
 Aperture height (y).
Double_t f_outer_straw_diameter
 Inner Straw diameter.
Double_t f_straw_pitch
 Outer Straw diameter.
Double_t f_offset_layer
 Distance (y) between straws in a layer.
Double_t f_delta_z_layer
 Offset (y) of straws between layers.
Double_t f_view_angle
 Distance (z) between layers.
Double_t f_wire_thickness
 Stereo view angle.
TString f_frame_material
 Sense wire thickness.
Double_t f_delta_z_view
 Structure frame material.
Double_t f_station_width
 Distance (z) between stereo views.
Double_t f_station_height
 Station envelope width (x).
Double_t f_station_length
 Station envelope height (y).
Double_t v_drift
 Station envelope length (z).
Double_t sigma_spatial
 drift velocity
std::string fMedium
 spatial resolution

Additional Inherited Members

Protected Attributes inherited from SHiP::Detector< strawtubesPoint >
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< strawtubesPoint > * fDetPoints
 energy loss
TGeoVolume * fDetector

Detailed Description

Definition at line 19 of file strawtubes.h.

Constructor & Destructor Documentation

◆ strawtubes() [1/4]

strawtubes::strawtubes ( const char * Name,
Bool_t Active )

Name : Detector Name Active: kTRUE for active detectors (ProcessHits() will be called) kFALSE for inactive detectors

Definition at line 52 of file strawtubes.cxx.

53 : Detector(name, active, kStraw) {}
@ kStraw

◆ strawtubes() [2/4]

strawtubes::strawtubes ( std::string medium)
explicit

Definition at line 49 of file strawtubes.cxx.

50 : Detector("strawtubes", kTRUE, kStraw), fMedium(std::move(medium)) {}
std::string fMedium
spatial resolution
Definition strawtubes.h:84

◆ strawtubes() [3/4]

strawtubes::strawtubes ( )

default constructor

Definition at line 46 of file strawtubes.cxx.

47 : Detector("strawtubes", kTRUE, kStraw), fMedium("air") {}

◆ strawtubes() [4/4]

strawtubes::strawtubes ( const strawtubes & )
privatedelete

vacuum box medium

container for data points

Member Function Documentation

◆ ConstructGeometry()

void strawtubes::ConstructGeometry ( )
overridevirtual

Create the detector geometry

If you are using the standard ASCII input for the geometry just copy this and use it for your detector, otherwise you can implement here you own way of constructing the geometry.

Implements SHiP::Detector< strawtubesPoint >.

Definition at line 189 of file strawtubes.cxx.

189 {
193
194 TGeoVolume* top = gGeoManager->GetTopVolume();
195 ShipGeo::InitMedium("mylar");
196 TGeoMedium* mylar = gGeoManager->GetMedium("mylar");
197 ShipGeo::InitMedium("STTmix8020_1bar");
198 TGeoMedium* sttmix8020_1bar = gGeoManager->GetMedium("STTmix8020_1bar");
199 ShipGeo::InitMedium("tungsten");
200 TGeoMedium* tungsten = gGeoManager->GetMedium("tungsten");
202 TGeoMedium* FrameMatPtr = gGeoManager->GetMedium(f_frame_material);
204 TGeoMedium* med = gGeoManager->GetMedium(fMedium.c_str());
205
206 gGeoManager->SetVisLevel(4);
207 gGeoManager->SetTopVisible();
208
209 // Epsilon to avoid overlapping volumes
210 Double_t eps = 0.0001;
211 // Straw (half) length
212 Double_t straw_length = f_aperture_width + 2. * eps;
213 // Width of frame: standard HEA 500 I-beam width
214 Double_t frame_width = 49.;
215 // Offset due to floor space limitation
216 Double_t floor_offset = 14.;
217
218 Double_t rmin, rmax, T_station_z;
219
220 // Arguments of boxes are half-lengths
221 [[maybe_unused]] TGeoBBox* detbox1 = new TGeoBBox(
222 "detbox1", f_aperture_width + frame_width,
223 f_aperture_height + frame_width - floor_offset / 2., f_station_length);
224 [[maybe_unused]] TGeoBBox* detbox2 = new TGeoBBox(
225 "detbox2", straw_length + eps,
227 TMath::Tan(f_view_angle * TMath::Pi() / 180.0) * straw_length * 2 +
228 f_offset_layer / TMath::Cos(f_view_angle * TMath::Pi() / 180.0) + eps,
229 f_station_length + eps);
230 TGeoTranslation* move_up =
231 new TGeoTranslation("move_up", 0, floor_offset / 2., 0);
232 move_up->RegisterYourself();
233
234 // Composite shape to create frame
235 TGeoCompositeShape* detcomp1 =
236 new TGeoCompositeShape("detcomp1", "(detbox1:move_up)-detbox2");
237
238 // Volume: straw
239 rmin = f_inner_straw_diameter / 2.;
240 rmax = f_outer_straw_diameter / 2.;
241 // Third argument is half-length of tube
242 TGeoTube* straw_tube = new TGeoTube("straw", rmin, rmax, straw_length);
243 TGeoVolume* straw = new TGeoVolume("straw", straw_tube, mylar);
244 straw->SetLineColor(4);
245 straw->SetVisibility(kTRUE);
246
247 // Volume: gas
248 rmin = f_wire_thickness / 2. + eps;
249 rmax = f_inner_straw_diameter / 2. - eps;
250 TGeoTube* gas_tube = new TGeoTube("gas", rmin, rmax, straw_length - 2. * eps);
251 TGeoVolume* gas = new TGeoVolume("gas", gas_tube, sttmix8020_1bar);
252 gas->SetLineColor(5);
253 // Only the gas is sensitive
254 AddSensitiveVolume(gas);
255
256 // Volume: wire
257 rmin = 0.;
258 rmax = f_wire_thickness / 2.;
259 TGeoTube* wire_tube =
260 new TGeoTube("wire", rmin, rmax, straw_length - 4. * eps);
261 TGeoVolume* wire = new TGeoVolume("wire", wire_tube, tungsten);
262 wire->SetLineColor(6);
263
264 // Tracking stations
265 // statnb = station number; vnb = view number; lnb = layer number; snb = straw
266 // number
267
268 // Station box to contain all components
269 TGeoBBox* statbox =
270 new TGeoBBox("statbox", f_station_width,
271 f_station_height - floor_offset / 2., f_station_length);
272
273 f_frame_material.ToLower();
274
275 for (Int_t statnb = 1; statnb < 5; statnb++) {
276 // Tracking station loop
277 TString nmstation = "Tr";
278 std::stringstream ss;
279 ss << statnb;
280 nmstation = nmstation + ss.str();
281 switch (statnb) {
282 case 1:
283 T_station_z = f_T1_z;
284 break;
285 case 2:
286 T_station_z = f_T2_z;
287 break;
288 case 3:
289 T_station_z = f_T3_z;
290 break;
291 case 4:
292 T_station_z = f_T4_z;
293 break;
294 default:
295 T_station_z = f_T1_z;
296 }
297
298 TGeoVolume* vol = new TGeoVolume(nmstation, statbox, med);
299 // z-translate the station to its (absolute) position
300 top->AddNode(vol, statnb,
301 new TGeoTranslation(0, floor_offset / 2., T_station_z));
302
303 TGeoVolume* statframe =
304 new TGeoVolume(nmstation + "_frame", detcomp1, FrameMatPtr);
305 vol->AddNode(statframe, statnb * 1e6,
306 new TGeoTranslation(0, -floor_offset / 2., 0));
307 statframe->SetLineColor(kRed);
308
309 for (Int_t vnb = 0; vnb < 4; vnb++) {
310 // View loop
311 const Double_t angle = [&] {
312 switch (vnb) {
313 case 1:
314 return f_view_angle;
315 case 2:
316 return -f_view_angle;
317 default:
318 return 0.;
319 }
320 }();
321 const TString nmview = [&] {
322 switch (vnb) {
323 case 0:
324 return nmstation + "_y1";
325 case 1:
326 return nmstation + "_u";
327 case 2:
328 return nmstation + "_v";
329 case 3:
330 return nmstation + "_y2";
331 default:
332 return nmstation + "_y1";
333 }
334 }();
335
336 // Adjustments in the stereo views
337 // stereo_growth: extension of stereo views beyond aperture
338 // stereo_pitch: straw pitch in stereo views
339 // offset_layer: layer offset in stereo views
340 // straws_per_layer: number of straws in one layer with stereo extension
341 // If angle == 0., all numbers return the case of non-stereo views.
342 const Double_t stereo_growth =
343 TMath::Tan(TMath::Abs(angle) * TMath::Pi() / 180.0) * straw_length;
344 const Double_t stereo_pitch =
345 f_straw_pitch / TMath::Cos(TMath::Abs(angle) * TMath::Pi() / 180.0);
346 const Double_t offset_layer =
347 f_offset_layer / TMath::Cos(TMath::Abs(angle) * TMath::Pi() / 180.0);
348 const Int_t straws_per_layer =
349 std::ceil(2 * (f_aperture_height + stereo_growth) / stereo_pitch);
350
351 for (Int_t lnb = 0; lnb < 2; lnb++) {
352 // Layer loop
353 TString nmlayer = nmview + "_layer_";
354 nmlayer += lnb;
355 TGeoBBox* layer = new TGeoBBox(
356 "layer box", straw_length + eps / 4,
357 f_aperture_height + stereo_growth * 2 + offset_layer + eps / 4,
358 f_outer_straw_diameter / 2. + eps / 4);
359 TGeoVolume* layerbox = new TGeoVolume(nmlayer, layer, med);
360
361 // The layer box sits in the viewframe.
362 // Hence, z-translate the layer w.r.t. the view
363 vol->AddNode(
364 layerbox, statnb * 1e6 + vnb * 1e5 + lnb * 1e4,
365 new TGeoTranslation(0, -floor_offset / 2.,
366 (vnb - 3. / 2.) * f_delta_z_view +
367 (lnb - 1. / 2.) * f_delta_z_layer));
368
369 TGeoRotation r6s;
370 TGeoTranslation t6s;
371 for (Int_t snb = 1; snb <= straws_per_layer; snb++) {
372 // Straw loop
373 // y-translate the straw to its position
374 t6s.SetTranslation(0,
375 f_aperture_height + stereo_growth -
376 (snb - 1. / 2.) * stereo_pitch +
377 lnb * offset_layer,
378 0);
379 // Rotate the straw with stereo angle
380 r6s.SetAngles(90 + angle, 90, 0);
381 TGeoCombiTrans c6s(t6s, r6s);
382 TGeoHMatrix* h6s = new TGeoHMatrix(c6s);
383 layerbox->AddNode(
384 straw, statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 1e3 + snb, h6s);
385 layerbox->AddNode(
386 gas, statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 2e3 + snb, h6s);
387 layerbox->AddNode(
388 wire, statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 3e3 + snb, h6s);
389 // End of straw loop
390 }
391
392 if (lnb == 1) {
393 // Add one more straw at the bottom of the second layer to cover
394 // aperture entirely
395 t6s.SetTranslation(0,
396 f_aperture_height + stereo_growth -
397 (straws_per_layer - 1. / 2.) * stereo_pitch -
398 lnb * offset_layer,
399 0);
400 r6s.SetAngles(90 + angle, 90, 0);
401 TGeoCombiTrans c6s(t6s, r6s);
402 TGeoHMatrix* h6s = new TGeoHMatrix(c6s);
403 layerbox->AddNode(
404 straw,
405 statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 1e3 + straws_per_layer + 1,
406 h6s);
407 layerbox->AddNode(
408 gas,
409 statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 2e3 + straws_per_layer + 1,
410 h6s);
411 layerbox->AddNode(
412 wire,
413 statnb * 1e6 + vnb * 1e5 + lnb * 1e4 + 3e3 + straws_per_layer + 1,
414 h6s);
415 }
416 // End of layer loop
417 }
418 // End of view loop
419 }
420 // End of tracking station loop
421 }
422}
Double_t f_aperture_width
z-position of tracking station 4
Definition strawtubes.h:68
Double_t f_inner_straw_diameter
Aperture height (y).
Definition strawtubes.h:70
Double_t f_station_length
Station envelope height (y).
Definition strawtubes.h:81
Double_t f_wire_thickness
Stereo view angle.
Definition strawtubes.h:76
Double_t f_T2_z
z-position of tracking station 1
Definition strawtubes.h:65
TString f_frame_material
Sense wire thickness.
Definition strawtubes.h:77
Double_t f_straw_pitch
Outer Straw diameter.
Definition strawtubes.h:72
Double_t f_T3_z
z-position of tracking station 2
Definition strawtubes.h:66
Double_t f_aperture_height
Aperture width (x).
Definition strawtubes.h:69
Double_t f_delta_z_view
Structure frame material.
Definition strawtubes.h:78
Double_t f_station_height
Station envelope width (x).
Definition strawtubes.h:80
Double_t f_T1_z
Definition strawtubes.h:64
Double_t f_view_angle
Distance (z) between layers.
Definition strawtubes.h:75
Double_t f_outer_straw_diameter
Inner Straw diameter.
Definition strawtubes.h:71
Double_t f_station_width
Distance (z) between stereo views.
Definition strawtubes.h:79
Double_t f_offset_layer
Distance (y) between straws in a layer.
Definition strawtubes.h:73
Double_t f_T4_z
z-position of tracking station 3
Definition strawtubes.h:67
Double_t f_delta_z_layer
Offset (y) of straws between layers.
Definition strawtubes.h:74
Int_t InitMedium(const char *name)
Definition ShipGeoUtil.h:22

◆ operator=()

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

◆ ProcessHits()

Bool_t strawtubes::ProcessHits ( FairVolume * v = nullptr)
override

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

This method is called from the MC stepping

Definition at line 55 of file strawtubes.cxx.

55 {
57 // Set parameters at entrance of volume. Reset ELoss.
58 if (gMC->IsTrackEntering()) {
59 fELoss = 0.;
60 fTime = gMC->TrackTime() * 1.0e09;
61 fLength = gMC->TrackLength();
62 gMC->TrackPosition(fPos);
63 gMC->TrackMomentum(fMom);
64 // Reset the "already recorded" marker so a later traversal of the same
65 // straw (curling track, next track/event) is not silently dropped.
66 fVolumeID = -1;
67 }
68 // Sum energy loss for all steps in the active volume
69 fELoss += gMC->Edep();
70
71 // Create strawtubesPoint at exit of active volume
72 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
73 gMC->IsTrackDisappeared()) {
74 if (fELoss == 0.) {
75 return kFALSE;
76 }
77 TParticle* p = gMC->GetStack()->GetCurrentTrack();
78 Int_t pdgCode = p->GetPdgCode();
79 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
80 fEventID = gMC->CurrentEvent();
81 Int_t straw_uniqueId;
82 gMC->CurrentVolID(straw_uniqueId);
83 if (fVolumeID == straw_uniqueId) {
84 // std::cout << pdgCode<< " same volume again ? "<< straw_uniqueId << "
85 // exit:" << gMC->IsTrackExiting() << " stop:" << gMC->IsTrackStop() << "
86 // disappeared:" << gMC->IsTrackDisappeared()<< std::endl;
87 return kTRUE;
88 }
89 fVolumeID = straw_uniqueId;
90 // # d = |pq . u x v|/|u x v|
91 TVector3 bot, top;
92 StrawEndPoints(straw_uniqueId, bot, top);
93 TLorentzVector Pos;
94 gMC->TrackPosition(Pos);
95 Double_t xmean = (fPos.X() + Pos.X()) / 2.;
96 Double_t ymean = (fPos.Y() + Pos.Y()) / 2.;
97 Double_t zmean = (fPos.Z() + Pos.Z()) / 2.;
98 TVector3 pq = TVector3(top.x() - xmean, top.y() - ymean, top.z() - zmean);
99 TVector3 u =
100 TVector3(bot.x() - top.x(), bot.y() - top.y(), bot.z() - top.z());
101 TVector3 v =
102 TVector3(fPos.X() - Pos.X(), fPos.Y() - Pos.Y(), fPos.Z() - Pos.Z());
103 TVector3 uCrossv = u.Cross(v);
104 Double_t dist2Wire = fabs(pq.Dot(uCrossv)) / (uCrossv.Mag() + 1E-8);
105 Double_t deltaTrackLength = gMC->TrackLength() - fLength;
106 AddHit(fEventID, fTrackID, straw_uniqueId, TVector3(xmean, ymean, zmean),
107 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, deltaTrackLength,
108 fELoss, pdgCode, dist2Wire);
109 if (dist2Wire > f_inner_straw_diameter / 2) {
110 std::cout << "addhit " << dist2Wire << " straw id " << straw_uniqueId
111 << " pdgcode " << pdgCode << " dot prod " << pq.Dot(uCrossv)
112 << std::endl;
113 std::cout << " exit:" << gMC->IsTrackExiting()
114 << " stop:" << gMC->IsTrackStop()
115 << " disappeared:" << gMC->IsTrackDisappeared() << std::endl;
116 std::cout << " entry:" << fPos.X() << " " << fPos.Y() << " " << fPos.Z()
117 << std::endl;
118 std::cout << " exit:" << Pos.X() << " " << Pos.Y() << " " << Pos.Z()
119 << std::endl;
120 std::cout << " mean:" << xmean << " " << ymean << " " << zmean
121 << std::endl;
122 std::cout << " bot:" << bot.x() << " " << bot.y() << " " << bot.z()
123 << std::endl;
124 std::cout << " top:" << top.x() << " " << top.y() << " " << top.z()
125 << std::endl;
126 pq.Print();
127 u.Print();
128 v.Print();
129 uCrossv.Print();
130 }
131 // Increment number of strawtubes det points in TParticle
132 ShipStack* stack = dynamic_cast<ShipStack*>(gMC->GetStack());
133 stack->AddPoint(kStraw);
134 }
135 return kTRUE;
136}
strawtubesPoint * AddHit(Args &&... args)
Definition Detector.h:38
static void StrawEndPoints(Int_t detID, TVector3 &bot, TVector3 &top)

◆ SetApertureArea()

void strawtubes::SetApertureArea ( Double_t width,
Double_t height )

Aperture width (x)

Aperture height (y)

Definition at line 146 of file strawtubes.cxx.

146 {
148 f_aperture_height = height;
149}
width(particle)
Definition rpvsusy.py:91

◆ SetDeltazLayer()

void strawtubes::SetDeltazLayer ( Double_t delta_z_layer)

Distance (z) between layers

Definition at line 163 of file strawtubes.cxx.

163 {
164 f_delta_z_layer = delta_z_layer;
165}

◆ SetDeltazView()

void strawtubes::SetDeltazView ( Double_t delta_z_view)

Distance (z) between stereo views

Definition at line 175 of file strawtubes.cxx.

175 {
176 f_delta_z_view = delta_z_view;
177}

◆ SetFrameMaterial()

void strawtubes::SetFrameMaterial ( TString frame_material)

Structure frame material

Definition at line 179 of file strawtubes.cxx.

179 {
180 f_frame_material = std::move(frame_material);
181}

◆ SetStationEnvelope()

void strawtubes::SetStationEnvelope ( Double_t x,
Double_t y,
Double_t z )

Station envelope width (x)

Station envelope height (y)

Station envelope length (z)

Definition at line 183 of file strawtubes.cxx.

◆ SetStereoAngle()

void strawtubes::SetStereoAngle ( Double_t stereo_angle)

Stereo view angle

Definition at line 167 of file strawtubes.cxx.

167 {
168 f_view_angle = stereo_angle;
169}

◆ SetStrawDiameter()

void strawtubes::SetStrawDiameter ( Double_t outer_straw_diameter,
Double_t wall_thickness )

Outer straw diameter

Inner straw diameter

Definition at line 151 of file strawtubes.cxx.

152 {
153 f_outer_straw_diameter = outer_straw_diameter;
155 outer_straw_diameter - 2 * wall_thickness;
156}

◆ SetStrawPitch()

void strawtubes::SetStrawPitch ( Double_t straw_pitch,
Double_t layer_offset )

Distance (y) between straws in a layer

Offset (y) of straws between layers

Definition at line 158 of file strawtubes.cxx.

158 {
159 f_straw_pitch = straw_pitch;
160 f_offset_layer = layer_offset;
161}

◆ SetStrawResolution()

void strawtubes::SetStrawResolution ( Double_t a,
Double_t b )
inline

Definition at line 50 of file strawtubes.h.

50 {
51 v_drift = a;
52 sigma_spatial = b;
53 }
Double_t v_drift
Station envelope length (z).
Definition strawtubes.h:82
Double_t sigma_spatial
drift velocity
Definition strawtubes.h:83

◆ SetWireThickness()

void strawtubes::SetWireThickness ( Double_t wire_thickness)

Sense wire thickness

Definition at line 171 of file strawtubes.cxx.

171 {
172 f_wire_thickness = wire_thickness;
173}

◆ SetzPositions()

void strawtubes::SetzPositions ( Double_t z1,
Double_t z2,
Double_t z3,
Double_t z4 )

z-position of tracking station 1

z-position of tracking station 2

z-position of tracking station 3

z-position of tracking station 4

Definition at line 138 of file strawtubes.cxx.

139 {
140 f_T1_z = z1;
141 f_T2_z = z2;
142 f_T3_z = z3;
143 f_T4_z = z4;
144}

◆ StrawDecode()

std::array< Int_t, 4 > strawtubes::StrawDecode ( Int_t detID)
static

Definition at line 426 of file strawtubes.cxx.

426 {
427 Int_t statnb, vnb, lnb, snb;
428 statnb = detID / 1e6;
429 vnb = (detID - statnb * 1e6) / 1e5;
430 lnb = (detID - statnb * 1e6 - vnb * 1e5) / 1e4;
431 snb = detID - statnb * 1e6 - vnb * 1e5 - lnb * 1e4 - 2e3;
432
433 if (statnb < 1 || statnb > 4 || vnb < 0 || vnb > 3 || lnb < 0 || lnb > 1 ||
434 snb < 1 || snb > 317) {
435 LOG(warning) << "Invalid strawtubes detID:";
436 LOG(warning) << detID << " -> station: " << statnb << ", view: " << vnb
437 << ", layer: " << lnb << ", straw: " << snb;
438 LOG(warning) << "strawtubes detID is 7-digit!";
439 return {0, -1, -1, 0};
440 } else {
441 return {statnb, vnb, lnb, snb};
442 }
443}

◆ StrawEndPoints()

void strawtubes::StrawEndPoints ( Int_t detID,
TVector3 & bot,
TVector3 & top )
static

Definition at line 448 of file strawtubes.cxx.

451{
452 // The geometry is fixed, so cache the endpoints per detID; TGeo navigation
453 // is expensive in the stepping and digitisation hot paths.
454 static std::unordered_map<Int_t, std::pair<TVector3, TVector3>> endPointCache;
455 if (auto it = endPointCache.find(fDetectorID); it != endPointCache.end()) {
456 vbot = it->second.first;
457 vtop = it->second.second;
458 return;
459 }
460 const auto [statnb, vnb, lnb, snb] = StrawDecode(fDetectorID);
461 TString stat = "Tr";
462 stat += statnb;
463 stat += "_";
464 stat += statnb;
465 const TString view = [&] {
466 switch (vnb) {
467 case 1:
468 return TString("_u");
469 case 2:
470 return TString("_v");
471 case 3:
472 return TString("_y2");
473 default:
474 return TString("_y1");
475 }
476 }();
477 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
478 TString prefix = "Tr";
479 prefix += statnb;
480 prefix += view;
481 prefix += "_";
482 TString layer = prefix + "layer_";
483 layer += lnb;
484 layer += "_";
485 layer += statnb;
486 layer += vnb;
487 layer += lnb;
488 layer += "0000";
489 TString wire = "wire_";
490 wire += fDetectorID + 1e3;
491 TString path = "/";
492 path += stat;
493 path += "/";
494 path += layer;
495 path += "/";
496 path += wire;
497 Bool_t rc = nav->cd(path);
498 if (!rc) {
499 LOG(warning) << "strawtubes::StrawDecode, TGeoNavigator failed" << path;
500 return;
501 }
502 TGeoNode* W = nav->GetCurrentNode();
503 TGeoTube* S = dynamic_cast<TGeoTube*>(W->GetVolume()->GetShape());
504 Double_t top[3] = {0, 0, S->GetDZ()};
505 Double_t bot[3] = {0, 0, -S->GetDZ()};
506 Double_t Gtop[3], Gbot[3];
507 nav->LocalToMaster(top, Gtop);
508 nav->LocalToMaster(bot, Gbot);
509 vtop.SetXYZ(Gtop[0], Gtop[1], Gtop[2]);
510 vbot.SetXYZ(Gbot[0], Gbot[1], Gbot[2]);
511 endPointCache.emplace(fDetectorID, std::make_pair(vbot, vtop));
512}
static std::array< Int_t, 4 > StrawDecode(Int_t detID)

◆ StrawSigmaSpatial()

Double_t strawtubes::StrawSigmaSpatial ( )
inline

Definition at line 55 of file strawtubes.h.

55{ return sigma_spatial; }

◆ StrawVdrift()

Double_t strawtubes::StrawVdrift ( )
inline

Definition at line 54 of file strawtubes.h.

54{ return v_drift; }

Member Data Documentation

◆ f_aperture_height

Double_t strawtubes::f_aperture_height
private

Aperture width (x).

Definition at line 69 of file strawtubes.h.

◆ f_aperture_width

Double_t strawtubes::f_aperture_width
private

z-position of tracking station 4

Definition at line 68 of file strawtubes.h.

◆ f_delta_z_layer

Double_t strawtubes::f_delta_z_layer
private

Offset (y) of straws between layers.

Definition at line 74 of file strawtubes.h.

◆ f_delta_z_view

Double_t strawtubes::f_delta_z_view
private

Structure frame material.

Definition at line 78 of file strawtubes.h.

◆ f_frame_material

TString strawtubes::f_frame_material
private

Sense wire thickness.

Definition at line 77 of file strawtubes.h.

◆ f_inner_straw_diameter

Double_t strawtubes::f_inner_straw_diameter
private

Aperture height (y).

Definition at line 70 of file strawtubes.h.

◆ f_offset_layer

Double_t strawtubes::f_offset_layer
private

Distance (y) between straws in a layer.

Definition at line 73 of file strawtubes.h.

◆ f_outer_straw_diameter

Double_t strawtubes::f_outer_straw_diameter
private

Inner Straw diameter.

Definition at line 71 of file strawtubes.h.

◆ f_station_height

Double_t strawtubes::f_station_height
private

Station envelope width (x).

Definition at line 80 of file strawtubes.h.

◆ f_station_length

Double_t strawtubes::f_station_length
private

Station envelope height (y).

Definition at line 81 of file strawtubes.h.

◆ f_station_width

Double_t strawtubes::f_station_width
private

Distance (z) between stereo views.

Definition at line 79 of file strawtubes.h.

◆ f_straw_pitch

Double_t strawtubes::f_straw_pitch
private

Outer Straw diameter.

Definition at line 72 of file strawtubes.h.

◆ f_T1_z

Double_t strawtubes::f_T1_z
private

Track information to be stored until the track leaves the active volume.

Definition at line 64 of file strawtubes.h.

◆ f_T2_z

Double_t strawtubes::f_T2_z
private

z-position of tracking station 1

Definition at line 65 of file strawtubes.h.

◆ f_T3_z

Double_t strawtubes::f_T3_z
private

z-position of tracking station 2

Definition at line 66 of file strawtubes.h.

◆ f_T4_z

Double_t strawtubes::f_T4_z
private

z-position of tracking station 3

Definition at line 67 of file strawtubes.h.

◆ f_view_angle

Double_t strawtubes::f_view_angle
private

Distance (z) between layers.

Definition at line 75 of file strawtubes.h.

◆ f_wire_thickness

Double_t strawtubes::f_wire_thickness
private

Stereo view angle.

Definition at line 76 of file strawtubes.h.

◆ fMedium

std::string strawtubes::fMedium
private

spatial resolution

Definition at line 84 of file strawtubes.h.

◆ sigma_spatial

Double_t strawtubes::sigma_spatial
private

drift velocity

Definition at line 83 of file strawtubes.h.

◆ v_drift

Double_t strawtubes::v_drift
private

Station envelope length (z).

Definition at line 82 of file strawtubes.h.


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