SND@LHC Software
Loading...
Searching...
No Matches
strawtubes Class Reference

#include <strawtubes.h>

Inheritance diagram for strawtubes:
Collaboration diagram for strawtubes:

Public Member Functions

 strawtubes (const char *Name, Bool_t Active)
 
 strawtubes ()
 
virtual ~strawtubes ()
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Reset ()
 
void SetZpositions (Double_t z0, Double_t z1, Double_t z2, Double_t z3, Double_t z4)
 
void SetStrawLength (Double_t strawlength)
 
void SetInnerStrawDiameter (Double_t innerstrawdiameter)
 
void SetOuterStrawDiameter (Double_t outerstrawdiameter)
 
void SetStrawPitch (Double_t strawpitch, Double_t layer_offset, Double_t plane_offset)
 
void SetDeltazLayer (Double_t deltazlayer)
 
void SetDeltazPlane (Double_t deltazplane)
 
void SetStrawsPerLayer (Int_t strawsperlayer)
 
void SetStereoAngle (Int_t stereoangle)
 
void SetWireThickness (Double_t wirethickness)
 
void SetDeltazFrame (Double_t deltazframe)
 
void SetFrameLateralWidth (Double_t framelateralwidth)
 
void SetFrameMaterial (TString framematerial)
 
void SetDeltazView (Double_t deltazview)
 
void SetStrawLength12 (Double_t strawlength12)
 
void SetStrawLengthVeto (Double_t strawlengthveto)
 
void SetVacBox_x (Double_t vacbox_x)
 
void SetVacBox_y (Double_t vacbox_y)
 
void SetVetoYDim (Double_t vetoydim)
 
void SetTr12YDim (Double_t tr12ydim)
 
void SetTr34YDim (Double_t tr34ydim)
 
void StrawDecode (Int_t detID, int &statnb, int &vnb, int &pnb, int &lnb, int &snb)
 
void StrawEndPoints (Int_t detID, TVector3 &top, TVector3 &bot)
 
void StrawEndPointsOriginal (Int_t detID, TVector3 &top, TVector3 &bot)
 
void SetStrawResolution (Double_t a, Double_t b)
 
Double_t StrawVdrift ()
 
Double_t StrawSigmaSpatial ()
 
void ConstructGeometry ()
 
strawtubesPointAddHit (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode, Double_t dist2Wire)
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual void EndOfEvent ()
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 

Private Member Functions

 strawtubes (const strawtubes &)
 
strawtubesoperator= (const strawtubes &)
 
Int_t InitMedium (const char *name)
 

Private Attributes

Int_t fTrackID
 
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
 
Double_t fT0z
 energy loss
 
Double_t fT1z
 z-position of veto station
 
Double_t fT2z
 z-position of tracking station 1
 
Double_t fT3z
 z-position of tracking station 2
 
Double_t fT4z
 z-position of tracking station 3
 
Double_t fStraw_length
 z-position of tracking station 4
 
Double_t fStraw_length_12
 Length (y) of a straw.
 
Double_t fStraw_length_veto
 strawlength for tracking station 1 & 2
 
Double_t fInner_Straw_diameter
 strawlength for veto station
 
Double_t fOuter_Straw_diameter
 Inner Straw diameter.
 
Double_t fStraw_pitch
 Outer Straw diameter.
 
Double_t fDeltaz_layer12
 Distance (x) between straws in one layer.
 
Double_t fDeltaz_plane12
 Distance (z) between layer 1&2.
 
Double_t fOffset_layer12
 Distance (z) between plane 1&2.
 
Double_t fOffset_plane12
 Offset (x) between straws of layer2&1.
 
Int_t fStraws_per_layer
 Offset (x) between straws of plane1&2.
 
Double_t fView_angle
 Number of straws in one layer.
 
Double_t fcosphi
 Stereo angle of layers in a view.
 
Double_t fsinphi
 
Double_t fWire_thickness
 
Double_t fDeltaz_frame
 Thickness of the wire.
 
Double_t fFrame_lateral_width
 Thickness (z) of the meterial frame.
 
TString fFrame_material
 Width (x and y) of the material frame.
 
Double_t fDeltaz_view
 Material of the view frame.
 
Double_t fVacBox_x
 Distance (z) between views.
 
Double_t fVacBox_y
 x size of station vacuumbox
 
Double_t fvetoydim
 y size of station vacuumbox
 
Double_t ftr12ydim
 y size of veto station
 
Double_t ftr34ydim
 y size of tr12 stations
 
Int_t fStraws_per_layer_veto
 y size of tr34 stations
 
Int_t fStraws_per_layer_tr12
 Number of straws in one veto layer.
 
Int_t fStraws_per_layer_tr34
 Number of straws in one tr12 layer.
 
Double_t v_drift
 Number of straws in one tr34 layer.
 
Double_t sigma_spatial
 drift velocity

 
TClonesArray * fstrawtubesPointCollection
 spatial resolution
 

Detailed Description

Definition at line 13 of file strawtubes.h.

Constructor & Destructor Documentation

◆ strawtubes() [1/3]

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 : FairDetector(name, active, kStraw),
54 fTrackID(-1),
55 fVolumeID(-1),
56 fPos(),
57 fMom(),
58 fTime(-1.),
59 fLength(-1.),
60 fELoss(-1),
61 fstrawtubesPointCollection(new TClonesArray("strawtubesPoint"))
62{
63}
@ kStraw
Int_t fVolumeID
track index
Definition strawtubes.h:110
TLorentzVector fMom
position at entrance
Definition strawtubes.h:112
TLorentzVector fPos
volume id
Definition strawtubes.h:111
TClonesArray * fstrawtubesPointCollection
spatial resolution
Definition strawtubes.h:152
Double_t fELoss
length
Definition strawtubes.h:115
Double_t fTime
momentum at entrance
Definition strawtubes.h:113
Double_t fLength
time
Definition strawtubes.h:114
Int_t fTrackID
Definition strawtubes.h:109

◆ strawtubes() [2/3]

strawtubes::strawtubes ( )

default constructor

Definition at line 39 of file strawtubes.cxx.

40 : FairDetector("strawtubes", kTRUE, kStraw),
41 fTrackID(-1),
42 fVolumeID(-1),
43 fPos(),
44 fMom(),
45 fTime(-1.),
46 fLength(-1.),
47 fELoss(-1),
48 fstrawtubesPointCollection(new TClonesArray("strawtubesPoint"))
49{
50}

◆ ~strawtubes()

strawtubes::~strawtubes ( )
virtual

destructor

Definition at line 65 of file strawtubes.cxx.

66{
70 }
71}

◆ strawtubes() [3/3]

strawtubes::strawtubes ( const strawtubes )
private

Member Function Documentation

◆ AddHit()

strawtubesPoint * strawtubes::AddHit ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
Int_t  pdgCode,
Double_t  dist2Wire 
)

This method is an example of how to add your own point of type strawtubesPoint to the clones array

Definition at line 924 of file strawtubes.cxx.

928{
929 TClonesArray& clref = *fstrawtubesPointCollection;
930 Int_t size = clref.GetEntriesFast();
931 //std::cout << "adding hit detid " <<detID<<std::endl;
932 return new(clref[size]) strawtubesPoint(trackID, detID, pos, mom,
933 time, length, eLoss, pdgCode, dist2Wire);
934}

◆ BeginEvent()

virtual void strawtubes::BeginEvent ( )
inlinevirtual

Definition at line 102 of file strawtubes.h.

102{;}

◆ BeginPrimary()

virtual void strawtubes::BeginPrimary ( )
inlinevirtual

Definition at line 99 of file strawtubes.h.

99{;}

◆ ConstructGeometry()

void strawtubes::ConstructGeometry ( )

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.

