From c71fa50520b1b5a8dab8de47e8341b8b63bf6564 Mon Sep 17 00:00:00 2001 From: Greg <gchristian@tamu.edu> Date: Mon, 4 Jun 2018 16:12:49 -0500 Subject: [PATCH] Added kinetic energy to TMDMData class. --- NPLib/Detectors/MDM/TMDMData.cxx | 3 +++ NPLib/Detectors/MDM/TMDMData.h | 11 +++++++++-- NPSimulation/Detectors/MDM/MDM.cc | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NPLib/Detectors/MDM/TMDMData.cxx b/NPLib/Detectors/MDM/TMDMData.cxx index b43984f74..d7c097c81 100644 --- a/NPLib/Detectors/MDM/TMDMData.cxx +++ b/NPLib/Detectors/MDM/TMDMData.cxx @@ -49,6 +49,8 @@ void TMDMData::Clear() { fMDM_Xpos.clear(); // Y fMDM_Ypos.clear(); + // + fMDM_Kinetic_Energy.clear(); // ID fMDM_Particle_Mass.clear(); fMDM_Particle_Charge.clear(); @@ -69,6 +71,7 @@ void TMDMData::Dump() const { cout << "DetNbr: " << fMDM_DetectorNbr[i] << ", X position: " << fMDM_Xpos[i] << ", Y position: " << fMDM_Ypos[i] + << ", Kinetic Energy: " << fMDM_Kinetic_Energy[i] << ", Particle Mass: " << fMDM_Particle_Mass[i] << ", Particle Charge: " << fMDM_Particle_Charge[i] << endl; } diff --git a/NPLib/Detectors/MDM/TMDMData.h b/NPLib/Detectors/MDM/TMDMData.h index a3669fc82..e36338ecb 100644 --- a/NPLib/Detectors/MDM/TMDMData.h +++ b/NPLib/Detectors/MDM/TMDMData.h @@ -43,6 +43,9 @@ class TMDMData : public TObject { // Y - position vector<Double_t> fMDM_Ypos; + // Kinetic Energy + vector<Double_t> fMDM_Kinetic_Energy; + // Particle ID vector<UShort_t> fMDM_Particle_Charge; vector<Double_t> fMDM_Particle_Mass; @@ -71,10 +74,11 @@ class TMDMData : public TObject { public: ////////////////////// SETTERS //////////////////////// // - inline void SetHit(UShort_t DetNbr, Double_t x, Double_t y, UShort_t charge, Double_t mass){ + inline void SetHit(UShort_t DetNbr, Double_t x, Double_t y, UShort_t charge, Double_t mass, Double_t eKin = 0){ fMDM_DetectorNbr.push_back(DetNbr); fMDM_Xpos.push_back(x); fMDM_Ypos.push_back(y); + fMDM_Kinetic_Energy.push_back(eKin); fMDM_Particle_Mass.push_back(mass); fMDM_Particle_Charge.push_back(charge); };//! @@ -91,6 +95,9 @@ class TMDMData : public TObject { // Y - position inline Double_t Get_Ypos(const unsigned int &i) const {return fMDM_Ypos[i];}//! + // Kinetic Energy + inline Double_t Get_Kinetic_Energy(const unsigned int &i) const + {return fMDM_Kinetic_Energy[i];}//! // Particle ID inline Double_t GetParticleMass(const unsigned int& i) const {return fMDM_Particle_Mass[i];}//! @@ -99,7 +106,7 @@ class TMDMData : public TObject { ////////////////////////////////////////////////////////////// // Required for ROOT dictionnary - ClassDef(TMDMData,2) // MDMData structure + ClassDef(TMDMData,3) // MDMData structure }; #endif diff --git a/NPSimulation/Detectors/MDM/MDM.cc b/NPSimulation/Detectors/MDM/MDM.cc index 4019ea09c..b3fd7c785 100644 --- a/NPSimulation/Detectors/MDM/MDM.cc +++ b/NPSimulation/Detectors/MDM/MDM.cc @@ -234,7 +234,7 @@ void MDM::ReadSensitive(const G4Event* event){ // Set X, Y positions in TMDMData class for(int i=0; i< 4; ++i) { - m_Event->SetHit(i, x[i], y[i], Charge, Mass/amu_c2); + m_Event->SetHit(i, x[i], y[i], Charge, Mass/amu_c2, Ekin/MeV); } ++indx; -- GitLab