diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx index 23d7cd36c67758b8e317a59c61fef0d65b4150d4..f1db8c903f5507262dcf645107df7b27545647a4 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.cxx @@ -74,7 +74,7 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa } //set initial values - nevents=0; + m_nevents=0; //These are the RHadron pdg_id @@ -132,8 +132,8 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa void SG_StepNtuple::BeginOfEventAction(const G4Event*){ m_nsteps=0; - rhid=0;//the rhadron index (either the first or second rhadon, usually) - nevents++; m_evtid=nevents;//since it gets cleared out after every fill... + m_rhadronIndex=0;//the rhadron index (either the first or second rhadon, usually) + m_nevents++; m_evtid=m_nevents;//since it gets cleared out after every fill... } @@ -175,7 +175,7 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa bool firstslow = aStep->GetPostStepPoint()->GetVelocity()<0.15*std::pow(minA,-2./3.)*CLHEP::c_light; //just save the first slow step for the rhadron for (int i=0; i<m_nsteps; ++i){ - if (m_rhid[i]==rhid && m_vbelowthresh[i]>0) firstslow=false; + if (m_rhid[i]==m_rhadronIndex && m_vbelowthresh[i]>0) firstslow=false; } if (firstslow || aStep->GetTrack()->GetCurrentStepNumber()<=1 || aStep->GetPostStepPoint()->GetKineticEnergy()==0.){ @@ -190,8 +190,8 @@ SG_StepNtuple::SG_StepNtuple():AthMessaging(Gaudi::svcLocator()->service< IMessa } // - if (aStep->GetPreStepPoint()->GetGlobalTime()==0) rhid++; - m_rhid[m_nsteps]=rhid; + if (aStep->GetPreStepPoint()->GetGlobalTime()==0) m_rhadronIndex++; + m_rhid[m_nsteps]=m_rhadronIndex; m_pdg[m_nsteps]=aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); m_charge[m_nsteps]=aStep->GetTrack()->GetDefinition()->GetPDGCharge(); diff --git a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h index d72190d6f74ede94d2a6b44e2865fc3c3af21bbb..5204e8a9fd44bae6ed8c9eca82cfa77a6aba2840 100644 --- a/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h +++ b/Simulation/G4Extensions/RHadrons/src/SG_StepNtuple.h @@ -41,7 +41,8 @@ namespace G4UA{ NTuple::Array<float> m_ke1, m_ke2; NTuple::Array<int> m_rh, m_rhid, m_step; std::set<int> rhs;//rhadron pdgid's - long nevents, rhid; + long m_nevents = 0; + long m_rhadronIndex = 0; }; // class SG_StepNtuple