From d0b139bd816c7e248a6425558542e6f12e849aca Mon Sep 17 00:00:00 2001 From: nicolas <nicolas@nptool> Date: Tue, 12 Feb 2013 18:14:24 +0000 Subject: [PATCH] * Remove compilation warnings --- NPSimulation/src/AnnularS1.cc | 12 ++++-------- NPSimulation/src/Chamber.cc | 12 +++--------- NPSimulation/src/DetectorConstruction.cc | 10 ++++------ NPSimulation/src/DummyDetector.cc | 4 +--- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/NPSimulation/src/AnnularS1.cc b/NPSimulation/src/AnnularS1.cc index 6d572feb0..69c565a5b 100644 --- a/NPSimulation/src/AnnularS1.cc +++ b/NPSimulation/src/AnnularS1.cc @@ -166,10 +166,6 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, //////////////////////////////////////////////////////////////// ////////////// Starting Volume Definition ////////////////////// //////////////////////////////////////////////////////////////// - // Little trick to avoid warning in compilation: Use a PVPlacement "buffer". - // If don't you will have a Warning unused variable 'myPVP' - G4PVPlacement* PVPBuffer ; - // Name of the module G4String Name = "S1Annular" + DetectorNumber; @@ -184,7 +180,7 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, // G4LogicalVolume* logicAnnularS1 = new G4LogicalVolume(solidAnnularS1, Iron, Name, 0, 0, 0); G4LogicalVolume* logicAnnularS1 = new G4LogicalVolume(solidAnnularS1, Vacuum, Name, 0, 0, 0); - PVPBuffer = new G4PVPlacement(G4Transform3D(*rotation, position), + new G4PVPlacement(G4Transform3D(*rotation, position), logicAnnularS1, Name, world, @@ -209,8 +205,8 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, // G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, Aluminium, "logicAluStrip", 0, 0, 0); G4LogicalVolume* logicAluStrip = new G4LogicalVolume(solidAluStrip, Vacuum, "logicAluStrip", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripFront, logicAluStrip, Name + "_AluStripFront", logicAnnularS1, false, 0); - PVPBuffer = new G4PVPlacement(0, positionAluStripBack, logicAluStrip, Name + "_AluStripBack", logicAnnularS1, false, 0); + new G4PVPlacement(0, positionAluStripFront, logicAluStrip, Name + "_AluStripFront", logicAnnularS1, false, 0); + new G4PVPlacement(0, positionAluStripBack, logicAluStrip, Name + "_AluStripBack", logicAnnularS1, false, 0); logicAluStrip->SetVisAttributes(G4VisAttributes::Invisible); @@ -226,7 +222,7 @@ void AnnularS1::VolumeMaker(G4int DetecNumber, G4LogicalVolume* logicSilicon = new G4LogicalVolume(solidSilicon, Silicon, "logicSilicon", 0, 0, 0); - PVPBuffer = new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicAnnularS1, false, 0); + new G4PVPlacement(0, positionSilicon, logicSilicon, Name + "_Silicon", logicAnnularS1, false, 0); // Set Silicon strip sensible logicSilicon->SetSensitiveDetector(m_Scorer); diff --git a/NPSimulation/src/Chamber.cc b/NPSimulation/src/Chamber.cc index a56bb3f43..6e58997f5 100644 --- a/NPSimulation/src/Chamber.cc +++ b/NPSimulation/src/Chamber.cc @@ -63,8 +63,8 @@ Chamber::Chamber() G4Material* Chamber::GetMaterialFromLibrary(G4String MaterialName, G4double Temperature, G4double Pressure) { - Temperature = 0 ; - Pressure = 0 ; + Temperature *= 1 ; + Pressure *= 1 ; G4Material* myMaterial; @@ -215,11 +215,6 @@ void Chamber::ReadConfiguration(string Path) // Called After DetecorConstruction::AddDetector Method void Chamber::ConstructDetector(G4LogicalVolume* world) { - -// Little trick to avoid warning in compilation: Use a PVPlacement "buffer". -// If don't you will have a Warning unused variable 'myPVP' - G4VPhysicalVolume* PVPBuffer ; - if (m_ChamberType) { // case of standard Chamber G4Sphere* solidChamber @@ -231,8 +226,7 @@ void Chamber::ConstructDetector(G4LogicalVolume* world) //G4RotationMatrix *rotation = new G4RotationMatrix(); //rotation->rotateY(m_ChamberAngle); - PVPBuffer = - new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logicChamber, "Chamber", world, false, 0); + new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logicChamber, "Chamber", world, false, 0); G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(0., 1., 1.)); logicChamber->SetVisAttributes(ChamberVisAtt); diff --git a/NPSimulation/src/DetectorConstruction.cc b/NPSimulation/src/DetectorConstruction.cc index 8a5326d26..b28e6c1c3 100644 --- a/NPSimulation/src/DetectorConstruction.cc +++ b/NPSimulation/src/DetectorConstruction.cc @@ -173,7 +173,6 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ string LineBuffer; string DataBuffer; - // needed for Magnetic field bool cAddThinSi = false; bool cComptonTelescope = false; @@ -192,10 +191,6 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ bool cW1 = false; bool cHelios = false; -#ifdef INC_HELIOS - bool check_MField = false; - double Bz=0.; -#endif int VerboseLevel = NPOptionManager::getInstance()->GetVerboseLevel(); ifstream ConfigFile; @@ -497,9 +492,12 @@ void DetectorConstruction::ReadConfigurationFile(string Path){ cHelios = true ; cout << "//////// Helios detector ////////" << endl ; +// bool check_MField = false; + double Bz=0.; + ConfigFile >> DataBuffer ; if (DataBuffer.compare(0, 7, "MField=") == 0){ - check_MField = true; +// check_MField = true; ConfigFile >> DataBuffer ; Bz = atof(DataBuffer.c_str()) ; cout << "//////// Magentic Field set at Bz= " << Bz << " ////////" << endl ; diff --git a/NPSimulation/src/DummyDetector.cc b/NPSimulation/src/DummyDetector.cc index 9346d36b2..8d8b505e5 100644 --- a/NPSimulation/src/DummyDetector.cc +++ b/NPSimulation/src/DummyDetector.cc @@ -265,8 +265,6 @@ void DUMMYDetector::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalV //////////////////////////////////////////////////////////////// ////////////// Starting Volume Definition ////////////////////// //////////////////////////////////////////////////////////////// - G4PVPlacement* PVPBuffer ; - // Name of the module std::ostringstream DetectorNumber ; DetectorNumber << DetNumber ; @@ -303,7 +301,7 @@ void DUMMYDetector::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalV - PVPBuffer = new G4PVPlacement( 0, + G4PVPlacement( 0, Det_pos, logicDUMMYDetector, Name + "_Scintillator", -- GitLab