1- // /_______________________________________________________________________________
2- // /_______________________________________________________________________________
3- // /_______________________________________________________________________________
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+ // ////////////////////////////////////////////////////////////////////////
24+ // / TRestGeant4Particle is just a container class to store particle properties
425// /
526// /
6- // / RESTSoft : Software for Rare Event Searches with TPCs
27+ // /--------------------------------------------------------------------------
728// /
8- // / TRestGeant4Particle.cxx
29+ // / RESTsoft - Software for Rare Event Searches with TPCs
930// /
10- // / Base class from which to inherit all other event classes in REST
31+ // / History of developments:
32+ // /
33+ // / 2015-July: First concept and implementation
34+ // / \author Javier Galan
35+ // /
36+ // / \class TRestGeant4Particle
37+ // /
38+ // / <hr>
1139// /
12- // / jul 2015: First concept
13- // / Created as part of the conceptualization of existing REST
14- // / software.
15- // / J. Galan
16- // /_______________________________________________________________________________
17-
1840#include " TRestGeant4Particle.h"
1941
2042using namespace std ;
@@ -28,3 +50,30 @@ TRestGeant4Particle::TRestGeant4Particle() {
2850TRestGeant4Particle::~TRestGeant4Particle () {
2951 // TRestGeant4Particle destructor
3052}
53+
54+ // /////////////////////////////////////////////
55+ // / \brief A copy method
56+ // /
57+ void TRestGeant4Particle::SetParticle (TRestGeant4Particle particle) {
58+ fExcitationLevel = particle.GetExcitationLevel ();
59+ fParticleName = particle.GetParticleName ();
60+ fEnergy = particle.GetEnergy ();
61+ fDirection = particle.GetMomentumDirection ();
62+ fOrigin = particle.fOrigin ;
63+ }
64+
65+ // /////////////////////////////////////////////
66+ // / \brief Prints on screen the details about the Geant4 simulation
67+ // / conditions, stored in TRestGeant4Metadata.
68+ // /
69+ void TRestGeant4Particle::Print () const {
70+ std::cout << " Particle name : " << GetParticleName () << std::endl;
71+ std::cout << " Charge : " << GetParticleCharge () << std::endl;
72+ std::cout << " Energy : " << GetEnergy () << " keV" << std::endl;
73+ std::cout << " Excitation level : " << GetExcitationLevel () << std::endl;
74+ std::cout << " X : " << GetOrigin ().X () << " mm Y : " << GetOrigin ().Y () << " mm Z : " << GetOrigin ().Z ()
75+ << " mm" << std::endl;
76+ std::cout << " Px : " << GetMomentumDirection ().X () << " Py : " << GetMomentumDirection ().Y ()
77+ << " Pz : " << GetMomentumDirection ().Z () << std::endl;
78+ std::cout << " ---------------------- " << std::endl;
79+ }
0 commit comments