REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
source
libraries
geant4
inc
TRestGeant4Particle.h
1
/*************************************************************************
2
* This file is part of the REST software framework. *
3
* *
4
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5
* For more information see http://gifna.unizar.es/trex *
6
* *
7
* REST is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* REST is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have a copy of the GNU General Public License along with *
18
* REST in $REST_PATH/LICENSE. *
19
* If not, see http://www.gnu.org/licenses/. *
20
* For the list of contributors see $REST_PATH/CREDITS. *
21
*************************************************************************/
22
23
#ifndef RestCore_TRestGeant4Particle
24
#define RestCore_TRestGeant4Particle
25
26
#include <TString.h>
27
#include <TVector3.h>
28
29
#include <iostream>
30
32
class
TRestGeant4Particle
{
33
protected
:
34
TString fParticleName;
35
Double_t fExcitationLevel = 0;
36
TVector3 fDirection = {1, 0, 0};
37
Double_t fEnergy = 0;
38
Int_t fCharge = 0;
39
TVector3 fOrigin;
40
41
public
:
42
inline
TString GetParticleName()
const
{
return
fParticleName; }
43
inline
Double_t GetExcitationLevel()
const
{
return
fExcitationLevel; }
44
inline
Double_t GetEnergy()
const
{
return
fEnergy; }
45
inline
TVector3 GetMomentumDirection()
const
{
return
fDirection; }
46
inline
Int_t GetParticleCharge()
const
{
return
fCharge; }
47
inline
TVector3 GetOrigin()
const
{
return
fOrigin; }
48
49
void
SetParticle
(
TRestGeant4Particle
particle);
50
51
void
SetParticleName(TString particle) { fParticleName = particle; }
52
53
void
SetExcitationLevel(Double_t excitationEnergy) {
54
fExcitationLevel = excitationEnergy;
55
if
(fExcitationLevel < 0) fExcitationLevel = 0;
56
}
57
58
void
SetParticleCharge(Int_t charge) { fCharge = charge; }
59
60
void
SetDirection(
const
TVector3& dir) { fDirection = dir.Unit(); }
61
void
SetEnergy(Double_t en) { fEnergy = en; }
62
void
SetOrigin(
const
TVector3& pos) { fOrigin = pos; }
63
64
void
Print
()
const
;
65
66
// Constructor
67
TRestGeant4Particle
();
68
// Destructor
69
virtual
~TRestGeant4Particle
();
70
71
ClassDef(
TRestGeant4Particle
, 4);
72
};
73
#endif
TRestGeant4Particle
A class used to store particle properties.
Definition:
TRestGeant4Particle.h:32
TRestGeant4Particle::SetParticle
void SetParticle(TRestGeant4Particle particle)
A copy method.
Definition:
TRestGeant4Particle.cxx:57
TRestGeant4Particle::Print
void Print() const
Prints on screen the details about the Geant4 simulation conditions, stored in TRestGeant4Metadata.
Definition:
TRestGeant4Particle.cxx:69
Generated on Thu Nov 21 2024 05:10:13 for REST-for-Physics by
1.9.4