CMS 3D CMS Logo

conversionTrackSequenceForReReco_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 import RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi
4 import RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi
5 
6 # Conversion Track candidate producer
8 # Conversion Track producer ( final fit )
11 ckfTracksFromConversionsReRecoTask = cms.Task(conversionTrackCandidates,
12  ckfOutInTracksFromConversions,
13  ckfInOutTracksFromConversions)
14 
15 #producer from general tracks collection, set tracker only and merged arbitrated flag
16 generalConversionTrackProducerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
17  TrackProducer = 'generalTracks',
18  setTrackerOnly = True,
19  useTrajectory = False,
20 )
21 
22 #producer from conversionStep tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
23 conversionStepConversionTrackProducerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
24  TrackProducer = 'conversionStepTracks',
25  setTrackerOnly = True,
26  setArbitratedMergedEcalGeneral = True,
27  useTrajectory = False,
28 )
29 
30 #producer from inout ecal seeded tracks, set arbitratedecalseeded and mergedarbitrated flags
31 inOutConversionTrackProducerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
32  TrackProducer = 'ckfInOutTracksFromConversions',
33  setArbitratedEcalSeeded = True,
34  useTrajectory = False,
35 )
36 
37 #producer from outin ecal seeded tracks, set arbitratedecalseeded and mergedarbitrated flags
38 outInConversionTrackProducerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
39  TrackProducer = 'ckfOutInTracksFromConversions',
40  setArbitratedEcalSeeded = True,
41  useTrajectory = False,
42 )
43 
44 #producer from gsf tracks, set only mergedarbitrated flag (default behaviour)
45 gsfConversionTrackProducerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
46  TrackProducer = 'electronGsfTracks',
47  useTrajectory = False,
48 )
49 
50 conversionTrackProducersReRecoTask = cms.Task(generalConversionTrackProducerReReco,
51  conversionStepConversionTrackProducerReReco,
52  inOutConversionTrackProducerReReco,
53  outInConversionTrackProducerReReco,
54  gsfConversionTrackProducerReReco)
55 
56 #merge generalTracks and conversionStepTracks collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
57 generalConversionStepConversionTrackMergerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
58  TrackProducer1 = 'generalConversionTrackProducerReReco',
59  TrackProducer2 = 'conversionStepConversionTrackProducerReReco',
60  #prefer collection settings:
61  #-1: propagate output/flag from both input collections
62  # 0: propagate output/flag from neither input collection
63  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
64  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
65  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
66  arbitratedMergedPreferCollection = 3,
67  arbitratedMergedEcalGeneralPreferCollection = 3,
68 )
69 
70 #merge two ecal-seeded collections, with arbitration by nhits then chi^2/ndof for both ecalseededarbitrated and mergedarbitrated flags
71 inOutOutInConversionTrackMergerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
72  TrackProducer1 = 'inOutConversionTrackProducerReReco',
73  TrackProducer2 = 'outInConversionTrackProducerReReco',
74  #prefer collection settings:
75  #-1: propagate output/flag from both input collections
76  # 0: propagate output/flag from neither input collection
77  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
78  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
79  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
80  arbitratedEcalSeededPreferCollection = 3,
81  arbitratedMergedPreferCollection = 3,
82 )
83 
84 #merge ecalseeded collections with collection from general tracks
85 #trackeronly flag is forwarded from the generaltrack-based collections
86 #ecalseeded flag is forwarded from the ecal seeded collection
87 #arbitratedmerged flag is set based on shared hit matching, arbitration by nhits then chi^2/ndof
88 generalInOutOutInConversionTrackMergerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
89  TrackProducer1 = 'inOutOutInConversionTrackMergerReReco',
90  TrackProducer2 = 'generalConversionStepConversionTrackMergerReReco',
91  arbitratedMergedPreferCollection = 3,
92 )
93 
94 #merge the result of the above with the collection from gsf tracks
95 #trackeronly and mergedecal flags are forwarded
96 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
97 gsfGeneralInOutOutInConversionTrackMergerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
98  TrackProducer1 = 'generalInOutOutInConversionTrackMergerReReco',
99  TrackProducer2 = 'gsfConversionTrackProducerReReco',
100  arbitratedMergedPreferCollection = 2,
101 )
102 
103 #final output collection contains combination of generaltracks, ecal seeded tracks and gsf tracks, with overlaps removed by shared hits
104 #precedence is given first to gsf tracks, then to the combination of ecal seeded and general tracks
105 #overlaps between the ecal seeded track collections and between ecal seeded and general tracks are arbitrated first by nhits then by chi^2/dof
106 #(logic and much of the code is adapted from FinalTrackSelectors)
107 
108 conversionTrackMergersReRecoTask = cms.Task(inOutOutInConversionTrackMergerReReco,
109  generalConversionStepConversionTrackMergerReReco,
110  generalInOutOutInConversionTrackMergerReReco,
111  gsfGeneralInOutOutInConversionTrackMergerReReco)
112 
113 conversionTrackTaskForReReco = cms.Task(ckfTracksFromConversionsReRecoTask,
114  conversionTrackProducersReRecoTask,
115  conversionTrackMergersReRecoTask)
116 conversionTrackSequenceForReReco = cms.Sequence(conversionTrackTaskForReReco)
117 
118 #merge the general tracks with the collection from gsf tracks
119 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
120 gsfGeneralConversionTrackMergerReReco = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
121  TrackProducer1 = 'generalConversionTrackProducerReReco',
122  TrackProducer2 = 'gsfConversionTrackProducerReReco',
123  arbitratedMergedPreferCollection = 2,
124 )
125 
126 #conversionTrackSequenceNoEcalSeeded = cms.Sequence(generalConversionTrackProducer*gsfConversionTrackProducer*gsfGeneralConversionTrackMerger)