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