fixes
This commit is contained in:
@@ -213,6 +213,9 @@ def run_batch(
|
||||
|
||||
assert (n_ex_non_zero==n_unique), f"only {n_unique} unique non-zero entries in total_dep_energy out of {n_ex_non_zero}"
|
||||
|
||||
if len(filename):
|
||||
df.to_pickle(filename)
|
||||
|
||||
return alldf
|
||||
|
||||
def _fill_event(gd : GeometryDescriptor,
|
||||
|
||||
@@ -294,7 +294,10 @@ G4VPhysicalVolume* DetectorConstruction::DefineVolumes()
|
||||
|
||||
position += layer.thickness / 2 *cm; //assign the physical volume to the layer
|
||||
|
||||
G4cout << "layer " << layer.name << " built with " << layer.sensors.size() << " sensors and depth of " << layer.thickness << G4endl;
|
||||
|
||||
}
|
||||
//exit(0);// DEBUG
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
|
||||
@@ -121,16 +121,21 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4Exception("PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
"MyCode0002", JustWarning, msg);
|
||||
}
|
||||
//draw particle position from a unit distribution in x-y with +-7.5 cm around the center
|
||||
G4double x = -1000;
|
||||
G4double y = -1000;
|
||||
G4double x_width = 15;
|
||||
G4double y_width = 15;
|
||||
while(x < -x_width/2. || x > x_width/2. || y < -y_width/2. || y > y_width/2.){
|
||||
x = G4INCL::Random::shoot()*x_width - x_width/2;
|
||||
y = G4INCL::Random::shoot()*y_width - y_width/2;
|
||||
if(false){
|
||||
//draw particle position from a unit distribution in x-y with +-3 cm around the center
|
||||
G4double x = -1000;
|
||||
G4double y = -1000;
|
||||
G4double x_width = 6;
|
||||
G4double y_width = 6;
|
||||
while(x < -x_width/2. || x > x_width/2. || y < -y_width/2. || y > y_width/2.){
|
||||
x = G4INCL::Random::shoot()*x_width - x_width/2;
|
||||
y = G4INCL::Random::shoot()*y_width - y_width/2;
|
||||
}
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x*cm, y*cm, -worldZHalfLength));
|
||||
}
|
||||
else{
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0.*cm, 0.*cm, -worldZHalfLength));
|
||||
}
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x*cm, y*cm, -worldZHalfLength));
|
||||
//printout for checking
|
||||
//G4cout << "shooting at " << x << " " << y << " " << -worldZHalfLength << G4endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user