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

Realistic BTOF digitization #1635

Open
wants to merge 119 commits into
base: main
Choose a base branch
from

Conversation

ssedd1123
Copy link

@ssedd1123 ssedd1123 commented Oct 15, 2024

Briefly, what does this PR introduce?

It's an attempt to make LGAD sensor response for Barrel TOF more realistic by doing the following,

  1. Spread charge deposition from strips that are hit directly to nearby strips.
  2. Perform digitization by converting charge deposited to electric pulse.
  3. Digitize the pulse by converting it to TDC and ADC value. ADC propto pulse height and TDC propto time when voltage crosses certain threshold.
  4. Convert the TDC and ADC value back to time and Edep by linear fit.
  5. Return the BTOF hit point as "TOFBarrelRecHit". Position is estimated by either weighted sum of ADC or just center of the cell with max ADC. It's weighted average by default, but the behavior can be changed by parameters.

Noise, edge correction and time talk correction will be developed in the future.

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
  • [x ] Changes have been communicated to collaborators

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

Does this PR change default behavior?

It replaces the content of "TOFBarrelRecHit" with results of this new clusterization. It was originally just geant point + random smearing. I have communicated to the reconstruction group and they advise that I submit this pull request so they can study the effect of having this new digitization/clusterization algorithm. They will decide if I should save the data in a new branch or replace the origin content.

ssedd1123 and others added 26 commits July 18, 2024 16:52
… distance relative to the center of the center cell. Now it's changed so spread is calculated relative to the true hit location.
…ighbors when cell ID from BitFieldDecoder for cellID is negative.
@github-actions github-actions bot added topic: tracking Relates to tracking reconstruction topic: PID Relates to PID reconstruction topic: barrel topic: digitization labels Oct 15, 2024
Copy link
Contributor

@simonge simonge left a comment

Choose a reason for hiding this comment

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

@ssedd1123 Looks good, you've addressed my main concern about accepting hits at any time in the pulse generation.

I have a couple of comments in the digitization code but otherwise happy enough for a first implementation now.

Down the line I would still like to see some changes to make this more reflect the separation of analogue and digital components of the readout in a more general way.

double thres = -m_cfg.t_thres;
int adc_range = m_cfg.adc_range;

for (const auto& pulse : *simhits) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will currently produce multiple hits for the edge cases where the analogue signal is above threshold on both sides of a 25ns boundary. This is (almost certainly) not going to be how the electronics works but hopefully won't cause issues at the moment.

Copy link
Author

Choose a reason for hiding this comment

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

You are correct. In the current implementation, if a pulse crosses the threshold very close to the 25 ns boundary, it will result in two hits: one with the correct TDC but incorrect ADC, and the other with the incorrect TDC but correct ADC. As you've rightly pointed out, this occurs because the time when the pulse crosses the threshold and the location of the pulse peak fall into different 25 ns windows.

I anticipated this issue and briefly mentioned it in my reply on December 20. However, I didn't take any further action because, as frustrating as it sounds, all the experts I consulted are also unsure about what will happen in such edge cases. The electronics are still under development, and I don't think anyone knows how this will behave in real-world scenarios.

I believe the best course of action is to document this behavior so that it can be addressed more accurately once we have more information. For now, I believe this is good enough as a reasonable first step toward digital simulation.

src/algorithms/digi/LGADPulseDigitization.cc Outdated Show resolved Hide resolved
ssedd1123 and others added 4 commits January 7, 2025 10:27
…ough is now a config parameter. The condition to check if 2 cells belong to the same sensor is now also a config parameter.
@eic eic deleted a comment from github-actions bot Jan 8, 2025
src/algorithms/digi/LGADPulseGeneration.h Outdated Show resolved Hide resolved
src/algorithms/digi/LGADPulseGeneration.h Outdated Show resolved Hide resolved
@ruse-traveler
Copy link
Contributor

Okay, last comment from me! The capybara report makes it seems like there's a few cases where a CellID gets set to some sort of max value (~1.9e19). Is this to be expected?
https://eicrecon.epic-eic.org/pr/1635/capybara/rec_dis_5x41_minQ2=0_craterlake_5x41/index.html#TOFBarrelADCTDC

@veprbl
Copy link
Member

veprbl commented Feb 3, 2025

Okay, last comment from me! The capybara report makes it seems like there's a few cases where a CellID gets set to some sort of max value (~1.9e19). Is this to be expected? https://eicrecon.epic-eic.org/pr/1635/capybara/rec_dis_5x41_minQ2=0_craterlake_5x41/index.html#TOFBarrelADCTDC

This is expected for 64 bit values. We often have upper 32 bit split into x and y coordinates that are non-zero and produce an overall large cellID.

@ruse-traveler
Copy link
Contributor

This is expected for 64 bit values. We often have upper 32 bit split into x and y coordinates that are non-zero and produce an overall large cellID.

Ahhhhh gotcha! I see!

@ssedd1123
Copy link
Author

Sorry I did not update this request for a month. Unfortunately I am having significant difficulty with my work visa so I am legally forbidden from performing any research related work at the moment. I will return to this request once I worked out my visa situation.

@ruse-traveler
Copy link
Contributor

Sorry I did not update this request for a month. Unfortunately I am having significant difficulty with my work visa so I am legally forbidden from performing any research related work at the moment. I will return to this request once I worked out my visa situation.

No worries! We completely understand given the situation! Just let us know if you need help, and we'll be happy to jump in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: barrel topic: digitization topic: infrastructure topic: PID Relates to PID reconstruction topic: tracking Relates to tracking reconstruction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants