Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy deposition discrepancy when parallel world detectors exist in the same space as real world volume #365

Open
rahmans1 opened this issue Jul 6, 2020 · 8 comments

Comments

@rahmans1
Copy link
Contributor

rahmans1 commented Jul 6, 2020

Environment: (where does this bug occur, have you tried other environments)

  • branch (master for latest released): test-magnetHotspotV1
  • revision (HEAD for most recent): HEAD
  • OS or system: Beluga (Compute Canada)
  • Special ROOT or Geant4 versions? Geant4.10.04, Root-6.14

Steps to reproduce: (give a step by step account of how to trigger the bug)

  1. Run a simulation and look at energy deposition in rz-plane on detector 4008.
    /remoll/setgeofile geometry/mollerMother_merged.gdml
    /remoll/physlist/register QGSP_BERT_HP
    /remoll/physlist/parallel/enable
    /remoll/parallel/setfile geometry/mollerParallel.gdml
    /run/numberOfThreads 5
    /run/initialize
    /remoll/addfield map_directory/segmentedJLAB_v2.txt
    /remoll/addfield map_directory/upstreamJLAB_v2.txt
    /remoll/evgen/set beam
    /remoll/evgen/beam/origin 0 0 -7.5 m
    /remoll/evgen/beam/rasx 5 mm
    /remoll/evgen/beam/rasy 5 mm
    /remoll/evgen/beam/corrx 0.065
    /remoll/evgen/beam/corry 0.065
    /remoll/evgen/beam/rasrefz -4.5 m
    /remoll/beamene 11 GeV
    /remoll/beamcurr 85 microampere
    /remoll/SD/disable_all
    /remoll/SD/enable 55
    /remoll/SD/detect lowenergyneutral 55
    /remoll/SD/detect secondaries 55
    /remoll/SD/enable 28
    /remoll/SD/detect lowenergyneutral 28
    /remoll/SD/detect secondaries 28
    /remoll/SD/detect boundaryhits 28
    /remoll/SD/enable 27
    /remoll/SD/detect lowenergyneutral 27
    /remoll/SD/detect secondaries 27
    /remoll/SD/detect boundaryhits 27
    /remoll/SD/enable 26
    /remoll/SD/detect lowenergyneutral 26
    /remoll/SD/detect secondaries 26
    /remoll/SD/detect boundaryhits 26
    /remoll/SD/enable 25
    /remoll/SD/detect lowenergyneutral 25
    /remoll/SD/detect secondaries 25
    /remoll/SD/detect boundaryhits 25
    /remoll/SD/enable 24
    /remoll/SD/detect lowenergyneutral 24
    /remoll/SD/detect secondaries 24
    /remoll/SD/detect boundaryhits 24
    /remoll/SD/enable 23
    /remoll/SD/detect lowenergyneutral 23
    /remoll/SD/detect secondaries 23
    /remoll/SD/detect boundaryhits 23
    /remoll/SD/enable 3001
    /remoll/SD/detect lowenergyneutral 3001
    /remoll/SD/detect secondaries 3001
    /remoll/SD/enable 3002
    /remoll/SD/detect lowenergyneutral 3002
    /remoll/SD/detect secondaries 3002
    /remoll/SD/enable 3003
    /remoll/SD/detect lowenergyneutral 3003
    /remoll/SD/detect secondaries 3003
    /remoll/SD/enable 3004
    /remoll/SD/detect lowenergyneutral 3004
    /remoll/SD/detect secondaries 3004
    /remoll/SD/enable 3005
    /remoll/SD/detect lowenergyneutral 3005
    /remoll/SD/detect secondaries 3005
    /remoll/SD/enable 3006
    /remoll/SD/detect lowenergyneutral 3006
    /remoll/SD/detect secondaries 3006
    /remoll/SD/enable 3007
    /remoll/SD/detect lowenergyneutral 3007
    /remoll/SD/detect secondaries 3007
    /remoll/SD/enable 3008
    /remoll/SD/detect lowenergyneutral 3008
    /remoll/SD/detect secondaries 3008
    /remoll/SD/enable 3009
    /remoll/SD/detect lowenergyneutral 3009
    /remoll/SD/detect secondaries 3009
    /remoll/SD/enable 3010
    /remoll/SD/detect lowenergyneutral 3010
    /remoll/SD/detect secondaries 3010
    /remoll/SD/enable 3011
    /remoll/SD/detect lowenergyneutral 3011
    /remoll/SD/detect secondaries 3011
    /remoll/SD/enable 3012
    /remoll/SD/detect lowenergyneutral 3012
    /remoll/SD/detect secondaries 3012
    /remoll/SD/enable 3013
    /remoll/SD/detect lowenergyneutral 3013
    /remoll/SD/detect secondaries 3013
    /remoll/SD/enable 3014
    /remoll/SD/detect lowenergyneutral 3014
    /remoll/SD/detect secondaries 3014
    /remoll/SD/enable 4001
    /remoll/SD/detect lowenergyneutral 4001
    /remoll/SD/detect secondaries 4001
    /remoll/SD/enable 4002
    /remoll/SD/detect lowenergyneutral 4002
    /remoll/SD/detect secondaries 4002
    /remoll/SD/enable 4003
    /remoll/SD/detect lowenergyneutral 4003
    /remoll/SD/detect secondaries 4003
    /remoll/SD/enable 4004
    /remoll/SD/detect lowenergyneutral 4004
    /remoll/SD/detect secondaries 4004
    /remoll/SD/enable 4005
    /remoll/SD/detect lowenergyneutral 4005
    /remoll/SD/detect secondaries 4005
    /remoll/SD/enable 4006
    /remoll/SD/detect lowenergyneutral 4006
    /remoll/SD/detect secondaries 4006
    /remoll/SD/enable 4007
    /remoll/SD/detect lowenergyneutral 4007
    /remoll/SD/detect secondaries 4007
    /remoll/SD/enable 4008
    /remoll/SD/detect lowenergyneutral 4008
    /remoll/SD/detect secondaries 4008
    /remoll/SD/enable 4009
    /remoll/SD/detect lowenergyneutral 4009
    /remoll/SD/detect secondaries 4009
    /remoll/SD/enable 4010
    /remoll/SD/detect lowenergyneutral 4010
    /remoll/SD/detect secondaries 4010
    /remoll/SD/enable 4011
    /remoll/SD/detect lowenergyneutral 4011
    /remoll/SD/detect secondaries 4011
    /remoll/SD/enable 4012
    /remoll/SD/detect lowenergyneutral 4012
    /remoll/SD/detect secondaries 4012
    /remoll/SD/enable 4013
    /remoll/SD/detect lowenergyneutral 4013
    /remoll/SD/detect secondaries 4013
    /remoll/SD/enable 4014
    /remoll/SD/detect lowenergyneutral 4014
    /remoll/SD/detect secondaries 4014
    /remoll/kryptonite/volume logicUSTracker
    /remoll/kryptonite/volume logicDSTracker
    /remoll/kryptonite/volume logicWasher_12
    /remoll/kryptonite/volume lefthut_Det_inside_logic
    /remoll/kryptonite/volume righthut_Det_inside_logic
    /remoll/kryptonite/enable
    /remoll/filename /lustre03/project/6049248/REMOLL/raw_output/magnetHotspot/develop-magnetHotspotV1/regular_v2/scratch/beam_9446550_1.root
    /run/beamOn 100000

  2. Then in a separate run, place a plane detector at z=1800 mm in the parallel world. The energy deposition in 4008 at the location where the plane detector was placed looks different. This was done with the beam generator and 10 million events.

