From 0ee775e0b310e65d3a3355d88081a17d0c01e425 Mon Sep 17 00:00:00 2001 From: matta <matta@npt> Date: Fri, 14 Jan 2011 22:02:20 +0000 Subject: [PATCH] * Fixing minor bug in Must2Array.cc --- NPLib/scripts/NPToolLogon.C | 10 ++++++---- NPSimulation/src/MUST2Array.cc | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/NPLib/scripts/NPToolLogon.C b/NPLib/scripts/NPToolLogon.C index ab0007dcd..15e82b573 100644 --- a/NPLib/scripts/NPToolLogon.C +++ b/NPLib/scripts/NPToolLogon.C @@ -20,16 +20,18 @@ * * * * *****************************************************************************/ + +// C++ headers +#include <iostream> +#include <vector> +using namespace std; + // ROOT headers #include "TSystem.h" #include "TROOT.h" #include "TList.h" #include "TSystemDirectory.h" #include "TString.h" - -// C++ headers -#include <iostream> -using namespace std; void NPToolLogon(bool quietmode = false) { diff --git a/NPSimulation/src/MUST2Array.cc b/NPSimulation/src/MUST2Array.cc index e644c5950..321e478c5 100644 --- a/NPSimulation/src/MUST2Array.cc +++ b/NPSimulation/src/MUST2Array.cc @@ -1156,7 +1156,7 @@ void MUST2Array::ReadSensitive(const G4Event* event) // Pos X Pos_X_itr = PosXHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeX ; h++) { + for (G4int h = 0 ; h < PosXHitMap->entries() ; h++) { G4int PosXTrackID = Pos_X_itr->first - N ; G4double PosX = *(Pos_X_itr->second) ; if (PosXTrackID == NTrackID) { @@ -1167,7 +1167,7 @@ void MUST2Array::ReadSensitive(const G4Event* event) // Pos Y Pos_Y_itr = PosYHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeX ; h++) { + for (G4int h = 0 ; h < PosYHitMap->entries() ; h++) { G4int PosYTrackID = Pos_Y_itr->first - N ; G4double PosY = *(Pos_Y_itr->second) ; if (PosYTrackID == NTrackID) { @@ -1178,7 +1178,7 @@ void MUST2Array::ReadSensitive(const G4Event* event) // Pos Z Pos_Z_itr = PosZHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeX ; h++) { + for (G4int h = 0 ; h < PosZHitMap->entries() ; h++) { G4int PosZTrackID = Pos_Z_itr->first - N ; G4double PosZ = *(Pos_Z_itr->second) ; if (PosZTrackID == NTrackID) { @@ -1189,7 +1189,7 @@ void MUST2Array::ReadSensitive(const G4Event* event) // Angle Theta Ang_Theta_itr = AngThetaHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeX ; h++) { + for (G4int h = 0 ; h < AngThetaHitMap->entries(); h++) { G4int AngThetaTrackID = Ang_Theta_itr->first - N ; G4double AngTheta = *(Ang_Theta_itr->second) ; if (AngThetaTrackID == NTrackID) { @@ -1200,7 +1200,7 @@ void MUST2Array::ReadSensitive(const G4Event* event) // Angle Phi Ang_Phi_itr = AngPhiHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeX ; h++) { + for (G4int h = 0 ; h < AngPhiHitMap->entries() ; h++) { G4int AngPhiTrackID = Ang_Phi_itr->first - N ; G4double AngPhi = *(Ang_Phi_itr->second) ; if (AngPhiTrackID == NTrackID) { -- GitLab