-
Notifications
You must be signed in to change notification settings - Fork 4
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
Created Lichen for ScienceRun1. Updated AmBe FV. Created NG FV #58
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7c30635
Created Lichen for Scienceun1. Updated AmBe FV. Created NG FV
76ea903
Removed repeated definition
cf6e7f4
Fix for codacy errors
ErikHogenbirk fac5151
Another codacy fix
ErikHogenbirk 31adbe4
Update sciencerun1.py
93f8ef7
Update SR0 AmBe to correct values
9c189bb
Update sciencerun1.py
e393ba5
remove SingleElectronS2 cut
feigaodm 4f74d01
fix style
feigaodm 212bd1f
Fix trailing whitespace
pdeperio 0fa1db6
Fix more lint whitespace issues
pdeperio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
"""The cuts for science run 0 | ||
|
||
This includes all current definitions of the cuts for the first science run | ||
""" | ||
|
||
# -*- coding: utf-8 -*- | ||
import inspect | ||
import os | ||
from pax import configuration | ||
|
||
PAX_CONFIG = configuration.load_configuration('XENON1T') | ||
from lax.lichen import ManyLichen, StringLichen | ||
from lax.lichens import sciencerun0 | ||
from lax import __version__ as lax_version | ||
|
||
# Store the directory of our data files | ||
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), | ||
'..', 'data') | ||
|
||
|
||
class AllEnergy(ManyLichen): | ||
"""Cuts applicable for low and high energy (gammas) | ||
|
||
This is a subset mostly of the low energy cuts. | ||
""" | ||
version = lax_version | ||
|
||
def __init__(self): | ||
self.lichen_list = [ | ||
FiducialCylinder1T(), | ||
InteractionExists(), | ||
S2Threshold(), | ||
InteractionPeaksBiggest(), | ||
S2AreaFractionTop(), | ||
S2SingleScatter(), | ||
DAQVeto(), | ||
S1SingleScatter(), | ||
S1AreaFractionTop(), | ||
S2PatternLikelihood(), | ||
S2Tails() | ||
] | ||
|
||
|
||
class LowEnergyRn220(AllEnergy): | ||
"""Select Rn220 events with cs1<200 | ||
|
||
This is the list that we use for the Rn220 data to calibrate ER in the | ||
region of interest. | ||
|
||
It doesn't contain the PreS2Junk cut | ||
""" | ||
|
||
def __init__(self): | ||
AllEnergy.__init__(self) | ||
# Replaces Interaction exists | ||
self.lichen_list[1] = S1LowEnergyRange() | ||
|
||
# Use a simpler single scatter cut | ||
self.lichen_list[5] = S2SingleScatterSimple() | ||
|
||
self.lichen_list += [ | ||
S1PatternLikelihood(), | ||
S2Width(), | ||
S1MaxPMT(), | ||
SingleElectronS2s() | ||
] | ||
|
||
|
||
class LowEnergyBackground(LowEnergyRn220): | ||
"""Select background events with cs1<200 | ||
|
||
This is the list that we'll use for the actual DM search. Additionally to the | ||
LowEnergyRn220 list it contains the PreS2Junk | ||
""" | ||
|
||
def __init__(self): | ||
LowEnergyRn220.__init__(self) | ||
|
||
self.lichen_list += [ | ||
PreS2Junk(), | ||
] | ||
|
||
class LowEnergyAmBe(LowEnergyRn220): | ||
"""Select AmBe events with cs1<200 with appropriate cuts | ||
|
||
It is the same as the LowEnergyRn220 cuts, except uses an AmBe fiducial. | ||
""" | ||
|
||
def __init__(self): | ||
LowEnergyRn220.__init__(self) | ||
|
||
# Replaces Fiducial | ||
self.lichen_list[0] = AmBeFiducial() | ||
|
||
class LowEnergyNG(LowEnergyRn220): | ||
"""Select AmBe events with cs1<200 with appropriate cuts | ||
|
||
It is the same as the LowEnergyRn220 cuts, except uses an AmBe fiducial. | ||
""" | ||
|
||
def __init__(self): | ||
LowEnergyRn220.__init__(self) | ||
|
||
# Replaces Fiducial | ||
self.lichen_list[0] = NGFiducial() | ||
|
||
|
||
DAQVeto = sciencerun0.DAQVeto | ||
|
||
S2Tails = sciencerun0.S2Tails | ||
|
||
FiducialCylinder1T = sciencerun0.S2Tails | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that looks like a typo |
||
|
||
FiducialFourLeafClover1250kg = sciencerun0.FiducialFourLeafClover1250kg | ||
|
||
class AmBeFiducial(StringLichen): | ||
"""AmBe Fiducial volume cut. | ||
This uses the same Z cuts as the 1T fiducial cylinder, | ||
but a wider allowed range in R to maximize the number of nuclear recoils. | ||
There is a third cut on the distance to the source, so that we cut away background ER. | ||
Link to note: | ||
https://xecluster.lngs.infn.it/dokuwiki/lib/exe/fetch.php?media=xenon:xenon1t:hogenbirk:nr_band_sr0.html | ||
|
||
Contact: Erik Hogenbirk <ehogenbi@nikhef.nl> | ||
|
||
Position updated to reflect correct I-Belt 1 position. Link to Note:xenon:xenon1t:analysis:dominick:sr1_ambe_check | ||
|
||
""" | ||
version = 2 | ||
string = "(distance_to_source < 103.5) & (-92.9 < z) & (z < -9) & (sqrt(x*x + y*y) < 42.00)" | ||
|
||
def pre(self, df): | ||
source_position = (97, 43.5, -50) | ||
df.loc[:, 'distance_to_source'] = ((source_position[0] - df['x']) ** 2 + | ||
(source_position[1] - df['y']) ** 2 + | ||
(source_position[2] - df['z']) ** 2) ** 0.5 | ||
return df | ||
|
||
class NGFiducial(StringLichen): | ||
"""NG Fiducial volume cut. | ||
Early Implimentation og NG Fiducial Volume. Might not be Needed | ||
|
||
|
||
Link to Note:xenon:xenon1t:analysis:dominick:sr1_ambe_check (By Dominic) | ||
|
||
|
||
""" | ||
version = 0 | ||
string = "(distance_to_source < 111.5) & (-92.9 < z) & (z < -9) & (sqrt(x*x + y*y) < 42.00)" | ||
|
||
def pre(self, df): | ||
source_position = (31.6, 86.8, -50) | ||
df.loc[:, 'distance_to_source'] = ((source_position[0] - df['x']) ** 2 + | ||
(source_position[1] - df['y']) ** 2 + | ||
(source_position[2] - df['z']) ** 2) ** 0.5 | ||
return df | ||
|
||
|
||
InteractionExists = sciencerun0.InteractionExists | ||
|
||
InteractionPeaksBiggest = sciencerun0.InteractionPeaksBiggest | ||
|
||
S1LowEnergyRange = sciencerun0.S1LowEnergyRange | ||
|
||
S1MaxPMT = sciencerun0.S1MaxPMT | ||
|
||
S1PatternLikelihood = sciencerun0.S1PatternLikelihood | ||
|
||
S1SingleScatter = sciencerun0.S1SingleScatter | ||
|
||
S2AreaFractionTop = sciencerun0.S2AreaFractionTop | ||
|
||
S2SingleScatter = sciencerun0.S2SingleScatter | ||
|
||
S2SingleScatterSimple = sciencerun0.S2SingleScatterSimple | ||
|
||
S2PatternLikelihood = sciencerun0.S2PatternLikelihood | ||
|
||
S2Threshold = sciencerun0.S2Threshold | ||
|
||
S2Width = sciencerun0.S2Width | ||
|
||
S1AreaFractionTop = sciencerun0.S1AreaFractionTop | ||
|
||
PreS2Junk = sciencerun0.PreS2Junk | ||
|
||
SingleElectronS2s = sciencerun0.SingleElectronS2s |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@feigaodm: is this still needed after XENON1T/pax#576?
If not, I guess we should remove from SR0 lichen too once SR0 gets reprocessed?