#include "Chamber20nep.hh" #include "Materials.hh" #include "G4PhysicalConstants.hh" #include "G4SystemOfUnits.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4SubtractionSolid.hh" #include "G4UnionSolid.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Colour.hh" #include "Chamber20nepMessenger.hh" Chamber20nep::Chamber20nep() { chamber20NepMessenger = new Chamber20nepMessenger(this); } Chamber20nep::~Chamber20nep() { delete chamber20NepMessenger; } G4LogicalVolume *Chamber20nep::Construct() { materials = Materials::GetInstance(); G4VisAttributes *color1 = new G4VisAttributes(G4Colour(1.,1.,1.0)); G4VisAttributes *color2 = new G4VisAttributes(G4Colour(0.,1.,1.0)); G4VisAttributes * darkviolet = new G4VisAttributes( G4Colour(64/255. ,0/255. ,64/255. )); G4VisAttributes * dummycolour = darkviolet; G4double outerX = 128*mm; outerY = 112*mm; outerL = 568*mm; G4double cutOutX = 114*mm; G4double cutOutY = 2.1*mm; G4double cutOutL = 160*mm; G4double innerX = 120*mm; G4double innerY = 104*mm; innerLorig = 557*mm; innerL = 384*mm; // temporary fix for 21Ne setup until calorimeter is coded G4double holeDiam = 56*mm; G4double holeL = 11.0*mm; G4VSolid* outerSol = new G4Box("outerBox",outerX/2,outerY/2,outerL/2); G4VSolid* cutOutSol = new G4Box("cutOutBox",cutOutX/2,cutOutY/2,cutOutL/2); G4VSolid* gasSol = new G4Box("gasBox",innerX/2,innerY/2,innerL/2); G4VSolid* holeSol = new G4Tubs("holeTube",0,holeDiam/2,holeL/2,0.0,360.0*deg); G4SubtractionSolid* chamber1Sol = new G4SubtractionSolid("chamber1", outerSol, cutOutSol, 0, G4ThreeVector(0,outerY/2-cutOutY/2,-outerL/2+120*mm)); G4SubtractionSolid* chamber2Sol = new G4SubtractionSolid("chamber2", chamber1Sol, cutOutSol, 0, G4ThreeVector(0,-outerY/2+cutOutY/2,-outerL/2+195*mm)); G4SubtractionSolid* chamberSol = new G4SubtractionSolid("chamber", chamber2Sol, holeSol, 0, G4ThreeVector(0,0,-outerL/2+holeL/2)); G4LogicalVolume* chamberLog = new G4LogicalVolume(chamberSol,materials->GetMaterial("G4_STAINLESS-STEEL"),"chamberLog",0,0,0); gasLog = new G4LogicalVolume(gasSol,materials->GetMaterial("gas"),"gasLog",0,0,0); auto *gasPhys = new G4PVPlacement(0,G4ThreeVector(0*mm,0.0*mm,-outerL/2+innerL/2),gasLog,"gasPhys",chamberLog,0,0); chamberLog->SetVisAttributes(color1); gasLog->SetVisAttributes(color2); G4Box* dummysurface_box = new G4Box("dummysurface_box", 59.5*mm, 51.5*mm, 0.5*mm); G4LogicalVolume* dummysurface_log= new G4LogicalVolume(dummysurface_box, materials->GetMaterial("gas"), "dummysurface_box", 0, 0, 0); dummysurface_log -> SetVisAttributes(dummycolour); G4ThreeVector dummyRelPos=G4ThreeVector(0,0,-138*mm); G4ThreeVector DummyPosLocal=DummyPos+dummyRelPos; auto *dummyPhys = new G4PVPlacement(0,DummyPosLocal, dummysurface_log, "dummysurface", gasLog, false, 0); G4ThreeVector gasRelPos=G4ThreeVector(0*mm,0.0*mm,-outerL/2+innerL/2); G4cout << "dummyposition in chamber" << dummyRelPos+gasRelPos << G4endl; return chamberLog; } G4double Chamber20nep::GetLength() { //return innerL-outerL/2; return innerLorig-outerL/2; // temporary fix for 21Ne setup until calorimeter is coded } G4double Chamber20nep::GetLength2() { return outerL; } G4double Chamber20nep::GetHeight() { return outerY; } G4LogicalVolume *Chamber20nep::GetTargetLog() { return gasLog; }