CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
conversionTrackSequence_cff.py
Go to the documentation of this file.
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 
12 ckfTracksFromConversions = cms.Sequence(conversionTrackCandidates*ckfOutInTracksFromConversions*ckfInOutTracksFromConversions)
13 
14 oldegConversionTrackCandidates = conversionTrackCandidates.clone()
15 oldegConversionTrackCandidates.scHybridBarrelProducer = cms.InputTag("correctedHybridSuperClusters")
16 oldegConversionTrackCandidates.bcBarrelCollection = cms.InputTag("hybridSuperClusters","hybridBarrelBasicClusters")
17 oldegConversionTrackCandidates.scIslandEndcapProducer = cms.InputTag("correctedMulti5x5SuperClustersWithPreshower")
18 oldegConversionTrackCandidates.bcEndcapCollection = cms.InputTag("multi5x5SuperClusters","multi5x5EndcapBasicClusters")
19 
20 ckfOutInTracksFromOldEGConversions = ckfOutInTracksFromConversions.clone()
21 ckfOutInTracksFromOldEGConversions.src = cms.InputTag('oldegConversionTrackCandidates','outInTracksFromConversions')
22 ckfOutInTracksFromOldEGConversions.producer = cms.string('oldegConversionTrackCandidates')
23 ckfOutInTracksFromOldEGConversions.ComponentName = cms.string('ckfOutInTracksFromOldEGConversions')
24 
25 ckfInOutTracksFromOldEGConversions = ckfInOutTracksFromConversions.clone()
26 ckfInOutTracksFromOldEGConversions.src = cms.InputTag('oldegConversionTrackCandidates','inOutTracksFromConversions')
27 ckfInOutTracksFromOldEGConversions.producer = cms.string('oldegConversionTrackCandidates')
28 ckfInOutTracksFromOldEGConversions.ComponentName = cms.string('ckfInOutTracksFromOldEGConversions')
29 
30 ckfTracksFromOldEGConversions = cms.Sequence(oldegConversionTrackCandidates*ckfOutInTracksFromOldEGConversions*ckfInOutTracksFromOldEGConversions)
31 
32 #producer from general tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
33 generalConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
34  TrackProducer = cms.string('generalTracks'),
35  setTrackerOnly = cms.bool(True),
36  setArbitratedMergedEcalGeneral = cms.bool(True),
37 )
38 
39 #producer from conversionStep tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
40 conversionStepConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
41  TrackProducer = cms.string('conversionStepTracks'),
42  setTrackerOnly = cms.bool(True),
43  setArbitratedMergedEcalGeneral = cms.bool(True),
44 )
45 
46 
47 #producer from inout ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
48 inOutConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
49  TrackProducer = cms.string('ckfInOutTracksFromConversions'),
50  setArbitratedEcalSeeded = cms.bool(True),
51  setArbitratedMergedEcalGeneral = cms.bool(True),
52 )
53 
54 #producer from outin ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
55 outInConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
56  TrackProducer = cms.string('ckfOutInTracksFromConversions'),
57  setArbitratedEcalSeeded = cms.bool(True),
58  setArbitratedMergedEcalGeneral = cms.bool(True),
59 )
60 
61 #producer from gsf tracks, set only mergedarbitrated flag (default behaviour)
62 gsfConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
63  TrackProducer = cms.string('electronGsfTracks'),
64  filterOnConvTrackHyp = cms.bool(False),
65 )
66 
67 conversionTrackProducers = cms.Sequence(generalConversionTrackProducer*conversionStepConversionTrackProducer*inOutConversionTrackProducer*outInConversionTrackProducer*gsfConversionTrackProducer)
68 
69 inOutOldEGConversionTrackProducer = inOutConversionTrackProducer.clone()
70 inOutOldEGConversionTrackProducer.TrackProducer = cms.string('ckfInOutTracksFromOldEGConversions')
71 outInOldEGConversionTrackProducer = outInConversionTrackProducer.clone()
72 outInOldEGConversionTrackProducer.TrackProducer = cms.string('ckfOutInTracksFromOldEGConversions')
73 
74 oldegConversionTrackProducers = cms.Sequence(inOutOldEGConversionTrackProducer*outInOldEGConversionTrackProducer)
75 
76 #merge generalTracks and conversionStepTracks collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
77 generalConversionStepConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
78  TrackProducer1 = cms.InputTag('generalConversionTrackProducer'),
79  TrackProducer2 = cms.InputTag('conversionStepConversionTrackProducer'),
80  #prefer collection settings:
81  #-1: propagate output/flag from both input collections
82  # 0: propagate output/flag from neither input collection
83  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
84  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
85  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
86  arbitratedMergedPreferCollection = cms.int32(3),
87  arbitratedMergedEcalGeneralPreferCollection = cms.int32(3),
88 )
89 
90 #merge two ecal-seeded collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
91 inOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
92  TrackProducer1 = cms.InputTag('inOutConversionTrackProducer'),
93  TrackProducer2 = cms.InputTag('outInConversionTrackProducer'),
94  #prefer collection settings:
95  #-1: propagate output/flag from both input collections
96  # 0: propagate output/flag from neither input collection
97  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
98  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
99  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
100  arbitratedEcalSeededPreferCollection = cms.int32(3),
101  arbitratedMergedPreferCollection = cms.int32(3),
102  arbitratedMergedEcalGeneralPreferCollection = cms.int32(3),
103 )
104 
105 #merge ecalseeded collections with collection from general tracks
106 #trackeronly flag is forwarded from the generaltrack-based collections
107 #ecalseeded flag is forwarded from the ecal seeded collection
108 #arbitratedmerged flag is set based on shared hit matching, arbitration by nhits then chi^2/ndof
109 #arbitratedmergedecalgeneral flag is set based on shared hit matching, precedence given to generalTracks
110 generalInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
111  TrackProducer1 = cms.InputTag('inOutOutInConversionTrackMerger'),
112  TrackProducer2 = cms.InputTag('generalConversionStepConversionTrackMerger'),
113  arbitratedMergedPreferCollection = cms.int32(3),
114  arbitratedMergedEcalGeneralPreferCollection = cms.int32(2),
115 )
116 
117 #merge the result of the above with the collection from gsf tracks
118 #trackeronly, arbitratedmergedecalgeneral, and mergedecal flags are forwarded
119 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
120 gsfGeneralInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
121  TrackProducer1 = cms.InputTag('generalInOutOutInConversionTrackMerger'),
122  TrackProducer2 = cms.InputTag('gsfConversionTrackProducer'),
123  arbitratedMergedPreferCollection = cms.int32(2),
124 )
125 
126 #final output collection contains combination of generaltracks, ecal seeded tracks and gsf tracks, with overlaps removed by shared hits
127 #precedence is given first to gsf tracks, then to the combination of ecal seeded and general tracks
128 #overlaps between the ecal seeded track collections and between ecal seeded and general tracks are arbitrated first by nhits then by chi^2/dof
129 #(logic and much of the code is adapted from FinalTrackSelectors)
130 
131 conversionTrackMergers = cms.Sequence(inOutOutInConversionTrackMerger*generalConversionStepConversionTrackMerger*generalInOutOutInConversionTrackMerger*gsfGeneralInOutOutInConversionTrackMerger)
132 
133 inOutOutInOldEGConversionTrackMerger = inOutOutInConversionTrackMerger.clone()
134 inOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('inOutOldEGConversionTrackProducer')
135 inOutOutInOldEGConversionTrackMerger.TrackProducer2 = cms.InputTag('outInOldEGConversionTrackProducer')
136 
137 generalInOutOutInOldEGConversionTrackMerger = generalInOutOutInConversionTrackMerger.clone()
138 generalInOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('inOutOutInOldEGConversionTrackMerger')
139 
140 gsfGeneralInOutOutInOldEGConversionTrackMerger = gsfGeneralInOutOutInConversionTrackMerger.clone()
141 gsfGeneralInOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('generalInOutOutInOldEGConversionTrackMerger')
142 
143 oldegConversionTrackMergers = cms.Sequence(inOutOutInOldEGConversionTrackMerger*generalInOutOutInOldEGConversionTrackMerger*gsfGeneralInOutOutInOldEGConversionTrackMerger)
144 
145 conversionTrackSequence = cms.Sequence(ckfTracksFromConversions*conversionTrackProducers*conversionTrackMergers)
146 
147 #merge the general tracks with the collection from gsf tracks
148 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
149 gsfGeneralConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
150  TrackProducer1 = cms.InputTag('generalConversionTrackProducer'),
151  TrackProducer2 = cms.InputTag('gsfConversionTrackProducer'),
152  arbitratedMergedPreferCollection = cms.int32(2),
153 )
154 
155 #special sequence for fastsim which skips the ecal-seeded and conversionStep tracks for now
156 conversionTrackSequenceNoEcalSeeded = cms.Sequence(generalConversionTrackProducer*gsfConversionTrackProducer*gsfGeneralConversionTrackMerger)