Dear Experts I am constructing a PbWO4 detector box for 1 cubic meter size and created particle gun with 10 GeV photon but when I run in visualization I can’t see photons interacting with the box. My construction.cc is as follows:
sim.cc (1.8 KB)
#include "construction.hh"
MyDetectorConstruction::MyDetectorConstruction()
{}
MyDetectorConstruction::~MyDetectorConstruction()
{}
G4VPhysicalVolume *MyDetectorConstruction::Construct()
{
G4double a; // atomic mass
G4double z; // atomic number
G4double density, pressure, temperature, fractionmass;
G4String name, symbol;
G4int nel, natoms;
a = 16.00*g/mole;
G4Element* elO = new G4Element(name="Oxygen", symbol="O2", z=8., a);
a = 183.85*g/mole;
G4Element* elW = new G4Element(name="Tungsten", symbol="W", z=74., a);
a = 207.19*g/mole;
G4Element* elPb = new G4Element(name="Lead", symbol="Pb", z=82., a);
a = 14.01*g/mole;
G4Element* elN = new G4Element(name="Nitrogen", symbol="N2", z=7., a);
//--- mixtures
density = 1.290*mg/cm3;
G4Material* Air = new G4Material(name="Air", density, nel=2);
Air->AddElement(elN, 0.7);
Air->AddElement(elO, 0.3);
density = 8.28*g/cm3;
G4Material* PbWO4 = new G4Material(name="PbWO4", density, nel=3);
PbWO4->AddElement(elPb, natoms=1);
PbWO4->AddElement(elW, natoms=1);
PbWO4->AddElement(elO, natoms=4);
G4NistManager *nist = G4NistManager::Instance();
G4Material *worldMat = nist->FindOrBuildMaterial("G4_AIR");
G4Material *theAbsorberMaterial = nist->FindOrBuildMaterial("PbWO4");
//define mother world
G4Box *solidWorld = new G4Box("solidWorld", 4*m, 4*m, 4*m);
G4LogicalVolume *logicWorld = new G4LogicalVolume(solidWorld, worldMat, "logicWorld");
G4VPhysicalVolume *physWorld = new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), logicWorld, "physWorld", 0, false, 0, true);
//Define detector Volume
const G4double sizeCalo = 2.0*m; // For normal calorimeter
G4double xAbsorber = sizeCalo / 2.0; // half dimension along x
G4double yAbsorber = sizeCalo / 2.0; // half dimension along y
G4double zAbsorber = sizeCalo / 2.0; // half dimension along z
G4Box* solidAbsorber = new G4Box("solidAbsorber", xAbsorber, yAbsorber, zAbsorber);
G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber, // solid
theAbsorberMaterial, // material
"logicAbsorber", // name
0, // field manager
0, // sensitive detector
0); // user limits
G4VPhysicalVolume* physiAbsorber = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), logicAbsorber, “physiAbsorber”, 0,false, 0, true);
logicAbsorber->SetMaterial( theAbsorberMaterial );
// PrintParameters();
return physWorld;
}
//void MyDetectorConstruction::ConstructSDandField()
//{
// MySensitiveDetector *sensDet = new MySensitiveDetector(“SensitiveDetector”);
//if(logicDetector != NULL)
// logicDetector->SetSensitiveDetector(sensDet);
//}Preformatted text