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

#include <TimeDetHit.h>

Inheritance diagram for TimeDetHit:
Collaboration diagram for TimeDetHit:

Public Member Functions

 TimeDetHit ()
 
 TimeDetHit (TimeDetPoint *p, Double_t t0)
 
 ~TimeDetHit () override=default
 
 TimeDetHit (const TimeDetHit &point)=default
 
TimeDetHitoperator= (const TimeDetHit &point)=default
 
Double_t GetX () const
 
Double_t GetY () const
 
Double_t GetZ () const
 
TVector3 GetXYZ () const
 
TGeoNode * GetNode () const
 
std::vector< double > GetTime (Double_t x) const
 
std::vector< double > GetTime () const
 
std::vector< double > GetMeasurements () const
 
void SetTDC (Float_t val1, Float_t val2)
 
void Print () const
 
void Dist (Float_t x, Float_t &lpos, Float_t &lneg) const
 
Double_t Resol (Double_t x) const
 
void setInvalid ()
 
void setIsValid ()
 
bool isValid () const
 
- 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

 ClassDef (TimeDetHit, 4)
 

Private Attributes

Bool_t flag {true}
 flag
 
Float_t t_1
 
Float_t t_2
 TDC on both sides.
 

Static Private Attributes

static constexpr Double_t v_drift = 15.
 
static constexpr Double_t par [4] = {0.0272814, 109.303, 0, 0.0539487}
 

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 TimeDetHit.h.

Constructor & Destructor Documentation

◆ TimeDetHit() [1/3]

TimeDetHit::TimeDetHit ( )

Default constructor

Definition at line 27 of file TimeDetHit.cxx.

◆ TimeDetHit() [2/3]

TimeDetHit::TimeDetHit ( TimeDetPoint p,
Double_t  t0 
)

Constructor from TimeDetHit

Parameters
detIDDetector ID
t_1,t_2TDC on both sides
flagTrue/False, in case of pile up

Definition at line 31 of file TimeDetHit.cxx.

32 if (!p) {
33 LOG(error) << "TimeDetHit: null TimeDetPoint pointer";
34 return;
35 }
36 fDetectorID = p->GetDetectorID();
37 Float_t lpos, lneg;
38 Dist(p->GetX(), lpos, lneg);
39 Double_t sigma = Resol(lneg); // in ns
40 t_1 = gRandom->Gaus(0, sigma) + lneg / v_drift + t0 + p->GetTime();
41 sigma = Resol(lpos); // in ns
42 t_2 = gRandom->Gaus(0, sigma) + lpos / v_drift + t0 + p->GetTime();
43}
Int_t fDetectorID
Detector unique identifier.
Definition: DetectorHit.h:40
static constexpr Double_t v_drift
Definition: TimeDetHit.h:56
Float_t t_1
Definition: TimeDetHit.h:60
Double_t Resol(Double_t x) const
Definition: TimeDetHit.cxx:73
void Dist(Float_t x, Float_t &lpos, Float_t &lneg) const
Definition: TimeDetHit.cxx:80
Float_t t_2
TDC on both sides.
Definition: TimeDetHit.h:60
ROOT p
Definition: makeDecay.py:76
dict sigma
Definition: runPythia8.py:187

◆ ~TimeDetHit()

TimeDetHit::~TimeDetHit ( )
overridedefault

Destructor

◆ TimeDetHit() [3/3]

TimeDetHit::TimeDetHit ( const TimeDetHit point)
default

Copy constructor

Member Function Documentation

◆ ClassDef()

TimeDetHit::ClassDef ( TimeDetHit  ,
 
)
private

◆ Dist()

void TimeDetHit::Dist ( Float_t  x,
Float_t &  lpos,
Float_t &  lneg 
) const

Definition at line 80 of file TimeDetHit.cxx.

80 {
81 TGeoNode* node = GetNode();
82 auto shape = dynamic_cast<TGeoBBox*>(node->GetVolume()->GetShape());
83 TVector3 pos = GetXYZ();
84 lpos = TMath::Abs(pos.X() + shape->GetDX() - x);
85 lneg = TMath::Abs(pos.X() - shape->GetDX() - x);
86}
TVector3 GetXYZ() const
Definition: TimeDetHit.cxx:88
TGeoNode * GetNode() const
Definition: TimeDetHit.cxx:115

◆ GetMeasurements()

std::vector< double > TimeDetHit::GetMeasurements ( ) const

Definition at line 77 of file TimeDetHit.cxx.

77{ return {t_1, t_2}; }

◆ GetNode()

TGeoNode * TimeDetHit::GetNode ( ) const

Definition at line 115 of file TimeDetHit.cxx.

115 {
116 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
117 TString path = "/Timing Detector_1/TimeDet_";
118 path += fDetectorID;
119 nav->cd(path);
120 return nav->GetCurrentNode();
121}

◆ GetTime() [1/2]

std::vector< double > TimeDetHit::GetTime ( ) const

Definition at line 60 of file TimeDetHit.cxx.