Expected Result: (what do you expect when you execute the steps above)

Uniform distribution across the hot zone.
RegularEpoxyNoParallelWorld

Actual Result: (what do you get when you execute the steps above)

Bright streak at z=1800 mm
CuH20Coil_Power

@cameronc137
Copy link
Contributor

What draw command and cuts are you using to get ROOT to make those plots?

@rahmans1
Copy link
Contributor Author

rahmans1 commented Jul 6, 2020

What draw command and cuts are you using to get ROOT to make those plots?

@cameronc137 I am using a root macro. But effectively
T->Draw("hit.r:hit.z", Form("(hit.det==4008)*hit.edep/%d", T->GetEntries()), "colz")

@wdconinc
Copy link
Member

wdconinc commented Jul 6, 2020

Are there any events with hits only in the parallel world detector and that therefore would increase T->GetEntries() with parallel world detectors, but not in the case without the parallel world?

@cipriangal
Copy link
Contributor

I guess this is because the parallel world detector forces a step right at that location (so all the energy deposition is dumped there). Without it it probably would smear things out since it doesn't have to calculate energy deposition right there.

@jmammei
Copy link
Contributor

jmammei commented Jul 6, 2020 via email

@wdconinc
Copy link
Member

wdconinc commented Jul 6, 2020

@cipriangal is likely right in this case. You can't plot integral quantities at a single point. What geant4 means with deposited energy is how much energy was deposited over the length of that step. If your steps are long (in a near vacuum or what not), then plotting all that energy deposition at the single end point of the step is not accurate. Especially if that end point is arbitrarily chosen. If you really want to plot energy deposition, you may be better off plotting it at the midpoint of the last step (no, there's not enough info in the tree for that).

@jmammei
Copy link
Contributor

jmammei commented Jul 6, 2020 via email

@wdconinc
Copy link
Member

wdconinc commented Jul 6, 2020

Imagine you have an electron hitting a collimator volume, which is a sensitive detector volume. Before the electron reaches the collimator it is every so slightly losing energy (by scattering or bremsstrahlung).

The first hit on the collimator will be at the exact surface. The energy deposition that is written to that hit is the energy that was deposited by the electron before it reached the collimator. So, yes, adding that to the energy deposited in the collimator is strictly speaking incorrect. It is probably usually irrelevant.

Now, the next hits (assuming you are not treating the volume as kryptonite) will be preceded by steps entirely in the collimator volume, so their energy deposition can be properly counted.

If you are using kryptonite, the energy deposition in the first hit will be (I think) the energy deposition in the previous step plus the entire remaining energy of the electron (which will then end up having an energy of exactly zero). Once again, a small mistake is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants