Skip to content
Snippets Groups Projects
Commit 9a43ae65 authored by Eric Torrence's avatar Eric Torrence
Browse files

Enable new SegmentFinder

parent 599a30d9
No related branches found
No related tags found
No related merge requests found
......@@ -7,9 +7,11 @@
# filepath - fully qualified path, including url if needed, to the input raw data file
# example: "root://hepatl30//atlas/local/torrence/faser/commissioning/TestBeamData/Run-004150/Faser-Physics-004150-00000.raw"
#
# runtype - optional flag to specify the data type (TI12Data or TestBeamData).
# runtype - optionally specify the data type (TI12Data, TI12Data02, or TestBeamData).
# In a normal file system location, this will be extracted from the directory name,
# but runtype will override this assignment.
# TI12Data02 is needed for the IFT geometry. Script will auto-detect this if read
# from normal file system location.
#
import sys
import argparse
......@@ -26,6 +28,8 @@ parser.add_argument("-n", "--nevents", type=int, default=-1,
help="Specify number of events to process (default: all)")
parser.add_argument("-v", "--verbose", action='store_true',
help="Turn on DEBUG output")
parser.add_argument("--clusterFit", action='store_true',
help="Use ClusterFit (old) track finder - default: SegmentFit(new)")
args = parser.parse_args()
......@@ -47,6 +51,23 @@ else:
runtype = filepath.parts[-3]
# Fix TI12 geometry versions as well (needed in production)
# Probably better to do this from configuration in upstream production scripts,
# so lets call this a hack for now
if runtype == "TI12Data":
runname = filepath.parts[-2]
try:
runnumber = int(runname.split('-')[1])
except Exception as e:
print(f"Failed to find run number in {filepath}")
print(f"Couldn't parse {runname}")
print(f"Leave runtype as {runtype}!")
else:
if runnumber > 5302: # Last TI12 run on Nov. 23, 2021 without IFT
print(f"Found run number {runnumber}, using TI12 configuration with IFT")
runtype = "TI12Data02"
print(f"Starting reconstruction of {filepath.name} with type {runtype}")
if args.nevents > 0:
print(f"Reconstructing {args.nevents} events by command-line option")
......@@ -140,9 +161,18 @@ acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags))
from TrackerSpacePointFormation.TrackerSpacePointFormationConfig import TrackerSpacePointFinderCfg
acc.merge(TrackerSpacePointFinderCfg(ConfigFlags))
# Try Dave's fitter
from TrackerClusterFit.TrackerClusterFitConfig import ClusterFitAlgCfg
acc.merge(ClusterFitAlgCfg(ConfigFlags))
# Can't use both in the same job, as they write to the same output histograms
if args.clusterFit:
print("Configuring TrackerClusterFit (old)")
# Try Dave's fitter
from TrackerClusterFit.TrackerClusterFitConfig import ClusterFitAlgCfg
acc.merge(ClusterFitAlgCfg(ConfigFlags))
else:
print("Configuring TrackerSegmentFit (new)")
# Try Dave's new fitter
from TrackerSegmentFit.TrackerSegmentFitConfig import SegmentFitAlgCfg
acc.merge(SegmentFitAlgCfg(ConfigFlags))
#
# Configure output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment