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