Esempio n. 1
0
def looperTracks(process):
    ##function from a RAW file
    #cmsDriver.py looper -s RAW2DIGI,RECO --customise RecoTracker/Loopers/Adapter.<any>
    ##function from a RECO file
    #usually cmsDriver.py looper -s RECO --customise RecoTracker/Loopers/Adapter.<any>
    if not hasattr(process, 'loopersMask'):
        adapt(process)

    ##attempt using primarily a track refitter. The TrackCandidateOption initially used does not function
    # it should be noted that the track refitting does not function so well either (does it really matter ?)
    from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
    process.loopersTracks = TrackRefitter.clone(
        src=cms.InputTag('loopersMask'))
    ## augment the looping capability of RK prop
    process.RungeKuttaTrackerPropagator.MaxDPhi = 100.0
    ## replace the RK propagator with something elst just to see how further it goes
    ### SHP does not help enough
    #process.RungeKuttaTrackerPropagator = process.SteppingHelixPropagatorAlong.clone( ComponentName = 'RungeKuttaTrackerPropagator')
    ### analytical propagator ...
    ##process.RungeKuttaTrackerPropagator = process.AnalyticalPropagator.clone( ComponentName = 'RungeKuttaTrackerPropagator',MaxDPhi = 1000.0)

    process.loopersSeq += process.loopersTracks

    ## now try to put those tracks (or the initial ones inside the generalTrack collection)
    try:
        process.generalTracks.TrackProducers.append(
            cms.InputTag('loopersMask'))
        process.generalTracks.hasSelector.append(0)
        process.generalTracks.setsToMerge[0].tLists.append(7)
    except:
        #fall back for 6.2
        process.earlyGeneralTracks.TrackProducers.append(
            cms.InputTag('loopersMask'))
        process.earlyGeneralTracks.selectedTrackQuals.append(
            cms.InputTag('dummy'))
        process.earlyGeneralTracks.hasSelector.append(0)
        process.earlyGeneralTracks.setsToMerge[0].tLists.append(7)

    for o in process.outputModules_():
        om = process.outputModules_()[o]
        om.outputCommands.append('keep *_loopersTracks_*_*')
    return (process)
Esempio n. 2
0
def looperTracks(process):
    ##function from a RAW file
    #cmsDriver.py looper -s RAW2DIGI,RECO --customise RecoTracker/Loopers/Adapter.<any>
    ##function from a RECO file
    #usually cmsDriver.py looper -s RECO --customise RecoTracker/Loopers/Adapter.<any>
    if not hasattr(process,'loopersMask'):
        adapt(process)

    ##attempt using primarily a track refitter. The TrackCandidateOption initially used does not function
    # it should be noted that the track refitting does not function so well either (does it really matter ?)
    from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
    process.loopersTracks = TrackRefitter.clone(
        src = cms.InputTag('loopersMask')
        )
    ## augment the looping capability of RK prop
    process.RungeKuttaTrackerPropagator.MaxDPhi = 100.0
    ## replace the RK propagator with something elst just to see how further it goes
    ### SHP does not help enough
    #process.RungeKuttaTrackerPropagator = process.SteppingHelixPropagatorAlong.clone( ComponentName = 'RungeKuttaTrackerPropagator')
    ### analytical propagator ...
    ##process.RungeKuttaTrackerPropagator = process.AnalyticalPropagator.clone( ComponentName = 'RungeKuttaTrackerPropagator',MaxDPhi = 1000.0)

    process.loopersSeq+=process.loopersTracks

    ## now try to put those tracks (or the initial ones inside the generalTrack collection)
    try:
        process.generalTracks.TrackProducers.append( cms.InputTag('loopersMask') )
        process.generalTracks.hasSelector.append( 0 )
        process.generalTracks.setsToMerge[0].tLists.append(7)
    except:
        #fall back for 6.2
        process.earlyGeneralTracks.TrackProducers.append( cms.InputTag('loopersMask') )
        process.earlyGeneralTracks.selectedTrackQuals.append( cms.InputTag('dummy') )
        process.earlyGeneralTracks.hasSelector.append( 0 )
        process.earlyGeneralTracks.setsToMerge[0].tLists.append(7)

    for o in process.outputModules_():
        om=process.outputModules_()[o]
        om.outputCommands.append('keep *_loopersTracks_*_*')
    return (process)
