Sunday, July 27, 2014

Some notes on the modified version of Geant4 LXe example

Some graduate students have worked on modifying the LXe example supplied with the geant4 package, here are my notes on understanding and troubleshooting the modifications.

  • cout needs << endl ; at the end, for flushing the buffer, especially when called inside a loop
  • "Find in Files" from commandline -
      grep "string to search for" /path/to/directory -R -n
  • the G4cout statements in the LXe example have an if statement before them, so the macro statement /LXe/eventVerbose 1 should be called if those are to be executed. 
  • the supplied macros in LXe example also have errors -
-  this is due to the modification noted in the Changes file, in 2013, November 22, 2013 P. Gumplinger (LXe-V09-06-12) - replace Update method and commands with ReinitializeGeometry. So we should just comment out the update lines in the macros. Four cc files have been modified in src -,, and

  • sets the gamma energy to be 140 keV.
  • pmt positioning is done originally in inside G4PVPlacement function -

    There, the PlacePMTs function calls have been commented out except in the xy plane.
  • G4double lxe_Energy[lxenum]    = { 3.001*eV , 3.000*eV, 2.999*eV, 2.998*eV };
  • is defined in - also


    G4double vacuum_RIND[lxenum]={1.,1.,1.,1.};
    (changed from 3 values in orig to 4 values here. seems to be a mistake. - refractive index should be a 3D vector, not 4D.

    In SetDefaults, sizes and numbers defined as

    fScint_x = 5.2*cm;
    fScint_y = 5.2*cm;
    fScint_z = 1*cm;
    fNx = 8;
    fNy = 8;
    fNz = 0;
  • has the added opfile <<  statements.
    Most of the G4couts in the original are after an if(fVerbose>0)
    that is, LXe/eventVerbose 1 must be set while running LXe for them to execute.
  • vis.mac the default visualization macro has
    /run/verbose 2
    /control/verbose 2

    setting these to 0 reduces some clutter.
  • Somewhere the process verbose is being set to 1, can't seem to override. So all hadron processes etc are listed.
  • 140 keV being deposited in modified version as against 511 in orig.
  • Energy weighted position of hits in LXe is being shown as non-zero in new and old, but in both cases, reconstructed position is 0,0,0

1 comment: