SND@LHC Software
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)
 
virtual ~TimeDetHit ()
 
Double_t GetX ()
 
Double_t GetY ()
 
Double_t GetZ ()
 
TVector3 GetXYZ ()
 
TGeoNode * GetNode ()
 
std::vector< double > GetTime (Double_t x)
 
std::vector< double > GetTime ()
 
std::vector< double > GetMeasurements ()
 
void SetTDC (Float_t val1, Float_t val2)
 
virtual void Print () const
 
void Dist (Float_t x, Float_t &lpos, Float_t &lneg)
 
Double_t Resol (Double_t x)
 
void setInvalid ()
 
void setIsValid ()
 
bool isValid () const
 
- Public Member Functions inherited from ShipHit
 ShipHit ()
 
 ShipHit (Int_t detID, Float_t digi)
 
virtual ~ShipHit ()
 
Double_t GetDigi () const
 
Int_t GetDetectorID () const
 
void SetDigi (Float_t d)
 
void SetDetectorID (Int_t detID)
 
virtual void Print (const Option_t *opt="") const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Member Functions

 TimeDetHit (const TimeDetHit &point)
 
TimeDetHit operator= (const TimeDetHit &point)
 
 ClassDef (TimeDetHit, 1)
 

Private Attributes

Double_t v_drift = 15.
 
Double_t par [4] = { 0.0272814, 109.303, 0, 0.0539487 }
 
Float_t flag
 flag
 
Float_t t_1
 
Float_t t_2
 TDC on both sides.
 

Additional Inherited Members

- Protected Member Functions inherited from ShipHit
 ClassDef (ShipHit, 1)
 
- Protected Attributes inherited from ShipHit
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 21 of file TimeDetHit.cxx.

22 : ShipHit()
23{
24 flag = true;
25}
ShipHit()
Definition ShipHit.cxx:5
Float_t flag
flag
Definition TimeDetHit.h:54

◆ 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 29 of file TimeDetHit.cxx.

30 : ShipHit()
31{
32 fDetectorID = p->GetDetectorID();
33 Float_t lpos, lneg;
34 Dist(p->GetX(), lpos, lneg);
35 Double_t sigma = Resol(lneg); // in ns
36 t_1 = gRandom->Gaus( 0, sigma ) + lneg/v_drift + t0 + p->GetTime();
37 sigma = Resol(lpos); // in ns
38 t_2 = gRandom->Gaus( 0, sigma ) + lpos/v_drift + t0 + p->GetTime();
39 flag = true;
40}
Int_t fDetectorID
Detector unique identifier.
Definition ShipHit.h:58
Double_t Resol(Double_t x)
Double_t v_drift
Definition TimeDetHit.h:51
Float_t t_1
Definition TimeDetHit.h:55
void Dist(Float_t x, Float_t &lpos, Float_t &lneg)
Float_t t_2
TDC on both sides.
Definition TimeDetHit.h:55

◆ ~TimeDetHit()

TimeDetHit::~TimeDetHit ( )
virtual

Destructor

Definition at line 44 of file TimeDetHit.cxx.

44{ }

◆ TimeDetHit() [3/3]

TimeDetHit::TimeDetHit ( const TimeDetHit point)
private

Member Function Documentation

◆ ClassDef()

TimeDetHit::ClassDef ( TimeDetHit  ,
 
)
private

◆ Dist()

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

Definition at line 91 of file TimeDetHit.cxx.

91 {
92 TGeoNode* node = GetNode();
93 auto shape = dynamic_cast<TGeoBBox*>(node->GetVolume()->GetShape());
94 TVector3 pos = GetXYZ();
95 lpos = TMath::Abs( pos.X() + shape->GetDX() - x );
96 lneg = TMath::Abs( pos.X() - shape->GetDX() - x );
97}
TVector3 GetXYZ()
TGeoNode * GetNode()

◆ GetMeasurements()

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

Definition at line 83 of file TimeDetHit.cxx.

83 {
84 std::vector<double> m;
85 m.push_back( t_1);
86 m.push_back( t_2);
87 return m;
88}
Double_t m

◆ GetNode()

TGeoNode * TimeDetHit::GetNode ( )

Definition at line 130 of file TimeDetHit.cxx.

131{
132 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
133 TString path = "/Timing Detector_1/TimeDet_";path+=fDetectorID;
134 Bool_t rc = nav->cd(path);
135 return nav->GetCurrentNode();
136}

◆ GetTime() [1/2]

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

Definition at line 63 of file TimeDetHit.cxx.

63 {
64 TGeoBBox* shape = (TGeoBBox*)gGeoManager->GetVolume("TimeDet")->GetShape();
65 Double_t t0 = (t_1+t_2)/2.-shape->GetDX()/v_drift;
66 Float_t lpos, lneg;
67 lneg = (t_1-t0)*v_drift;
68 lpos = (t_2-t0)*v_drift;
69 Float_t r1 = Resol(lneg);
70 Float_t r2 = Resol(lpos);
71 Double_t dt = TMath::Sqrt(r1*r1+r2*r2);
72 std::vector<double> m;
73 m.push_back(t0);
74 m.push_back(dt);
75 return m;
76}

◆ GetTime() [2/2]

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

Definition at line 47 of file TimeDetHit.cxx.

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

◆ GetX()

Double_t TimeDetHit::GetX ( )

Accessors

Definition at line 112 of file TimeDetHit.cxx.

113{ TVector3 pos = GetXYZ();
114 return pos.X();
115}

◆ GetXYZ()

TVector3 TimeDetHit::GetXYZ ( )

Definition at line 99 of file TimeDetHit.cxx.

100{
101 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
102 TGeoNode* node = GetNode();
103 auto shape = dynamic_cast<TGeoBBox*>(node->GetVolume()->GetShape());
104 Double_t origin[3] = {shape->GetOrigin()[0],shape->GetOrigin()[1],shape->GetOrigin()[2]};
105 Double_t master[3] = {0,0,0};
106 nav->LocalToMaster(origin,master);
107 TVector3 pos = TVector3(master[0],master[1],master[2]);
108 return pos;
109}
origin(sTree, it)

◆ GetY()

Double_t TimeDetHit::GetY ( )

Definition at line 118 of file TimeDetHit.cxx.

119{ TVector3 pos = GetXYZ();
120 return pos.Y();
121}

◆ GetZ()

Double_t TimeDetHit::GetZ ( )

Definition at line 124 of file TimeDetHit.cxx.

125{ TVector3 pos = GetXYZ();
126 return pos.Z();
127}

◆ isValid()

bool TimeDetHit::isValid ( ) const
inline

Definition at line 47 of file TimeDetHit.h.

47{return flag;}

◆ operator=()

TimeDetHit TimeDetHit::operator= ( const TimeDetHit point)
private

◆ Print()

void TimeDetHit::Print ( ) const
virtual

Output to screen

Definition at line 140 of file TimeDetHit.cxx.

141{
142 cout << "-I- TimeDetHit: TimeDet hit " << " in detector " << fDetectorID << endl;
143 cout << " TDC left " << t_1 << " ns TDC right " << t_2 << " ns" << endl;
144}

◆ Resol()

Double_t TimeDetHit::Resol ( Double_t  x)

Definition at line 78 of file TimeDetHit.cxx.

79{
80 return par[0]*TMath::Exp( (x-par[2])/par[1] )+par[3];
81}
Double_t par[4]
Definition TimeDetHit.h:52

◆ setInvalid()

void TimeDetHit::setInvalid ( )
inline

Definition at line 45 of file TimeDetHit.h.

45{flag = false;}

◆ setIsValid()

void TimeDetHit::setIsValid ( )
inline

Definition at line 46 of file TimeDetHit.h.

46{flag = true;}

◆ SetTDC()

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

Modifier

Definition at line 38 of file TimeDetHit.h.

38{t_1=val1;t_2=val2;}

Member Data Documentation

◆ flag

Float_t TimeDetHit::flag
private

flag

Definition at line 54 of file TimeDetHit.h.

◆ par

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

Definition at line 52 of file TimeDetHit.h.

52{ 0.0272814, 109.303, 0, 0.0539487 };

◆ t_1

Float_t TimeDetHit::t_1
private

Definition at line 55 of file TimeDetHit.h.

◆ t_2

Float_t TimeDetHit::t_2
private

TDC on both sides.

Definition at line 55 of file TimeDetHit.h.

◆ v_drift

Double_t TimeDetHit::v_drift = 15.
private

Definition at line 51 of file TimeDetHit.h.


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