Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Adding realism to Hcal digitization and Hcal geometry #5

Merged
merged 35 commits into from
Mar 18, 2021
Merged

Conversation

cmantill
Copy link
Collaborator

@cmantill cmantill commented Feb 8, 2021

Related to Hcal digitization PR in ldmx-sw

Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! More detailed discussion on parent PR.

test/hcal_digi_pipeline_test_config.py Outdated Show resolved Hide resolved
test/hcal_digi_pipeline_test_config.py Outdated Show resolved Hide resolved
test/HcalDigiPipelineTest.cxx Show resolved Hide resolved
test/HcalDigiPipelineTest.cxx Outdated Show resolved Hide resolved
test/HcalDigiPipelineTest.cxx Outdated Show resolved Hide resolved
include/Hcal/HcalDigiProducer.h Outdated Show resolved Hide resolved
include/Hcal/HcalOldDigiProducer.h Outdated Show resolved Hide resolved
src/Hcal/HcalGeometryProvider.cxx Show resolved Hide resolved
src/Hcal/HcalRecProducer.cxx Outdated Show resolved Hide resolved
src/Hcal/HcalRecProducer.cxx Outdated Show resolved Hide resolved
Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Round 2 🎉

Again, great work. I have two large(ish)-scale comments.

  1. Not sure what is "right", but it seems like the single-ended readout mode should still account for attenuation and time shift as the pulse travels down the bar to the chip.
  2. Don't mix ID types! All of the IDs that you use at your DIGI level (including single-ended readout!) should be digi IDs. Even if you decide to not account for attenuation and not define the end at which the single-ended bars are read-out. The types shouldn't mix.

python/digi.py Outdated Show resolved Hide resolved
python/digi.py Outdated Show resolved Hide resolved
python/digi.py Outdated Show resolved Hide resolved
src/Hcal/HcalDigiProducer.cxx Outdated Show resolved Hide resolved
src/Hcal/HcalDigiProducer.cxx Outdated Show resolved Hide resolved
src/Hcal/HcalDigiProducer.cxx Show resolved Hide resolved
src/Hcal/HcalGeometryProvider.cxx Show resolved Hide resolved
src/Hcal/HcalRecProducer.cxx Outdated Show resolved Hide resolved
test/HcalDigiPipelineTest.cxx Outdated Show resolved Hide resolved
test/hcal_digi_pipeline_test_config.py Outdated Show resolved Hide resolved
@tomeichlersmith
Copy link
Member

tomeichlersmith commented Mar 16, 2021

Ok, I'm reporting back here about the testing. I really want to get this working becuase these tests look really useful.

After a clean build of ldmx-sw/iss941 + Hcal/iss1, I also uncommented the following line so that the geometry test would run.

// p->run();

I have not been able to mimic the issue that you posted?

Maybe there are two errors on top of each other...

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test [Hcal][Geometry]
Filters: [Hcal][Geometry]
No test cases matched '[Hcal][Geometry]'
===============================================================================
No tests ran

And

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test [Hcal][functionality]
Filters: [Hcal][functionality]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
output including failures from digi tests
...
===============================================================================
test cases:    2 |    0 passed |  2 failed
assertions: 7432 | 7419 passed | 13 failed

Ok... so let's try to do the tests individually.

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test [Hcal] "*Digi*"
Filters: [Hcal] *Digi*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..
12 digi mis-match failures
...
===============================================================================
test cases:    1 |    0 passed |  1 failed
assertions: 6001 | 5989 passed | 12 failed

And

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test [Hcal] "*Geometry*"
Filters: [Hcal] *Geometry*
... output from running simulation ...
===============================================================================
All tests passed (1430 assertions in 1 test case)

But running them together...

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test [Hcal]
Filters: [Hcal]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
run_test is a Catch v2.13.0 host application.
Run with -? for options

