CbmRoot
Loading...
Searching...
No Matches
CbmMvdPoint.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer], Florian Uhlig, Philipp Sitzmann */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdPoint source file -----
7// ----- Created 06/11/06 by V. Friese -----
8// -------------------------------------------------------------------------
9#include "CbmMvdPoint.h"
10
11#include <FairMCEventHeader.h> // for FairMCEventHeader
12#include <FairMCPoint.h> // for FairMCPoint
13#include <FairPrimaryGenerator.h> // for FairPrimaryGenerator
14#include <FairRunSim.h> // for FairRunSim
15#include <Logger.h> // for Logger, LOG
16
17#include <TVector3.h> // for TVector3
18
19// ----- Default constructor -------------------------------------------
21 : FairMCPoint()
23 , fX_out(0)
24 , fY_out(0)
25 , fZ_out(0)
26 , fPx_out(0)
27 , fPy_out(0)
28 , fPz_out(0)
29 , fPdgCode(0)
30 , fPointId(-1)
31 , fFrame(0)
32 , fStartTime(0.)
33{
34}
35// -------------------------------------------------------------------------
36
37
38// ----- Standard constructor ------------------------------------------
39CbmMvdPoint::CbmMvdPoint(int32_t trackID, int32_t pdgCode, int32_t stationNr, TVector3 posIn, TVector3 posOut,
40 TVector3 momIn, TVector3 momOut, double tof, double length, double eLoss, int32_t frame)
41 : FairMCPoint(trackID, stationNr, posIn, momIn, tof, length, eLoss)
43 , fX_out(posOut.X())
44 , fY_out(posOut.Y())
45 , fZ_out(posOut.Z())
46 , fPx_out(momOut.Px())
47 , fPy_out(momOut.Py())
48 , fPz_out(momOut.Pz())
49 , fPdgCode(pdgCode)
50 , fPointId(-1)
51 , fFrame(frame)
52 , fStartTime(0)
53{
54 FairRunSim* run = FairRunSim::Instance();
55 FairPrimaryGenerator* gen = run->GetPrimaryGenerator();
56 FairMCEventHeader* event = gen->GetEvent();
57
58 fStartTime = event->GetT();
59 fDetectorID = DetectorId(stationNr);
60}
61
62// -------------------------------------------------------------------------
63
64
65// ----- Destructor ----------------------------------------------------
67// -------------------------------------------------------------------------
68
69
70// ----- Public method Print -------------------------------------------
71void CbmMvdPoint::Print(const Option_t* /*opt*/) const
72{
73 LOG(info) << "MVD Point for track " << fTrackID << " in station " << GetStationNr();
74 LOG(info) << " Position (" << fX << ", " << fY << ", " << fZ << ") cm";
75 LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
76 LOG(info) << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV";
77}
78// -------------------------------------------------------------------------
79
80// ----- Public method GetAbsTime --------------------------------------
82{
83
84
85 int32_t absTime = fTime + fStartTime;
86
87 return absTime;
88}
89// -------------------------------------------------------------------------
90
ClassImp(CbmConverterManager)
int32_t DetectorId(int32_t iStation) const
int32_t GetStationNr() const
Definition CbmMvdPoint.h:75
virtual ~CbmMvdPoint()
virtual void Print(const Option_t *opt) const
int32_t GetAbsTime()
double fStartTime