Skip to content
Snippets Groups Projects
Commit d6455b04 authored by srlund2's avatar srlund2
Browse files

removed GDML dependencies that I accidentally left in the first time

parent 726d764f
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "G4LogicalVolume.hh" #include "G4LogicalVolume.hh"
#include "G4VUserDetectorConstruction.hh" #include "G4VUserDetectorConstruction.hh"
#include "G4SubtractionSolid.hh" #include "G4SubtractionSolid.hh"
#include "G4GDMLParser.hh" //#include "G4GDMLParser.hh"
#include "G4RunManager.hh" #include "G4RunManager.hh"
#include "Materials.hh" #include "Materials.hh"
...@@ -115,7 +115,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction ...@@ -115,7 +115,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction
G4Material* m_filler; G4Material* m_filler;
G4MaterialPropertiesTable* m_GasMPT; G4MaterialPropertiesTable* m_GasMPT;
G4GDMLParser m_Parser; //G4GDMLParser m_Parser;
G4RunManager* m_runMan; G4RunManager* m_runMan;
DetectorMessenger* m_DetectorMessenger; DetectorMessenger* m_DetectorMessenger;
}; };
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#include "G4VisExtent.hh" #include "G4VisExtent.hh"
#include "G4Colour.hh" #include "G4Colour.hh"
#include "G4UImanager.hh" #include "G4UImanager.hh"
#include "G4GDMLParser.hh" //#include "G4GDMLParser.hh"
/* /*
* *
...@@ -79,6 +79,7 @@ DetectorConstruction::DetectorConstruction() ...@@ -79,6 +79,7 @@ DetectorConstruction::DetectorConstruction()
m_ConstructionHasBeenDone(false), m_ConstructionHasBeenDone(false),
m_UsingCADmodel(false), m_UsingCADmodel(false),
m_logicWorld(0), m_logicWorld(0),
m_logicLightGuide(0),
m_DetectorMessenger(nullptr) m_DetectorMessenger(nullptr)
{ {
materials = Materials::getInstance(); materials = Materials::getInstance();
...@@ -286,6 +287,45 @@ void DetectorConstruction::PlaceGeometry(){ ...@@ -286,6 +287,45 @@ void DetectorConstruction::PlaceGeometry(){
G4RotationMatrix * PMTrot = new G4RotationMatrix(); G4RotationMatrix * PMTrot = new G4RotationMatrix();
PMTrot->rotateX(90*deg); PMTrot->rotateX(90*deg);
if(m_nSegmentsX == 1 && m_nSegmentsZ == 1){
m_physLightGuide.push_back(
new G4PVPlacement(m_rotation,
G4ThreeVector(m_LGpos->x(), m_LGpos->y(), m_LGpos->z()),
m_logicLightGuide,
"LightGuide",
m_logicHalfWorld,
false,
0) );
//----------------- Place the PMT -----------------//
m_physPMT.push_back(
new G4PVPlacement(PMTrot,
G4ThreeVector(m_pmtPos->x(), m_pmtPos->y(), m_pmtPos->z()),
m_logicPMT,
"PMT",
m_logicHalfWorld,
false,
0) );
//----------------- Define Optical Borders -----------------//
m_Surfvec.push_back(
new G4LogicalBorderSurface("AlSurface",
m_physLightGuide.back(),
m_physHalfWorld,
materials->AlSurface ) );
m_Surfvec.push_back(
new G4LogicalBorderSurface("AlSurface",
m_physHalfWorld,
m_physLightGuide.back(),
materials->AlSurface ) );
return;
}
char name[40]; char name[40];
...@@ -503,12 +543,12 @@ void DetectorConstruction::UseCADModel(G4String fileName){ ...@@ -503,12 +543,12 @@ void DetectorConstruction::UseCADModel(G4String fileName){
"LightGuide"); //name "LightGuide"); //name
} }
if(fileType == "gdml"){ // if(fileType == "gdml"){
m_Parser.Read(fileName); // m_Parser.Read(fileName);
} // }
if(fileType == "step"){ // if(fileType == "step"){
m_logicLightGuide = m_Parser.ParseST(fileName,materials->Air,materials->Al); // m_logicLightGuide = m_Parser.ParseST(fileName,materials->Air,materials->Al);
} // }
if(m_logicLightGuide !=0 ){ if(m_logicLightGuide !=0 ){
...@@ -544,15 +584,17 @@ void DetectorConstruction::UseCADModel(G4String fileName){ ...@@ -544,15 +584,17 @@ void DetectorConstruction::UseCADModel(G4String fileName){
* Output the model of the light guide to GDML * Output the model of the light guide to GDML
*/ */
void DetectorConstruction::OutputToGDML(G4String fileName){ void DetectorConstruction::OutputToGDML(G4String fileName){
if(m_physLightGuide[0] != 0){
G4cout << "Go home, you're drunk" << G4endl;
// if(m_physLightGuide[0] != 0){
//For some reason this only works as a pointer //For some reason this only works as a pointer
G4GDMLParser* gdml = new G4GDMLParser(); // G4GDMLParser* gdml = new G4GDMLParser();
gdml->Write(fileName.c_str(),m_physLightGuide.back()); // gdml->Write(fileName.c_str(),m_physLightGuide.back());
delete gdml; // delete gdml;
}else{ // }else{
G4cout << "No physical light guide defined..." << G4endl; // G4cout << "No physical light guide defined..." << G4endl;
G4cout << "Can't write model to GDML" << G4endl; // G4cout << "Can't write model to GDML" << G4endl;
} // }
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment