DUNE / 2x2_sim

Wrappers for ArgonCube 2x2 simulation at NERSC
Apache License 2.0
5 stars 11 forks source link

control maximum segment length #14

Open krwood opened 1 year ago

krwood commented 1 year ago

@cuddandr 's plot of segment lengths shows we have some pretty long hit segments inside the 2x2.

minirun3_segment_length

We should put in something into https://github.com/DUNE/2x2_sim/blob/main/run-edep-sim/macros/2x2_beam.mac like:

/edep/hitLength volTPCActive 5 mm
/process/eLoss/StepFunction 0.0001 5 mm
/process/eLoss/StepFunctionMuHad 0.0001 5 mm

@peter-madigan has studied different settings in the past and should be able to advise us on what was used to get good data/mc agreement out of module0,1.

peter-madigan commented 1 year ago

You can see here on page 63 / figure 4.20 how this modifies the geant step size

For module 0, I used 0.001 1mm to make sure that the steps are always about 1mm for muons with an energy less than ~300MeV For the hit length, I did 1mm as well. I found that this produced segments that were actually 2mm for whatever reason - I'm thinking it probably has to do with how edep-sim merges geant4 steps.

I looked at 5mm, 1mm, 0.1mm, and 0.01mm, and honestly didn't see much of a difference between 1mm and 0.1mm. At 5mm and 0.01mm, the dQ/dx width visibly decreases, so I would say that you need to set it somewhere between these two bounds.

That said, we do get about a 10% smaller width of the dQ/dx peak in larndsim than what we see in module 0 data at the 1mm step size.

peter-madigan commented 1 year ago

image image Copying these plots here for reference

peter-madigan commented 1 year ago

image Forgot the dQ/dx plot

sam-fogarty commented 1 year ago

I wanted to add to this discussion an alternative option to control the step size. It allows for a firm upper limit on the segment size in edep-sim, which can eliminate, if we want, the O(cm) segment sizes that we've been seeing. There is a place in the detector GDMLs where auxiliary aux types are specified, i.e.

<volume name="volTPCActive">
      <materialref ref="LAr"/>
      <solidref ref="TPCActive_shape"/>
      <auxiliary auxtype="SensDet" auxvalue="TPCActive_shape"/>
      <auxiliary auxtype="EField" auxvalue="(500.0 V/cm, 0.0 V/cm, 0.0 V/cm)"/>

These are parsed from the GDML in this script src/EDepSimUserDetectorConstruction.cc and are used to set user defined limits for the simulation. We can add an auxiliary auxtype for StepLimit in the GDML e.g. : <auxiliary auxtype="StepLimit" auxvalue="0.1 mm"/> It will act as a step size limiter (this is mentioned in the edep-sim README). But edep-sim does combine segments to some extent, so to minimize that, I set in the macro:

/edep/hitLength TPCActive_shape 0.00001 mm
/edep/update

Making hitlength very small to ensure no combining. I first tested this configuration with low energy electrons in module0 (because it was the easiest and quickest for me to do) where I tried 0.1 mm and 0.01 mm for step limit (note that the electron track lengths are O(1 mm) ) and with the hitLength parameter above. I get a strict upper bound now on the segment lengths of 0.1 mm and 0.01 mm respectively. With the hitLength set to default (2 mm) and no step limit, I get segment lengths up to 1 mm.

image (9) image (8) image (7)

Here’s an example with some small 2x2 spill samples I made. I plotted the edep-sim segments within the active LAr only, not including the other segment detectors since I only applied StepLimit and hitLength to the active LAr and not the other segment detectors.

image (11) image (10)

Avg segments per event in active LAr with No StepLimit / Default hitlength: ~160 Avg segments per event in active LAr with StepLimit / hitlength: ~3500

image (13) image (12)

So it looks like this is a suitable option for limiting the step size. We should consider then how small of step sizes we really need. An important consideration is how it affects file sizes and requirements on computing resources. Additionally we should consider what benefits we would gain, if any, w.r.t data-MC comparisons by reducing the step size.