R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BNeulandHit.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 "R3BNeulandHit.h"
15#include <Math/Vector3Dfwd.h>
16#include <Rtypes.h>
17#include <RtypesCore.h>
18#include <TVector3.h>
19#include <cmath>
20#include <iostream>
21#include <ostream>
22#include <utility>
23
24constexpr double light_speed = 29.97924580000000105;
25// constexpr double light_speed_square = 898.75517873681758374; // cm²/ns²
26
28 double TdcL,
29 double TdcR,
30 double time_val,
31 double QdcL,
32 double QdcR,
33 double energy_val,
34 ROOT::Math::XYZVector pos,
35 ROOT::Math::XYZVector pix)
36 : module_id(paddle)
37 , tdc_left(TdcL)
38 , tdc_right(TdcR)
39 , time(time_val)
40 , qdc_left(QdcL)
41 , qdc_right(QdcR)
42 , energy(energy_val)
43 , position(std::move(pos))
44 , pixel(std::move(pix))
45{
46}
47
48auto R3BNeulandHit::GetBeta() const -> double { return position.r() / (time * light_speed); }
49
50auto R3BNeulandHit::GetEToF(const double mass) const -> double
51{
52 const auto beta = GetBeta();
53 const auto gamma = 1. / std::sqrt(1. - (beta * beta));
54 const auto etof = (gamma - 1.) * mass;
55 return 1.81522 + 0.984612 * etof; // TODO: EToF is ever so slightly off. Maybe some rounding/mass error?
56}
57
58auto operator<<(std::ostream& os_stream, const R3BNeulandHit& hit) -> std::ostream&
59{
60 os_stream << "R3BNeulandHit: NeuLAND Hit in Paddle " << hit.module_id << "\n"
61 << " TdcL: " << hit.tdc_left << " TdcR: " << hit.tdc_right << " Time: " << hit.time << "\n"
62 << " QdcL: " << hit.qdc_left << " QdcR: " << hit.qdc_right << " Energy: " << hit.energy << "\n"
63 << " Position XYZ: " << hit.position.X() << " " << hit.position.Y() << " "
64 << hit.GetPosition().Z() << "\n";
65 return os_stream;
66}
67
68void R3BNeulandHit::Print(const Option_t* /*unused*/) const { std::cout << *this; }
69
ClassImp(R3B::Neuland::Cal2HitPar)
constexpr double light_speed
cm/ns
auto operator<<(std::ostream &os_stream, const R3BNeulandHit &hit) -> std::ostream &
R3BNeulandHit()=default
auto GetBeta() const -> double
void Print(const Option_t *) const override
ROOT::Math::XYZVectorD pixel
ROOT::Math::XYZVectorD position
auto GetEToF(double mass=NEUTRON_MASS_MEV) const -> double