R3BROOT
R3B analysis software
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 <cmath>
16
17static const Double_t massNeutron = 939.565379; // MeV/c²
18static const Double_t c = 29.9792458; // cm/ns
19static const Double_t c2 = 898.75517873681758374; // cm²/ns²
20
21R3BNeulandNeutron::R3BNeulandNeutron(Int_t paddle, Double_t time, const TVector3& pos, const TVector3& pix)
22 : fPaddle(paddle)
23 , fT(time)
24 , fPosition(pos)
25 , fPixel(pix)
26{
27}
28
30 : fPaddle(hit.GetPaddle())
31 , fT(hit.GetT())
32 , fPosition(hit.GetPosition())
33 , fPixel(hit.GetPixel())
34{
35}
36
38 : R3BNeulandNeutron(cluster.GetFirstHit())
39{
40}
41
43{
44 const Double_t v2 = GetPosition().Mag2() / std::pow(GetT(), 2); // cm²/ns²
45 return 1. / std::sqrt(1. - (v2 / c2));
46}
47
48TVector3 R3BNeulandNeutron::GetP() const { return GetPosition() * (GetGamma() * massNeutron / GetT() / c); }
49
50Double_t R3BNeulandNeutron::GetEtot() const { return GetGamma() * massNeutron; }
51
52Double_t R3BNeulandNeutron::GetEkin() const { return (GetGamma() - 1.) * massNeutron; }
53
54std::ostream& operator<<(std::ostream& os, const R3BNeulandNeutron& digi)
55{
56 os << "R3BNeulandNeutron: XYZTE " << digi.GetPosition().X() << " " << digi.GetPosition().Y() << " "
57 << digi.GetPosition().Z() << " " << digi.GetT() << " " << digi.GetEkin() << std::endl;
58 return os;
59}
60
61void R3BNeulandNeutron::Print(const Option_t*) const { std::cout << *this; }
62
ClassImp(R3B::Neuland::Cal2HitPar)
static const Double_t c
std::ostream & operator<<(std::ostream &os, const R3BNeulandNeutron &digi)
static const Double_t c2
static const Double_t massNeutron
TVector3 GetPosition() const
TVector3 GetP() const
TVector3 GetPixel() const
Double_t GetEtot() const
void Print(const Option_t *) const override
R3BNeulandNeutron()=default
Double_t GetGamma() const
Int_t GetPaddle() const
Double_t GetT() const
Double_t GetEkin() const