-
Notifications
You must be signed in to change notification settings - Fork 34
Digitization algorithm that reproduces the HGCROC measurement #2169
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
base: main
Are you sure you want to change the base?
Conversation
veprbl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some early comments.
|
|
||
| #include <algorithms/algorithm.h> | ||
| #include <edm4eic/SimPulseCollection.h> | ||
| #include <edm4eic/RawHGCROCHitCollection.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to require EDM4eic 8.3.0 to use your code. Basically, see some of older changes removed in https://github.com/eic/EICrecon/pull/2121/files for inspiration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing out the EDM4eic version requirement. I believe I understood the changes in the page you linked, and have updated the EDM4EIC_VERSION_MIN 8.0 to 8.3.0. Please let me know if I've misunderstood your comments.
|
|
||
| namespace eicrecon { | ||
|
|
||
| class PulseDigi_factory : public JOmniFactory<PulseDigi_factory, PulseDigiConfig> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please come up with a more descriptive name than PulseDigi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This algorithm needs a use somewhere. We don't add dead code. Either make a unit test or include this in the analysis chain.
| ParameterRef<double> m_time_window{this, "time_window", config().time_window}; | ||
| ParameterRef<double> m_adc_phase{this, "adc_phase", config().adc_phase}; | ||
| ParameterRef<double> m_toa_thres{this, "toa_thres", config().toa_thres}; | ||
| ParameterRef<double> m_tot_thres{this, "tot_thres", config().tot_thres}; | ||
| ParameterRef<unsigned int> m_capADC{this, "capADC", config().capADC}; | ||
| ParameterRef<double> m_dyRangeADC{this, "dyRangeADC", config().dyRangeADC}; | ||
| ParameterRef<unsigned int> m_capTOA{this, "capTOA", config().capTOA}; | ||
| ParameterRef<double> m_dyRangeTOA{this, "dyRangeTOA", config().dyRangeTOA}; | ||
| ParameterRef<unsigned int> m_capTOT{this, "capTOT", config().capTOT}; | ||
| ParameterRef<double> m_dyRangeTOT{this, "dyRangeTOT", config().dyRangeTOT}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ParameterRef<double> m_time_window{this, "time_window", config().time_window}; | |
| ParameterRef<double> m_adc_phase{this, "adc_phase", config().adc_phase}; | |
| ParameterRef<double> m_toa_thres{this, "toa_thres", config().toa_thres}; | |
| ParameterRef<double> m_tot_thres{this, "tot_thres", config().tot_thres}; | |
| ParameterRef<unsigned int> m_capADC{this, "capADC", config().capADC}; | |
| ParameterRef<double> m_dyRangeADC{this, "dyRangeADC", config().dyRangeADC}; | |
| ParameterRef<unsigned int> m_capTOA{this, "capTOA", config().capTOA}; | |
| ParameterRef<double> m_dyRangeTOA{this, "dyRangeTOA", config().dyRangeTOA}; | |
| ParameterRef<unsigned int> m_capTOT{this, "capTOT", config().capTOT}; | |
| ParameterRef<double> m_dyRangeTOT{this, "dyRangeTOT", config().dyRangeTOT}; | |
| ParameterRef<double> m_time_window{this, "timeWindow", config().time_window}; | |
| ParameterRef<double> m_adc_phase{this, "adcPhase", config().adc_phase}; | |
| ParameterRef<double> m_toa_thres{this, "toaThres", config().toa_thres}; | |
| ParameterRef<double> m_tot_thres{this, "totThres", config().tot_thres}; | |
| ParameterRef<unsigned int> m_capADC{this, "capADC", config().capADC}; | |
| ParameterRef<double> m_dyRangeADC{this, "dyRangeADC", config().dyRangeADC}; | |
| ParameterRef<unsigned int> m_capTOA{this, "capTOA", config().capTOA}; | |
| ParameterRef<double> m_dyRangeTOA{this, "dyRangeTOA", config().dyRangeTOA}; | |
| ParameterRef<unsigned int> m_capTOT{this, "capTOT", config().capTOT}; | |
| ParameterRef<double> m_dyRangeTOT{this, "dyRangeTOT", config().dyRangeTOT}; |
camelCase for JANA2 parameter names, and underscores for config names. Bonus points for making variable names consistent with what is used elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing out that the JANA2 parameters were not using camelCase. I've applied your suggested changes in PulseDigi_factory.h.
For the parameter names in PulseDigiConfig.h, would it be better to use underscores consistently for all of them? Since CalorimeterHitDigiConfig uses camelCase for its parameters (it has capADC and dyRangeADC), it is a bit hard for me to decided, so I wanted to follow your suggestion.
|
@mhkim-anl Can you please first address @veprbl's early comments, and introduce sufficient wiring that this actually gets used? It should also pass compilation checks (use version or has_include guards around output datatype sections, but the calculations need to be enabled). Then I can take a look and review. |
|
@veprbl @wdconinc
In the meantime, I added reviewers because this PR was presented at the last simulation meeting, Slides. I was going to add reviewers after presenting the first version of the digitization algorithm. I'll address and resolve @veprbl's early comments first for sure. Since my studies on BIC's ADC, TOA, and TOT dynamic ranges are completing, I'll update the codes based on @veprbl and @wdconinc's comments soon. Thanks! |
|
Regarding @veprbl's and @wdconinc's following comments,
Since BIC has come to prefer CALOROC1B chip over HGCROC, I've implemented CALOROC1B data model (PR) and I'm now considering whether this algorithm should reproduce the HGCROC measurement, the CALOROC1B measurement, or both. I understood that only the HGCROC data model has been implemented from @ruse-traveler's previous PR because the CALOROC1B chip is not available yet. However, if we implement the CALOROC1B data model, we can compare its performance with the HGCROC-based one and use this to help decide which chip will ultimately be used for the ePIC calorimeters. This study will also provide useful input for the chip development, including parameter optimization such as thresholds and dynamic ranges. Therefore, I would like to discuss the CALOROC1B data model implementation and the direction of this algorithm at the upcoming BIC simulation meeting. I'll invite reviewers to that discussion. |
Briefly, what does this PR introduce?
This PR is to reproduce the HGCROC measurement and store the corresponding data types,
RawHGCROCHitandHGCROCSample, from pulse. When HGCROC measures the TOT, it is stored in the same sample where the TOA is measured even though it is measured during a sample that is different from the TOA one. This means we should not finalize/output the sample immediately after scanning a time window in the code. Rather, we need to temporarily store the samples somewhere (like a buffer) until the TOT is measured or all the amplitudes are scanned. For this purpose, a class,HGCROCRawSamplewas used in this algorithm.Please refer to the slides on the basic structure of this digitization algorithm.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No
Does this PR change default behavior?
No