-
Notifications
You must be signed in to change notification settings - Fork 16
[WIP] Add a simple runtime test #39
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
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
014ec05
Add a simple runtime test
tmadlener 99126ea
Guard ODD tests via environment variable enable tests for mucoll image
tmadlener a653f55
Use more events for test to make sure failures are detected
tmadlener a3435ec
Remove unnecessary service and includes
tmadlener 06154ee
Make sure to set correct env
tmadlener 97eee8b
[drop] Add more debug output
tmadlener 3c2cc98
Remove InputTrackerHitRelationCollectionName from CKF tracking
madbaron 7f18eae
Merge branch 'main' into add-test
madbaron ac3c372
Change OutputCollection to a single string format
madbaron 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,185 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import os | ||
|
|
||
| from Gaudi.Configuration import INFO, VERBOSE | ||
| from Gaudi.Configurables import ( | ||
| ACTSSeededCKFTrackingAlg, | ||
| CollectionMerger, | ||
| DDPlanarDigi, | ||
| EventDataSvc, | ||
| GeoSvc, | ||
| ) | ||
|
|
||
| from k4FWCore import ApplicationMgr, IOSvc | ||
| from k4FWCore.parseArgs import parser | ||
|
|
||
| parser.add_argument( | ||
| "--compactFile", | ||
| help="The geometry compact file to use for reconstruction", | ||
| type=str, | ||
| ) | ||
| parser.add_argument( | ||
| "--trackingGeoFile", | ||
| help="The TGeo file containing the tracking geometry", | ||
| type=str, | ||
| ) | ||
| parser.add_argument( | ||
| "--materialFile", | ||
| help="The file containing the material mapping for the tracking geometry", | ||
| type=str, | ||
| ) | ||
| parser.add_argument( | ||
| "--geoDescFile", help="The JSON file describing the subdetectors", type=str | ||
| ) | ||
|
|
||
| args = parser.parse_known_args()[0] | ||
|
|
||
|
|
||
| svcList = [ | ||
| GeoSvc("GeoSvc", detectors=[args.compactFile], EnableGeant4Geo=False), | ||
| EventDataSvc("EventDataSvc"), | ||
| ] | ||
|
|
||
| iosvc = IOSvc( | ||
| "IOSvc", | ||
| Input=["particle_gun_MAIA_SIM.edm4hep.root"], | ||
| Output="maia_ckf_tracking_reco.edm4hep.root", | ||
| ) | ||
|
|
||
|
|
||
| algList = [] | ||
|
|
||
|
|
||
| for name in ("VertexBarrel", "VertexEndcap"): | ||
| algList.append( | ||
| DDPlanarDigi( | ||
| f"{name}Digitizer", | ||
| CorrectTimesForPropagation=True, | ||
| IsStrip=False, | ||
| ResolutionT=[0.03], | ||
| ResolutionU=[0.005], | ||
| ResolutionV=[0.005], | ||
| SubDetectorName="Vertex", | ||
| TimeWindowMax=[0.15], | ||
| TimeWindowMin=[-0.09], | ||
| UseTimeWindow=True, | ||
| SimTrackHitCollectionName=[f"{name}Collection"], | ||
| SimTrkHitRelCollection=[f"{name}HitsRelations"], | ||
| TrackerHitCollectionName=[f"{name}Hits"], | ||
| ) | ||
| ) | ||
|
|
||
| for name in ( | ||
| "InnerTrackerBarrel", | ||
| "InnerTrackerEndcap", | ||
| "OuterTrackerBarrel", | ||
| "OuterTrackerEndcap", | ||
| ): | ||
| algList.append( | ||
| DDPlanarDigi( | ||
| f"{name}Digitizer", | ||
| CorrectTimesForPropagation=True, | ||
| IsStrip="InnerBarrel" in name or "OuterEndcap" in name, # Is this true? | ||
| ResolutionT=[0.06], | ||
| ResolutionU=[0.007], | ||
| ResolutionV=[0.09], | ||
| SubDetectorName=name.replace("Barrel", "s").replace("Endcap", "s"), | ||
| TimeWindowMax=[0.3], | ||
| TimeWindowMin=[-0.18], | ||
| UseTimeWindow=True, | ||
| SimTrackHitCollectionName=[f"{name}Collection"], | ||
| SimTrkHitRelCollection=[f"{name}HitsRelations"], | ||
| TrackerHitCollectionName=[f"{name}Hits"], | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| algList.append( | ||
| CollectionMerger( | ||
| "MergeHits", | ||
| InputCollections=[ | ||
| "VertexBarrelHits", | ||
| "VertexEndcapHits", | ||
| "InnerTrackerBarrelHits", | ||
| "InnerTrackerEndcapHits", | ||
| "OuterTrackerBarrelHits", | ||
| "OuterTrackerEndcapHits", | ||
| ], | ||
| OutputCollection="MergedTrackerHits", | ||
| ) | ||
| ) | ||
|
|
||
| algList.append( | ||
| CollectionMerger( | ||
| "MergeHitsRelations", | ||
| InputCollections=[ | ||
| "VertexBarrelHitsRelations", | ||
| "VertexEndcapHitsRelations", | ||
| "InnerTrackerBarrelHitsRelations", | ||
| "InnerTrackerEndcapHitsRelations", | ||
| "OuterTrackerBarrelHitsRelations", | ||
| "OuterTrackerEndcapHitsRelations", | ||
| ], | ||
| OutputCollection="MergedTrackerHitsRelations", | ||
| ) | ||
| ) | ||
|
|
||
| ckf_tracking = ACTSSeededCKFTrackingAlg( | ||
| "CKFTracking", | ||
| MatFile=args.materialFile, | ||
| TGeoFile=args.trackingGeoFile, | ||
| TGeoDescFile=args.geoDescFile, | ||
| DetectorSchema=args.compactFile, | ||
| RunCKF="True", | ||
| CKF_Chi2CutOff=10, | ||
| SeedFinding_RMax=150, | ||
| SeedFinding_MinPt=500, | ||
| SeedFinding_ImpactMax=3, | ||
| CKF_NumMeasurementsCutOff=1, | ||
| SeedFinding_SigmaScattering=50, | ||
| SeedFinding_CollisionRegion=6, | ||
| SeedFinding_RadLengthPerSeed=0.1, | ||
| SeedingLayers=[ | ||
| "13", | ||
| "2", | ||
| "13", | ||
| "6", | ||
| "13", | ||
| "10", | ||
| "13", | ||
| "14", | ||
| "14", | ||
| "2", | ||
| "14", | ||
| "6", | ||
| "14", | ||
| "10", | ||
| "14", | ||
| "14", | ||
| "15", | ||
| "2", | ||
| "15", | ||
| "6", | ||
| "15", | ||
| "10", | ||
| "15", | ||
| "14", | ||
| "8", | ||
| "2", | ||
| "17", | ||
| "2", | ||
| "18", | ||
| "2", | ||
| ], | ||
| OutputTrackCollectionName=["AllTracks"], | ||
| OutputSeedCollectionName=["SeedTracks"], | ||
| InputTrackerHitCollectionName=["MergedTrackerHits"], | ||
| OutputLevel=VERBOSE, | ||
| ) | ||
| algList.append(ckf_tracking) | ||
|
|
||
|
|
||
| ApplicationMgr( | ||
| TopAlg=algList, ExtSvc=svcList, OutputLevel=INFO, EvtSel="NONE", EvtMax=-1 | ||
| ) |
Oops, something went wrong.
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.
Using 10 events here to actually trigger failures, see key4hep/k4FWCore#367