### KFFittingSmoother without outlier rejection - to be used for constrained fit
from TrackingTools.TrackFitters.KFFittingSmoother_cfi import KFFittingSmoother
process.TwoBodyDecayTrackFitter = KFFittingSmoother.clone(
    ComponentName = cms.string( "TwoBodyDecayTrackFitter" ),
    Fitter = cms.string('RKFitter'),
    Smoother = cms.string('RKSmoother'),
    LogPixelProbabilityCut = cms.double(-15.0),
    EstimateCut = cms.double(-1.0),
)

from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter

### First refitter - constructs transient tracks and trajectories from persistent tracks
process.Refitter = TrackRefitter.clone(
    src = "AlignmentTrackSelector",
    TrajectoryInEvent = True
)

### Refitter using the TwoBodyDecay momentum constraint
process.TrackRefitterTBDMomConstraint = TrackRefitter.clone(
    src = "AlignmentTrackSelector",
    srcConstr = "TwoBodyDecayMomConstraint",
    Fitter = cms.string('TwoBodyDecayTrackFitter'),
    constraint = "momentum",
    TrajectoryInEvent = True
)

### Refitter using the full TwoBodyDecay constraint
process.TrackRefitterTBDConstraint = TrackRefitter.clone(
    src = "AlignmentTrackSelector",
    srcConstr = "TwoBodyDecayConstraint",
from CalibTracker.SiStripCommon.shallowTree_test_template import *
process.TFileService.fileName = 'test_shallowGainCalibration.root'

process.load('CalibTracker.SiStripCommon.ShallowGainCalibration_cfi')
from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter

process.load('RecoTracker.TrackProducer.TrackRefitters_cff')
process.tracksRefit = TrackRefitter.clone()
process.shallowGainCalibration.Tracks = 'tracksRefit'

process.testTree = cms.EDAnalyzer(
   "ShallowTree",
   outputCommands = cms.untracked.vstring(
      'drop *',
      'keep *_shallowGainCalibration_*_*',
      )
   )

process.out = cms.OutputModule(
   "PoolOutputModule",
   fileName = cms.untracked.string('test_shallowGainCalibration_edm.root'),
   dropMetaData = cms.untracked.string("DROPPED"),
   outputCommands = cms.untracked.vstring(
      'drop *',
      'keep *_shallowGainCalibration_*_*'
      ),
)

process.p = cms.Path(process.MeasurementTrackerEvent*process.tracksRefit*process.shallowGainCalibration*process.testTree)
process.end = cms.EndPath(process.out)
process.s = cms.Schedule(process.p, process.end)
        tag=cms.string("SiStripGainFromParticles"),
        connect=cms.string(
            "sqlite_file:/afs/cern.ch/user/m/musich/public/forStripDBcontacts/G2_initial2017/Gains_G2_299061_Sqlite.db"
        )))

###################################################################
# The BeamSpot
###################################################################
process.offlineBeamSpot = cms.EDProducer("BeamSpotProducer")

###################################################################
# The track refitter
###################################################################
from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
process.load('RecoTracker.TrackProducer.TrackRefitters_cff')
process.tracksRefit = TrackRefitter.clone(
    src=cms.InputTag("ALCARECOSiStripCalCosmics"))

###################################################################
# The module
###################################################################
process.SiStripGainsValidator = cms.EDAnalyzer(
    'SiStripGainsValidator', Tracks=cms.InputTag("tracksRefit"))

###################################################################
# Output name
###################################################################
process.TFileService = cms.Service(
    "TFileService", fileName=cms.string("SiStripGainValidation.root"))

