CMS 3D CMS Logo

Functions

tools::matcher Namespace Reference

Functions

def basejet_matching
def make_matching

Function Documentation

def tools::matcher::basejet_matching (   process,
  algorithms,
  genjets,
  sequence 
)
Match the underlying jet collections to truth to support embedding.

Definition at line 4 of file matcher.py.

00005                                                             :
00006     '''
00007     Match the underlying jet collections to truth to support embedding.
00008     '''
00009     builder = proto.make_process_adder(process, sequence)
00010     for algorithm in algorithms.keys():
00011         # Match the base jet refs of the algorithm to support embedding if
00012         # desired.
00013         jetrefs = getattr(process, algorithms[algorithm]['rawSource']).jetSrc
00014         jetmatcher = proto.tau_truth_matcher.clone(
00015             src = jetrefs,
00016             matched = cms.InputTag(genjets),
00017         )
00018         jetmatcher_name = algorithm + "BaseJetsMatcher"
00019         algorithms[algorithm]['jet_matcher'] = jetmatcher_name
00020         builder(jetmatcher_name, jetmatcher)
00021 

def tools::matcher::make_matching (   process,
  algorithms,
  genjets,
  sequence 
)
Add a matching (named [algorithm]+"Matcher") between each algorithm (the keys
in [algorithms]) and the [genjets] collection.  A ref selection of each
collection in [algorithms] containing only those with valid matches is
produced in [algorithm]+"GenMatched"

The function modifies the input algorithms dictionary and adds they keys
['matcher'], ['matched_collection'], which point to the new modules.

Definition at line 22 of file matcher.py.

00023                                                          :
00024     '''
00025     Add a matching (named [algorithm]+"Matcher") between each algorithm (the keys
00026     in [algorithms]) and the [genjets] collection.  A ref selection of each
00027     collection in [algorithms] containing only those with valid matches is
00028     produced in [algorithm]+"GenMatched"
00029 
00030     The function modifies the input algorithms dictionary and adds they keys
00031     ['matcher'], ['matched_collection'], which point to the new modules.
00032 
00033     '''
00034     builder = proto.make_process_adder(process, sequence)
00035     for algorithm in algorithms.keys():
00036         # Match the actual taus to truth.
00037         matcher = proto.tau_truth_matcher.clone(
00038             src = cms.InputTag(algorithms[algorithm]['producer']),
00039             matched = cms.InputTag(genjets)
00040         )
00041         matcher_name = algorithm+"Matcher"
00042         algorithms[algorithm]['matcher'] = matcher_name
00043         builder(matcher_name, matcher)
00044         # Make match selector
00045         match_selector = proto.tau_matched_selector.clone(
00046             src = cms.InputTag(algorithms[algorithm]['producer']),
00047             matching = cms.InputTag(matcher_name)
00048         )
00049         selector_name = algorithm + "GenMatched"
00050         algorithms[algorithm]['matched_collection'] = selector_name
00051         builder(selector_name, match_selector)