-------------------------------------------------------------------------------
Hcal Digi Pipeline test
-------------------------------------------------------------------------------
/home/tom/ldmx/ldmx-sw/Hcal/test/HcalDigiPipelineTest.cxx:239
...............................................................................

... 12 digi failures ...

... simulation being initialized ...
-------------------------------------------------------------------------------
Hcal Geometry test
-------------------------------------------------------------------------------
/home/tom/ldmx/ldmx-sw/Hcal/test/HcalGeometryTest.cxx:103
...............................................................................

/home/tom/ldmx/ldmx-sw/Hcal/test/HcalGeometryTest.cxx:110: FAILED:
  {Unknown expression after the reported line}
due to a fatal error condition:
  SIGSEGV - Segmentation violation signal

===============================================================================
test cases:    2 |    0 passed |  2 failed
assertions: 7432 | 7419 passed | 13 failed


 *** Break *** segmentation violation
 Generating stack trace...
/home/ldmx.sh: line 60:    39 Segmentation fault      (core dumped) ../run_test [Hcal]

So I have confirmed what you've already told me 🎉

More Investigation

I've found using the -s flag helps. It tells run_test to print successful tests as well as failures. This can tell us when the failure actually happens.

[ldmx] tom@sokka:~/ldmx/ldmx-sw/build/test$ ldmx ../run_test -s [Hcal]
Filters: [Hcal]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
run_test is a Catch v2.13.0 host application.
Run with -? for options

-------------------------------------------------------------------------------
Hcal Digi Pipeline test
-------------------------------------------------------------------------------
/home/tom/ldmx/ldmx-sw/Hcal/test/HcalDigiPipelineTest.cxx:239
...............................................................................

... 12 digi failures ...

... simulation being initialized ...
-------------------------------------------------------------------------------
Hcal Geometry test
-------------------------------------------------------------------------------
/home/tom/ldmx/ldmx-sw/Hcal/test/HcalGeometryTest.cxx:103
...............................................................................

... A BUNCH OF SUCCESSFUL POSITION TESTS ...

/home/tom/ldmx/ldmx-sw/Hcal/test/HcalGeometryTest.cxx:110: FAILED:
  {Unknown expression after the reported line}
due to a fatal error condition:
  SIGSEGV - Segmentation violation signal

===============================================================================
test cases:    2 |    0 passed |  2 failed
assertions: 7432 | 7419 passed | 13 failed


 *** Break *** segmentation violation
 Generating stack trace...
/home/ldmx.sh: line 60:    39 Segmentation fault      (core dumped) ../run_test [Hcal]

Ok ... so we are successfully testing a lot of the positions. I put in a print statement at the end of HcalCheckReconstruction::analyze to see if we finish testing the positions and we do. I then added print statements in onProcessEnd and onFileClose to see if we finish processing and we don't. I tried increasing the number of events and we don't get passed the first event, so something is breaking in nextEvent. I will keep looking at this today, super interesting.

Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find a way to allow both of your tests to run with the ntuplizing uncommented without modifying Framework. I think for now, we should leave the ntuplizing commented-out and then we can uncomment it in the future when a patch to Framework is merged in.

The NtupleManager is a global singleton which is only destroyed when the DLL is unloaded. This means both of the HCal tests see the same NtupleManager object.

LDMX-Software/Framework#39

include/Hcal/HcalDigiProducer.h Outdated Show resolved Hide resolved
include/Hcal/HcalDigiProducer.h Outdated Show resolved Hide resolved
/**
* Grabs configure parameters from the python config file.
*/
virtual void configure(framework::config::Parameters&);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment on virtual methods.

src/Hcal/HcalGeometryProvider.cxx Show resolved Hide resolved
@omar-moreno omar-moreno self-requested a review March 18, 2021 21:17
@omar-moreno omar-moreno merged commit fc0359c into trunk Mar 18, 2021
@omar-moreno omar-moreno mentioned this pull request Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants