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()
22 , fX_out(0)
23 , fY_out(0)
24 , fZ_out(0)
25 , fPx_out(0)
26 , fPy_out(0)
27 , fPz_out(0)
28 , fPdgCode(0)
29 , fPointId(-1)
30 , fFrame(0)
31 , fStartTime(0.)
32{
33}
34
35// ----- Standard constructor ------------------------------------------
36CbmMvdPoint::CbmMvdPoint(int32_t trackID, int32_t pdgCode, int32_t sensorNr, TVector3 posIn, TVector3 posOut,
37 TVector3 momIn, TVector3 momOut, double tof, double length, double eLoss, int32_t frame)
38 : FairMCPoint(trackID, CbmMvdAddress::GetAddressFromSensorNrAndPixelXY(sensorNr, 0, 0), posIn, momIn, tof, length,
39 eLoss)
40 , fX_out(posOut.X())
41 , fY_out(posOut.Y())
42 , fZ_out(posOut.Z())
43 , fPx_out(momOut.Px())
44 , fPy_out(momOut.Py())
45 , fPz_out(momOut.Pz())
46 , fPdgCode(pdgCode)
47 , fPointId(-1)
48 , fFrame(frame)
49 , fStartTime(0)
50{
51 FairRunSim* run = FairRunSim::Instance();
52 FairPrimaryGenerator* gen = run->GetPrimaryGenerator();
53 FairMCEventHeader* event = gen->GetEvent();
54
55 fStartTime = event->GetT();
56}
57
58// ----- Destructor ----------------------------------------------------
60// -------------------------------------------------------------------------
61
62
63// ----- Public method Print -------------------------------------------
64void CbmMvdPoint::Print(const Option_t* /*opt*/) const
65{
66 LOG(info) << "MVD Point for track " << fTrackID << " in sensor with detID 0x" << std::hex << fDetectorID << std::dec;
67 LOG(info) << " Position (" << fX << ", " << fY << ", " << fZ << ") cm";
68 LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
69 LOG(info) << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV";
70}
71
72// ----- Public method GetAbsTime --------------------------------------
74{
75
76
77 int32_t absTime = fTime + fStartTime;
78
79 return absTime;
80}
81
ClassImp(CbmConverterManager)
Functions to encode or decode the address field of MVD data.
Double32_t fY_out
Definition CbmMvdPoint.h:94
int32_t fPointId
Definition CbmMvdPoint.h:97
Double32_t fPy_out
Definition CbmMvdPoint.h:95
virtual ~CbmMvdPoint()
virtual void Print(const Option_t *opt) const
Double32_t fPx_out
Definition CbmMvdPoint.h:95
Double32_t fZ_out
Definition CbmMvdPoint.h:94
int32_t GetAbsTime()
double fStartTime
Definition CbmMvdPoint.h:99
Double32_t fPz_out
Definition CbmMvdPoint.h:95
int32_t fFrame
Definition CbmMvdPoint.h:98
Double32_t fX_out
Definition CbmMvdPoint.h:94
int32_t fPdgCode
Definition CbmMvdPoint.h:96