Problem 2379 - World volume size messenger behaves differently depending upon when the absorber size is changed
Summary: World volume size messenger behaves differently depending upon when the absor...
Status: RESOLVED FIXED
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: electromagnetic/TestEM5 (show other problems)
Version: 10.7
Hardware: All All
: P4 minor
Assignee: Vladimir.Ivantchenko
URL:
Depends on:
Blocks:
 
Reported: 2021-06-04 15:13 CEST by alexander.howard
Modified: 2021-12-03 12:38 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description alexander.howard 2021-06-04 15:13:32 CEST
The World Volume messenger fails to set the change the size of the world if the chosen value is smaller than the default absorber and the command is issued before changing the absorber size.

For example:

/testem/det/setAbsThick 1.0 mm
/testem/det/setAbsYZ 10.0 mm
/testem/det/setWorldX 1.1 mm
/testem/det/setWorldYZ 15 mm

/run/initialize

Gives different results to:

/testem/det/setWorldX 1.1 mm
/testem/det/setWorldYZ 15 mm
/testem/det/setAbsThick 1.0 mm
/testem/det/setAbsYZ 10.0 mm

/run/initialize

The following method inside DetectorConstruction.cc is at fault:

void DetectorConstruction::ComputeGeomParameters()
{
  // Compute derived parameters of the calorimeter
  fXstartAbs = fXposAbs-0.5*fAbsorberThickness; 
  fXendAbs   = fXposAbs+0.5*fAbsorberThickness;

  G4double xmax = std::max(std::abs(fXstartAbs), std::abs(fXendAbs));
     
  // change world size by the flag or if the absorber is large 
  if (fDefaultWorld || 2*xmax >=  fWorldSizeX ||
      fAbsorberSizeYZ >= fWorldSizeYZ) 
    {
      fWorldSizeX = 3*xmax; 
      fWorldSizeYZ= 1.2*fAbsorberSizeYZ;
    }         
}

It gets triggered after the set world command, but is applying limits from the default absorber, unless absorber size is set first.

This could either be documented, or the world volume could be automatically set to 10% bigger than the absorber with a minimum of 2 mm bigger to accommodate back splash.
Comment 1 Vladimir.Ivantchenko 2021-12-03 12:37:34 CET
Hi Alex,

the example was fixed for 11.0.

Vladimir
Comment 2 Vladimir.Ivantchenko 2021-12-03 12:38:08 CET
Forget to say, thank you for the report!