Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AnalysisProductions
Manage
Activity
Members
Labels
Plan
Issues
63
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
114
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb Data Packages
AnalysisProductions
Merge requests
!2131
Lb2Lc3Pi
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Lb2Lc3Pi
yangj/Lb2Lc3Pi
into
master
Overview
2
Commits
3
Pipelines
3
Changes
2
2 unresolved threads
Hide all comments
Merged
Jiaqi Yang
requested to merge
yangj/Lb2Lc3Pi
into
master
1 month ago
Overview
2
Commits
3
Pipelines
3
Changes
2
2 unresolved threads
Hide all comments
Expand
Lambda_b0 -> (Lambda_c+ -> p+ K- Pi+) Pi- Pi+ Pi-
Edited
1 month ago
by
Jiaqi Yang
0
0
Merge request reports
Compare
master
version 2
13593fb6
1 month ago
version 1
ef34f862
1 month ago
master (base)
and
latest version
latest version
8ea6f275
3 commits,
1 month ago
version 2
13593fb6
2 commits,
1 month ago
version 1
ef34f862
1 commit,
1 month ago
2 files
+
362
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Lb2Lc3Pi/Lb2Lc3Pi.py
0 → 100644
+
321
−
0
Options
import
Functors
as
F
import
Functors.math
as
fmath
from
DaVinci
import
Options
,
make_config
from
DaVinci.algorithms
import
create_lines_filter
from
PyConf.reading
import
get_particles
,
get_pvs
from
Functors.math
import
log
from
FunTuple
import
FunctorCollection
,
FunTuple_Particles
as
FunTuple
from
PyConf.application
import
metainfo_repos
from
FunTuple.functorcollections
import
DecayTreeFitterResults
,
Kinematics
,
ParticleID
,
EventInfo
,
HltTisTos
,
SelectionInfo
Hlt1_decisions
=
[
"
Hlt1TrackMVA
"
,
"
Hlt1TwoTrackMVA
"
,
"
Hlt1TwoTrackMVACharmXSec
"
,
"
Hlt1TwoTrackKs
"
,
"
Hlt1KsToPiPi
"
,
"
Hlt1GECPassthrough
"
'
Hlt1D2KK
'
,
'
Hlt1D2KPi
'
,
'
Hlt1D2PiPi
'
,
'
Hlt1DiMuonHighMass
'
,
'
Hlt1DiMuonLowMass
'
,
'
Hlt1DiMuonSoft
'
,
'
Hlt1LowPtMuon
'
,
'
Hlt1LowPtDiMuon
'
,
'
Hlt1SingleHighPtMuon
'
,
'
Hlt1TrackMuonMVA
'
]
Hlt2_decisions
=
[
"
Hlt2Topo2Body
"
,
"
Hlt2Topo3Body
"
,
"
Hlt2Topo4Body
"
]
def
make_tistos_hlt1
(
data
):
return
HltTisTos
(
selection_type
=
"
Hlt1
"
,
trigger_lines
=
[
f
"
{
x
}
Decision
"
for
x
in
Hlt1_decisions
if
"
GECPassthrough
"
not
in
x
],
data
=
data
,
)
# Only for Sprucing -- needs to be reconfigured
def
make_tistos_hlt2
(
data
):
return
HltTisTos
(
selection_type
=
"
Hlt2
"
,
trigger_lines
=
[
f
"
{
x
}
Decision
"
for
x
in
Hlt2_decisions
],
data
=
data
,
)
def
make_comp_variables
(
data
):
v2_pvs
=
get_pvs
()
variables
=
FunctorCollection
({
"
MAX_PT
"
:
F
.
MAX
(
F
.
PT
),
"
MIN_PT
"
:
F
.
MIN
(
F
.
PT
),
"
SUM_PT
"
:
F
.
SUM
(
F
.
PT
),
"
MAX_P
"
:
F
.
MAX
(
F
.
P
),
"
MIN_P
"
:
F
.
MIN
(
F
.
P
),
"
BPVDIRA
"
:
F
.
BPVDIRA
(
v2_pvs
),
"
BPVFDIR
"
:
F
.
BPVFDIR
(
v2_pvs
),
"
CHI2VXND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:
F
.
BPVX
(
v2_pvs
),
"
BPVY
"
:
F
.
BPVY
(
v2_pvs
),
"
BPVZ
"
:
F
.
BPVZ
(
v2_pvs
),
})
variables
+=
Kinematics
()
variables
+=
ParticleID
(
extra_info
=
True
)
variables
+=
make_tistos_hlt1
(
data
)
variables
+=
make_tistos_hlt2
(
data
)
#-- Only for Sprucing
return
variables
def
make_basic_variables
(
data
):
v2_pvs
=
get_pvs
()
variables
=
FunctorCollection
({
"
TRCHI2DOF
"
:
F
.
CHI2DOF
,
"
TRGHOSTPROB
"
:
F
.
GHOSTPROB
,
"
BPVIPCHI2
"
:
F
.
BPVIPCHI2
(
v2_pvs
),
"
PIDK
"
:
F
.
PID_K
,
"
PIDe
"
:
F
.
PID_E
,
"
PIDmu
"
:
F
.
PID_MU
,
"
PIDp
"
:
F
.
PID_P
,
"
ISMUON
"
:
F
.
ISMUON
,
"
BPVIP
"
:
F
.
BPVIP
(
v2_pvs
),
"
ETA
"
:
F
.
ETA
,
"
PHI
"
:
F
.
PHI
,
#some track-related variables
"
NDOF
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
NDOF
@
F
.
TRACK
,
"
NFTHITS
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
NFTHITS
@
F
.
TRACK
,
"
NHITS
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
NHITS
@
F
.
TRACK
,
"
NUTHITS
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
NUTHITS
@
F
.
TRACK
,
"
NVPHITS
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
NVPHITS
@
F
.
TRACK
,
"
TRACKHASVELO
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
TRACKHASVELO
@
F
.
TRACK
,
"
TRACKHISTORY
"
:
F
.
VALUE_OR
(
-
1
)
@
F
.
TRACKHISTORY
@
F
.
TRACK
,
"
TRACKPT
"
:
F
.
TRACK_PT
,
"
ISMUON
"
:
F
.
ISMUON
,
"
INMUON
"
:
F
.
INMUON
,
"
INECAL
"
:
F
.
INECAL
,
"
INHCAL
"
:
F
.
INHCAL
,
})
variables
+=
Kinematics
()
variables
+=
ParticleID
(
extra_info
=
True
)
variables
+=
make_tistos_hlt1
(
data
)
return
variables
def
make_hlt2_event_variables
(
line_name
,
line_data
):
v2_pvs
=
get_pvs
()
evt_variables
=
EventInfo
()
evt_variables
+=
SelectionInfo
(
selection_type
=
"
Hlt1
"
,
trigger_lines
=
Hlt1_decisions
)
evt_variables
+=
SelectionInfo
(
selection_type
=
"
Hlt2
"
,
trigger_lines
=
Hlt2_decisions
)
evt_variables
+=
FunctorCollection
({
"
NPV
"
:
F
.
SIZE
(
v2_pvs
),
"
ALLPVX[NPVs]
"
:
F
.
ALLPVX
(
v2_pvs
),
"
ALLPVY[NPVs]
"
:
F
.
ALLPVY
(
v2_pvs
),
"
ALLPVZ[NPVs]
"
:
F
.
ALLPVZ
(
v2_pvs
),
})
return
evt_variables
def
DecayTreeFitter
(
data
,
pv_fit
=
True
,
mass_fit
=
False
,
prefix
=
"
DTF
"
,
mass_constraints
=
[]):
from
DecayTreeFitter
import
DecayTreeFitter
pvs
=
get_pvs
()
variables
=
FunctorCollection
()
variables
+=
Kinematics
()
if
pv_fit
:
DTF
=
DecayTreeFitter
(
name
=
'
PV_Fit_{hash}
'
,
input_particles
=
data
,
input_pvs
=
pvs
,
)
variables
+=
DecayTreeFitterResults
(
DTF
=
DTF
,
prefix
=
prefix
+
"
_PV_
"
,
decay_origin
=
True
,
with_lifetime
=
True
,
with_kinematics
=
True
)
if
mass_fit
:
DTFM_excl
=
DecayTreeFitter
(
name
=
'
PVandMass_Fit_{hash}
'
,
input_particles
=
data
,
input_pvs
=
pvs
,
mass_constraints
=
mass_constraints
)
variables
+=
DecayTreeFitterResults
(
DTF
=
DTFM_excl
,
prefix
=
prefix
+
"
_PVandMass_
"
,
decay_origin
=
True
,
with_lifetime
=
True
,
with_kinematics
=
True
)
return
variables
def
SpruceB2OC_LbToLcpPiPiPi_LcpToPKPi_Tuple
():
###################################################
spruce_line
=
"
SpruceB2OC_LbToLcpPiPiPi_LcpToPKPi
"
input_data
=
get_particles
(
f
"
/Event/Spruce/
{
spruce_line
}
/Particles
"
)
evt_vars
=
make_hlt2_event_variables
(
spruce_line
,
line_data
=
input_data
)
fields
=
{
'
Lb
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) pi- pi+ pi-]CC
'
,
'
LbPi1
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) ^pi- pi+ pi-]CC
'
,
'
LbPi2
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) pi- ^pi+ pi-]CC
'
,
'
LbPi3
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) pi- pi+ ^pi-]CC
'
,
'
Lc
'
:
'
[Lambda_b0 -> ^(Lambda_c+ -> p+ K- pi+) pi- pi+ pi-]CC
'
,
'
LcP
'
:
'
[Lambda_b0 -> (Lambda_c+ -> ^p+ K- pi+) pi- pi+ pi-]CC
'
,
'
LcK
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ ^K- pi+) pi- pi+ pi-]CC
'
,
'
LcPi
'
:
'
[Lambda_b0 -> (Lambda_c+ -> p+ K- ^pi+) pi- pi+ pi-]CC
'
,
}
variables
=
{
"
Lb
"
:
make_comp_variables
(
input_data
)
+
DecayTreeFitter
(
input_data
),
"
LbPi1
"
:
make_basic_variables
(
input_data
),
"
LbPi2
"
:
make_basic_variables
(
input_data
),
"
LbPi3
"
:
make_basic_variables
(
input_data
),
"
Lc
"
:
make_comp_variables
(
input_data
),
"
LcP
"
:
make_basic_variables
(
input_data
),
"
LcK
"
:
make_basic_variables
(
input_data
),
"
LcPi
"
:
make_basic_variables
(
input_data
),
}
my_tuple
=
FunTuple
(
name
=
"
Tuple
"
,
tuple_name
=
"
DecayTree
"
,
inputs
=
input_data
,
fields
=
fields
,
variables
=
variables
,
event_variables
=
evt_vars
)
my_filter
=
create_lines_filter
(
name
=
f
"
HDRFilter_
{
spruce_line
}
"
,
lines
=
[
f
'
{
spruce_line
}
'
])
###################################################
user_algorithms
=
{}
user_algorithms
.
update
({
"
LbToLcpPiPiPi
"
:
[
my_filter
,
my_tuple
]})
return
user_algorithms
### CONFIG definition ###
def
main
(
options
:
Options
):
all_user_algorithms
=
{}
all_user_algorithms
.
update
(
SpruceB2OC_LbToLcpPiPiPi_LcpToPKPi_Tuple
())
return
make_config
(
options
,
all_user_algorithms
)
Loading