Skip to content
Snippets Groups Projects

Prototype of new alignment configuration

Merged Florian Reiss requested to merge pyconf into master
Compare and Show latest version
7 files
+ 141
89
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -9,7 +9,6 @@
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options
from PyConf.application import configure_input
from RecoConf.hlt1_tracking import default_ft_decoding_version
@@ -28,12 +27,9 @@ configure_input(options)
# only configure data flow after this line !
from Humboldt.utils import runAlignment
# at the moment, define tracks and PVs by hand. Could be changed to centrally defined selection in the future
def getAlignmentTracksAndPVs():
from RecoConf.reconstruction_objects import reconstruction
@@ -44,7 +40,12 @@ def getAlignmentTracksAndPVs():
#, make_reco_pvs.bind( make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs)
#with reconstruction.bind(from_file=False), make_hlt2_tracks.bind(light_reco=True, use_pr_kf=True, fast_reco=False), make_reco_pvs.bind( make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs):
from RecoConf.hlt2_global_reco import make_default_reconstruction
with reconstruction.bind(from_file=False), make_hlt2_tracks.bind(light_reco=False), make_reco_pvs.bind( make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs), make_VeloClusterTrackingSIMD_tracks.bind(make_tracks=VeloClusterTrackingSIMDFull), make_default_reconstruction.bind(usePatPVFuture=True):
with reconstruction.bind(from_file=False), make_hlt2_tracks.bind(
light_reco=False), make_reco_pvs.bind(
make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs
), make_VeloClusterTrackingSIMD_tracks.bind(
make_tracks=VeloClusterTrackingSIMDFull
), make_default_reconstruction.bind(usePatPVFuture=True):
#make tracks and PVs
# TODO: in principle the PVs should be an optional input for the alignment
reco = reconstruction()
@@ -56,7 +57,7 @@ def getAlignmentTracksAndPVs():
pvs = reco["PVs"]
from PyConf.application import default_raw_banks, createODIN
odin = createODIN( RawBanks=default_raw_banks(("ODIN"))).ODIN
odin = createODIN(RawBanks=default_raw_banks(("ODIN"))).ODIN
# create input particles, use dummy particles for now
# TODO: in principle these should be composite particles and be an optional input for the alginment
from Humboldt.ParticleSelections import DummyParticles
@@ -80,13 +81,12 @@ def getAlignmentTracksAndPVs():
InputLocations=[selected_tracks, selected_BackwardTracks
]).OutputLocation
selected_pvs = VertexListRefiner(MaxChi2PerDoF=5,
MinNumTracks=15,
MinNumLongTracks=0,
selected_pvs = VertexListRefiner(
MaxChi2PerDoF=5,
MinNumTracks=15,
MinNumLongTracks=0,
InputLocation=pvs).OutputLocation
# add track and vertex monitoring
from PyConf.Algorithms import TrackMonitor, TrackFitMatchMonitor, TrackVertexMonitor, VPTrackMonitor
from RecoConf.mc_checking import monitor_vphits_resolution
@@ -99,12 +99,18 @@ def getAlignmentTracksAndPVs():
# TODO: check vertices
myTrackVertexMonitor = TrackVertexMonitor(
TrackContainer=alignmentTracks, PVContainer=pvs)
myVPTrackMonitor = VPTrackMonitor(TrackContainer=best_tracks, ClusterContainer=make_VPClus_hits())
monitorlist = [myTrackMonitor, myTrackFitMatchMonitor, myTrackVertexMonitor, myVPTrackMonitor, monitor_vphits_resolution()]
myVPTrackMonitor = VPTrackMonitor(
TrackContainer=best_tracks, ClusterContainer=make_VPClus_hits())
monitorlist = [
myTrackMonitor, myTrackFitMatchMonitor, myTrackVertexMonitor,
myVPTrackMonitor,
monitor_vphits_resolution()
]
return alignmentTracks, selected_pvs, particles, odin, monitorlist
alignmentTracks, alignmentPVs, particles, odin, monitors = getAlignmentTracksAndPVs()
alignmentTracks, alignmentPVs, particles, odin, monitors = getAlignmentTracksAndPVs(
)
#define elements and degrees of freedom to be aligned
from TAlignment.Alignables import Alignables
@@ -117,12 +123,13 @@ elements.VPModules(dofsmodules)
# add survey constraints
from Configurables import SurveyConstraints
from PyConf.Tools import AlignChisqConstraintTool
from PyConf.Tools import AlignChisqConstraintTool
surveyconstraints = SurveyConstraints()
surveyconstraints.VP()
myAlignChisqConstraintTool = AlignChisqConstraintTool(Constraints=surveyconstraints.Constraints,
XmlUncertainties=surveyconstraints.XmlUncertainties,
XmlFiles=surveyconstraints.XmlFiles)
myAlignChisqConstraintTool = AlignChisqConstraintTool(
Constraints=surveyconstraints.Constraints,
XmlUncertainties=surveyconstraints.XmlUncertainties,
XmlFiles=surveyconstraints.XmlFiles)
# define Lagrange constraints
constraints = []
@@ -132,6 +139,13 @@ constraints.append(
constraints.append(
"VPInternal : VP/VPLeft/Module..WithSupport: Tx Ty Tz Rx Ry Rz")
runAlignment(options, chisqConstraintTool=myAlignChisqConstraintTool, lagrangeConstrains=constraints, alignmentTracks=alignmentTracks, alignmentPVs=alignmentPVs, particles=particles, odin=odin, elementsToAlign=elements, monitorList=monitors)
\ No newline at end of file
runAlignment(
options,
chisqConstraintTool=myAlignChisqConstraintTool,
lagrangeConstrains=constraints,
alignmentTracks=alignmentTracks,
alignmentPVs=alignmentPVs,
particles=particles,
odin=odin,
elementsToAlign=elements,
monitorList=monitors)
Loading