Skip to content

Conversation

@mhkim-anl
Copy link
Contributor

@mhkim-anl mhkim-anl commented Oct 30, 2025

Briefly, what does this PR introduce?

This PR is to reproduce the HGCROC measurement and store the corresponding data types, RawHGCROCHit and HGCROCSample, 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, HGCROCRawSample was used in this algorithm.

More details will be presented at the next BIC simulation meeting.

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

No

@mhkim-anl mhkim-anl changed the title Fill HGCROC sample from pulse Digitization algorithm that reproduces the HGCROC measurement Oct 31, 2025
@mhkim-anl mhkim-anl self-assigned this Oct 31, 2025
Copy link
Member

@veprbl veprbl left a 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>
Copy link
Member

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.


namespace eicrecon {

class PulseDigi_factory : public JOmniFactory<PulseDigi_factory, PulseDigiConfig> {
Copy link
Member

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.

Copy link
Member

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.

Comment on lines +23 to +32
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};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Digitization algorithm to measure ADC, TOA, and TOT

3 participants