LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
22 stars 21 forks source link

Recoil electron not found in inclusive sample #1212

Open bryngemark opened 1 year ago

bryngemark commented 1 year ago

Describe the bug I don't see the recoil electron position or momentum info, nor the containment radius variables being filled, in an inclusive sample generated with release v3.2.10

To Reproduce Steps to reproduce the behavior:

  1. Use the v3.2.10 release of ldmx-sw
  2. Run the config below
  3. Inspect the EcalVeto variables mentioned above
  4. For comparison, have a look at any file in /sdf/group/ldmx/data/user.lenekrist/v14/4.0GeV/v3.2.10_1e_pencilBeam/

Desired behavior I thought we hade fixed this, at least we did for signal, see https://github.com/LDMX-Software/ldmx-sw/issues/1153 I'd like the electron recoil info to be available for any process, in a way that matches our intuition that the recoil electron is the "same" particle as the incoming electron, after it has passed the target/undergone some significant interaction, whichever happens first.

I also think this highlights that there is something missing in our validation suite. Perhaps this will be amended in the procedure to do 8 GeV validation that will come. I think having a predefined set of histograms for each type of sample, and a corresponding gold, would be a very powerful way to efficiently pinpoint any basic problems in our simulation and do much of the heavy lifting in sample validation.

Environment: I used the v3.2.10 production image on LDCS for this.

Additional context

#!/bin/python                                                                                                                                       

import os
import sys
from LDMX.Framework import ldmxcfg
p=ldmxcfg.Process('sim')                                                                                   
p.run = 1
p.maxEvents = 10000
p.maxTriesPerEvent = 1

from LDMX.SimCore import generators as gen
from LDMX.SimCore import simulator

sim = simulator.simulator( "inclusive_single_e" )
sim.setDetector( 'ldmx-det-v14', True )  #True to include scoring planes                                                                    
sim.description = "One 4 GeV electron shot from far upstream."
sim.generators.append(gen.single_4gev_e_upstream_tagger())
sim.beamSpotSmear = [0.,0.,0.]
sim.description = '4 GeV inclusive pencil beam simulation'

import LDMX.Ecal.EcalGeometry
import LDMX.Ecal.ecal_hardcoded_conditions
import LDMX.Hcal.HcalGeometry
import LDMX.Hcal.hcal_hardcoded_conditions

from LDMX.Ecal import digi as eDigi
from LDMX.Ecal import vetos

ecalReco   =eDigi.EcalRecProducer('ecalRecon')
ecalDigi = eDigi.EcalDigiProducer()
ecalReco.v14()

ecalVeto   =vetos.EcalVetoProcessor('ecalVetoBDT')
p.sequence=[ sim, ecalDigi, ecalReco, ecalVeto ] 

p.keep = [ "drop MagnetScoringPlaneHits", "drop TrackerScoringPlaneHits", "drop HcalScoringPlaneHits"]
p.outputFiles=["simoutput.root"]
tvami commented 2 months ago

@bryngemark this is not an issue anymore for 8 GeV, right? If I look at the gold for the inclusive https://github.com/LDMX-Software/ldmx-sw/blob/trunk/.github/validation_samples/inclusive/gold.root it shows the RoC variables, and also it fills the fiducial variable, which is based on the recoil electrons position/momentum. Based on that I'd say this issue can be closed.