CbmRoot
Loading...
Searching...
No Matches
CbmMustPoint.cxx
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Radoslaw Karabowicz [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmMustPoint source file -----
7// ----- Created 2024-11-26 by R. Karabowicz -----
8// -------------------------------------------------------------------------
9
10#include "CbmMustPoint.h"
11
12#include "CbmDefs.h" // for ToIntegralType, ECbmDataType
13
14#include <FairLink.h> // for FairLink
15#include <FairMCPoint.h> // for FairMCPoint
16#include <Logger.h> // for Logger, LOG
17
18
19// ----- Default constructor -------------------------------------------
20CbmMustPoint::CbmMustPoint() : FairMCPoint() {}
21// -------------------------------------------------------------------------
22
23// ----- Standard constructor ------------------------------------------
24CbmMustPoint::CbmMustPoint(Int_t trackID, uint32_t address, TVector3 posIn, TVector3 posOut, TVector3 momIn,
25 TVector3 momOut, Double_t tof, Double_t length, Double_t eLoss)
26 : FairMCPoint(trackID, address, posIn, momIn, tof, length, eLoss)
27 , fX_out(posOut.X())
28 , fY_out(posOut.Y())
29 , fZ_out(posOut.Z())
30 , fPx_out(momOut.Px())
31 , fPy_out(momOut.Py())
32 , fPz_out(momOut.Pz())
33{
34 SetLink(FairLink(ToIntegralType(ECbmDataType::kMCTrack), trackID));
35}
36// -------------------------------------------------------------------------
37
38// ----- Destructor ----------------------------------------------------
40// -------------------------------------------------------------------------
41
42// ----- Copy constructor ------------------------------------------
44 : FairMCPoint(point.fTrackID, point.fDetectorID, TVector3(point.fX, point.fY, point.fZ),
45 TVector3(point.fPx, point.fPy, point.fPz), point.fTime, point.fLength, point.fELoss, point.fEventId)
46 , fX_out(point.fX_out)
47 , fY_out(point.fY_out)
48 , fZ_out(point.fZ_out)
49 , fPx_out(point.fPx_out)
50 , fPy_out(point.fPy_out)
51 , fPz_out(point.fPz_out)
52{
53}
54// -------------------------------------------------------------------------
55
56// ----- Public method Print -------------------------------------------
57void CbmMustPoint::Print(const Option_t* opt) const
58{
59 LOG(info) << " CbmMustPoint: MUST Point for track " << fTrackID << " in det/lay/mod/str " << fDetectorID;
60 LOG(info) << " Position (" << fX << ", " << fY << ", " << fZ << ") cm";
61 LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
62 LOG(info) << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV"
63 << " opt=" << opt;
64}
65// -------------------------------------------------------------------------
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Converts an element of enum class to its underlying integral type.
Definition CbmDefs.h:33
int Int_t
Double_t fZ_out
Double_t fPz_out
Double_t fY_out
Double_t fPx_out
virtual void Print(const Option_t *opt) const
virtual ~CbmMustPoint()
Double_t fPy_out
Double_t fX_out