R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BMCTrack.cxx
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#include "R3BMCTrack.h"
15#include "FairLogger.h"
16#include <iostream>
17#include <utility>
18
20 : fPdgCode(0)
21 , fMotherId(0)
22 , fStartVertex()
23 , fMomentumMass()
24 , fNPoints()
25{
26}
27
29 int motherId,
30 ROOT::Math::XYZTVector xyzt,
31 ROOT::Math::PxPyPzMVector pm,
32 std::array<int, kLAST + 1> nPoints)
33 : fPdgCode(pdgCode)
34 , fMotherId(motherId)
35 , fStartVertex(std::move(xyzt))
36 , fMomentumMass(std::move(pm))
37 , fNPoints(nPoints)
38{
39}
40
41R3BMCTrack::R3BMCTrack(TParticle* part, std::array<int, kLAST + 1> nPoints, int fMC)
42 : fPdgCode(part->GetPdgCode())
43 , fMotherId(part->GetMother(0))
44 , fStartVertex(part->Vx(), part->Vy(), part->Vz(), fMC == 0 ? part->T() * 1e09 : part->T()) // G3 == 0 ?!
45 , fMomentumMass(part->Px(), part->Py(), part->Pz(), part->GetMass())
46 , fNPoints(nPoints)
47{
48}
49
50void R3BMCTrack::Print(Option_t* option) const
51{
52 std::cout << "Track " << option << ", mother : " << fMotherId << ", Type " << fPdgCode << ", momentum ("
53 << fMomentumMass.Px() << ", " << fMomentumMass.Py() << ", " << fMomentumMass.Pz() << ") GeV" << std::endl;
54 std::cout << "Ref " << GetNPoints(kREF) << ", DCH " << GetNPoints(kDCH) << ", CAL " << GetNPoints(kCAL) << ", LAND "
55 << GetNPoints(kLAND) << ", GFI " << GetNPoints(kGFI) << ", TOFd " << GetNPoints(kTOFD) << ", TOF "
56 << GetNPoints(kTOF) << ", TRACKER " << GetNPoints(kTRA) << ", CALIFA " << GetNPoints(kCALIFA) << ", PSP "
57 << GetNPoints(kPSP) << ", VETO " << GetNPoints(kVETO) << ", RPC " << GetNPoints(kRPC) << ", NeuLAND "
58 << GetNPoints(kNEULAND) << std::endl;
59#ifdef SOFIA
60 std::cout << ", SCI " << GetNPoints(kSOFSCI) << ", AT " << GetNPoints(kSOFAT) << ", TRIM " << GetNPoints(kSOFTRIM)
61 << ", MWPC1 " << GetNPoints(kSOFMWPC1) << ", TWIM " << GetNPoints(kSOFTWIM) << ", MWPC2 "
62 << GetNPoints(kSOFMWPC2) << ", SOF ToF Wall " << GetNPoints(kSOFTofWall) << std::endl;
63#endif
64#ifdef GTPC
65 std::cout << ", GTPC " << GetNPoints(kGTPC) << std::endl;
66#endif
67#ifdef ASYEOS
68 std::cout << ", CHIMERA " << GetNPoints(kCHIMERA) << ", KRAB " << GetNPoints(kKRAB) << ", KRATTA "
69 << GetNPoints(kKRATTA) << std::endl;
70#endif
71}
72
74{
75 if (detId < 0 || detId >= fNPoints.size())
76 {
77 LOG(error) << "Unknown detector ID " << detId;
78 return 0;
79 }
80 return fNPoints.at(detId);
81}
82
DetectorId
Unique identifier for all R3B detector systems.
@ kSOFMWPC2
@ kSOFTWIM
@ kRPC
@ kCAL
@ kTOF
@ kTRA
@ kREF
@ kCALIFA
@ kLAND
@ kGFI
@ kPSP
@ kVETO
@ kNEULAND
@ kDCH
@ kTOFD
@ kSOFMWPC1
ClassImp(R3B::Neuland::Cal2HitPar)
int GetPdgCode() const
Accessors.
Definition R3BMCTrack.h:48
int GetNPoints(DetectorId detId) const
Accessors to the number of MCPoints in the detectors.
double GetMass() const
Definition R3BMCTrack.h:60
void Print(Option_t *option="") const override
Output to screen.
R3BMCTrack()
Default constructor.