R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandNeutron.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 "
R3BNeulandNeutron.h
"
15
#include "
R3BNeulandCluster.h
"
16
#include "
R3BNeulandHit.h
"
17
#include <Math/Vector3Dfwd.h>
18
#include <RtypesCore.h>
19
#include <cmath>
20
#include <iostream>
21
#include <ostream>
22
#include <utility>
23
24
static
const
double
MASS_OF_NEUTRON
= 939.565379;
// MeV/c²
25
static
const
double
SPEED_OF_LIGHT
= 29.9792458;
// cm/ns
26
static
const
double
SPEED_OF_LIGHT_SQ
= 898.75517873681758374;
// cm²/ns²
27
28
R3BNeulandNeutron::R3BNeulandNeutron
(Int_t paddle,
double
time, ROOT::Math::XYZVector pos, ROOT::Math::XYZVector pix)
29
: fPaddle(paddle)
30
, fT(time)
31
, fPosition(std::move(pos))
32
, fPixel(std::move(pix))
33
{
34
}
35
36
R3BNeulandNeutron::R3BNeulandNeutron
(
const
R3BNeulandHit
& hit)
37
:
fPaddle
(hit.
GetPaddle
())
38
,
fT
(hit.
GetT
())
39
,
fPosition
(hit.
GetPosition
())
40
,
fPixel
(hit.
GetPixel
())
41
{
42
}
43
44
R3BNeulandNeutron::R3BNeulandNeutron
(
const
R3BNeulandCluster
& cluster)
45
:
R3BNeulandNeutron
(cluster.GetFirstHit())
46
{
47
}
48
49
auto
R3BNeulandNeutron::GetGamma
() const ->
double
50
{
51
const
double
velocity_sq =
GetPosition
().Mag2() / std::pow(
GetT
(), 2);
// cm²/ns²
52
return
1. / std::sqrt(1. - (velocity_sq /
SPEED_OF_LIGHT_SQ
));
53
}
54
55
auto
R3BNeulandNeutron::GetP
() const ->
ROOT
::Math::XYZVector
56
{
57
return
GetPosition
() * (
GetGamma
() *
MASS_OF_NEUTRON
/
GetT
() /
SPEED_OF_LIGHT
);
58
}
59
60
auto
R3BNeulandNeutron::GetEtot
() const ->
double
{
return
GetGamma
() *
MASS_OF_NEUTRON
; }
61
62
auto
R3BNeulandNeutron::GetEkin
() const ->
double
{
return
(
GetGamma
() - 1.) *
MASS_OF_NEUTRON
; }
63
64
auto
operator<<
(std::ostream& ostream,
const
R3BNeulandNeutron
& digi) -> std::ostream&
65
{
66
ostream <<
"R3BNeulandNeutron: XYZTE "
<< digi.GetPosition().X() <<
" "
<< digi.GetPosition().Y() <<
" "
67
<< digi.GetPosition().Z() <<
" "
<< digi.GetT() <<
" "
<< digi.GetEkin() <<
"\n"
;
68
return
ostream;
69
}
70
71
void
R3BNeulandNeutron::Print
(
const
Option_t*
/*option*/
)
const
{ std::cout << *
this
; }
operator<<
std::ostream & operator<<(std::ostream &os, const R3BNeulandCalData &calData)
Definition
R3BNeulandCalData.cxx:25
R3BNeulandCluster.h
R3BNeulandHit.h
SPEED_OF_LIGHT
static const double SPEED_OF_LIGHT
Definition
R3BNeulandNeutron.cxx:25
SPEED_OF_LIGHT_SQ
static const double SPEED_OF_LIGHT_SQ
Definition
R3BNeulandNeutron.cxx:26
MASS_OF_NEUTRON
static const double MASS_OF_NEUTRON
Definition
R3BNeulandNeutron.cxx:24
R3BNeulandNeutron.h
R3BNeulandCluster
Definition
R3BNeulandCluster.h:28
R3BNeulandNeutron
Definition
R3BNeulandNeutron.h:30
R3BNeulandNeutron::fT
double fT
Definition
R3BNeulandNeutron.h:51
R3BNeulandNeutron::fPaddle
int fPaddle
Definition
R3BNeulandNeutron.h:50
R3BNeulandNeutron::GetPaddle
auto GetPaddle() const -> int
Definition
R3BNeulandNeutron.h:37
R3BNeulandNeutron::fPixel
ROOT::Math::XYZVector fPixel
Definition
R3BNeulandNeutron.h:53
R3BNeulandNeutron::Print
void Print(const Option_t *) const override
Definition
R3BNeulandNeutron.cxx:71
R3BNeulandNeutron::R3BNeulandNeutron
R3BNeulandNeutron()=default
R3BNeulandNeutron::fPosition
ROOT::Math::XYZVector fPosition
Definition
R3BNeulandNeutron.h:52
R3BNeulandNeutron::GetPixel
auto GetPixel() const -> ROOT::Math::XYZVector
Definition
R3BNeulandNeutron.h:40
R3BNeulandNeutron::GetPosition
auto GetPosition() const -> ROOT::Math::XYZVector
Definition
R3BNeulandNeutron.h:39
R3BNeulandNeutron::GetEkin
auto GetEkin() const -> double
Definition
R3BNeulandNeutron.cxx:62
R3BNeulandNeutron::GetEtot
auto GetEtot() const -> double
Definition
R3BNeulandNeutron.cxx:60
R3BNeulandNeutron::GetT
auto GetT() const -> double
Definition
R3BNeulandNeutron.h:38
R3BNeulandNeutron::GetP
auto GetP() const -> ROOT::Math::XYZVector
Definition
R3BNeulandNeutron.cxx:55
R3BNeulandNeutron::GetGamma
auto GetGamma() const -> double
Definition
R3BNeulandNeutron.cxx:49
ROOT
Definition
R3BROOTTypeJson.h:8
R3BNeulandHit
Definition
R3BNeulandHit.h:30
r3bdata
neulandData
R3BNeulandNeutron.cxx
Generated by
1.18.0