Definition at line 319 of file strawtubes.cxx.

320{
325 TGeoVolume *top = gGeoManager->GetTopVolume();
326 InitMedium("air");
327 TGeoMedium *air = gGeoManager->GetMedium("air");
328 InitMedium("ShipSens");
329 TGeoMedium *Se = gGeoManager->GetMedium("ShipSens");
330 InitMedium("aluminium");
331 TGeoMedium *Al = gGeoManager->GetMedium("aluminium");
332 InitMedium("mylar");
333 TGeoMedium *mylar = gGeoManager->GetMedium("mylar");
334 InitMedium("STTmix9010_2bar");
335 TGeoMedium *sttmix9010_2bar = gGeoManager->GetMedium("STTmix9010_2bar");
336 InitMedium("tungsten");
337 TGeoMedium *tungsten = gGeoManager->GetMedium("tungsten");
339 TGeoMedium *FrameMatPtr = gGeoManager->GetMedium(fFrame_material);
340 InitMedium("vacuum");
341 TGeoMedium *med = gGeoManager->GetMedium("vacuum");
342
343 gGeoManager->SetVisLevel(4);
344 gGeoManager->SetTopVisible();
345
346 //epsilon to avoid overlapping volumes
347 //Double_t eps=0.1;
348 Double_t eps=0.0001;
349 Double_t epsS=0.0001;
350 //width of frame
351 Double_t framewidth = 40.;
352 //width of view
353 Double_t viewwidth = fDeltaz_view-eps;
354 //width of plane
355 Double_t planewidth = fOuter_Straw_diameter+fDeltaz_layer12-eps;
356 //width of layer
357 Double_t layerwidth = fOuter_Straw_diameter;
358
359 Double_t rmin, rmax, dx, dy, dz, z, density,a,w;
360 Double_t par[20];
361 Int_t nel,numed,isvol,ifield;
362 Double_t radl, absl, TStationz;
363
364 Double_t yDim = (fStraws_per_layer+1) * fStraw_pitch /2. ; // put everything inside vacbox
365 //arguments of box are half-lengths;
366 TGeoBBox *detbox1 = new TGeoBBox("detbox1", fStraw_length+fFrame_lateral_width, ftr34ydim+fFrame_lateral_width, fDeltaz_frame/2.);
367 TGeoBBox *detbox2 = new TGeoBBox("detbox2", fStraw_length+eps, ftr34ydim+eps, fDeltaz_frame/2.+eps);
368
369 TGeoBBox *detbox1_12 = new TGeoBBox("detbox1_12", fStraw_length_12+fFrame_lateral_width, ftr12ydim+fFrame_lateral_width, fDeltaz_frame/2.);
370 TGeoBBox *detbox2_12 = new TGeoBBox("detbox2_12", fStraw_length_12+eps, ftr12ydim+eps, fDeltaz_frame/2.+eps);
371 TGeoCompositeShape *detcomp1 = new TGeoCompositeShape("detcomp1", "detbox1-detbox2");
372 TGeoCompositeShape *detcomp1_12 = new TGeoCompositeShape("detcomp1_12", "detbox1_12-detbox2_12");
373 TGeoBBox *vetovacbox;
374 TGeoCompositeShape *detcomp1_veto;
375 if (fStraw_length_veto>1){
376 TGeoBBox *detbox1_veto = new TGeoBBox("detbox1_veto", fStraw_length_veto+1., fvetoydim+1., fDeltaz_view/2.);
377 TGeoBBox *detbox2_veto = new TGeoBBox("detbox2_veto", fStraw_length_veto+eps, fvetoydim+eps, fDeltaz_view/2.+eps);
378
379 //the station sits inside a vacuum box
380 //TGeoBBox *vetovacbox = new TGeoBBox("Vetovacbox", fVacBox_x, fVacBox_y, fDeltaz_view );
381 vetovacbox = new TGeoBBox("Vetovacbox", fStraw_length_veto+75., fvetoydim+75., fDeltaz_view );
382 detcomp1_veto = new TGeoCompositeShape("detcomp1_veto", "detbox1_veto-detbox2_veto");
383 }
384 // Volume: straw
386 rmax = fOuter_Straw_diameter/2.;
387 //third argument is halflength of tube
388 TGeoTube *straw_tube = new TGeoTube("straw",rmin,rmax,fStraw_length-4.*eps);
389 TGeoVolume *straw = new TGeoVolume("straw",straw_tube, mylar);
390 straw->SetLineColor(4);
391 straw->SetVisibility(kTRUE);
392 TGeoTube *straw_tube_12 = new TGeoTube("straw_12",rmin,rmax,fStraw_length_12-4.*eps);
393 TGeoVolume *straw_12 = new TGeoVolume("straw_12",straw_tube_12, mylar);
394 straw_12->SetLineColor(4);
395 straw_12->SetVisibility(kTRUE);
396 TGeoVolume *straw_veto;
397 if (fStraw_length_veto>1){
398 TGeoTube *straw_tube_veto = new TGeoTube("straw_veto",rmin,rmax,fStraw_length_veto-4.*eps);
399 straw_veto = new TGeoVolume("straw_veto",straw_tube_veto, mylar);
400 straw_veto->SetLineColor(4);
401 straw_veto->SetVisibility(kTRUE);
402 }
403 // Volume: gas
404 rmin = fWire_thickness/2.+epsS;
405 rmax = fInner_Straw_diameter/2.-epsS;
406 TGeoTube *gas_tube = new TGeoTube("gas",rmin,rmax,fStraw_length-6.*eps);
407 TGeoVolume *gas = new TGeoVolume("gas",gas_tube, sttmix9010_2bar);
408 gas->SetLineColor(5); //only the gas is sensitive
409 AddSensitiveVolume(gas);
410 TGeoTube *gas_tube_12 = new TGeoTube("gas_12",rmin,rmax,fStraw_length_12-6.*eps);
411 TGeoVolume *gas_12 = new TGeoVolume("gas_12",gas_tube_12, sttmix9010_2bar);
412 gas_12->SetLineColor(5); //only the gas is sensitive
413 AddSensitiveVolume(gas_12);
414 TGeoVolume *gas_veto;
415 TGeoBBox *layer_veto;
416 if (fStraw_length_veto>1){
417 TGeoTube *gas_tube_veto = new TGeoTube("gas_veto",rmin,rmax,fStraw_length_veto-6.*eps);
418 gas_veto = new TGeoVolume("gas_veto",gas_tube_veto, sttmix9010_2bar);
419 gas_veto->SetLineColor(5); //only the gas is sensitive
420 AddSensitiveVolume(gas_veto);
421 }
422
423 // Volume: wire
424 rmin=0.;
425 rmax = fWire_thickness/2.;
426 TGeoTube *wire_tube = new TGeoTube("wire",rmin,rmax,fStraw_length-8.*eps);
427 TGeoVolume *wire = new TGeoVolume("wire",wire_tube, tungsten);
428 wire->SetLineColor(6);
429 TGeoTube *wire_tube_12 = new TGeoTube("wire_12",rmin,rmax,fStraw_length_12-8.*eps);
430 TGeoVolume *wire_12 = new TGeoVolume("wire_12",wire_tube_12, tungsten);
431 wire_12->SetLineColor(6);
432 Int_t statnb;
433 if (fStraw_length_veto>1){
434 TGeoTube *wire_tube_veto = new TGeoTube("wire_veto",rmin,rmax,fStraw_length_veto-8.*eps);
435 TGeoVolume *wire_veto = new TGeoVolume("wire_veto",wire_tube_veto, tungsten);
436 wire_veto->SetLineColor(6);
437 statnb=5;
438 // statnb = station number. 1,2,3,4 tracking stations, 5 veto station
439 TGeoVolume *vetovac = new TGeoVolume("Veto", vetovacbox, med);
440
441 top->AddNode(vetovac, statnb, new TGeoTranslation(0,0,fT0z));
442 //vetovac->SetVisDaughters(kTRUE);
443 //vetovac->SetTransparency(80);
444
445 //Veto station
446 //vnb=view number; pnb=plane number; lnb=layer number; snb=straw number
447 TString nmveto = "Veto";
448 TStationz=fT0z;
449 for (Int_t vnb=0; vnb<2; vnb++) {
450 //view loop
451 Double_t angle;
452 TGeoRotation r5;
453 TGeoTranslation t5;
454 nmveto = "Veto";
455 switch (vnb) {
456 case 0:
457 angle=0.;
458 nmveto = nmveto+"_x";
459 break;
460 case 1:
462 nmveto = nmveto+"_u";
463 break;
464 default:
465 angle=0.;
466 nmveto = nmveto+"_x";
467 }
468
469 TGeoVolume *viewframe_veto = new TGeoVolume(nmveto, detcomp1_veto, Al);
470 //z-translate the viewframe_veto from station z pos
471 t5.SetTranslation(0, 0,(vnb-1./2.)*fDeltaz_view);
472 //rotate the frame box by angle degrees around the z axis (0 if it isn't a stereo view)
473 r5.SetAngles(angle,0,0);
474 TGeoCombiTrans c5(t5, r5);
475 TGeoHMatrix *h5 = new TGeoHMatrix(c5);
476 vetovac->AddNode(viewframe_veto, statnb*10000000+vnb*1000000,h5);
477 viewframe_veto->SetLineColor(kRed);
478
479 TGeoTranslation t5p;
480
481 for (Int_t pnb=0; pnb<2; pnb++) {
482 //plane loop
483 TString nmplane_veto = nmveto+"_plane_"; nmplane_veto += pnb;
484 //width of the planes: z distance between layers + outer straw diameter
485 TGeoBBox *plane_veto = new TGeoBBox("plane box", fStraw_length_veto+eps/2., fvetoydim+eps/2., planewidth/2.+3.*eps/2.);
486 TGeoVolume *planebox_veto = new TGeoVolume(nmplane_veto, plane_veto, med);
487 //the planebox sits in the viewframe
488 //hence z translate the plane wrt to the view
489
490 t5.SetTranslation(0, 0,(vnb-1./2.)*fDeltaz_view+(pnb-1./2.)*fDeltaz_plane12);
491 TGeoCombiTrans d5(t5, r5);
492 TGeoHMatrix *j5 = new TGeoHMatrix(d5);
493 vetovac->AddNode(planebox_veto, statnb*10000000+vnb*1000000+pnb*100000,j5);
494
495 for (Int_t lnb=0; lnb<2; lnb++) {
496 TString nmlayer_veto = nmplane_veto+"_layer_"; nmlayer_veto += lnb;
497 //width of the layer: (plane width-2eps)/2
498 layer_veto = new TGeoBBox("layer box_veto", fStraw_length_veto+eps/4., fvetoydim+eps/4., layerwidth/2.+eps/4.);
499 TGeoVolume *layerbox_veto = new TGeoVolume(nmlayer_veto, layer_veto, med);
500 //z translate the layerbox wrt the plane box (which is already rotated)
501 planebox_veto->AddNode(layerbox_veto, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,new TGeoTranslation(0,0,(lnb-1./2.)*fDeltaz_layer12));
502 //layer loop
503 TGeoRotation r6v;
504 TGeoTranslation t6v;
505 Int_t nr = statnb*10000000+vnb*1000000+pnb*100000+lnb*10000;
506 for (Int_t snb=1; snb<fStraws_per_layer_veto; snb++) {
507 //straw loop
508 t6v.SetTranslation(0,fvetoydim-fStraw_pitch*snb-fOffset_plane12*pnb+lnb*fOffset_layer12,0);
509 r6v.SetAngles(90,90,0);
510 TGeoCombiTrans c6v(t6v, r6v);
511 TGeoHMatrix *h6v = new TGeoHMatrix(c6v);
512
513 layerbox_veto->AddNode(straw_veto,nr+1000+snb,h6v);
514 layerbox_veto->AddNode(gas_veto, nr+2000+snb,h6v);
515 layerbox_veto->AddNode(wire_veto, nr+3000+snb,h6v);
516 //end of straw loop
517 }
518 //end of layer loop
519 }
520 //end of plane loop
521 }
522 //end of view loop
523 } }
524 // end of veto station loop
525 //Tracking stations
526 //statnb=station number; vnb=view number; pnb=plane number; lnb=layer number; snb=straw number
527
528 //New scalable endpoints of vacuum boxes which cover rotated view frames
529
530 Double_t x_prime = (fVacBox_x+0.6*fFrame_lateral_width+2*eps)*TMath::Cos(fView_angle*TMath::Pi()/180.0) + (ftr34ydim+fFrame_lateral_width+2*eps)*TMath::Sin(fView_angle*TMath::Pi()/180.0);
531 Double_t y_prime = (fVacBox_x+0.6*fFrame_lateral_width+2*eps)*TMath::Sin(fView_angle*TMath::Pi()/180.0) + (ftr34ydim+fFrame_lateral_width+2*eps)*TMath::Cos(fView_angle*TMath::Pi()/180.0);
532 Double_t x_prime_12 = (fStraw_length_12+fFrame_lateral_width+2*eps)*TMath::Cos(fView_angle*TMath::Pi()/180.0) + (ftr12ydim+fFrame_lateral_width+2*eps)*TMath::Sin(fView_angle*TMath::Pi()/180.0);
533 Double_t y_prime_12 = (fStraw_length_12+fFrame_lateral_width+2*eps)*TMath::Sin(fView_angle*TMath::Pi()/180.0) + (ftr12ydim+fFrame_lateral_width+2*eps)*TMath::Cos(fView_angle*TMath::Pi()/180.0);
534
535 TGeoBBox *vacbox = new TGeoBBox("vacbox", x_prime+eps, y_prime+eps, 2.*fDeltaz_view);
536 TGeoBBox *vacbox_12 = new TGeoBBox("vacbox_12", x_prime_12+eps, y_prime_12+eps, 2.*fDeltaz_view);
537
538 fFrame_material.ToLower();
539
540 for (statnb=1;statnb<5;statnb++) {
541 // tracking station loop
542 TString nmstation = "Tr";
543 std::stringstream ss;
544 ss << statnb;
545 nmstation = nmstation + ss.str();
546 TGeoVolume *vac;
547 TGeoVolume *vac_12;
548 switch (statnb) {
549 case 1:
550 TStationz=fT1z;
551 vac_12 = new TGeoVolume(nmstation, vacbox_12, med);
552 top->AddNode(vac_12, statnb, new TGeoTranslation(0,0,TStationz));
553 break;
554 case 2:
555 TStationz=fT2z;
556 vac_12 = new TGeoVolume(nmstation, vacbox_12, med);
557 top->AddNode(vac_12, statnb, new TGeoTranslation(0,0,TStationz));
558 break;
559 case 3:
560 TStationz=fT3z;
561 vac = new TGeoVolume(nmstation, vacbox, med);
562 top->AddNode(vac, statnb, new TGeoTranslation(0,0,TStationz));
563 break;
564 case 4:
565 TStationz=fT4z;
566 vac = new TGeoVolume(nmstation, vacbox, med);
567 top->AddNode(vac, statnb, new TGeoTranslation(0,0,TStationz));
568 break;
569 default:
570 break;
571 }
572
573 if ((statnb==1)||(statnb==2)) {
574 for (Int_t vnb=0; vnb<4; vnb++) {
575 //view loop
576 TString nmview_12;
577
578 Double_t angle;
579 TGeoRotation r5;
580 TGeoTranslation t5;
581
582 switch (vnb) {
583 case 0:
584 angle=0.;
585 nmview_12 = nmstation+"_x1";
586 break;
587 case 1:
589 nmview_12 = nmstation+"_u";
590 break;
591 case 2:
593 nmview_12 = nmstation+"_v";
594 break;
595 case 3:
596 angle=0.;
597 nmview_12 = nmstation+"_x2";
598 break;
599 default:
600 angle=0.;
601 nmview_12 = nmstation+"_x1";
602 }
603
604 TGeoVolume *viewframe_12;
605 if (fFrame_material.Contains("aluminium")) {
606 viewframe_12 = new TGeoVolume(nmview_12, detcomp1_12, Al);
607 }
608 else {
609 viewframe_12 = new TGeoVolume(nmview_12, detcomp1_12, FrameMatPtr);
610 }
611
612
613 //z-translate the viewframe from station z pos
614 t5.SetTranslation(0, 0,(vnb-3./2.)*(fDeltaz_view));
615 //rotate the frame box by angle degrees around the z axis (0 if it isn't a stereo view)
616 r5.SetAngles(angle,0,0);
617 TGeoCombiTrans c5(t5, r5);
618 TGeoHMatrix *h5 = new TGeoHMatrix(c5);
619
620 vac_12->AddNode(viewframe_12, statnb*10000000+vnb*1000000,h5);
621 viewframe_12->SetLineColor(kRed);
622
623 for (Int_t pnb=0; pnb<2; pnb++) {
624 //plane loop
625 TString nmplane_12 = nmview_12+"_plane_";
626 nmplane_12 += pnb;
627 TGeoBBox *plane_12 = new TGeoBBox("plane box_12", fStraw_length_12+eps/2, ftr12ydim+eps/2, planewidth/2.+3.*eps/2);
628 TGeoVolume *planebox_12 = new TGeoVolume(nmplane_12, plane_12, med);
629
630 //the planebox sits in the viewframe
631 //hence z translate the plane wrt to the view
632 TGeoTranslation t3;
633 t3.SetTranslation(0, 0,(vnb-3./2.)*(fDeltaz_view)+(pnb-1./2.)*fDeltaz_plane12);
634 TGeoCombiTrans d3(t3, r5);
635 TGeoHMatrix *j3 = new TGeoHMatrix(d3);
636 vac_12->AddNode(planebox_12, statnb*10000000+vnb*1000000+pnb*100000,j3);
637
638 for (Int_t lnb=0; lnb<2; lnb++) {
639
640 //width of the layer: (plane width-2*eps)/2
641
642 //z translate the layerbox wrt the plane box (which is already rotated)
643 TString nmlayer_12 = nmplane_12+"_layer_"; nmlayer_12 += lnb;
644 TGeoBBox *layer_12 = new TGeoBBox("layer box_12", fStraw_length_12+eps/4, ftr12ydim+eps/4, layerwidth/2.+eps/4);
645 TGeoVolume *layerbox_12 = new TGeoVolume(nmlayer_12, layer_12, med);
646 planebox_12->AddNode(layerbox_12, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,new TGeoTranslation(0,0,(lnb-1./2.)*fDeltaz_layer12));
647
648 //layer loop
649 TGeoRotation r6s;
650 TGeoTranslation t6s;
651 for (Int_t snb=1; snb<fStraws_per_layer_tr12; snb++) {
652 //straw loop
653 t6s.SetTranslation(0,ftr12ydim-fStraw_pitch*snb-fOffset_plane12*pnb+lnb*fOffset_layer12,0);
654 r6s.SetAngles(90,90,0);
655 TGeoCombiTrans c6s(t6s, r6s);
656 TGeoHMatrix *h6s = new TGeoHMatrix(c6s);
657 layerbox_12->AddNode(straw_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+1000+snb,h6s);
658 layerbox_12->AddNode(gas_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+2000+snb,h6s);
659 layerbox_12->AddNode(wire_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+3000+snb,h6s);
660
661 //end of straw loop
662 }
663 //end of layer loop
664 }
665 //end of plane loop
666 }
667 //end of view loop
668 }
669 //end of station1/2
670 }
671 if ((statnb==3)||(statnb==4)) {
672 for (Int_t vnb=0; vnb<4; vnb++) {
673 //view loop
674 TString nmview;
675 Double_t angle;
676 TGeoRotation r5;
677 TGeoTranslation t5;
678
679 switch (vnb) {
680 case 0:
681 angle=0.;
682 nmview = nmstation+"_x1";
683 break;
684 case 1:
686 nmview = nmstation+"_u";
687 break;
688 case 2:
690 nmview = nmstation+"_v";
691 break;
692 case 3:
693 angle=0.;
694 nmview = nmstation+"_x2";
695 break;
696 default:
697 angle=0.;
698 nmview = nmstation+"_x1";
699 }
700
701 TGeoVolume *viewframe;
702 if (fFrame_material.Contains("aluminium")) {
703 viewframe = new TGeoVolume(nmview, detcomp1, Al);
704 }
705 else {
706 viewframe = new TGeoVolume(nmview, detcomp1, FrameMatPtr);
707 }
708
709
710 //z-translate the viewframe from station z pos
711 t5.SetTranslation(0, 0,(vnb-3./2.)*(fDeltaz_view));
712 //rotate the frame box by angle degrees around the z axis (0 if it isn't a stereo view)
713 r5.SetAngles(angle,0,0);
714 TGeoCombiTrans c5(t5, r5);
715 TGeoHMatrix *h5 = new TGeoHMatrix(c5);
716
717 vac->AddNode(viewframe, statnb*10000000+vnb*1000000,h5);
718 viewframe->SetLineColor(kRed);
719
720 for (Int_t pnb=0; pnb<2; pnb++) {
721 //plane loop
722 TString nmplane = nmview+"_plane_";
723 nmplane += pnb;
724 TGeoBBox *plane = new TGeoBBox("plane box", fStraw_length+eps/2, ftr34ydim+eps/2, planewidth/2.+3.*eps/2);
725 TGeoVolume *planebox = new TGeoVolume(nmplane, plane, med);
726
727 //the planebox sits in the viewframe
728 //hence z translate the plane wrt to the view
729 TGeoTranslation t3;
730 t3.SetTranslation(0, 0,(vnb-3./2.)*(fDeltaz_view)+(pnb-1./2.)*fDeltaz_plane12);
731 TGeoCombiTrans d3(t3, r5);
732 TGeoHMatrix *j3 = new TGeoHMatrix(d3);
733 vac->AddNode(planebox, statnb*10000000+vnb*1000000+pnb*100000,j3);
734
735 for (Int_t lnb=0; lnb<2; lnb++) {
736
737 //width of the layer: (plane width-2*eps)/2
738
739 //z translate the layerbox wrt the plane box (which is already rotated)
740 TString nmlayer = nmplane+"_layer_"; nmlayer += lnb;
741 TGeoBBox *layer = new TGeoBBox("layer box", fStraw_length+eps/4, ftr34ydim+eps/4, layerwidth/2.+eps/4);
742 TGeoVolume *layerbox = new TGeoVolume(nmlayer, layer, med);
743 planebox->AddNode(layerbox, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,new TGeoTranslation(0,0,(lnb-1./2.)*fDeltaz_layer12));
744
745 //layer loop
746 TGeoRotation r6s;
747 TGeoTranslation t6s;
748 for (Int_t snb=1; snb<fStraws_per_layer_tr34; snb++) {
749 //straw loop
750 t6s.SetTranslation(0,ftr34ydim-fStraw_pitch*snb-fOffset_plane12*pnb+lnb*fOffset_layer12,0);
751 r6s.SetAngles(90,90,0);
752 TGeoCombiTrans c6s(t6s, r6s);
753 TGeoHMatrix *h6s = new TGeoHMatrix(c6s);
754 layerbox->AddNode(straw,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+1000+snb,h6s);
755 layerbox->AddNode(gas,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+2000+snb,h6s);
756 layerbox->AddNode(wire,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+3000+snb,h6s);
757
758 //end of straw loop
759 }
760 //end of layer loop
761 }
762 //end of plane loop
763 }
764 //end of view loop
765 }
766 //end of station1/2
767 }
768
769
770 //end of station
771 }
772 std::cout << "tracking stations added" << std::endl;
773}
Double_t fT2z
z-position of tracking station 1
Definition strawtubes.h:118
Double_t fDeltaz_view
Material of the view frame.
Definition strawtubes.h:139
Int_t fStraws_per_layer_tr34
Number of straws in one tr12 layer.
Definition strawtubes.h:147
Double_t fStraw_length_12
Length (y) of a straw.
Definition strawtubes.h:122
Int_t fStraws_per_layer
Offset (x) between straws of plane1&2.
Definition strawtubes.h:131
Double_t fStraw_length_veto
strawlength for tracking station 1 & 2
Definition strawtubes.h:123
Double_t fInner_Straw_diameter
strawlength for veto station
Definition strawtubes.h:124
Double_t ftr34ydim
y size of tr12 stations
Definition strawtubes.h:144
Double_t fDeltaz_plane12
Distance (z) between layer 1&2.
Definition strawtubes.h:128
Double_t fvetoydim
y size of station vacuumbox
Definition strawtubes.h:142
TString fFrame_material
Width (x and y) of the material frame.
Definition strawtubes.h:138
Double_t fOffset_layer12
Distance (z) between plane 1&2.
Definition strawtubes.h:129
Double_t fWire_thickness
Definition strawtubes.h:135
Int_t InitMedium(const char *name)
Double_t fStraw_length
z-position of tracking station 4
Definition strawtubes.h:121
Double_t fT3z
z-position of tracking station 2
Definition strawtubes.h:119
Double_t fFrame_lateral_width
Thickness (z) of the meterial frame.
Definition strawtubes.h:137
Double_t fT1z
z-position of veto station
Definition strawtubes.h:117
Double_t fStraw_pitch
Outer Straw diameter.
Definition strawtubes.h:126
Double_t fDeltaz_layer12
Distance (x) between straws in one layer.
Definition strawtubes.h:127
Double_t fOffset_plane12
Offset (x) between straws of layer2&1.
Definition strawtubes.h:130
Double_t fT0z
energy loss
Definition strawtubes.h:116
Double_t ftr12ydim
y size of veto station
Definition strawtubes.h:143
Int_t fStraws_per_layer_veto
y size of tr34 stations
Definition strawtubes.h:145
Double_t fVacBox_x
Distance (z) between views.
Definition strawtubes.h:140
Double_t fView_angle
Number of straws in one layer.
Definition strawtubes.h:132
Double_t fOuter_Straw_diameter
Inner Straw diameter.
Definition strawtubes.h:125
Int_t fStraws_per_layer_tr12
Number of straws in one veto layer.
Definition strawtubes.h:146
Double_t fT4z
z-position of tracking station 3
Definition strawtubes.h:120
Double_t fDeltaz_frame
Thickness of the wire.
Definition strawtubes.h:136
real(dp), parameter, public eps

