This commit is contained in:
Jan Kieseler
2023-10-09 11:55:30 +02:00
parent 48c0391978
commit 9cd1a93ced
5 changed files with 8 additions and 8 deletions
+2 -1
View File
@@ -82,6 +82,7 @@ public:
y = (copyNo / layer.nx) * layer.sens_ywidth*cm;
}
G4ThreeVector origin(x, y, z);
// G4ThreeVector(layer.sens_xwidth * (i % layer.nx) - layer.sens_xwidth * ((float)layer.nx-1) / 2.*cm, //from sensor position below
origin -= G4ThreeVector(layer.sens_xwidth * ((float)layer.nx-1) / 2.*cm, layer.sens_ywidth * ((float)layer.ny-1) / 2.*cm, 0);
origin += G4ThreeVector(0., 0., position);
physVol->SetTranslation(origin);
@@ -270,7 +271,7 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
if(layer.isActive){
for(int i = 0; i < layer.nx*layer.ny; i++){
Sensor sensor;
sensor.position = G4ThreeVector(layer.sens_xwidth * (i % layer.nx) - layer.sens_xwidth * ((float)layer.nx-1) / 2.*cm,
sensor.position = G4ThreeVector(layer.sens_xwidth * (i % layer.nx) - layer.sens_xwidth * ((float)layer.nx-1) / 2.*cm, // FIX!!!!
layer.sens_ywidth * (i / layer.nx) - layer.sens_ywidth * ((float)layer.ny-1) / 2.*cm, position);
sensor.size = G4ThreeVector(layer.sens_xwidth, layer.sens_ywidth, layer.thickness);
sensor.energy = 0;
+1 -1
View File
@@ -25,7 +25,7 @@ void G4System::init(GeometryDescriptor &CW){
//
runManager =
G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
runManager->SetNumberOfThreads(20);//more doesn't make sense
runManager->SetNumberOfThreads(1);//more doesn't make sense
runManager->SetVerboseLevel(0);
}
else{
+3 -1
View File
@@ -78,7 +78,9 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
// This function is called at the begining of event
G4double rand = G4INCL::Random::shoot();
G4double rand = 0;
while(rand > 1 || rand < 0)
rand = G4INCL::Random::shoot();
partEnergy = rand*(maxPartEnergy-minPartEnergy)+minPartEnergy;
auto particleDefinition