-
Notifications
You must be signed in to change notification settings - Fork 21
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
Hcal tot digitization #1475
base: trunk
Are you sure you want to change the base?
Hcal tot digitization #1475
Conversation
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 getting this started!
Generally, I would like to see some more detailed explanation on what you've done and then some plots showing that your developments are doing what is intended. Additionally, you have edited HgcrcoEmulator which is also used within the Ecal digitiziation pipeline. Have you confirmed that these edits do not change that pipeline at all?
(Side note: remove the .DS_Store
files from the branch (using git rm
). These are not related to the software and just tells me that you are on MacOS!)
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 the extra detail. I agree that the new PulseRecord
class would not be affecting the emulation. The HgcrocEmulator not only is called at separate times but the Ecal and Hcal subsystems have their own copies of the class so they will not interfere. My concern about how this affects the Ecal emulation is from the change in the value used to determine if a specific pulse is above the tot threshold or not. I've highlighted the specific code below. This change is well motivated, I just want to understand the downstream effects.
Besides more specific comments below, my other requests are to remove the .DS_Store
files that are not interesting for us and write some more documentation into the PulseRecord
header file. You've already written a nice summary in your comment above so that is a good place to start.
// Print Voltages, adc/tot values to the same txt file | ||
std::ofstream dataFile("Voltage_ADC_TOT.txt", std::ios::app); | ||
for (const auto& entry : DigiToPlot) { | ||
dataFile << std::get<0>(entry) << " " << std::get<1>(entry) << " " | ||
<< std::get<2>(entry) << "\n"; | ||
} | ||
dataFile.close(); |
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 chunk of code (and the others like it) is incredibly helpful for you the developer when tuning the digitization parameters; however, most people running this producer will not be tuning the parameters and creating an extra txt file would at best be confusing and at worst cause extra issues.
My request here is to put these code blocks behind a configuration parameter such that the user can choose whether to save the digitization information. Maybe a digi_emulation_file
parameter that is the file to save the information to? (e.g. it could be "Voltage_ADC_TOT.txt"
) and when it is empty, nothing is saved.
for (const auto& record : pulseRecord) { | ||
DigiToPlot.emplace_back(record.getVolts(), record.getADC(), | ||
record.getTOT()); | ||
} |
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.
One of the code blocks that could be skipped if the user doesn't want to save the digi emulation detailed information.
// Recording digitized pulses in PulseRecord | ||
// Access PulseRecord | ||
const auto& pulseRecord = hgcroc_->getPulseRecord(); | ||
|
||
for (const auto& record : pulseRecord) { | ||
DigiToPlot.emplace_back(record.getVolts(), record.getADC(), | ||
record.getTOT()); | ||
} | ||
|
||
// Print Voltages, adc/tot values to the same txt file | ||
std::ofstream dataFile("Voltage_ADC_TOT.txt", std::ios::app); | ||
for (const auto& entry : DigiToPlot) { | ||
dataFile << std::get<0>(entry) << " " << std::get<1>(entry) << " " | ||
<< std::get<2>(entry) << "\n"; | ||
} | ||
dataFile.close(); | ||
|
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.
One of the code blocks that could be skipped if the user doesn't want to save the digi emulation detailed information.
|
||
// Recording digitized pulses in PulseRecord | ||
// Access PulseRecord | ||
const auto& pulseRecord = hgcroc_->getPulseRecord(); | ||
|
||
for (const auto& record : pulseRecord) { | ||
DigiToPlot.emplace_back(record.getVolts(), record.getADC(), | ||
record.getTOT()); | ||
} | ||
|
||
// Print Voltages, adc/tot values to the same txt file | ||
std::ofstream dataFile("Voltage_ADC_TOT.txt", std::ios::app); | ||
for (const auto& entry : DigiToPlot) { | ||
dataFile << std::get<0>(entry) << " " << std::get<1>(entry) << " " | ||
<< std::get<2>(entry) << "\n"; | ||
} | ||
dataFile.close(); |
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.
One of the code blocks that could be skipped if the user doesn't want to save the digi emulation detailed information.
|
||
if (vpeak > totThreshold) { | ||
if (bxvolts > totThreshold) { |
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 is the part that I am worried about effecting the ECal digi emulation as well. This is a substantial change and could affect things there and, while the change is well motivated, I would like to understand what the results are.
return true; // always readout | ||
for (const auto &digi : digiToAdd) return true; // always readout | ||
|
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 don't need the for loop. It will exit on the first entry in the for loop anyways.
return true; // always readout | |
for (const auto &digi : digiToAdd) return true; // always readout | |
return true; // always readout |
I am updating ldmx-sw, with implemented Hcal TOT digitization.
What are the issues that this addresses?
Check List