R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BMCTrack.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#ifndef R3BMCTRACK_H
15#define R3BMCTRACK_H
16
17#include "Math/Vector4D.h"
18#include "R3BDetectorList.h"
19#include "TLorentzVector.h"
20#include "TObject.h"
21#include "TParticle.h"
22#include "TVector3.h"
23#include <array>
24
25class R3BMCTrack : public TObject
26{
27 public:
29 R3BMCTrack();
30
32 R3BMCTrack(int pdgCode,
33 int motherID,
34 ROOT::Math::XYZTVector xyzt,
35 ROOT::Math::PxPyPzMVector pm,
36 std::array<int, kLAST + 1> nPoints);
37
39 R3BMCTrack(TParticle* particle, std::array<int, kLAST + 1> nPoints, int fMC);
40
42 ~R3BMCTrack() override = default;
43
45 void Print(Option_t* option = "") const override;
46
48 int GetPdgCode() const { return fPdgCode; }
49 int GetMotherId() const { return fMotherId; }
50
51 double GetStartX() const { return fStartVertex.X(); }
52 double GetStartY() const { return fStartVertex.Y(); }
53 double GetStartZ() const { return fStartVertex.Z(); }
54 double GetStartT() const { return fStartVertex.T(); }
55 ROOT::Math::XYZTVector GetStartVertex() const { return fStartVertex; }
56
57 double GetPx() const { return fMomentumMass.Px(); }
58 double GetPy() const { return fMomentumMass.Py(); }
59 double GetPz() const { return fMomentumMass.Pz(); }
60 double GetMass() const { return fMomentumMass.M(); }
61 ROOT::Math::PxPyPzMVector GetMomentumMass() const { return fMomentumMass; };
62 ROOT::Math::PxPyPzEVector GetFourMomentum() const { return ROOT::Math::PxPyPzEVector(fMomentumMass); };
63 double GetEnergy() const { return fMomentumMass.E(); }
64 double GetPt() const { return fMomentumMass.Pt(); }
65 double GetP() const { return fMomentumMass.P(); }
66 double GetRapidity() const { return fMomentumMass.Rapidity(); };
67
69 int GetNPoints(DetectorId detId) const;
70
72 void SetMotherId(int id) { fMotherId = id; } // Used by R3BMCStack UpdateTrackIndex. Needed? -> Could make const!
73
74 private:
76 const int fPdgCode;
77
79 int fMotherId;
80
82 const ROOT::Math::XYZTVector fStartVertex;
83
85 const ROOT::Math::PxPyPzMVector fMomentumMass;
86
88 const std::array<int, kLAST + 1> fNPoints;
89
90 ClassDefOverride(R3BMCTrack, 3);
91};
92
93#endif
DetectorId
Unique identifier for all R3B detector systems.
int GetPdgCode() const
Accessors.
Definition R3BMCTrack.h:48
double GetStartX() const
Definition R3BMCTrack.h:51
double GetStartY() const
Definition R3BMCTrack.h:52
double GetEnergy() const
Definition R3BMCTrack.h:63
double GetRapidity() const
Definition R3BMCTrack.h:66
double GetPt() const
Definition R3BMCTrack.h:64
ROOT::Math::XYZTVector GetStartVertex() const
Definition R3BMCTrack.h:55
double GetPz() const
Definition R3BMCTrack.h:59
ROOT::Math::PxPyPzEVector GetFourMomentum() const
Definition R3BMCTrack.h:62
int GetNPoints(DetectorId detId) const
Accessors to the number of MCPoints in the detectors.
double GetStartZ() const
Definition R3BMCTrack.h:53
double GetStartT() const
Definition R3BMCTrack.h:54
ROOT::Math::PxPyPzMVector GetMomentumMass() const
Definition R3BMCTrack.h:61
double GetP() const
Definition R3BMCTrack.h:65
double GetPy() const
Definition R3BMCTrack.h:58
double GetMass() const
Definition R3BMCTrack.h:60
void Print(Option_t *option="") const override
Output to screen.
R3BMCTrack()
Default constructor.
double GetPx() const
Definition R3BMCTrack.h:57
~R3BMCTrack() override=default
Destructor.
void SetMotherId(int id)
Modifiers.
Definition R3BMCTrack.h:72
int GetMotherId() const
Definition R3BMCTrack.h:49