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

Fax update for campaign v3 #516

Merged
merged 5 commits into from
Feb 18, 2017
Merged

Fax update for campaign v3 #516

merged 5 commits into from
Feb 18, 2017

Conversation

mcfatelin
Copy link
Contributor

FAX updated for the campaign. The changes are

  1. s2_area_mean_top_fraction changed to the one compatible with the LCE map used. See #491
  2. Store the truth information based on the hits on PMTs. Previously it was based on the photons after detection but before allocating the PMT hits.
  3. Add the top_fraction information into truth output.
  4. Enable the PMT to generate after pulse > 1PE. The amplitude of AP comes from study by Julien.

…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
@@ -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) ]
Copy link
Member

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 ']'

# 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(
Copy link
Member

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

# 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) )
Copy link
Member

Choose a reason for hiding this comment

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

[flake8]

  • [E202] whitespace before ')'

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,
Copy link
Member

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

len(arriving_photon_times_bottom) + len(arriving_photon_times_top) )
self.store_true_peak('s2',
g4_id,
t,
Copy link
Member

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

self.store_true_peak('s2',
g4_id,
t,
x,
Copy link
Member

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

g4_id,
t,
x,
y,
Copy link
Member

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

t,
x,
y,
z,
Copy link
Member

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

x,
y,
z,
np.concatenate((
Copy link
Member

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

arriving_photon_times_top,
arriving_photon_times_bottom
)
),
Copy link
Member

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

arriving_photon_times_bottom
)
),
electron_times,
Copy link
Member

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

)
),
electron_times,
)
Copy link
Member

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

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(
Copy link
Member

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

z=z
)
peak_top_fraction = float(len(arriving_photon_times_top)) / float(
len(arriving_photon_times_bottom) + len(arriving_photon_times_top) )
Copy link
Member

Choose a reason for hiding this comment

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

[flake8]

  • [E202] whitespace before ')'

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,
Copy link
Member

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

len(arriving_photon_times_bottom) + len(arriving_photon_times_top) )
self.store_true_peak('s1',
g4_id,
t,
Copy link
Member

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

self.store_true_peak('s1',
g4_id,
t,
x,
Copy link
Member

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

g4_id,
t,
x,
y,
Copy link
Member

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

t,
x,
y,
z,
Copy link
Member

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

x,
y,
z,
np.concatenate((
Copy link
Member

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

arriving_photon_times_top,
arriving_photon_times_bottom
)
),
Copy link
Member

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

arriving_photon_times_bottom
)
),
peak_top_fraction = peak_top_fraction,
Copy link
Member

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

)
),
peak_top_fraction = peak_top_fraction,
)
Copy link
Member

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

@@ -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(
Copy link
Member

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

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) )
Copy link
Member

Choose a reason for hiding this comment

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

[flake8]

  • [E202] whitespace before ')'

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,
Copy link
Member

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

len(arriving_photon_times_bottom) + len(arriving_photon_times_top) )
self.store_true_peak('photoionization_afterpulse',
g4_id,
t = s2_ap_electron_time,
Copy link
Member

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

self.store_true_peak('photoionization_afterpulse',
g4_id,
t = s2_ap_electron_time,
x = X[electron_id],
Copy link
Member

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

g4_id,
t = s2_ap_electron_time,
x = X[electron_id],
y = Y[electron_id],
Copy link
Member

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

t = s2_ap_electron_time,
x = X[electron_id],
y = Y[electron_id],
z = -self.config['gate_to_anode_distance'],
Copy link
Member

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

x = X[electron_id],
y = Y[electron_id],
z = -self.config['gate_to_anode_distance'],
photon_times = np.concatenate((
Copy link
Member

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

arriving_photon_times_bottom
)
),
peak_top_fraction = peak_top_fraction,
Copy link
Member

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

)
),
peak_top_fraction = peak_top_fraction,
)
Copy link
Member

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

Copy link
Contributor

@JelleAalbers JelleAalbers left a 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)

@pdeperio
Copy link
Contributor

Should partially fix https://github.com/XENON1T/mc/issues/20

@JelleAalbers JelleAalbers merged commit dcc5fce into master Feb 18, 2017
@JelleAalbers JelleAalbers deleted the fax_update_for_campaign_v3 branch February 18, 2017 00:00
@pdeperio
Copy link
Contributor

Discussed Jelle's two points in person:

  • Function is aggregating the info into a few variables just like before, not actually storing each photon
  • With the option to avoid dead PMTs during per-PMT distribution, current truth storage is consistent before and after considering dead PMTs (since total photons already scaled from @berget2's data-derived LCE map including dead PMTs)

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 MEAN_TOP_FRACTION hack.

pdeperio added a commit to XENON1T/processing that referenced this pull request Feb 18, 2017
pdeperio added a commit to XENON1T/processing that referenced this pull request Feb 28, 2017
* 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
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.

4 participants