◆ CopyClones()

virtual void strawtubes::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
inlinevirtual

The following methods can be implemented if you need to make any optional action in your detector during the transport.

Definition at line 93 of file strawtubes.h.

94 {;}

◆ EndOfEvent()

void strawtubes::EndOfEvent ( )
virtual

Definition at line 167 of file strawtubes.cxx.

168{
170}

◆ FinishPrimary()

virtual void strawtubes::FinishPrimary ( )
inlinevirtual

Definition at line 97 of file strawtubes.h.

97{;}

◆ FinishRun()

virtual void strawtubes::FinishRun ( )
inlinevirtual

Definition at line 98 of file strawtubes.h.

98{;}

◆ GetCollection()

TClonesArray * strawtubes::GetCollection ( Int_t  iColl) const
virtual

Gets the produced collections

Definition at line 188 of file strawtubes.cxx.

189{
190 if (iColl == 0) { return fstrawtubesPointCollection; }
191 else { return NULL; }
192}

◆ Initialize()

void strawtubes::Initialize ( )
virtual

Initialization of the detector is done here

Definition at line 73 of file strawtubes.cxx.

74{
75 FairDetector::Initialize();
76// FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb();
77// vetoGeoPar* par=(vetoGeoPar*)(rtdb->getContainer("vetoGeoPar"));
78}

