Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:16

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi
0004 import RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi
0005 
0006 # Conversion Track candidate producer 
0007 from RecoEgamma.EgammaPhotonProducers.conversionTrackCandidates_cff import *
0008 # Conversion Track producer  ( final fit )
0009 from RecoEgamma.EgammaPhotonProducers.ckfOutInTracksFromConversions_cfi import *
0010 from RecoEgamma.EgammaPhotonProducers.ckfInOutTracksFromConversions_cfi import *
0011 
0012 ckfTracksFromConversionsTask = cms.Task(conversionTrackCandidates,ckfOutInTracksFromConversions,ckfInOutTracksFromConversions)
0013 ckfTracksFromConversions = cms.Sequence(ckfTracksFromConversionsTask)
0014 
0015 oldegConversionTrackCandidates = conversionTrackCandidates.clone(
0016     scHybridBarrelProducer = "correctedHybridSuperClusters",
0017     bcBarrelCollection     = "hybridSuperClusters:hybridBarrelBasicClusters",
0018     scIslandEndcapProducer = "correctedMulti5x5SuperClustersWithPreshower",
0019     bcEndcapCollection     = "multi5x5SuperClusters:multi5x5EndcapBasicClusters"
0020 )
0021 ckfOutInTracksFromOldEGConversions = ckfOutInTracksFromConversions.clone(
0022     src           = 'oldegConversionTrackCandidates:outInTracksFromConversions',
0023     producer      = 'oldegConversionTrackCandidates',
0024     ComponentName = 'ckfOutInTracksFromOldEGConversions'
0025 )
0026 ckfInOutTracksFromOldEGConversions = ckfInOutTracksFromConversions.clone(
0027     src           = 'oldegConversionTrackCandidates:inOutTracksFromConversions',
0028     producer      = 'oldegConversionTrackCandidates',
0029     ComponentName = 'ckfInOutTracksFromOldEGConversions'
0030 )
0031 ckfTracksFromOldEGConversionsTask = cms.Task(oldegConversionTrackCandidates,ckfOutInTracksFromOldEGConversions,ckfInOutTracksFromOldEGConversions)
0032 ckfTracksFromOldEGConversions = cms.Sequence(ckfTracksFromOldEGConversionsTask)
0033 #producer from general tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
0034 generalConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
0035     TrackProducer  = 'generalTracks',
0036     setTrackerOnly = True,
0037     setArbitratedMergedEcalGeneral = True,
0038 )
0039 
0040 #fastSim
0041 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0042 # the conversion producer depends on trajectories
0043 # so we feed it with the 'before mixing' track collection
0044 generalConversionTrackProducerTmp = generalConversionTrackProducer.clone(
0045     TrackProducer = 'generalTracksBeforeMixing')
0046 
0047 # then we need to fix the track references, so that they point to the final track collection, after mixing
0048 import FastSimulation.Tracking.ConversionTrackRefFix_cfi
0049 _fastSim_conversionTrackRefFix = FastSimulation.Tracking.ConversionTrackRefFix_cfi.fixedConversionTracks.clone(
0050                  src = "generalConversionTrackProducerTmp")
0051 fastSim.toReplaceWith(generalConversionTrackProducer,
0052                       _fastSim_conversionTrackRefFix)
0053 
0054 
0055 #producer from conversionStep tracks collection, set tracker only, merged arbitrated, merged arbitrated ecal/general flags
0056 conversionStepConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
0057     TrackProducer  = 'conversionStepTracks',
0058     setTrackerOnly = True,
0059     setArbitratedMergedEcalGeneral = True,
0060 )
0061 
0062 
0063 #producer from inout ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
0064 inOutConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
0065     TrackProducer           = 'ckfInOutTracksFromConversions',
0066     setArbitratedEcalSeeded = True,
0067     setArbitratedMergedEcalGeneral = True,
0068 )
0069 
0070 #producer from outin ecal seeded tracks, set arbitratedecalseeded, mergedarbitratedecalgeneral and mergedarbitrated flags
0071 outInConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
0072     TrackProducer           = 'ckfOutInTracksFromConversions',
0073     setArbitratedEcalSeeded = True,
0074     setArbitratedMergedEcalGeneral = True,
0075 )
0076 
0077 #producer from gsf tracks, set only mergedarbitrated flag (default behaviour)
0078 gsfConversionTrackProducer = RecoEgamma.EgammaPhotonProducers.conversionTrackProducer_cfi.conversionTrackProducer.clone(
0079     TrackProducer        = 'electronGsfTracks',
0080     filterOnConvTrackHyp = False,
0081 )
0082 
0083 conversionTrackProducersTask = cms.Task(generalConversionTrackProducer,conversionStepConversionTrackProducer,inOutConversionTrackProducer,outInConversionTrackProducer,gsfConversionTrackProducer)
0084 conversionTrackProducers = cms.Sequence(conversionTrackProducersTask)
0085 
0086 inOutOldEGConversionTrackProducer = inOutConversionTrackProducer.clone(
0087     TrackProducer = 'ckfInOutTracksFromOldEGConversions'
0088 )
0089 outInOldEGConversionTrackProducer = outInConversionTrackProducer.clone(
0090     TrackProducer = 'ckfOutInTracksFromOldEGConversions'
0091 )
0092 oldegConversionTrackProducersTask = cms.Task(inOutOldEGConversionTrackProducer,outInOldEGConversionTrackProducer)
0093 oldegConversionTrackProducers = cms.Sequence(oldegConversionTrackProducersTask)
0094 #merge generalTracks and conversionStepTracks collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
0095 generalConversionStepConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
0096     TrackProducer1 = 'generalConversionTrackProducer',
0097     TrackProducer2 = 'conversionStepConversionTrackProducer',
0098     #prefer collection settings:
0099     #-1: propagate output/flag from both input collections
0100     # 0: propagate output/flag from neither input collection
0101     # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
0102     # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
0103     # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof  
0104     arbitratedMergedPreferCollection            = 3,
0105     arbitratedMergedEcalGeneralPreferCollection = 3,        
0106 )
0107 
0108 #merge two ecal-seeded collections, with arbitration by nhits then chi^2/ndof for ecalseededarbitrated, mergedarbitratedecalgeneral and mergedarbitrated flags
0109 inOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
0110     TrackProducer1 = 'inOutConversionTrackProducer',
0111     TrackProducer2 = 'outInConversionTrackProducer',
0112     #prefer collection settings:
0113     #-1: propagate output/flag from both input collections
0114     # 0: propagate output/flag from neither input collection
0115     # 1: arbitrate output/flag (remove duplicates by shared hits), give precedence to first input collection
0116     # 2: arbitrate output/flag (remove duplicates by shared hits), give precedence to second input collection
0117     # 3: arbitrate output/flag (remove duplicates by shared hits), arbitration first by number of hits, second by chisq/ndof  
0118     arbitratedEcalSeededPreferCollection        = 3,    
0119     arbitratedMergedPreferCollection            = 3,
0120     arbitratedMergedEcalGeneralPreferCollection = 3,        
0121 )
0122 
0123 #merge ecalseeded collections with collection from general tracks
0124 #trackeronly flag is forwarded from the generaltrack-based collections
0125 #ecalseeded flag is forwarded from the ecal seeded collection
0126 #arbitratedmerged flag is set based on shared hit matching, arbitration by nhits then chi^2/ndof
0127 #arbitratedmergedecalgeneral flag is set based on shared hit matching, precedence given to generalTracks
0128 generalInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
0129     TrackProducer1 = 'inOutOutInConversionTrackMerger',
0130     TrackProducer2 = 'generalConversionStepConversionTrackMerger',
0131     arbitratedMergedPreferCollection            = 3,
0132     arbitratedMergedEcalGeneralPreferCollection = 2,        
0133 )
0134 
0135 #merge the result of the above with the collection from gsf tracks
0136 #trackeronly, arbitratedmergedecalgeneral, and mergedecal flags are forwarded
0137 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
0138 gsfGeneralInOutOutInConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
0139     TrackProducer1 = 'generalInOutOutInConversionTrackMerger',
0140     TrackProducer2 = 'gsfConversionTrackProducer',
0141     arbitratedMergedPreferCollection = 2,
0142 )
0143 
0144 #final output collection contains combination of generaltracks, ecal seeded tracks and gsf tracks, with overlaps removed by shared hits
0145 #precedence is given first to gsf tracks, then to the combination of ecal seeded and general tracks
0146 #overlaps between the ecal seeded track collections and between ecal seeded and general tracks are arbitrated first by nhits then by chi^2/dof
0147 #(logic and much of the code is adapted from FinalTrackSelectors)
0148 
0149 conversionTrackMergersTask = cms.Task(inOutOutInConversionTrackMerger,generalConversionStepConversionTrackMerger,generalInOutOutInConversionTrackMerger,gsfGeneralInOutOutInConversionTrackMerger)
0150 conversionTrackMergers = cms.Sequence(conversionTrackMergersTask)
0151 
0152 inOutOutInOldEGConversionTrackMerger = inOutOutInConversionTrackMerger.clone(
0153     TrackProducer1 = 'inOutOldEGConversionTrackProducer',
0154     TrackProducer2 = 'outInOldEGConversionTrackProducer'
0155 )
0156 generalInOutOutInOldEGConversionTrackMerger = generalInOutOutInConversionTrackMerger.clone(
0157     TrackProducer1 = 'inOutOutInOldEGConversionTrackMerger'
0158 )
0159 gsfGeneralInOutOutInOldEGConversionTrackMerger = gsfGeneralInOutOutInConversionTrackMerger.clone(
0160     TrackProducer1 = 'generalInOutOutInOldEGConversionTrackMerger'
0161 )
0162 oldegConversionTrackMergersTask = cms.Task(inOutOutInOldEGConversionTrackMerger,generalInOutOutInOldEGConversionTrackMerger,gsfGeneralInOutOutInOldEGConversionTrackMerger)
0163 oldegConversionTrackMergers = cms.Sequence(oldegConversionTrackMergersTask)
0164 
0165 
0166 conversionTrackTask = cms.Task(ckfTracksFromConversionsTask,conversionTrackProducersTask,conversionTrackMergersTask)
0167 conversionTrackSequence = cms.Sequence(conversionTrackTask)
0168 #merge the general tracks with the collection from gsf tracks
0169 #arbitratedmerged flag set based on overlap removal by shared hits, with precedence given to gsf tracks
0170 gsfGeneralConversionTrackMerger = RecoEgamma.EgammaPhotonProducers.conversionTrackMerger_cfi.conversionTrackMerger.clone(
0171     TrackProducer1 = 'generalConversionTrackProducer',
0172     TrackProducer2 = 'gsfConversionTrackProducer',
0173     arbitratedMergedPreferCollection = 2,
0174 )
0175 
0176 #special sequence for fastsim which skips the ecal-seeded and conversionStep tracks for now
0177 conversionTrackTaskNoEcalSeeded = cms.Task(generalConversionTrackProducer,gsfConversionTrackProducer,gsfGeneralConversionTrackMerger)
0178 conversionTrackSequenceNoEcalSeeded = cms.Sequence(conversionTrackTaskNoEcalSeeded)
0179 
0180 _fastSim_conversionTrackTaskNoEcalSeeded = conversionTrackTaskNoEcalSeeded.copy()
0181 _fastSim_conversionTrackTaskNoEcalSeeded.replace(generalConversionTrackProducer,cms.Task(generalConversionTrackProducerTmp,generalConversionTrackProducer))
0182 fastSim.toReplaceWith(conversionTrackTaskNoEcalSeeded,_fastSim_conversionTrackTaskNoEcalSeeded)