-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fax update for campaign v3 #516
Conversation
…the hit times of PE on PMTs, removing the contribution from dead PMTs. Also photoionization after pulses are recorded as well.
… pulse informaton is configurated for each PMT, based on AP analysis done by Julien
pax/simulation.py
Outdated
@@ -314,7 +338,7 @@ def make_pax_event(self): | |||
n_rvs=n_afterpulses)) | |||
|
|||
# If none of the setting specified, do not make afterpulses | |||
|
|||
ap_gains = [ x*y for x, y in zip(ap_gains, ap_amplifications) ] |
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.
[flake8]
- [E201] whitespace after '['
- [E202] whitespace before ']'
pax/plugins/io/WaveformSimulator.py
Outdated
# Generate S2 hitpattern "at the anode": cue for simulator to use S2 LCE map | ||
z=-self.config['gate_to_anode_distance']) | ||
peak_top_fraction = float(len(arriving_photon_times_top)) / float( |
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.
[flake8]
- [F841] local variable 'peak_top_fraction' is assigned to but never used
pax/plugins/io/WaveformSimulator.py
Outdated
# Generate S2 hitpattern "at the anode": cue for simulator to use S2 LCE map | ||
z=-self.config['gate_to_anode_distance']) | ||
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) |
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.
[flake8]
- [E202] whitespace before ')'
pax/plugins/io/WaveformSimulator.py
Outdated
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('s2', | ||
g4_id, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('s2', | ||
g4_id, | ||
t, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
self.store_true_peak('s2', | ||
g4_id, | ||
t, | ||
x, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
g4_id, | ||
t, | ||
x, | ||
y, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
t, | ||
x, | ||
y, | ||
z, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
x, | ||
y, | ||
z, | ||
np.concatenate(( |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
arriving_photon_times_top, | ||
arriving_photon_times_bottom | ||
) | ||
), |
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.
[flake8]
- [E124] closing bracket does not match visual indentation
pax/plugins/io/WaveformSimulator.py
Outdated
arriving_photon_times_bottom | ||
) | ||
), | ||
electron_times, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
) | ||
), | ||
electron_times, | ||
) |
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.
[flake8]
- [E124] closing bracket does not match visual indentation
pax/plugins/io/WaveformSimulator.py
Outdated
return self.simulator.queue_signal(photon_times, x=x, y=y, z=z) | ||
|
||
def s2_after_pulses(self): | ||
arriving_photon_times_top, arriving_photon_times_bottom = self.simulator.queue_signal( |
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.
[flake8]
- [E222] multiple spaces after operator
pax/plugins/io/WaveformSimulator.py
Outdated
z=z | ||
) | ||
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) |
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.
[flake8]
- [E202] whitespace before ')'
pax/plugins/io/WaveformSimulator.py
Outdated
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('s1', | ||
g4_id, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('s1', | ||
g4_id, | ||
t, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
self.store_true_peak('s1', | ||
g4_id, | ||
t, | ||
x, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
g4_id, | ||
t, | ||
x, | ||
y, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
t, | ||
x, | ||
y, | ||
z, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
x, | ||
y, | ||
z, | ||
np.concatenate(( |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
arriving_photon_times_top, | ||
arriving_photon_times_bottom | ||
) | ||
), |
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.
[flake8]
- [E124] closing bracket does not match visual indentation
pax/plugins/io/WaveformSimulator.py
Outdated
arriving_photon_times_bottom | ||
) | ||
), | ||
peak_top_fraction = peak_top_fraction, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
) | ||
), | ||
peak_top_fraction = peak_top_fraction, | ||
) |
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.
[flake8]
- [E124] closing bracket does not match visual indentation
pax/plugins/io/WaveformSimulator.py
Outdated
@@ -191,12 +227,27 @@ def s2_after_pulses(self): | |||
Y[electron_id] | |||
) | |||
# queue the photons caused by the s2 after pulses | |||
self.simulator.queue_signal( | |||
arriving_photon_times_top, arriving_photon_times_bottom = self.simulator.queue_signal( |
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.
[flake8]
- [E222] multiple spaces after operator
pax/plugins/io/WaveformSimulator.py
Outdated
s2_ap_photon_times, | ||
X[electron_id], | ||
Y[electron_id], | ||
-self.config['gate_to_anode_distance'] | ||
) | ||
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) |
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.
[flake8]
- [E202] whitespace before ')'
pax/plugins/io/WaveformSimulator.py
Outdated
peak_top_fraction = float(len(arriving_photon_times_top)) / float( | ||
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('photoionization_afterpulse', | ||
g4_id, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
pax/plugins/io/WaveformSimulator.py
Outdated
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) ) | ||
self.store_true_peak('photoionization_afterpulse', | ||
g4_id, | ||
t = s2_ap_electron_time, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
self.store_true_peak('photoionization_afterpulse', | ||
g4_id, | ||
t = s2_ap_electron_time, | ||
x = X[electron_id], |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
g4_id, | ||
t = s2_ap_electron_time, | ||
x = X[electron_id], | ||
y = Y[electron_id], |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
t = s2_ap_electron_time, | ||
x = X[electron_id], | ||
y = Y[electron_id], | ||
z = -self.config['gate_to_anode_distance'], |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
x = X[electron_id], | ||
y = Y[electron_id], | ||
z = -self.config['gate_to_anode_distance'], | ||
photon_times = np.concatenate(( |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
arriving_photon_times_bottom | ||
) | ||
), | ||
peak_top_fraction = peak_top_fraction, |
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.
[flake8]
- [E127] continuation line over-indented for visual indent
- [E251] unexpected spaces around keyword / parameter equals
pax/plugins/io/WaveformSimulator.py
Outdated
) | ||
), | ||
peak_top_fraction = peak_top_fraction, | ||
) |
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.
[flake8]
- [E124] closing bracket does not match visual indentation
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.
Thanks Qing! Very useful to store the top fraction and update the area fraction top. Afterpulse gains will help the simulator/data matching.
On storing the photon times I would suggest a few minor changes (besides the style issues):
- You store the photon times in the truth output. For the root output I suppose this is fine (it's binary and compressed), but for the csv file it will create a rather large file by writing out all the floating point numbers in text (considering some peaks are millions of photons). Could you suppress this column in the csv?
- You mentioned you'd like to store the photon times to find out which photons end up in dead channels. I think your current implementation doesn't do this, it just records the photons that go to the top and bottom PMTs (whether they are dead or not). Or am I mistaken?
Your indentation is a little bit different compared to the rest of pax (many newlines)... You're maintaining the code so I can't complain, but I can't promise I won't change it someday either ;-)
(sorry meant to hit request changes; of course it's approved if you can address these)
Should partially fix https://github.com/XENON1T/mc/issues/20 |
Discussed Jelle's two points in person:
Will need to reconsider all of this when updating to MC-only maps in the future (for both S1 and S2). The processing scripts must be synchronized for new truth info (@jhowl01 in arrays output, @mcfatelin in flat output) and removing |
* First attempt at synchronizing with pax_v6.4.0 XENON1T/pax#516 * Temporary Truth sorting * Updating TruthSorting.py according to new fax update * fixed array capabilities for new truth info * fixed peak_top_fraction conflict * Fixed some bugs of TruthSorting* * No midpoint anymore in pax processed. Switch to using center_time for S1&s2 peak time * Change BatchMergeTruthAndProcessed.py duration to 5min to increase the job priority. The merging of 1000 events usually only takes less than 1min * new createfakecsv.py * Remove previous commitment * fixed some bugs, added begin_production.py capability, added peak/s1s2 minitree capability * fixed bug in begin_production.py * added tag column to array output (0 for s1, 1 for s2, 2 for photoionization) * removed scap txts * added placeholder txt
FAX updated for the campaign. The changes are