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

#include <TimeDet.h>

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

Public Member Functions

 TimeDet (const char *Name, Bool_t Active)
 TimeDet ()
Bool_t ProcessHits (FairVolume *v=nullptr) override
void SetZposition (Double_t z)
void SetBarZspacing (Double_t row, Double_t column)
void SetBarZ (Double_t dz)
void SetSizeX (Double_t x)
void SetSizeY (Double_t y)
Int_t GetNColumns () const
Int_t GetNRows () const
Int_t GetNBars () const
Double_t GetBarSizeX () const
Double_t GetBarSizeY () const
Double_t GetBarSizeZ () const
Double_t GetBarOverlapX () const
Double_t GetBarOverlapY () const
double GetXCol (int ic) const
double GetYRow (int ir) const
void GetBarRowCol (int ib, int &irow, int &icol) const
double GetZBar (int ir, int ic) const
void ConstructGeometry () override
Public Member Functions inherited from SHiP::Detector< TimeDetPoint >
 Detector ()=default
 ~Detector () override=default
TimeDetPoint * 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

Private Member Functions

 TimeDet (const TimeDet &)=delete
 Overlap along y.
TimeDet & operator= (const TimeDet &)=delete

Private Attributes

Double_t fzPos
Double_t fxSize
 z-position of veto station
Double_t fySize
 width of the detector
Double_t fxBar
 height of the detector
Double_t fyBar
 length of the bar
Double_t fzBar
 width of the bar
Double_t fdzBarCol
 depth of the bar
Double_t fdzBarRow
 z-distance between columns
Int_t fNCol
 z-distance between rows
Int_t fNRow
 Number of columns.
Double_t fxCenter
 Number of rows.
Double_t fyCenter
 x-position of the detector center
Int_t fNBars
 y-position of the detector center
Double_t fxOv
 Number of bars.
Double_t fyOv
 Overlap along x.

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file TimeDet.h.

Constructor & Destructor Documentation

◆ TimeDet() [1/3]

TimeDet::TimeDet ( 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 66 of file TimeDet.cxx.

67 : Detector(name, active, kTimeDet),
68 //
69 fzPos(0),
70 fxSize(550),
71 fySize(650),
72 fxBar(140),
73 fyBar(6),
74 fzBar(1),
75 fdzBarCol(9.0),
76 fdzBarRow(1.2),
77 fNCol(3),
78 fNRow(110),
79 fxCenter(0),
80 fyCenter(0) {
81 fNBars = fNCol * fNRow;
82 fxOv = kDefaultBarOverlapX;
83 fyOv = kDefaultBarOverlapY;
84}
@ kTimeDet
Double_t fxSize
z-position of veto station
Definition TimeDet.h:66
Double_t fxBar
height of the detector
Definition TimeDet.h:69
Double_t fyOv
Overlap along x.
Definition TimeDet.h:84
Double_t fxCenter
Number of rows.
Definition TimeDet.h:79
Int_t fNRow
Number of columns.
Definition TimeDet.h:77
Int_t fNBars
y-position of the detector center
Definition TimeDet.h:82
Double_t fdzBarRow
z-distance between columns
Definition TimeDet.h:74
Double_t fySize
width of the detector
Definition TimeDet.h:67
Double_t fyBar
length of the bar
Definition TimeDet.h:70
Double_t fzPos
Definition TimeDet.h:64
Double_t fyCenter
x-position of the detector center
Definition TimeDet.h:80
Double_t fzBar
width of the bar
Definition TimeDet.h:71
Int_t fNCol
z-distance between rows
Definition TimeDet.h:76
Double_t fdzBarCol
depth of the bar
Definition TimeDet.h:73
Double_t fxOv
Number of bars.
Definition TimeDet.h:83

◆ TimeDet() [2/3]

TimeDet::TimeDet ( )

default constructor

Definition at line 47 of file TimeDet.cxx.

48 : Detector("TimeDet", kTRUE, kTimeDet),
49 fzPos(0),
50 fxSize(550),
51 fySize(650),
52 fxBar(140),
53 fyBar(6),
54 fzBar(1),
55 fdzBarCol(9.0),
56 fdzBarRow(1.2),
57 fNCol(3),
58 fNRow(110),
59 fxCenter(0),
60 fyCenter(0) {
61 fNBars = fNCol * fNRow;
62 fxOv = kDefaultBarOverlapX;
63 fyOv = kDefaultBarOverlapY;
64}

◆ TimeDet() [3/3]

TimeDet::TimeDet ( const TimeDet & )
privatedelete

Overlap along y.

Member Function Documentation

◆ ConstructGeometry()

void TimeDet::ConstructGeometry ( )
overridevirtual

Create the detector geometry

Implements SHiP::Detector< TimeDetPoint >.

Definition at line 144 of file TimeDet.cxx.

144 {
145 TGeoVolume* top = gGeoManager->GetTopVolume();
146
147 ShipGeo::InitMedium("polyvinyltoluene");
148 TGeoMedium* Scint = gGeoManager->GetMedium("polyvinyltoluene");
149
151
152 fDetector = new TGeoVolumeAssembly("Timing Detector");
153
154 TGeoVolume* plate =
155 gGeoManager->MakeBox("TimeDet", Scint, fxBar / 2, fyBar / 2, fzBar / 2);
156 plate->SetLineColor(kBlue);
157 AddSensitiveVolume(plate);
158
159 for (int ib = 0; ib < fNBars; ib++) {
160 int irow = 0, icol = 0;
161 GetBarRowCol(ib, irow, icol);
162
163 double xbar = 0, ybar = 0, zbar = 0;
164 xbar = GetXCol(icol);
165 ybar = GetYRow(irow);
166 zbar = GetZBar(irow, icol);
167
168 fDetector->AddNode(plate, ib, new TGeoTranslation(xbar, ybar, zbar));
169
170 // printf("%3i %3i %2i %8.3f %8.3f %8.3f\n",ib, irow,icol,
171 // xbar,ybar,zbar);
172 }
173
174 top->AddNode(fDetector, 1, new TGeoTranslation(0, 0, fzPos));
175
177
178 return;
179}
void GetBarRowCol(int ib, int &irow, int &icol) const
Definition TimeDet.cxx:181
double GetXCol(int ic) const
Definition TimeDet.cxx:187
double GetZBar(int ir, int ic) const
Definition TimeDet.cxx:195
double GetYRow(int ir) const
Definition TimeDet.cxx:191
Int_t InitMedium(const char *name)
Definition ShipGeoUtil.h:22

◆ GetBarOverlapX()

Double_t TimeDet::GetBarOverlapX ( ) const
inline

Definition at line 51 of file TimeDet.h.

51{ return fxOv; }

◆ GetBarOverlapY()

Double_t TimeDet::GetBarOverlapY ( ) const
inline

Definition at line 52 of file TimeDet.h.

52{ return fyOv; }

◆ GetBarRowCol()

void TimeDet::GetBarRowCol ( int ib,
int & irow,
int & icol ) const

Definition at line 181 of file TimeDet.cxx.

181 {
182 irow = ib / fNCol;
183 icol = (ib % fNCol);
184 return;
185}

◆ GetBarSizeX()

Double_t TimeDet::GetBarSizeX ( ) const
inline

Definition at line 48 of file TimeDet.h.

48{ return fxBar; }

◆ GetBarSizeY()

Double_t TimeDet::GetBarSizeY ( ) const
inline

Definition at line 49 of file TimeDet.h.

49{ return fyBar; }

◆ GetBarSizeZ()

Double_t TimeDet::GetBarSizeZ ( ) const
inline

Definition at line 50 of file TimeDet.h.

50{ return fzBar; }

◆ GetNBars()

Int_t TimeDet::GetNBars ( ) const
inline

Definition at line 47 of file TimeDet.h.

47{ return fNBars; }

◆ GetNColumns()

Int_t TimeDet::GetNColumns ( ) const
inline

Definition at line 45 of file TimeDet.h.

45{ return fNCol; }

◆ GetNRows()

Int_t TimeDet::GetNRows ( ) const
inline

Definition at line 46 of file TimeDet.h.

46{ return fNRow; }

◆ GetXCol()

double TimeDet::GetXCol ( int ic) const

Definition at line 187 of file TimeDet.cxx.

187 {
188 return (ic - 0.5 * (fNCol - 1)) * (fxBar - fxOv) + fxCenter;
189}

◆ GetYRow()

double TimeDet::GetYRow ( int ir) const

Definition at line 191 of file TimeDet.cxx.

191 {
192 return (ir - 0.5 * (fNRow - 1)) * (fyBar - fyOv) + fyCenter;
193}

◆ GetZBar()

double TimeDet::GetZBar ( int ir,
int ic ) const

Definition at line 195 of file TimeDet.cxx.

195 {
196 double z = (ir % 2) * fdzBarRow + (ic % 2) * fdzBarCol;
197 return z;
198}

◆ operator=()

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

◆ ProcessHits()

Bool_t TimeDet::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 86 of file TimeDet.cxx.

86 {
88 // Set parameters at entrance of volume. Reset ELoss.
89 if (gMC->IsTrackEntering()) {
90 fELoss = 0.;
91 fTime = gMC->TrackTime() * 1.0e09;
92 fLength = gMC->TrackLength();
93 gMC->TrackPosition(fPos);
94 gMC->TrackMomentum(fMom);
95 }
96
97 // Sum energy loss for all steps in the active volume
98 fELoss += gMC->Edep();
99
100 // Create vetoPoint at exit of active volume
101 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
102 gMC->IsTrackDisappeared()) {
103 if (fELoss == 0.) {
104 return kFALSE;
105 }
106
107 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
108 fEventID = gMC->CurrentEvent();
109 Int_t uniqueId;
110 gMC->CurrentVolID(uniqueId);
111 if (uniqueId > 1000000) // Solid scintillator case
112 {
113 Int_t vcpy;
114 gMC->CurrentVolOffID(1, vcpy);
115 if (vcpy == 5) uniqueId += 4; // Copy of half
116 }
117
118 TParticle* p = gMC->GetStack()->GetCurrentTrack();
119 Int_t pdgCode = p->GetPdgCode();
120 TLorentzVector Pos;
121 gMC->TrackPosition(Pos);
122 TLorentzVector Mom;
123 gMC->TrackMomentum(Mom);
124 Double_t xmean = (fPos.X() + Pos.X()) / 2.;
125 Double_t ymean = (fPos.Y() + Pos.Y()) / 2.;
126 Double_t zmean = (fPos.Z() + Pos.Z()) / 2.;
127
128 // cout << uniqueId << " :(" << xmean << ", " << ymean << ", " << zmean <<
129 // "): " << gMC->CurrentVolName() << endl;
130
131 AddHit(fEventID, fTrackID, uniqueId, TVector3(xmean, ymean, zmean),
132 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength, fELoss,
133 pdgCode, TVector3(Pos.X(), Pos.Y(), Pos.Z()),
134 TVector3(Mom.Px(), Mom.Py(), Mom.Pz()));
135
136 // Increment number of veto det points in TParticle
137 ShipStack* stack = dynamic_cast<ShipStack*>(gMC->GetStack());
138 stack->AddPoint(kTimeDet);
139 }
140
141 return kTRUE;
142}
TimeDetPoint * AddHit(Args &&... args)
Definition Detector.h:38

