Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.VarParsing as VarParsing
0002 
0003 ivars = VarParsing.VarParsing('standard')
0004 ivars.register('initialEvent',mult=ivars.multiplicity.singleton,info="for testing")
0005 
0006 ivars.files = 'file:/mnt/hadoop/cms/store/user/yetkin/MC_Production/Pythia80_HydjetDrum_mix01/RECO/set2_random40000_HydjetDrum_642.root'
0007 
0008 ivars.output = 'test.root'
0009 ivars.maxEvents = -1
0010 ivars.initialEvent = 1
0011 
0012 ivars.parseArguments()
0013 
0014 import FWCore.ParameterSet.Config as cms
0015 
0016 process = cms.Process('TRACKATTACK')
0017 
0018 doRegit=True
0019 rawORreco=True
0020 isEmbedded=True
0021 
0022 process.options = cms.untracked.PSet(
0023     wantSummary = cms.untracked.bool(True)
0024 )
0025 
0026 #####################################################################################
0027 # Input source
0028 #####################################################################################
0029 
0030 process.source = cms.Source("PoolSource",
0031                             duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0032                             fileNames = cms.untracked.vstring(
0033     ivars.files
0034     ))
0035 
0036 process.Timing = cms.Service("Timing")
0037 
0038 # Number of events we want to process, -1 = all events
0039 process.maxEvents = cms.untracked.PSet(
0040             input = cms.untracked.int32(ivars.maxEvents))
0041 
0042 
0043 #####################################################################################
0044 # Load some general stuff
0045 #####################################################################################
0046 
0047 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0048 process.load('Configuration.StandardSequences.Services_cff')
0049 process.load('Configuration.StandardSequences.GeometryExtended_cff')
0050 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0051 process.load('Configuration.StandardSequences.RawToDigi_cff')
0052 process.load('Configuration.StandardSequences.ReconstructionHeavyIons_cff')
0053 process.load('FWCore.MessageService.MessageLogger_cfi')
0054 process.load('RecoLocalTracker.SiPixelRecHits.PixelCPEESProducers_cff')
0055 # Data Global Tag 44x 
0056 #process.GlobalTag.globaltag = 'GR_P_V27::All'
0057 
0058 # MC Global Tag 44x 
0059 process.GlobalTag.globaltag = 'STARTHI44_V7::All'
0060 
0061 # load centrality
0062 from CmsHi.Analysis2010.CommonFunctions_cff import *
0063 overrideCentrality(process)
0064 process.HeavyIonGlobalParameters = cms.PSet(
0065     centralityVariable = cms.string("HFhits"),
0066     nonDefaultGlauberModel = cms.string("Hydjet_2760GeV"),
0067     centralitySrc = cms.InputTag("hiCentrality")
0068     )
0069 
0070 process.hiCentrality.pixelBarrelOnly = False
0071 
0072 #process.load("RecoHI.HiCentralityAlgos.CentralityFilter_cfi")
0073 #process.centralityFilter.selectedBins = [0,1]
0074 
0075 # EcalSeverityLevel ES Producer
0076 process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi")
0077 process.load("RecoEcal.EgammaCoreTools.EcalNextToDeadChannelESProducer_cff")
0078 
0079 
0080 #####################################################################################
0081 # Define tree output
0082 #####################################################################################
0083 
0084 process.TFileService = cms.Service("TFileService",
0085                                   fileName=cms.string(ivars.output))
0086 
0087 #####################################################################################
0088 # Additional Reconstruction 
0089 #####################################################################################
0090 
0091 
0092 # redo reco or just tracking
0093 
0094 if rawORreco:
0095     process.rechits = cms.Sequence(process.siPixelRecHits * process.siStripMatchedRecHits)
0096     process.hiTrackReco = cms.Sequence(process.rechits * process.heavyIonTracking)
0097 
0098 
0099     process.trackRecoAndSelection = cms.Path(
0100         #process.centralityFilter*
0101         process.hiTrackReco 
0102         )
0103     
0104 else:
0105     process.reco_extra = cms.Path(
0106         #process.centralityFilter *
0107         process.RawToDigi * process.reconstructionHeavyIons)
0108     
0109 
0110     
0111 # tack on iteative tracking, particle flow and calo-matching
0112 
0113 #iteerative tracking
0114 process.load("RecoHI.HiTracking.hiIterTracking_cff")
0115 process.heavyIonTracking *= process.hiIterTracking
0116 
0117 
0118 # Now do more tracking around the jets
0119 
0120 if doRegit:
0121     process.load("RecoHI.HiTracking.hiRegitTracking_cff")
0122     
0123     process.hiRegitInitialStepSeeds.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0124     process.hiRegitLowPtTripletStepSeeds.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0125     process.hiRegitPixelPairStepSeeds.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0126     process.hiRegitDetachedTripletStepSeeds.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0127     process.hiRegitMixedTripletStepSeedsA.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0128     process.hiRegitMixedTripletStepSeedsB.RegionFactoryPSet.RegionPSet.JetSrc = cms.InputTag("iterativeConePu5CaloJets")
0129     
0130 
0131     # merged with the global, iterative tracking
0132     process.load("RecoHI.HiTracking.MergeRegit_cff")
0133 
0134 
0135     
0136     # now re-run the muons
0137     process.regGlobalMuons = process.globalMuons.clone(
0138         TrackerCollectionLabel = "hiGeneralAndRegitTracks"
0139         )
0140     process.regGlbTrackQual = process.glbTrackQual.clone(
0141         InputCollection = "regGlobalMuons",
0142         InputLinksCollection = "regGlobalMuons"
0143         )
0144     process.regMuons = process.muons.clone()
0145     process.regMuons.TrackExtractorPSet.inputTrackCollection = "hiGeneralAndRegitTracks"
0146     process.regMuons.globalTrackQualityInputTag = "regGlbTrackQual"
0147     process.regMuons.inputCollectionLabels = cms.VInputTag("hiGeneralAndRegitTracks", "regGlobalMuons", "standAloneMuons:UpdatedAtVtx", "tevMuons:firstHit", "tevMuons:picky",
0148                                                            "tevMuons:dyt")
0149     
0150     
0151     process.regMuonReco = cms.Sequence(
0152         process.regGlobalMuons*
0153         process.regGlbTrackQual*
0154         process.regMuons
0155         )
0156     
0157 
0158     
0159     
0160     process.regionalTracking = cms.Path(
0161         process.hiRegitTracking *
0162         process.hiGeneralAndRegitTracks*
0163         process.regMuonReco 
0164         )
0165     
0166     
0167 process.load("edwenger.HiTrkEffAnalyzer.HiTPCuts_cff")
0168 process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi")
0169 process.load("SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi")
0170 process.load("MitHig.PixelTrackletAnalyzer.trackAnalyzer_cff")
0171 process.cutsTPForEff.primaryOnly = False
0172 process.cutsTPForFak.ptMin = 0.2
0173 process.cutsTPForEff.ptMin = 0.2
0174 
0175 if doRegit:
0176     process.anaTrack.trackSrc = 'hiGeneralAndRegitTracks'
0177     process.anaTrack.qualityString = "highPurity"
0178 else:
0179     process.anaTrack.trackSrc = 'hiGeneralTracks'
0180     process.anaTrack.qualityString = "highPurity"
0181 
0182 process.anaTrack.trackPtMin = 0
0183 process.anaTrack.useQuality = False
0184 process.anaTrack.doPFMatching = False
0185 process.anaTrack.doSimTrack = True    
0186 
0187 process.trackAnalysis = cms.Path(
0188     process.cutsTPForEff*
0189     process.cutsTPForFak*
0190     process.anaTrack
0191     )
0192 
0193 
0194 #####################################################################################
0195 # Edm Output
0196 #####################################################################################
0197 
0198 #process.out = cms.OutputModule("PoolOutputModule",
0199 #                               fileName = cms.untracked.string("/tmp/mnguyen/output.root")
0200 #                               )
0201 #process.save = cms.EndPath(process.out)