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

Missing MPGD Hits #4

Open
mposik1983 opened this issue Nov 10, 2022 · 6 comments
Open

Missing MPGD Hits #4

mposik1983 opened this issue Nov 10, 2022 · 6 comments

Comments

@mposik1983
Copy link

Is your feature request related to a problem? Please describe.
Yes. After running ddsim only about 20% of the simulated events show up as hits in the MPGD layers. This is due to a default energy cut of 1keV being applied. Setting this cut to 0 keV I then see 100% of the hits show up in the MPGD layers. This was applied by adding the following filter to my ddsim steering file:

Screen Shot 2022-11-10 at 2 41 44 PM

When running with npsim and using the steering file above, but commenting out the last two "filter" related lines I also see the loss of hits in the MPGD layers. So it seems npsim also uses a 1 keV energy cut by default.

Describe the solution you'd like
Set default energy deposition cut for the trackers to 0 keV

@wdconinc
Copy link
Contributor

I'm surprised that this doesn't seem to work when you use npsim without that setting.

Here is the relevant line in npsim, https://eicweb.phy.anl.gov/EIC/NPDet/-/blob/master/src/dd4pod/python/npsim.py#L43, with the filter defined in ddsim, https://github.com/AIDASoft/DD4hep/blob/master/DDG4/python/DDSim/Helper/Filter.py#L114...

@mposik1983
Copy link
Author

Ok, so I think I narrowed it down to how I was calling npsim. If use npsim in the same way I do ddsim:

(method 1) npsim --steeringFile steering.py --compactFile epic_tracking_only.xml -G -N 100 --outputFile test.edm4hep.root

where steering.py is the file printed in the earlier screen shot with the two "filter" lines commented out, I get a lot of 0 hits in the MPGD layers. However if I run npsim following a tutorial made for Athena e.g.

(method 2) npsim --compactFile=epic_tracking_only.xml -N=100 --random.seed 1 --enableGun --gun.energy 10GeV --gun.thetaMin 80deg --gun.thetaMax 80*deg --gun.distribution uniform --outputFile test.root

This picks up the 0 keV energy cut defined in npsim.py as you pointed out and I get the expected hits in the MPGD Barrel. However I noticed that with method 2 I do not get any hits (completely empty histograms) in the MPGD DIRC layer, which are there if I run method 1 (using npsim or ddsim).

I think my steering file is creating a new instance of DDSim

"SIm = DD4hepSimulation()"

Sim then would take the default values of ddsim ? So if the simulation campaigns are using npsim the energy deposition cut shouldn't be a problem.

I am not sure why though I see MPGD DIRC hits when running via method 1, but get empty histograms with method 2.

@wdconinc
Copy link
Contributor

Thanks for figuring this out; I think you're right that a duplicate DD4hepSimulation object is created. That's very useful to know (since we use steering files for the production, like in your method 1).

Could you check what happens when you run with a steering file but explicitly add the edep0 filter on the command line?

npsim --steeringFile steering.py --compactFile epic_tracking_only.xml -G -N 100 --outputFile test.edm4hep.root --filter.tracker 'edep0'

@wdconinc
Copy link
Contributor

This (i.e. creating a SIM object in your steering file and then creating one in npsim) seem like it should work, per https://github.com/AIDASoft/DD4hep/blob/master/DDG4/python/DDSim/DD4hepSimulation.py#L93. I wonder why it fails to copy the filter information correctly.

@mposik1983
Copy link
Author

Running
npsim --steeringFile steering.py --compactFile epic_tracking_only.xml -G -N 100 --outputFile test.edm4hep.root --filter.tracker 'edep0'
as you suggested looks like it worked correctly. I attached the histogram of the number of hits in the two MPGD layers. These both seem reasonable to me

Screen Shot 2022-11-11 at 2 10 33 PM

Screen Shot 2022-11-11 at 2 10 48 PM

@wdconinc
Copy link
Contributor

That's good to know. It's a much easier fix in the short term for the singles productions.

@wdconinc wdconinc transferred this issue from eic/epic Nov 19, 2022
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

2 participants