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

#include <strawtubesHit.h>

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

Public Member Functions

 strawtubesHit ()
 strawtubesHit (Int_t detID, Float_t tdc)
 strawtubesHit (strawtubesPoint *p, Double_t t0)
 ~strawtubesHit () override=default
Int_t GetStationNumber () const
Int_t GetViewNumber () const
Int_t GetLayerNumber () const
Int_t GetStrawNumber () const
void Print () const
Float_t GetTDC () const
void setInvalid ()
bool isValid () const
 strawtubesHit (const strawtubesHit &point)=default
strawtubesHit & operator= (const strawtubesHit &point)=default
void Print (const Option_t *opt="") const override
Public Member Functions inherited from SHiP::DetectorHit
 DetectorHit ()
 DetectorHit (Int_t detID, Float_t digi)
 ~DetectorHit () override=default
Double_t GetDigi () const
Int_t GetDetectorID () const
void SetDigi (Float_t d)
void SetDetectorID (Int_t detID)
void Print (const Option_t *opt="") const override

Private Member Functions

 ClassDefOverride (strawtubesHit, 6)

Private Attributes

Bool_t flag {true}
 validity flag

Additional Inherited Members

Protected Member Functions inherited from SHiP::DetectorHit
 ClassDefOverride (SHiP::DetectorHit, 1)
Protected Attributes inherited from SHiP::DetectorHit
Float_t fdigi
 digitized detector hit
Int_t fDetectorID
 Detector unique identifier.

Detailed Description

Definition at line 11 of file strawtubesHit.h.

Constructor & Destructor Documentation

◆ strawtubesHit() [1/4]

strawtubesHit::strawtubesHit ( )

Default constructor

Definition at line 27 of file strawtubesHit.cxx.

27: SHiP::DetectorHit() {}

◆ strawtubesHit() [2/4]

strawtubesHit::strawtubesHit ( Int_t detID,
Float_t tdc )

Constructor with arguments

Parameters
detIDDetector ID
digidigitized/measured TDC
flagTrue/False, false if there is another hit with smaller tdc

Definition at line 29 of file strawtubesHit.cxx.

30 : SHiP::DetectorHit(detID, tdc) {}

◆ strawtubesHit() [3/4]

strawtubesHit::strawtubesHit ( strawtubesPoint * p,
Double_t t0 )

Definition at line 33 of file strawtubesHit.cxx.

34 : SHiP::DetectorHit() {
35 if (!p) {
36 LOG(error) << "strawtubesHit: null strawtubesPoint pointer";
37 return;
38 }
39 TVector3 start = TVector3();
40 TVector3 stop = TVector3();
41 fDetectorID = p->GetDetectorID();
42 strawtubes* module = dynamic_cast<strawtubes*>(
43 FairRunSim::Instance()->GetListOfModules()->FindObject("strawtubes"));
44 Double_t v_drift = module->StrawVdrift();
45 Double_t sigma_spatial = module->StrawSigmaSpatial();
47 Double_t t_drift =
48 fabs(gRandom->Gaus(p->dist2Wire(), sigma_spatial)) / v_drift;
49 fdigi =
50 t0 + p->GetTime() + t_drift + (stop[0] - p->GetX()) / ShipUnit::c_light;
51}
Float_t fdigi
digitized detector hit
Definition DetectorHit.h:39
Int_t fDetectorID
Detector unique identifier.
Definition DetectorHit.h:40
static void StrawEndPoints(Int_t detID, TVector3 &bot, TVector3 &top)
constexpr double c_light
Definition ShipUnit.h:44

◆ ~strawtubesHit()

strawtubesHit::~strawtubesHit ( )
overridedefault

Destructor

◆ strawtubesHit() [4/4]

strawtubesHit::strawtubesHit ( const strawtubesHit & point)
default

Copy constructor

Member Function Documentation

◆ ClassDefOverride()

strawtubesHit::ClassDefOverride ( strawtubesHit ,
6  )
private

◆ GetLayerNumber()

Int_t strawtubesHit::GetLayerNumber ( ) const

Definition at line 71 of file strawtubesHit.cxx.

71 {
72 Int_t detID = GetDetectorID();
73 const auto decode = strawtubes::StrawDecode(detID);
74
75 return std::get<2>(decode);
76}
Int_t GetDetectorID() const
Definition DetectorHit.h:29
static std::array< Int_t, 4 > StrawDecode(Int_t detID)

◆ GetStationNumber()

Int_t strawtubesHit::GetStationNumber ( ) const

Accessors

Definition at line 57 of file strawtubesHit.cxx.

57 {
58 Int_t detID = GetDetectorID();
59 const auto decode = strawtubes::StrawDecode(detID);
60
61 return std::get<0>(decode);
62}

◆ GetStrawNumber()

Int_t strawtubesHit::GetStrawNumber ( ) const

Definition at line 78 of file strawtubesHit.cxx.

78 {
79 Int_t detID = GetDetectorID();
80 const auto decode = strawtubes::StrawDecode(detID);
81
82 return std::get<3>(decode);
83}

◆ GetTDC()

Float_t strawtubesHit::GetTDC ( ) const
inline

Definition at line 35 of file strawtubesHit.h.

35{ return fdigi; }

◆ GetViewNumber()

Int_t strawtubesHit::GetViewNumber ( ) const

Definition at line 64 of file strawtubesHit.cxx.

64 {
65 Int_t detID = GetDetectorID();
66 const auto decode = strawtubes::StrawDecode(detID);
67
68 return std::get<1>(decode);
69}

◆ isValid()

bool strawtubesHit::isValid ( ) const
inline

Definition at line 37 of file strawtubesHit.h.

37{ return flag; }
Bool_t flag
validity flag

◆ operator=()

strawtubesHit & strawtubesHit::operator= ( const strawtubesHit & point)
default

◆ Print() [1/2]

void strawtubesHit::Print ( ) const

Definition at line 86 of file strawtubesHit.cxx.

86 {
87 cout << "-I- strawtubesHit: strawtubes hit " << " in detector " << fDetectorID
88 << endl;
89 cout << " TDC " << fdigi << " ns" << endl;
90}

◆ Print() [2/2]

void SHiP::DetectorHit::Print ( const Option_t * opt = "") const
inlineoverride

Output to screen

Definition at line 36 of file DetectorHit.h.

36{}

◆ setInvalid()

void strawtubesHit::setInvalid ( )
inline

Definition at line 36 of file strawtubesHit.h.

36{ flag = false; }

Member Data Documentation

◆ flag

Bool_t strawtubesHit::flag {true}
private

validity flag

Definition at line 44 of file strawtubesHit.h.

44{true};

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