Class for training and analysing a tracking module, which has a MVA filter in it.
Works best, if you are on a jupyter ntoebook.
You need to supply a run_class, which includes all needed settings, on how to
train and execute the module. This class will be mixed in with the normal trackfindingcdc
run classes, so you can add the setting (e.g. tracking_coverage etc.) as normal.
One examples is:
class TestClass:
# This module will be trained
recording_module = "FilterBasedVXDCDCTrackMerger"
# This is the name of the parameter of this module, which will be set to "mva" etc.
recording_parameter = "filter"
# These mva cuts will be tested during evaluation.
evaluation_cuts = [0.1, 0.2, ...]
tracking_coverage = {
'UsePXDHits': True,
'UseSVDHits': True,
'UseCDCHits': True,
}
# Some options, which will control the run classes
fit_tracks = False
generator_module = "EvtGenInput"
# This will be added to the "normal" path, to record the training data (you do not have to set the module to
# recording, as this is done automatically).
def add_recording_modules(self, path):
mctrackfinder = path.add_module('TrackFinderMCTruthRecoTracks',
RecoTracksStoreArrayName='MCRecoTracks',
WhichParticles=[])
path.add_module('MCRecoTracksMatcher', mcRecoTracksStoreArrayName="MCRecoTracks",
prRecoTracksStoreArrayName="CDCRecoTracks", UseCDCHits=True, UsePXDHits=False, UseSVDHits=False)
path.add_module('MCRecoTracksMatcher', mcRecoTracksStoreArrayName="MCRecoTracks",
prRecoTracksStoreArrayName="VXDRecoTracks", UseCDCHits=False, UsePXDHits=True, UseSVDHits=True)
# Merge CDC and CXD tracks
path.add_module('FilterBasedVXDCDCTrackMerger',
extrapolate=False,
CDCRecoTrackStoreArrayName="CDCRecoTracks",
VXDRecoTrackStoreArrayName="VXDRecoTracks",
MergedRecoTrackStoreArrayName="RecoTracks")
return path
# This will be added to the "normal" path, to evaluate the mva cuts. In most cases, this is the same as the
# add_recording_modules (as the module parameters will be set automatically), but maybe you need
# more here...
def add_validation_modules(self, path):
mctrackfinder = path.add_module('TrackFinderMCTruthRecoTracks',
RecoTracksStoreArrayName='MCRecoTracks',
WhichParticles=[])
# Merge CDC and CXD tracks
path.add_module('FilterBasedVXDCDCTrackMerger',
extrapolate=True,
CDCRecoTrackStoreArrayName="CDCRecoTracks",
VXDRecoTrackStoreArrayName="VXDRecoTracks",
MergedRecoTrackStoreArrayName="PrefitRecoTracks")
path.add_module("SetupGenfitExtrapolation")
path.add_module("DAFRecoFitter", recoTracksStoreArrayName="PrefitRecoTracks")
path.add_module("TrackCreator", recoTrackColName="PrefitRecoTracks")
path.add_module("FittedTracksStorer", inputRecoTracksStoreArrayName="PrefitRecoTracks",
outputRecoTracksStoreArrayName="RecoTracks")
# We need to include the matching ourselves, as we have already a matching algorithm in place
path.add_module('MCRecoTracksMatcher', mcRecoTracksStoreArrayName="MCRecoTracks",
prRecoTracksStoreArrayName="RecoTracks", UseCDCHits=True, UsePXDHits=True, UseSVDHits=True)
return path
Definition at line 49 of file analyse.py.