60 {
61 TGeoBBox* shape =
62 dynamic_cast<TGeoBBox*>(gGeoManager->GetVolume("TimeDet")->GetShape());
63 Double_t t0 = (t_1 + t_2) / 2. - shape->GetDX() / v_drift;
64 Float_t lpos, lneg;
65 lneg = (t_1 - t0) * v_drift;
66 lpos = (t_2 - t0) * v_drift;
67 Float_t r1 = Resol(lneg);
68 Float_t r2 = Resol(lpos);
69 Double_t dt = TMath::Sqrt(r1 * r1 + r2 * r2);
70 return {t0, dt};
71}

◆ GetTime() [2/2]

std::vector< double > TimeDetHit::GetTime ( Double_t  x) const

Definition at line 46 of file TimeDetHit.cxx.

46 {
47 // calculate distance to left and right end
48 Float_t lpos, lneg;
49 Dist(x, lpos, lneg);
50 Double_t r = Resol(lneg);
51 Double_t w1 = 1. / (r * r);
52 r = Resol(lpos);
53 Double_t w2 = 1. / (r * r);
54 Double_t dt = 1. / TMath::Sqrt(w1 + w2);
55 Double_t t =
56 ((t_1 - lneg / v_drift) * w1 + (t_2 - lpos / v_drift) * w2) / (w1 + w2);
57 return {t, dt};
58}

◆ GetX()

Double_t TimeDetHit::GetX ( ) const

Accessors

Definition at line 100 of file TimeDetHit.cxx.

100 {
101 TVector3 pos = GetXYZ();
102 return pos.X();
103}

◆ GetXYZ()

TVector3 TimeDetHit::GetXYZ ( ) const

Definition at line 88 of file TimeDetHit.cxx.

88 {
89 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
90 TGeoNode* node = GetNode();
91 auto shape = dynamic_cast<TGeoBBox*>(node->GetVolume()->GetShape());
92 Double_t origin[3] = {shape->GetOrigin()[0], shape->GetOrigin()[1],
93 shape->GetOrigin()[2]};
94 Double_t master[3] = {0, 0, 0};
95 nav->LocalToMaster(origin, master);
96 TVector3 pos = TVector3(master[0], master[1], master[2]);
97 return pos;
98}
None origin(sTree, it)

◆ GetY()

Double_t TimeDetHit::GetY ( ) const

Definition at line 105 of file TimeDetHit.cxx.

105 {
106 TVector3 pos = GetXYZ();
107 return pos.Y();
108}

◆ GetZ()

Double_t TimeDetHit::GetZ ( ) const

Definition at line 110 of file TimeDetHit.cxx.

110 {
111 TVector3 pos = GetXYZ();
112 return pos.Z();
113}

◆ isValid()

bool TimeDetHit::isValid ( ) const
inline

Definition at line 53 of file TimeDetHit.h.

53{ return flag; }
Bool_t flag
flag
Definition: TimeDetHit.h:59

◆ operator=()

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

◆ Print()

void TimeDetHit::Print ( ) const

Definition at line 124 of file TimeDetHit.cxx.

124 {
125 cout << "-I- TimeDetHit: TimeDet hit " << " in detector " << fDetectorID
126 << endl;
127 cout << " TDC left " << t_1 << " ns TDC right " << t_2 << " ns" << endl;
128}

◆ Resol()

Double_t TimeDetHit::Resol ( Double_t  x) const

Definition at line 73 of file TimeDetHit.cxx.

73 {
74 return par[0] * TMath::Exp((x - par[2]) / par[1]) + par[3];
75}
static constexpr Double_t par[4]
Definition: TimeDetHit.h:57

◆ setInvalid()

void TimeDetHit::setInvalid ( )
inline

Definition at line 51 of file TimeDetHit.h.

51{ flag = false; }

◆ setIsValid()

void TimeDetHit::setIsValid ( )
inline

Definition at line 52 of file TimeDetHit.h.

52{ flag = true; }

◆ SetTDC()

void TimeDetHit::SetTDC ( Float_t  val1,
Float_t  val2 
)
inline

Modifier

Definition at line 40 of file TimeDetHit.h.

40 {
41 t_1 = val1;
42 t_2 = val2;
43 }

Member Data Documentation

◆ flag

Bool_t TimeDetHit::flag {true}
private

flag

Definition at line 59 of file TimeDetHit.h.

◆ par

constexpr Double_t TimeDetHit::par[4] = {0.0272814, 109.303, 0, 0.0539487}
staticconstexprprivate

Definition at line 57 of file TimeDetHit.h.

◆ t_1

Float_t TimeDetHit::t_1
private

Definition at line 60 of file TimeDetHit.h.

◆ t_2

Float_t TimeDetHit::t_2
private

TDC on both sides.

Definition at line 60 of file TimeDetHit.h.

◆ v_drift

constexpr Double_t TimeDetHit::v_drift = 15.
staticconstexprprivate

Definition at line 56 of file TimeDetHit.h.


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