◆ InitMedium()

Int_t strawtubes::InitMedium ( const char *  name)
private

Definition at line 81 of file strawtubes.cxx.

82{
83 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
84 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
85 static FairGeoMedia *media=geoFace->getMedia();
86 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
87
88 FairGeoMedium *ShipMedium=media->getMedium(name);
89
90 if (!ShipMedium)
91 {
92 Fatal("InitMedium","Material %s not defined in media file.", name);
93 return -1111;
94 }
95 TGeoMedium* medium=gGeoManager->GetMedium(name);
96 if (medium!=NULL)
97 return ShipMedium->getMediumIndex();
98
99 return geoBuild->createMedium(ShipMedium);
100}

◆ operator=()

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

◆ PostTrack()

virtual void strawtubes::PostTrack ( )
inlinevirtual

Definition at line 100 of file strawtubes.h.

100{;}

◆ PreTrack()

virtual void strawtubes::PreTrack ( )
inlinevirtual

Definition at line 101 of file strawtubes.h.

101{;}

◆ ProcessHits()

Bool_t strawtubes::ProcessHits ( FairVolume *  v = 0)
virtual

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

This method is called from the MC stepping

Definition at line 102 of file strawtubes.cxx.

103{
105 //Set parameters at entrance of volume. Reset ELoss.
106 if ( gMC->IsTrackEntering() ) {
107 fELoss = 0.;
108 fTime = gMC->TrackTime() * 1.0e09;
109 fLength = gMC->TrackLength();
110 gMC->TrackPosition(fPos);
111 gMC->TrackMomentum(fMom);
112 }
113 // Sum energy loss for all steps in the active volume
114 fELoss += gMC->Edep();
115
116 // Create strawtubesPoint at exit of active volume
117 if ( gMC->IsTrackExiting() ||
118 gMC->IsTrackStop() ||
119 gMC->IsTrackDisappeared() ) {
120 if (fELoss == 0. ) { return kFALSE; }
121 TParticle* p=gMC->GetStack()->GetCurrentTrack();
122 Int_t pdgCode = p->GetPdgCode();
123 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
124 Int_t straw_uniqueId;
125 gMC->CurrentVolID(straw_uniqueId);
126 if (fVolumeID == straw_uniqueId) {
127 //std::cout << pdgCode<< " same volume again ? "<< straw_uniqueId << " exit:" << gMC->IsTrackExiting() << " stop:" << gMC->IsTrackStop() << " disappeared:" << gMC->IsTrackDisappeared()<< std::endl;
128 return kTRUE; }
129 fVolumeID = straw_uniqueId;
130 // # d = |pq . u x v|/|u x v|
131 TVector3 bot,top;
132 StrawEndPoints(straw_uniqueId,bot,top);
133 TLorentzVector Pos;
134 gMC->TrackPosition(Pos);
135 Double_t xmean = (fPos.X()+Pos.X())/2. ;
136 Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
137 Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
138 TVector3 pq = TVector3(top.x()-xmean,top.y()-ymean,top.z()-zmean );
139 TVector3 u = TVector3(bot.x()-top.x(),bot.y()-top.y(),bot.z()-top.z() );
140 TVector3 v = TVector3(fPos.X()-Pos.X(),fPos.Y()-Pos.Y(),fPos.Z()-Pos.Z());
141 TVector3 uCrossv = u.Cross(v);
142 Double_t dist2Wire = fabs(pq.Dot(uCrossv))/(uCrossv.Mag()+1E-8);
143 Double_t deltaTrackLength = gMC->TrackLength() - fLength;
144 AddHit(fTrackID, straw_uniqueId, TVector3(xmean, ymean, zmean),
145 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, deltaTrackLength,
146 fELoss,pdgCode,dist2Wire);
147 if (dist2Wire>fInner_Straw_diameter/2){
148 std::cout << "addhit " << dist2Wire<< " straw id " << straw_uniqueId << " pdgcode " << pdgCode<< " dot prod " << pq.Dot(uCrossv)<< std::endl;
149 std::cout << " exit:" << gMC->IsTrackExiting() << " stop:" << gMC->IsTrackStop() << " disappeared:" << gMC->IsTrackDisappeared()<< std::endl;
150 std::cout << " entry:" << fPos.X()<< " " << fPos.Y()<< " " << fPos.Z() << std::endl;
151 std::cout << " exit:" << Pos.X()<< " " << Pos.Y()<< " " << Pos.Z() << std::endl;
152 std::cout << " mean:" << xmean<< " " << ymean << " " << zmean << std::endl;
153 std::cout << " bot:" << bot.x()<< " " << bot.y() << " " << bot.z() << std::endl;
154 std::cout << " top:" << top.x()<< " " << top.y() << " " << top.z() << std::endl;
155 pq.Print();
156 u.Print();
157 v.Print();
158 uCrossv.Print();
159 }
160 // Increment number of strawtubes det points in TParticle
161 ShipStack* stack = (ShipStack*) gMC->GetStack();
162 stack->AddPoint(kStraw);
163 }
164 return kTRUE;
165}
strawtubesPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode, Double_t dist2Wire)
void StrawEndPoints(Int_t detID, TVector3 &top, TVector3 &bot)

