JeffersonLab / remoll

Simulations for the MOLLER Experiment at Jefferson Lab, http://moller.jlab.org
http://jeffersonlab.github.io/remoll/
11 stars 55 forks source link

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

Open rahmans1 opened 4 years ago

rahmans1 commented 4 years ago

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

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 commented 4 years ago

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

rahmans1 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

So does this only affect the parallel world detectors?

Are we 100% sure that the edep variable is being calculated and recorded properly in the "real" geometry?

Juliette

Sent from my Samsung Galaxy smartphone.

-------- Original message -------- From: cipriangal notifications@github.com Date: 2020-07-06 1:39 p.m. (GMT-06:00) To: JeffersonLab/remoll remoll@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [EXTERNAL] Re: [JeffersonLab/remoll] Energy deposition discrepancy when parallel world detectors exist in the same space as real world volume (#365)

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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_remoll_issues_365-23issuecomment-2D654401661&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=w6PhlF4C-oeM-6LmjCQ3mg&m=6rLpWdXwvZRV_pCFpqnOnOB69zfqwdILtF9vv1QQRM0&s=JOBKhG3zgdQk6u1SutfsAoGkmfFOWCaT-dM7wrfU5uE&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AB4CGEBVJS36XCJMZ27SMNTR2IK7NANCNFSM4OREWYYQ&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=w6PhlF4C-oeM-6LmjCQ3mg&m=6rLpWdXwvZRV_pCFpqnOnOB69zfqwdILtF9vv1QQRM0&s=QbzVnTFYObB1AhBsefGywcd4U59O72VhIK0O7Sq2hdo&e=.

wdconinc commented 4 years ago

@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 commented 4 years ago

What does "single point" mean?

We are plotting hit.r:hit.z and weighting with hit.edep/ and taking the value in that pixel as the integrated energy deposited in the volume represented by the pixel (integrated through the width).

I believe that the collimator powers are calculated in a similar way.

Are there any issues with this?

We have intolerably high doses in the epoxy for the magnets, and we are trying to double-check everything.

Juliette

Sent from my Samsung Galaxy smartphone.

-------- Original message -------- From: Wouter Deconinck notifications@github.com Date: 2020-07-06 3:25 p.m. (GMT-06:00) To: JeffersonLab/remoll remoll@noreply.github.com Cc: Juliette Mammei crowder@jlab.org, Comment comment@noreply.github.com Subject: [EXTERNAL] Re: [JeffersonLab/remoll] Energy deposition discrepancy when parallel world detectors exist in the same space as real world volume (#365)

@cipriangalhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_cipriangal&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=w6PhlF4C-oeM-6LmjCQ3mg&m=AKdCJSYCb8KTM1Uu9t12T7HfAb7L_ARghD98s_RWsc0&s=xjQi3iGwSG-oZ4HLZggZfJ8Ayn0TRa0Kjc5TduR09ek&e= 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).

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_remoll_issues_365-23issuecomment-2D654447610&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=w6PhlF4C-oeM-6LmjCQ3mg&m=AKdCJSYCb8KTM1Uu9t12T7HfAb7L_ARghD98s_RWsc0&s=xllaxurxs6U61qCw47I_-LUrZZ8GEI5zuLE0WZ61VzI&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AB4CGEFDEN6W7OBS62RVF5LR2IXLVANCNFSM4OREWYYQ&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=w6PhlF4C-oeM-6LmjCQ3mg&m=AKdCJSYCb8KTM1Uu9t12T7HfAb7L_ARghD98s_RWsc0&s=QWCJ-GjiLm_3yZkt8bQZOLPADp1-MFPSAIa0ZiGPgQE&e=.

wdconinc commented 4 years ago

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.