◆ SetBarZ()

void TimeDet::SetBarZ ( Double_t dz)
inline

Definition at line 41 of file TimeDet.h.

41{ fzBar = dz; }

◆ SetBarZspacing()

void TimeDet::SetBarZspacing ( Double_t row,
Double_t column )
inline

Definition at line 37 of file TimeDet.h.

37 {
38 fdzBarRow = row;
39 fdzBarCol = column;
40 }

◆ SetSizeX()

void TimeDet::SetSizeX ( Double_t x)
inline

Definition at line 42 of file TimeDet.h.

◆ SetSizeY()

void TimeDet::SetSizeY ( Double_t y)
inline

Definition at line 43 of file TimeDet.h.

◆ SetZposition()

void TimeDet::SetZposition ( Double_t z)
inline

Sets detector position along z

Definition at line 36 of file TimeDet.h.

36{ fzPos = z; }

Member Data Documentation

◆ fdzBarCol

Double_t TimeDet::fdzBarCol
private

depth of the bar

Definition at line 73 of file TimeDet.h.

◆ fdzBarRow

Double_t TimeDet::fdzBarRow
private

z-distance between columns

Definition at line 74 of file TimeDet.h.

◆ fNBars

Int_t TimeDet::fNBars
private

y-position of the detector center

Definition at line 82 of file TimeDet.h.

◆ fNCol

Int_t TimeDet::fNCol
private

z-distance between rows

Definition at line 76 of file TimeDet.h.

◆ fNRow

Int_t TimeDet::fNRow
private

Number of columns.

Definition at line 77 of file TimeDet.h.

◆ fxBar

Double_t TimeDet::fxBar
private

height of the detector

Definition at line 69 of file TimeDet.h.

◆ fxCenter

Double_t TimeDet::fxCenter
private

Number of rows.

Definition at line 79 of file TimeDet.h.

◆ fxOv

Double_t TimeDet::fxOv
private

Number of bars.

Definition at line 83 of file TimeDet.h.

◆ fxSize

Double_t TimeDet::fxSize
private

z-position of veto station

Definition at line 66 of file TimeDet.h.

◆ fyBar

Double_t TimeDet::fyBar
private

length of the bar

Definition at line 70 of file TimeDet.h.

◆ fyCenter

Double_t TimeDet::fyCenter
private

x-position of the detector center

Definition at line 80 of file TimeDet.h.

◆ fyOv

Double_t TimeDet::fyOv
private

Overlap along x.

Definition at line 84 of file TimeDet.h.

◆ fySize

Double_t TimeDet::fySize
private

width of the detector

Definition at line 67 of file TimeDet.h.

◆ fzBar

Double_t TimeDet::fzBar
private

width of the bar

Definition at line 71 of file TimeDet.h.

◆ fzPos

Double_t TimeDet::fzPos
private

Detector parameters.

Definition at line 64 of file TimeDet.h.


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