process.p = cms.Path(process.offlineBeamSpot *
                     process.MeasurementTrackerEvent * process.tracksRefit *
#process.TwoBodyDecayConstraint.chi2Cut = 100

### KFFittingSmoother without outlier rejection - to be used for constrained fit
from TrackingTools.TrackFitters.KFFittingSmoother_cfi import KFFittingSmoother
process.TwoBodyDecayTrackFitter = KFFittingSmoother.clone(
    ComponentName=cms.string("TwoBodyDecayTrackFitter"),
    Fitter=cms.string('RKFitter'),
    Smoother=cms.string('RKSmoother'),
    LogPixelProbabilityCut=cms.double(-15.0),
    EstimateCut=cms.double(-1.0),
)

from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter

### First refitter - constructs transient tracks and trajectories from persistent tracks
process.Refitter = TrackRefitter.clone(src="AlignmentTrackSelector",
                                       TrajectoryInEvent=True)

### Refitter using the TwoBodyDecay momentum constraint
process.TrackRefitterTBDMomConstraint = TrackRefitter.clone(
    src="AlignmentTrackSelector",
    srcConstr="TwoBodyDecayMomConstraint",
    Fitter=cms.string('TwoBodyDecayTrackFitter'),
    constraint="momentum",
    TrajectoryInEvent=True)

### Refitter using the full TwoBodyDecay constraint
process.TrackRefitterTBDConstraint = TrackRefitter.clone(
    src="AlignmentTrackSelector",
    srcConstr="TwoBodyDecayConstraint",
    Fitter=cms.string('TwoBodyDecayTrackFitter'),
    constraint="trackParameters",
Esempio n. 7
0
        #process.MessageLogger.categories.append('CosmicMuon')
    process.MessageLogger.categories.append('CosmicSplittingResolution')
    process.MessageLogger.categories.append('CosmicSplitEventDump')
    process.MessageLogger.categories.append('T2TMapMaker')
    process.MessageLogger.categories.append('T2TMapComposer')
    process.MessageLogger.categories.append('TrackComparer')

# Stuff we need for refits.

# For refitting tracker tracks.
if not options.pp_reco_mode:
    from RecoTracker.TrackProducer.TrackRefitterP5_cfi import TrackRefitterP5
    track_refitter = TrackRefitterP5.clone()
else:
    from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
    track_refitter = TrackRefitter.clone()

# Refit the global tracks. Configure the basic module, from which
# we'll replace the source label.
from RecoMuon.GlobalMuonProducer.tevMuons_cfi import tevMuons
muon_refitter = tevMuons.clone()
muon_refitter.RefitIndex = cms.vint32(1)
muon_refitter.Refits = cms.vstring('')
muon_refitter.RefitterParameters.RescaleErrorFactor = cms.double(10)
#muon_refitter.RefitterParameters.RefitRPCHits = False
#muon_refitter.RefitterParameters.Propagator = 'SteppingHelixPropagatorAny'

if not options.pp_reco_mode:
    muon_refitter.RefitterParameters.PropDirForCosmics = cms.bool(True)
    from RecoMuon.TrackingTools.MuonTrackLoader_cff import MuonUpdatorAtVertexAnyDirection
    muon_refitter.TrackLoaderParameters = cms.PSet(
Esempio n. 8
0
        #process.MessageLogger.categories.append('CosmicMuon')
    process.MessageLogger.categories.append('CosmicSplittingResolution')
    process.MessageLogger.categories.append('CosmicSplitEventDump')
    process.MessageLogger.categories.append('T2TMapMaker')
    process.MessageLogger.categories.append('T2TMapComposer')
    process.MessageLogger.categories.append('TrackComparer')

# Stuff we need for refits.

# For refitting tracker tracks.
if not options.pp_reco_mode:
    from RecoTracker.TrackProducer.TrackRefitterP5_cfi import TrackRefitterP5
    track_refitter = TrackRefitterP5.clone()
else:
    from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
    track_refitter = TrackRefitter.clone()

# Refit the global tracks. Configure the basic module, from which
# we'll replace the source label.
from RecoMuon.GlobalMuonProducer.tevMuons_cfi import tevMuons
muon_refitter = tevMuons.clone()
muon_refitter.RefitIndex = cms.vint32(1)
muon_refitter.Refits = cms.vstring('')
muon_refitter.RefitterParameters.RescaleErrorFactor = cms.double(10)
#muon_refitter.RefitterParameters.RefitRPCHits = False
#muon_refitter.RefitterParameters.Propagator = 'SteppingHelixPropagatorAny'

if not options.pp_reco_mode:
    muon_refitter.RefitterParameters.PropDirForCosmics = cms.bool(True)
    from RecoMuon.TrackingTools.MuonTrackLoader_cff import MuonUpdatorAtVertexAnyDirection
    muon_refitter.TrackLoaderParameters = cms.PSet(
Esempio n. 9
0
from CalibTracker.SiStripCommon.shallowTree_test_template import *

process.TFileService.fileName = 'LorentzAngleInputVariables.root'

process.load('CalibTracker.SiStripCommon.ShallowClustersProducer_cfi')
process.load('CalibTracker.SiStripCommon.ShallowTrackClustersProducer_cfi')
#process.load('CalibTracker.SiStripCommon.ShallowSimTracksProducer_cfi')
process.load('CalibTracker.SiStripCommon.ShallowTracksProducer_cfi')
#process.load('CalibTracker.SiStripCommon.ShallowGainCalibration_cfi')

process.load('RecoTracker.TrackProducer.TrackRefitters_cff')

from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
from CalibTracker.SiStripLorentzAngle.ntuple_cff import LorentzAngleOutputCommands

process.tracksRefit = TrackRefitter.clone()
process.shallowTrackClusters.Tracks = 'tracksRefit'
#process.maxEvents = 30
process.LATree = cms.EDAnalyzer(
    "ShallowTree",
    outputCommands=cms.untracked.vstring(
        'drop *',
        'keep *_shallowTrackClusters_*clusterIdx*_*',
        'keep *_shallowTrackClusters_*onTrkClusterIdx*_*',
        'keep *_shallowTrackClusters_*onTrkClustersEnd*_*',
        'keep *_shallowTrackClusters_*trackindex*_*',
    ))
process.LATree.outputCommands += LorentzAngleOutputCommands

#process.p = cms.Path(process.MeasurementTrackerEvent*process.tracksRefit*process.shallowTrackClusters*process.shallowClusters*process.shallowSimTracks*process.LATree)
#process.p = cms.Path(process.MeasurementTrackerEvent*process.tracksRefit*process.shallowTrackClusters*process.shallowClusters*process.shallowTracks*process.shallowGainCalibration*process.LATree)
Esempio n. 10
0
    'Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '92X_dataRun2_Express_v4', '')

###################################################################
# The BeamSpot
###################################################################
process.offlineBeamSpot = cms.EDProducer("BeamSpotProducer")

###################################################################
# The track refitter
###################################################################
from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
process.load('RecoTracker.TrackProducer.TrackRefitters_cff')
process.tracksRefit = TrackRefitter.clone(
    src=cms.InputTag("ALCARECOSiStripCalMinBiasAAG"))

###################################################################
# The module
###################################################################
process.demo = cms.EDAnalyzer('SiStripAnalyzer',
                              lumiScalers=cms.InputTag("scalersRawToDigi"),
                              Tracks=cms.InputTag("tracksRefit"))

###################################################################
# Output name
###################################################################
process.TFileService = cms.Service("TFileService",
                                   fileName=cms.string("SiStripInfo.root"))

process.p = cms.Path(process.offlineBeamSpot *
Esempio n. 11
0
import FWCore.ParameterSet.Config as cms

# vertex constraint
doConstraint = cms.EDProducer("VertexConstraintProducer")

# refit tracks
from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter
refitTracks = TrackRefitter.clone(
    constraint = 'vertex',
    srcConstr = 'doConstraint'
    )

# sequence
trackRefit = cms.Sequence(doConstraint * refitTracks)