From 7035a004ce398dbae9cb1836758b15f70a05f050 Mon Sep 17 00:00:00 2001
From: matta <matta@npt>
Date: Fri, 15 Feb 2013 10:25:10 +0000
Subject: [PATCH] * Fixing Warning in NPS and new bug created by previous
 warning fix

---
 NPSimulation/include/EventGeneratorIsotropic.hh       | 2 +-
 NPSimulation/include/EventGeneratorTwoBodyReaction.hh | 2 +-
 NPSimulation/include/VEventGenerator.hh               | 2 +-
 NPSimulation/src/EventGeneratorIsotropic.cc           | 2 +-
 NPSimulation/src/EventGeneratorParticleDecay.cc       | 6 +-----
 NPSimulation/src/Sharc.cc                             | 9 +--------
 6 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/NPSimulation/include/EventGeneratorIsotropic.hh b/NPSimulation/include/EventGeneratorIsotropic.hh
index 3564bf6e3..c2d7c8dd2 100644
--- a/NPSimulation/include/EventGeneratorIsotropic.hh
+++ b/NPSimulation/include/EventGeneratorIsotropic.hh
@@ -38,7 +38,7 @@ public:     // Constructor and destructor
   virtual ~EventGeneratorIsotropic();
   
 public:     // Inherit from VEventGenerator Class
-  void ReadConfiguration(string,int dump=0)               ;
+  void ReadConfiguration(string,int)               ;
   void GenerateEvent(G4Event*) ;
   void InitializeRootOutput()                  ;
   
diff --git a/NPSimulation/include/EventGeneratorTwoBodyReaction.hh b/NPSimulation/include/EventGeneratorTwoBodyReaction.hh
index 85389059b..467bd7116 100644
--- a/NPSimulation/include/EventGeneratorTwoBodyReaction.hh
+++ b/NPSimulation/include/EventGeneratorTwoBodyReaction.hh
@@ -54,7 +54,7 @@ class EventGeneratorTwoBodyReaction : public VEventGenerator
 
 
    public: // Inherit from VEventGenerator class
-      void ReadConfiguration(string,int dump=0);
+      void ReadConfiguration(string,int);
       void GenerateEvent(G4Event*);
       void SetTarget(Target* Target) ;
 
diff --git a/NPSimulation/include/VEventGenerator.hh b/NPSimulation/include/VEventGenerator.hh
index 5ec0e7540..9da49d9a7 100644
--- a/NPSimulation/include/VEventGenerator.hh
+++ b/NPSimulation/include/VEventGenerator.hh
@@ -53,7 +53,7 @@ public:
    virtual ~VEventGenerator();
 
 public:
-   virtual void ReadConfiguration(string,int iteration=0) {};
+  virtual void ReadConfiguration(string,int dump=0) {dump=0;};
    virtual void GenerateEvent(G4Event*) {};
    virtual void InitializeRootOutput() {};
 
diff --git a/NPSimulation/src/EventGeneratorIsotropic.cc b/NPSimulation/src/EventGeneratorIsotropic.cc
index 136a97029..5b2d29cc3 100644
--- a/NPSimulation/src/EventGeneratorIsotropic.cc
+++ b/NPSimulation/src/EventGeneratorIsotropic.cc
@@ -190,7 +190,7 @@ void EventGeneratorIsotropic::ReadConfiguration(string Path,int){
 
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void EventGeneratorIsotropic::GenerateEvent(G4Event* anEvent){
+void EventGeneratorIsotropic::GenerateEvent(G4Event*){
   
   if(m_particle==NULL){
     if(m_particleName!="gamma"){
diff --git a/NPSimulation/src/EventGeneratorParticleDecay.cc b/NPSimulation/src/EventGeneratorParticleDecay.cc
index cb1e20f1a..703a32044 100644
--- a/NPSimulation/src/EventGeneratorParticleDecay.cc
+++ b/NPSimulation/src/EventGeneratorParticleDecay.cc
@@ -64,8 +64,6 @@ void EventGeneratorParticleDecay::ReadConfiguration(string Path,int Occurence){
   bool ReadingStatusParticleDecay  = false ;
   
   bool check_Daughter = false ;
-  bool check_CrossSection = false ;
-  bool check_ExcitationEnergy = false ;
   bool check_shoot = false ;
   bool check_created = false ;
   
@@ -136,7 +134,6 @@ void EventGeneratorParticleDecay::ReadConfiguration(string Path,int Occurence){
       }
       
       else if(DataBuffer == "ExcitationEnergy=") {
-        check_ExcitationEnergy = true;
         LineStream.clear();
         LineStream.str(LineBuffer);
         
@@ -159,7 +156,6 @@ void EventGeneratorParticleDecay::ReadConfiguration(string Path,int Occurence){
         LineStream.str(LineBuffer);
         LineStream >> CSPath >> CSName ;
         if(VerboseLevel==1) G4cout << "    Cross Section Path: " << CSPath  << G4endl;
-        check_CrossSection = true;
       }
       
       else if(DataBuffer == "shoot=") {
@@ -201,7 +197,7 @@ void EventGeneratorParticleDecay::ReadConfiguration(string Path,int Occurence){
 
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-void EventGeneratorParticleDecay::GenerateEvent(G4Event* anEvent){
+void EventGeneratorParticleDecay::GenerateEvent(G4Event*){
   
   // Look for the decaying nucleus
   Particle decayingParticle = m_ParticleStack->SearchAndRemoveParticle(m_MotherNucleiName);
diff --git a/NPSimulation/src/Sharc.cc b/NPSimulation/src/Sharc.cc
index 386d9bc5a..b0c98770b 100644
--- a/NPSimulation/src/Sharc.cc
+++ b/NPSimulation/src/Sharc.cc
@@ -417,9 +417,7 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
       
       // create the PAD
       // Make a single detector geometry
-      G4LogicalVolume* logicPADDetector=
-      new G4LogicalVolume(PADDetector,m_MaterialVacuum,"logicPADDetector", 0, 0, 0);
-      logicPADDetector->SetVisAttributes(G4VisAttributes::Invisible);
+      G4LogicalVolume* logicPADDetector = NULL;
       
       G4ThreeVector PAD_Wafer_Offset =
       G4ThreeVector(PAD_Wafer_Length_Offset, PAD_Wafer_Width_Offset,0 );
@@ -472,11 +470,6 @@ void Sharc::ConstructBOXDetector(G4LogicalVolume* world){
                           PAD_Wafer_Offset-G4ThreeVector(0,0,0.5*PAD_PCB_Thickness-0.5*m_ThicknessPAD[i][j]),
                           logicPADWafer,"PAD_Wafer",logicPADDetector,false,DetNbr);
       }
-      
-      else{
-        delete logicPADDetector;
-      }
-      
       ///////////////////////////////////////////////////////////////////////////////////
       // Place the detector in the world
       // Position of the center of the PCB
-- 
GitLab