◆ Register()

void strawtubes::Register ( )
virtual

Registers the produced collections in FAIRRootManager.

This will create a branch in the output tree called strawtubesPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

Definition at line 174 of file strawtubes.cxx.

175{
176
183 FairRootManager::Instance()->Register("strawtubesPoint", "strawtubes",
185}

◆ Reset()

void strawtubes::Reset ( )
virtual

has to be called after each event to reset the containers

Definition at line 194 of file strawtubes.cxx.

195{
197}

◆ SetDeltazFrame()

void strawtubes::SetDeltazFrame ( Double_t  deltazframe)

Thickness (z) of the meterial frame

Definition at line 262 of file strawtubes.cxx.

263{
264 fDeltaz_frame = deltazframe;
265}

◆ SetDeltazLayer()

void strawtubes::SetDeltazLayer ( Double_t  deltazlayer)

Distance (z) between layer 1&2

Definition at line 230 of file strawtubes.cxx.

231{
232 fDeltaz_layer12 = deltazlayer;
233}

◆ SetDeltazPlane()

void strawtubes::SetDeltazPlane ( Double_t  deltazplane)

Distance (z) between plane 1&2

Definition at line 235 of file strawtubes.cxx.

236{
237 fDeltaz_plane12 = deltazplane;
238}

◆ SetDeltazView()

void strawtubes::SetDeltazView ( Double_t  deltazview)

Distance (z) between views

Definition at line 257 of file strawtubes.cxx.

258{
259 fDeltaz_view = deltazview;
260}

◆ SetFrameLateralWidth()

void strawtubes::SetFrameLateralWidth ( Double_t  framelateralwidth)

Width (x and y) of the material frame

Definition at line 267 of file strawtubes.cxx.

268{
269 fFrame_lateral_width = framelateralwidth;
270}

◆ SetFrameMaterial()

void strawtubes::SetFrameMaterial ( TString  framematerial)

Material of the view frame

Definition at line 272 of file strawtubes.cxx.

273{
274 fFrame_material = framematerial;
275}

◆ SetInnerStrawDiameter()

void strawtubes::SetInnerStrawDiameter ( Double_t  innerstrawdiameter)

Inner Straw diameter

Definition at line 212 of file strawtubes.cxx.

213{
214 fInner_Straw_diameter = innerstrawdiameter;
215}

◆ SetOuterStrawDiameter()

void strawtubes::SetOuterStrawDiameter ( Double_t  outerstrawdiameter)

Outer Straw diameter

Definition at line 217 of file strawtubes.cxx.

218{
219 fOuter_Straw_diameter = outerstrawdiameter;
220}

◆ SetSpecialPhysicsCuts()

virtual void strawtubes::SetSpecialPhysicsCuts ( )
inlinevirtual

Definition at line 95 of file strawtubes.h.

95{;}

◆ SetStereoAngle()

void strawtubes::SetStereoAngle ( Int_t  stereoangle)

Stereo angle of planes in a view

Definition at line 245 of file strawtubes.cxx.

246{
247 fView_angle = stereoangle;
248 fcosphi=cos(TMath::Pi()*fView_angle/180.);
249 fsinphi=sin(TMath::Pi()*fView_angle/180.);
250}
Double_t fcosphi
Stereo angle of layers in a view.
Definition strawtubes.h:133
Double_t fsinphi
Definition strawtubes.h:134

◆ SetStrawLength()

void strawtubes::SetStrawLength ( Double_t  strawlength)

Length (y) of a straw

Definition at line 207 of file strawtubes.cxx.

208{
209 fStraw_length = strawlength;
210}

◆ SetStrawLength12()

void strawtubes::SetStrawLength12 ( Double_t  strawlength12)

strawlength of stations 1,2

Definition at line 278 of file strawtubes.cxx.

279{
280 fStraw_length_12 = strawlength12;
281}

◆ SetStrawLengthVeto()

void strawtubes::SetStrawLengthVeto ( Double_t  strawlengthveto)

strawlength of veto station

Definition at line 283 of file strawtubes.cxx.

284{
285 fStraw_length_veto = strawlengthveto;
286}

◆ SetStrawPitch()

void strawtubes::SetStrawPitch ( Double_t  strawpitch,
Double_t  layer_offset,
Double_t  plane_offset 
)

Distance (x) between straws in one layer

Definition at line 223 of file strawtubes.cxx.

224{
225 fStraw_pitch = strawpitch;
226 fOffset_layer12 = layer_offset;
227 fOffset_plane12 = plane_offset;
228}

◆ SetStrawResolution()

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

Definition at line 72 of file strawtubes.h.

Double_t v_drift
Number of straws in one tr34 layer.
Definition strawtubes.h:148
Double_t sigma_spatial
drift velocity
Definition strawtubes.h:149

◆ SetStrawsPerLayer()

void strawtubes::SetStrawsPerLayer ( Int_t  strawsperlayer)

number of straws in one layer

Definition at line 240 of file strawtubes.cxx.

241{
242 fStraws_per_layer = strawsperlayer;
243}

◆ SetTr12YDim()

void strawtubes::SetTr12YDim ( Double_t  tr12ydim)

y size of stations 12

Definition at line 305 of file strawtubes.cxx.

306{
309 //std::cout<<"fStraws_per_layer_tr12 "<<fStraws_per_layer_tr12<< " ftr12ydim "<< ftr12ydim <<std::endl;
310}

◆ SetTr34YDim()

void strawtubes::SetTr34YDim ( Double_t  tr34ydim)

y size of stations 34

Definition at line 311 of file strawtubes.cxx.

312{
315 //std::cout<<"fStraws_per_layer_tr34 "<<fStraws_per_layer_tr34<<" ftr34ydim "<< ftr34ydim << std::endl;
316}

◆ SetVacBox_x()

void strawtubes::SetVacBox_x ( Double_t  vacbox_x)

x size of station vacuum box

Definition at line 289 of file strawtubes.cxx.

290{
291 fVacBox_x = vacbox_x;
292}

◆ SetVacBox_y()

void strawtubes::SetVacBox_y ( Double_t  vacbox_y)

y size of station vacuum box

Definition at line 294 of file strawtubes.cxx.

295{
296 fVacBox_y = vacbox_y;
297}
Double_t fVacBox_y
x size of station vacuumbox
Definition strawtubes.h:141

◆ SetVetoYDim()

void strawtubes::SetVetoYDim ( Double_t  vetoydim)

y size of veto

Definition at line 299 of file strawtubes.cxx.

300{
303 //std::cout<<"fStraws_per_layer_veto "<<fStraws_per_layer_veto<<" fvetoydim "<< fvetoydim<<std::endl;
304}

◆ SetWireThickness()

void strawtubes::SetWireThickness ( Double_t  wirethickness)

Thickness of the wire

Definition at line 252 of file strawtubes.cxx.

253{
254 fWire_thickness = wirethickness;
255}

◆ SetZpositions()

void strawtubes::SetZpositions ( Double_t  z0,
Double_t  z1,
Double_t  z2,
Double_t  z3,
Double_t  z4 
)

z-position of veto station

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 198 of file strawtubes.cxx.

199{
200 fT0z = z0;
201 fT1z = z1;
202 fT2z = z2;
203 fT3z = z3;
204 fT4z = z4;
205}

◆ StrawDecode()

void strawtubes::StrawDecode ( Int_t  detID,
int &  statnb,
int &  vnb,
int &  pnb,
int &  lnb,
int &  snb 
)

Definition at line 776 of file strawtubes.cxx.

777{
778 statnb = detID/10000000;
779 vnb = (detID - statnb*10000000)/1000000;
780 pnb = (detID - statnb*10000000 - vnb*1000000)/100000;
781 lnb = (detID - statnb*10000000 - vnb*1000000 - pnb*100000)/10000;
782 snb = detID - statnb*10000000 - vnb*1000000 - pnb*100000 - lnb*10000 - 2000;
783}

◆ StrawEndPoints()

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

Definition at line 786 of file strawtubes.cxx.

788{
789 Int_t statnb = fDetectorID/10000000;
790 Int_t vnb = (fDetectorID - statnb*10000000)/1000000;
791 Int_t pnb = (fDetectorID- statnb*10000000 - vnb*1000000)/100000;
792 Int_t lnb = (fDetectorID - statnb*10000000 - vnb*1000000 - pnb*100000)/10000;
793 TString stat = "Tr";stat+=+statnb;stat+="_";stat+=statnb;
794 if (statnb==5){stat="Veto_5";}
795 TString view;
796 switch (vnb) {
797 case 0:
798 view = "_x1";
799 if (statnb==5){view = "_x";}
800 break;
801 case 1:
802 view = "_u";
803 break;
804 case 2:
805 view = "_v";
806 break;
807 case 3:
808 view = "_x2";
809 break;
810 default:
811 view = "_x1";}
812 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
813 TString prefix = "Tr";
814 if (statnb==5){prefix="Veto";}
815 else{prefix+=statnb;}
816 prefix+=view;prefix+="_plane_";prefix+=pnb;prefix+="_";
817 TString plane = prefix;plane+=statnb;plane+=vnb;plane+=+pnb;plane+="00000";
818 TString layer = prefix+"layer_";layer+=lnb;layer+="_";layer+=statnb;layer+=vnb;layer+=pnb;layer+=lnb;layer+="0000";
819 TString wire = "wire_";
820 if (statnb==5){wire+="veto_";}
821 wire+=(fDetectorID+1000);
822 if (statnb<3){wire = "wire_12_";wire+=(fDetectorID+1000);}
823 TString path = "/";path+=stat;path+="/";path+=plane;path+="/";path+=layer;path+="/";path+=wire;
824 Bool_t rc = nav->cd(path);
825 if (not rc){
826 cout << "strawtubes::StrawDecode, TgeoNavigator failed "<<path<<endl;
827 return;
828 }
829 TGeoNode* W = nav->GetCurrentNode();
830 TGeoTube* S = dynamic_cast<TGeoTube*>(W->GetVolume()->GetShape());
831 Double_t top[3] = {0,0,S->GetDZ()};
832 Double_t bot[3] = {0,0,-S->GetDZ()};
833 Double_t Gtop[3],Gbot[3];
834 nav->LocalToMaster(top, Gtop); nav->LocalToMaster(bot, Gbot);
835 vtop.SetXYZ(Gtop[0],Gtop[1],Gtop[2]);
836 vbot.SetXYZ(Gbot[0],Gbot[1],Gbot[2]);
837}
dict S
Definition MufiCTR.py:12

◆ StrawEndPointsOriginal()

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

Definition at line 838 of file strawtubes.cxx.

840{
841 Double_t sinangle,cosangle;
842 Int_t statnb,vnb,pnb,lnb,snb;
843 StrawDecode(detID,statnb,vnb,pnb,lnb,snb);
844 switch (vnb) {
845 case 0:
846 sinangle=0.;
847 cosangle=1.;
848 break;
849 case 1:
850 sinangle=fsinphi;
851 cosangle=fcosphi;
852 break;
853 case 2:
854 sinangle=-fsinphi;
855 cosangle=fcosphi;
856 break;
857 case 3:
858 sinangle=0.;
859 cosangle=1.;
860 break;
861 default:
862 sinangle=0.;
863 cosangle=1.;
864 }
865
866 //cout << "DetID" << detID << " statnb "<<statnb<<" vnb " << vnb << " pnb " << pnb <<" lnb "<< lnb << " snb " << snb << endl;
867 // from ConstructGeometry above
868 Double_t yDim = (fStraws_per_layer+1) * fStraw_pitch /2. ;
869 Double_t ypos = 0.;
870 Double_t xtop = 0.;
871 Double_t ytop = 0.;
872 Double_t xbot = 0.;
873 Double_t ybot = 0.;
874 if ((statnb==1)|| (statnb==2)) {
876 xtop = -fStraw_length_12*cosangle - ypos*sinangle;
877 ytop = -fStraw_length_12*sinangle + ypos*cosangle;
878 xbot = fStraw_length_12*cosangle - ypos*sinangle;
879 ybot = fStraw_length_12*sinangle + ypos*cosangle;}
880 if ((statnb==3)|| (statnb==4)) {
882 xtop = -fStraw_length*cosangle - ypos*sinangle;
883 ytop = -fStraw_length*sinangle + ypos*cosangle;
884 xbot = fStraw_length*cosangle - ypos*sinangle;
885 ybot = fStraw_length*sinangle + ypos*cosangle; }
886 if (statnb==5) {
888 xtop = -fStraw_length_veto*cosangle - ypos*sinangle;
889 ytop = -fStraw_length_veto*sinangle + ypos*cosangle;
890 xbot = fStraw_length_veto*cosangle - ypos*sinangle;
891 ybot = fStraw_length_veto*sinangle + ypos*cosangle; }
892
893 Double_t TStationz;
894 switch (statnb) {
895 case 1:
896 TStationz = fT1z;
897 break;
898 case 2:
899 TStationz = fT2z;
900 break;
901 case 3:
902 TStationz = fT3z;
903 break;
904 case 4:
905 TStationz = fT4z;
906 break;
907 case 5:
908 TStationz = fT0z;
909 break;
910 default:
911 TStationz = fT0z;
912 }
913 Double_t zpos;
914 if (statnb < 5){
915 zpos = TStationz+(vnb-3./2.)*fDeltaz_view+(pnb-1./2.)*fDeltaz_plane12+(lnb-1./2.)*fDeltaz_layer12;
916 }else{
917 zpos = TStationz+(vnb-1./2.)*fDeltaz_view+(pnb-1./2.)*fDeltaz_plane12+(lnb-1./2.)*fDeltaz_layer12;
918 }
919 top = TVector3(xtop,ytop,zpos);
920 bot = TVector3(xbot,ybot,zpos);
921 //cout << "dets="<< xtop << " "<< xbot << " "<< ytop << " "<< ybot<< " "<< ypos<< " "<< fStraw_length<< " "<<detID<<endl;
922 //cout << "top/bot="<< snb << " "<< vnb << " "<< pnb << " "<< lnb << " "<< ypos<< " "<< fOffset_layer12<< " "<<fOffset_plane12<<endl;
923}
void StrawDecode(Int_t detID, int &statnb, int &vnb, int &pnb, int &lnb, int &snb)

◆ StrawSigmaSpatial()

Double_t strawtubes::StrawSigmaSpatial ( )
inline

Definition at line 74 of file strawtubes.h.

74{return sigma_spatial;}

◆ StrawVdrift()

Double_t strawtubes::StrawVdrift ( )
inline

Definition at line 73 of file strawtubes.h.

73{return v_drift;}

Member Data Documentation

◆ fcosphi

Double_t strawtubes::fcosphi
private

Stereo angle of layers in a view.

Definition at line 133 of file strawtubes.h.

◆ fDeltaz_frame

Double_t strawtubes::fDeltaz_frame
private

Thickness of the wire.

Definition at line 136 of file strawtubes.h.

◆ fDeltaz_layer12

Double_t strawtubes::fDeltaz_layer12
private

Distance (x) between straws in one layer.

Definition at line 127 of file strawtubes.h.

◆ fDeltaz_plane12

Double_t strawtubes::fDeltaz_plane12
private

Distance (z) between layer 1&2.

Definition at line 128 of file strawtubes.h.

◆ fDeltaz_view

Double_t strawtubes::fDeltaz_view
private

Material of the view frame.

Definition at line 139 of file strawtubes.h.

◆ fELoss

Double_t strawtubes::fELoss
private

length

Definition at line 115 of file strawtubes.h.

◆ fFrame_lateral_width

Double_t strawtubes::fFrame_lateral_width
private

Thickness (z) of the meterial frame.

Definition at line 137 of file strawtubes.h.

◆ fFrame_material

TString strawtubes::fFrame_material
private

Width (x and y) of the material frame.

Definition at line 138 of file strawtubes.h.

◆ fInner_Straw_diameter

Double_t strawtubes::fInner_Straw_diameter
private

strawlength for veto station

Definition at line 124 of file strawtubes.h.

◆ fLength

Double_t strawtubes::fLength
private

time

Definition at line 114 of file strawtubes.h.

◆ fMom

TLorentzVector strawtubes::fMom
private

position at entrance

Definition at line 112 of file strawtubes.h.

◆ fOffset_layer12

Double_t strawtubes::fOffset_layer12
private

Distance (z) between plane 1&2.

Definition at line 129 of file strawtubes.h.

◆ fOffset_plane12

Double_t strawtubes::fOffset_plane12
private

Offset (x) between straws of layer2&1.

Definition at line 130 of file strawtubes.h.

◆ fOuter_Straw_diameter

Double_t strawtubes::fOuter_Straw_diameter
private

Inner Straw diameter.

Definition at line 125 of file strawtubes.h.

◆ fPos

TLorentzVector strawtubes::fPos
private

volume id

Definition at line 111 of file strawtubes.h.

◆ fsinphi

Double_t strawtubes::fsinphi
private

Definition at line 134 of file strawtubes.h.

◆ fStraw_length

Double_t strawtubes::fStraw_length
private

z-position of tracking station 4

Definition at line 121 of file strawtubes.h.

◆ fStraw_length_12

Double_t strawtubes::fStraw_length_12
private

Length (y) of a straw.

Definition at line 122 of file strawtubes.h.

◆ fStraw_length_veto

Double_t strawtubes::fStraw_length_veto
private

strawlength for tracking station 1 & 2

Definition at line 123 of file strawtubes.h.

◆ fStraw_pitch

Double_t strawtubes::fStraw_pitch
private

Outer Straw diameter.

Definition at line 126 of file strawtubes.h.

◆ fStraws_per_layer

Int_t strawtubes::fStraws_per_layer
private

Offset (x) between straws of plane1&2.

Definition at line 131 of file strawtubes.h.

◆ fStraws_per_layer_tr12

Int_t strawtubes::fStraws_per_layer_tr12
private

Number of straws in one veto layer.

Definition at line 146 of file strawtubes.h.

◆ fStraws_per_layer_tr34

Int_t strawtubes::fStraws_per_layer_tr34
private

Number of straws in one tr12 layer.

Definition at line 147 of file strawtubes.h.

◆ fStraws_per_layer_veto

Int_t strawtubes::fStraws_per_layer_veto
private

y size of tr34 stations

Definition at line 145 of file strawtubes.h.

◆ fstrawtubesPointCollection

TClonesArray* strawtubes::fstrawtubesPointCollection
private

spatial resolution

container for data points

Definition at line 152 of file strawtubes.h.

◆ fT0z

Double_t strawtubes::fT0z
private

energy loss

Definition at line 116 of file strawtubes.h.

◆ fT1z

Double_t strawtubes::fT1z
private

z-position of veto station

Definition at line 117 of file strawtubes.h.

◆ fT2z

Double_t strawtubes::fT2z
private

z-position of tracking station 1

Definition at line 118 of file strawtubes.h.

◆ fT3z

Double_t strawtubes::fT3z
private

z-position of tracking station 2

Definition at line 119 of file strawtubes.h.

◆ fT4z

Double_t strawtubes::fT4z
private

z-position of tracking station 3

Definition at line 120 of file strawtubes.h.

◆ fTime

Double_t strawtubes::fTime
private

momentum at entrance

Definition at line 113 of file strawtubes.h.

◆ ftr12ydim

Double_t strawtubes::ftr12ydim
private

y size of veto station

Definition at line 143 of file strawtubes.h.

◆ ftr34ydim

Double_t strawtubes::ftr34ydim
private

y size of tr12 stations

Definition at line 144 of file strawtubes.h.

◆ fTrackID

Int_t strawtubes::fTrackID
private

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

Definition at line 109 of file strawtubes.h.

◆ fVacBox_x

Double_t strawtubes::fVacBox_x
private

Distance (z) between views.

Definition at line 140 of file strawtubes.h.

◆ fVacBox_y

Double_t strawtubes::fVacBox_y
private

x size of station vacuumbox

Definition at line 141 of file strawtubes.h.

◆ fvetoydim

Double_t strawtubes::fvetoydim
private

y size of station vacuumbox

Definition at line 142 of file strawtubes.h.

◆ fView_angle

Double_t strawtubes::fView_angle
private

Number of straws in one layer.

Definition at line 132 of file strawtubes.h.

◆ fVolumeID

Int_t strawtubes::fVolumeID
private

track index

Definition at line 110 of file strawtubes.h.

◆ fWire_thickness

Double_t strawtubes::fWire_thickness
private

Definition at line 135 of file strawtubes.h.

◆ sigma_spatial

Double_t strawtubes::sigma_spatial
private

drift velocity

Definition at line 149 of file strawtubes.h.

◆ v_drift

Double_t strawtubes::v_drift
private

Number of straws in one tr34 layer.

Definition at line 148 of file strawtubes.h.


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