CMS 3D CMS Logo

conversionTrackSequence_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 
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 #fastSim
40 from Configuration.Eras.Modifier_fastSim_cff import fastSim
41 # the conversion producer depends on trajectories
42 # so we feed it with the 'before mixing' track collection
43 generalConversionTrackProducerTmp = generalConversionTrackProducer.clone(
44  TrackProducer = 'generalTracksBeforeMixing')
45 
46 # then we need to fix the track references, so that they point to the final track collection, after mixing
47 import FastSimulation.Tracking.ConversionTrackRefFix_cfi
48 _fastSim_conversionTrackRefFix = FastSimulation.Tracking.ConversionTrackRefFix_cfi.fixedConversionTracks.clone(
49  src = cms.InputTag("generalConversionTrackProducerTmp"))
50 fastSim.toReplaceWith(generalConversionTrackProducer,
51  _fastSim_conversionTrackRefFix)
52 
53 
54 #producer from conversionStep tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
55 conversionStepConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
56  TrackProducer = cms.string('conversionStepTracks'),
57  setTrackerOnly = cms.bool(True),
58  setArbitratedMergedEcalGeneral = cms.bool(True),
59 )
60 
61 
62 #producer from inout ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
63 inOutConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
64  TrackProducer = cms.string('ckfInOutTracksFromConversions'),
65  setArbitratedEcalSeeded = cms.bool(True),
66  setArbitratedMergedEcalGeneral = cms.bool(True),
67 )
68 
69 #producer from outin ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
70 outInConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
71  TrackProducer = cms.string('ckfOutInTracksFromConversions'),
72  setArbitratedEcalSeeded = cms.bool(True),
73  setArbitratedMergedEcalGeneral = cms.bool(True),
74 )
75 
76 #producer from gsf tracks, set only mergedarbitrated flag (default behaviour)
77 gsfConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
78  TrackProducer = cms.string('electronGsfTracks'),
79  filterOnConvTrackHyp = cms.bool(False),
80 )
81 
82 conversionTrackProducers = cms.Sequence(generalConversionTrackProducer*conversionStepConversionTrackProducer*inOutConversionTrackProducer*outInConversionTrackProducer*gsfConversionTrackProducer)
83 
84 inOutOldEGConversionTrackProducer = inOutConversionTrackProducer.clone()
85 inOutOldEGConversionTrackProducer.TrackProducer = cms.string('ckfInOutTracksFromOldEGConversions')
86 outInOldEGConversionTrackProducer = outInConversionTrackProducer.clone()
87 outInOldEGConversionTrackProducer.TrackProducer = cms.string('ckfOutInTracksFromOldEGConversions')
88 
89 oldegConversionTrackProducers = cms.Sequence(inOutOldEGConversionTrackProducer*outInOldEGConversionTrackProducer)
90 
91 #merge generalTracks and conversionStepTracks collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
92 generalConversionStepConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
93  TrackProducer1 = cms.InputTag('generalConversionTrackProducer'),
94  TrackProducer2 = cms.InputTag('conversionStepConversionTrackProducer'),
95  #prefer collection settings:
96  #-1: propagate output/flag from both input collections
97  # 0: propagate output/flag from neither input collection
98  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
99  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
100  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
101  arbitratedMergedPreferCollection = cms.int32(3),
102  arbitratedMergedEcalGeneralPreferCollection = cms.int32(3),
103 )
104 
105 #merge two ecal-seeded collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
106 inOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
107  TrackProducer1 = cms.InputTag('inOutConversionTrackProducer'),
108  TrackProducer2 = cms.InputTag('outInConversionTrackProducer'),
109  #prefer collection settings:
110  #-1: propagate output/flag from both input collections
111  # 0: propagate output/flag from neither input collection
112  # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
113  # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
114  # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof
115  arbitratedEcalSeededPreferCollection = cms.int32(3),
116  arbitratedMergedPreferCollection = cms.int32(3),
117  arbitratedMergedEcalGeneralPreferCollection = cms.int32(3),
118 )
119 
120 #merge ecalseeded collections with collection from general tracks
121 #trackeronly flag is forwarded from the generaltrack-based collections
122 #ecalseeded flag is forwarded from the ecal seeded collection
123 #arbitratedmerged flag is set based on shared hit matching, arbitration by nhits then chi^2/ndof
124 #arbitratedmergedecalgeneral flag is set based on shared hit matching, precedence given to generalTracks
125 generalInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
126  TrackProducer1 = cms.InputTag('inOutOutInConversionTrackMerger'),
127  TrackProducer2 = cms.InputTag('generalConversionStepConversionTrackMerger'),
128  arbitratedMergedPreferCollection = cms.int32(3),
129  arbitratedMergedEcalGeneralPreferCollection = cms.int32(2),
130 )
131 
132 #merge the result of the above with the collection from gsf tracks
133 #trackeronly, arbitratedmergedecalgeneral, and mergedecal flags are forwarded
134 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
135 gsfGeneralInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
136  TrackProducer1 = cms.InputTag('generalInOutOutInConversionTrackMerger'),
137  TrackProducer2 = cms.InputTag('gsfConversionTrackProducer'),
138  arbitratedMergedPreferCollection = cms.int32(2),
139 )
140 
141 #final output collection contains combination of generaltracks, ecal seeded tracks and gsf tracks, with overlaps removed by shared hits
142 #precedence is given first to gsf tracks, then to the combination of ecal seeded and general tracks
143 #overlaps between the ecal seeded track collections and between ecal seeded and general tracks are arbitrated first by nhits then by chi^2/dof
144 #(logic and much of the code is adapted from FinalTrackSelectors)
145 
146 conversionTrackMergers = cms.Sequence(inOutOutInConversionTrackMerger*generalConversionStepConversionTrackMerger*generalInOutOutInConversionTrackMerger*gsfGeneralInOutOutInConversionTrackMerger)
147 
148 inOutOutInOldEGConversionTrackMerger = inOutOutInConversionTrackMerger.clone()
149 inOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('inOutOldEGConversionTrackProducer')
150 inOutOutInOldEGConversionTrackMerger.TrackProducer2 = cms.InputTag('outInOldEGConversionTrackProducer')
151 
152 generalInOutOutInOldEGConversionTrackMerger = generalInOutOutInConversionTrackMerger.clone()
153 generalInOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('inOutOutInOldEGConversionTrackMerger')
154 
155 gsfGeneralInOutOutInOldEGConversionTrackMerger = gsfGeneralInOutOutInConversionTrackMerger.clone()
156 gsfGeneralInOutOutInOldEGConversionTrackMerger.TrackProducer1 = cms.InputTag('generalInOutOutInOldEGConversionTrackMerger')
157 
158 oldegConversionTrackMergers = cms.Sequence(inOutOutInOldEGConversionTrackMerger*generalInOutOutInOldEGConversionTrackMerger*gsfGeneralInOutOutInOldEGConversionTrackMerger)
159 
160 conversionTrackSequence = cms.Sequence(ckfTracksFromConversions*conversionTrackProducers*conversionTrackMergers)
161 
162 #merge the general tracks with the collection from gsf tracks
163 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
164 gsfGeneralConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
165  TrackProducer1 = cms.InputTag('generalConversionTrackProducer'),
166  TrackProducer2 = cms.InputTag('gsfConversionTrackProducer'),
167  arbitratedMergedPreferCollection = cms.int32(2),
168 )
169 
170 #special sequence for fastsim which skips the ecal-seeded and conversionStep tracks for now
171 conversionTrackSequenceNoEcalSeeded = cms.Sequence(generalConversionTrackProducer*gsfConversionTrackProducer*gsfGeneralConversionTrackMerger)
172 
173 _fastSim_conversionTrackSequenceNoEcalSeeded = conversionTrackSequenceNoEcalSeeded.copy()
174 _fastSim_conversionTrackSequenceNoEcalSeeded.replace(generalConversionTrackProducer,generalConversionTrackProducerTmp+generalConversionTrackProducer)
175 fastSim.toReplaceWith(conversionTrackSequenceNoEcalSeeded,_fastSim_conversionTrackSequenceNoEcalSeeded)