Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DaVinci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Marcelo Vilaca Pinheiro Soares
DaVinci
Commits
87e70041
Commit
87e70041
authored
7 years ago
by
Michel De Cian
Committed by
Alex Pearce
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
First commit of Configuration file, trying to get TurboSP MC to run with truthmatching
parent
0dafa217
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Phys/Tesla/python/Tesla/Configuration.py
+76
-6
76 additions, 6 deletions
Phys/Tesla/python/Tesla/Configuration.py
with
76 additions
and
6 deletions
Phys/Tesla/python/Tesla/Configuration.py
+
76
−
6
View file @
87e70041
...
...
@@ -200,7 +200,7 @@ class Tesla(LHCbConfigurableUser):
HistogramPersistencySvc
().
OutputFile
=
self
.
getProp
(
"
Histogram
"
)
def
_configureTimingAuditor
(
self
):
"""
Enable the printing of the algorithm timing table.
"""
"""
Enable the printing of the a
te
lgorithm timing table.
"""
ApplicationMgr
().
ExtSvc
+=
[
'
ToolSvc
'
,
'
AuditorSvc
'
]
ApplicationMgr
().
AuditAlgorithms
=
True
AuditorSvc
().
Auditors
+=
[
'
TimingAuditor
'
]
...
...
@@ -212,9 +212,11 @@ class Tesla(LHCbConfigurableUser):
def
_configureTrackTruth
(
self
,
assocpp
,
trackLoc
)
:
assoctr
=
TrackAssociator
(
"
TurboAssocTr
"
+
trackLoc
)
assoctr
.
OutputLevel
=
self
.
getProp
(
'
OutputLevel
'
)
assoctr
.
OutputLevel
=
self
.
getProp
(
'
OutputLevel
'
)
assoctr
.
TracksInContainer
=
trackLoc
assocpp
.
TrackLocations
+=
[
trackLoc
]
assoctr
.
TracksInContainer
=
trackLoc
assocpp
.
TrackLocations
+=
[
trackLoc
]
#assocpp.OutputLevel = 1
# Add it to a sequence
return
assoctr
...
...
@@ -288,7 +290,8 @@ class Tesla(LHCbConfigurableUser):
copy_signal_mcp
.
OutputPrefix
=
output_prefix
# Don't copy the associated reconstruction, as Tesla already saves it
copy_signal_mcp
.
SaveAssociatedRecoInfo
=
False
copy_signal_mcp
.
OutputLevel
=
1
algorithms
=
[
copy_pp2mcp
,
copy_signal_mcp
]
seq
=
GaudiSequencer
(
'
TurboMCFiltering
'
,
Members
=
algorithms
)
...
...
@@ -591,6 +594,45 @@ class Tesla(LHCbConfigurableUser):
# Add the output sequence
TeslaReportAlgoSeq
.
Members
+=
[
TeslaOutputStreamsSequence
]
def
_configureTruthMatching
(
self
,
name
,
packing
):
# CHARGED STUFF #####################################################################
# Get the location of all tracks and all charged protoparticles we want to truthmatch
track_locs
=
[
v
for
v
in
packing
.
outputs
.
values
()
if
'
track
'
in
v
.
lower
()]
proto_locs
=
[
v
for
v
in
packing
.
outputs
.
values
()
if
'
proto
'
in
v
.
lower
()]
ChargedProtoSeq
=
GaudiSequencer
(
"
ChargedTruthSequencer
"
)
assocpp
=
ChargedPP2MC
(
"
TurboProtoAssocPP
"
)
assocpp
.
OutputLevel
=
self
.
getProp
(
'
OutputLevel
'
)
#assocpp.OutputLevel = 1
assocpp
.
VetoEmpty
=
True
# Make all track -> MCParticle linker tables
for
loc
in
track_locs
:
truthSeq
=
self
.
_configureTrackTruth
(
assocpp
,
loc
)
ChargedProtoSeq
.
Members
.
append
(
truthSeq
)
# Make the protoparticle -> track linker tables
assocpp
.
InputData
+=
proto_locs
ChargedProtoSeq
.
Members
.
append
(
assocpp
)
#relationsLocations = [os.path.join('Relations', path)
# for path in assocpp.InputData]
#relationsLocations.append(protoneutral)
print
"
++++++++++++++++
"
print
relationsLocations
print
proto_locs
#dummy = [ loc.lstrip('/Event/') for loc in proto_locs ]
#relationsLocations = [ '/Event/Relations' + v for v in dummy ]
relationsLocations
=
[
loc
.
replace
(
'
/Event
'
,
'
/Event/Relations
'
)
for
loc
in
proto_locs
]
print
relationsLocations
print
"
++++++++++++++++
"
#relationsLocations = [ "/Event/Relations/Turbo/Long/Protos" ]
filterMCSeq
=
self
.
_filterMCParticlesSequence
(
relationsLocations
)
ChargedProtoSeq
.
Members
+=
[
filterMCSeq
]
return
ChargedProtoSeq
def
_configureOutputStream
(
self
,
stream
,
lines_dict
):
'''
The lines dictionary should have the following form:
...
...
@@ -830,7 +872,7 @@ class Tesla(LHCbConfigurableUser):
)]
# Kill any links the output file might have had to the input file
if
online
:
if
online
and
not
simulation
:
address_killer
=
[
AddressKillerAlg
()]
else
:
address_killer
=
[]
...
...
@@ -901,6 +943,22 @@ class Tesla(LHCbConfigurableUser):
]
))
# MC stuff
if
self
.
getProp
(
"
Simulation
"
):
# Make sure the DoD is alive and well
from
Configurables
import
ApplicationMgr
,
DataOnDemandSvc
extsvc
=
ApplicationMgr
().
ExtSvc
dod
=
DataOnDemandSvc
()
dod_enabled
=
(
'
DataOnDemandSvc
'
in
extsvc
)
or
(
dod
in
extsvc
)
if
not
dod_enabled
:
ApplicationMgr
().
ExtSvc
.
append
(
dod
)
# Check that the DoD is running
#dod.OutputLevel = 1
self
.
_unpackMC
()
stream_seq
.
Members
.
append
(
self
.
_configureTruthMatching
(
name
,
packing
))
# No need to clone if the output prefix is empty (everything stays
# under /Event/Turbo)
if
output_prefix
:
...
...
@@ -1038,7 +1096,7 @@ class Tesla(LHCbConfigurableUser):
else
:
fname
=
self
.
getProp
(
'
outputFile
'
)
if
online
:
if
online
and
not
self
.
getProp
(
'
Simulation
'
)
:
writer
=
OutputStream
(
namer
(
self
.
writerName
))
writer
.
AcceptAlgs
+=
[
'
LumiSeq
'
,
'
PhysFilter
'
]
# In online mode we perform the raw event juggling (otherwise
...
...
@@ -1048,8 +1106,18 @@ class Tesla(LHCbConfigurableUser):
# In offline mode, e.g. after Brunel, propagate everything from the
# input file to the output
writer
=
InputCopyStream
(
namer
(
self
.
writerName
))
optional_output_locations
+=
self
.
_output_raw_event_locations
(
raw_format_output
)
optional_output_locations
+=
[
"
/Event/Turbo/Relations#999
"
]
optional_output_locations
+=
[
"
/Event/Turbo/MC#999
"
]
writer
.
ItemList
=
required_output_locations
writer
.
OptItemList
=
optional_output_locations
print
"
###############################
"
print
"
###############################
"
print
"
###############################
"
print
writer
.
ItemList
print
writer
.
OptItemList
# Keep the 2016 behaviour by not writing out anything if the
# sel reports are missing
writer
.
RequireAlgs
=
[
self
.
_selReportsCheck
(),
stream_seq
]
...
...
@@ -1148,6 +1216,8 @@ class Tesla(LHCbConfigurableUser):
if
self
.
getProp
(
'
Mode
'
)
is
"
Online
"
:
self
.
setProp
(
'
WriteFSR
'
,
True
)
self
.
_configureLumi
()
if
self
.
getProp
(
'
Simulation
'
)
==
True
:
self
.
_unpackMC
()
else
:
DecodeRawEvent
().
DataOnDemand
=
True
RecombineRawEvent
(
Version
=
self
.
getProp
(
'
SplitRawEventInput
'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment