14#include "FairGeoBuilder.h"
15#include "FairGeoInterface.h"
16#include "FairGeoLoader.h"
17#include "FairGeoMedia.h"
18#include "FairGeoNode.h"
19#include "FairGeoVolume.h"
20#include "FairRootManager.h"
22#include "FairRuntimeDb.h"
23#include "FairVolume.h"
27#include "TClonesArray.h"
29#include "TGeoCompositeShape.h"
30#include "TGeoManager.h"
31#include "TGeoMaterial.h"
32#include "TGeoMedium.h"
37#include "TVirtualMC.h"
43 : Detector(
"TimeDet", kTRUE,
kTimeDet),
96 if (gMC->IsTrackEntering()) {
98 fTime = gMC->TrackTime() * 1.0e09;
100 gMC->TrackPosition(
fPos);
101 gMC->TrackMomentum(
fMom);
108 if (gMC->IsTrackExiting() || gMC->IsTrackStop() ||
109 gMC->IsTrackDisappeared()) {
114 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
117 gMC->CurrentVolID(uniqueId);
118 if (uniqueId > 1000000)
121 gMC->CurrentVolOffID(1, vcpy);
122 if (vcpy == 5) uniqueId += 4;
125 TParticle* p = gMC->GetStack()->GetCurrentTrack();
126 Int_t pdgCode = p->GetPdgCode();
128 gMC->TrackPosition(Pos);
130 gMC->TrackMomentum(Mom);
131 Double_t xmean = (
fPos.X() + Pos.X()) / 2.;
132 Double_t ymean = (
fPos.Y() + Pos.Y()) / 2.;
133 Double_t zmean = (
fPos.Z() + Pos.Z()) / 2.;
140 pdgCode, TVector3(Pos.X(), Pos.Y(), Pos.Z()),
141 TVector3(Mom.Px(), Mom.Py(), Mom.Pz()));
152 TGeoVolume* top = gGeoManager->GetTopVolume();
155 TGeoMedium* Scint = gGeoManager->GetMedium(
"polyvinyltoluene");
159 fDetector =
new TGeoVolumeAssembly(
"Timing Detector");
162 gGeoManager->MakeBox(
"TimeDet", Scint,
fxBar / 2,
fyBar / 2,
fzBar / 2);
163 plate->SetLineColor(kBlue);
164 AddSensitiveVolume(plate);
166 for (
int ib = 0; ib <
fNBars; ib++) {
167 int irow = 0, icol = 0;
170 double xbar = 0, ybar = 0, zbar = 0;
175 fDetector->AddNode(plate, ib,
new TGeoTranslation(xbar, ybar, zbar));
Int_t fTrackID
event index
TLorentzVector fPos
volume id
Double_t fTime
momentum at entrance
TimeDetPoint * AddHit(Args &&... args)
TLorentzVector fMom
position at entrance
Double_t fxSize
z-position of veto station
Double_t fxBar
height of the detector
Double_t fyOv
Overlap along x.
Double_t fxCenter
Number of rows.
void GetBarRowCol(int ib, int &irow, int &icol) const
double GetXCol(int ic) const
Int_t fNRow
Number of columns.
Int_t fNBars
y-position of the detector center
Double_t fdzBarRow
z-distance between columns
Double_t fySize
width of the detector
Double_t fyBar
length of the bar
Bool_t ProcessHits(FairVolume *v=0) override
Double_t fyCenter
x-position of the detector center
Double_t fzBar
width of the bar
Int_t fNCol
z-distance between rows
void ConstructGeometry() override
Double_t fdzBarCol
depth of the bar
double GetZBar(int ir, int ic) const
Double_t fxOv
Number of bars.
double GetYRow(int ir) const
Int_t InitMedium(const char *name)