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 
0019 rawORreco=True
0020 isEmbedded=True
0021 
0022 process.Timing = cms.Service("Timing")
0023 
0024 process.options = cms.untracked.PSet(
0025     wantSummary = cms.untracked.bool(True)
0026 )
0027 
0028 #####################################################################################
0029 # Input source
0030 #####################################################################################
0031 
0032 process.source = cms.Source("PoolSource",
0033                             duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0034                             fileNames = cms.untracked.vstring(
0035     ivars.files
0036     ))
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,2,3]
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 # Define Analysis sequencues
0092 process.load('CmsHi.JetAnalysis.ExtraPfReco_cff')
0093 
0094 ############
0095 # Extra RECO
0096 ############
0097 
0098 
0099 
0100 # redo reco or just tracking
0101 
0102 if rawORreco:
0103     process.rechits = cms.Sequence(process.siPixelRecHits * process.siStripMatchedRecHits)
0104     process.hiTrackReco = cms.Sequence(process.rechits * process.heavyIonTracking)
0105     process.muonRecoPbPb = cms.Sequence(muonRecoPbPbTask)
0106     
0107     process.reco_extra =  cms.Path(
0108         #process.centralityFilter
0109         process.hiTrackReco
0110         *process.muonRecoPbPb
0111         *process.electronGsfTrackingHi        
0112         *process.hiParticleFlowLocalReco
0113         *process.gsfEcalDrivenElectronSequence
0114         *process.hiParticleFlowReco
0115         *process.PFTowers
0116         )        
0117 else:
0118     process.reco_extra = cms.Path(process.RawToDigi * process.reconstructionHeavyIons_withPF)
0119     
0120 # tack on iteative tracking, particle flow and calo-matching
0121 
0122 #iteerative tracking
0123 process.load("RecoHI.HiTracking.hiIterTracking_cff")
0124 process.heavyIonTracking *= process.hiIterTracking
0125 
0126 # redo muons
0127 process.globalMuons.TrackerCollectionLabel = "hiGeneralTracks"
0128 process.muons.TrackExtractorPSet.inputTrackCollection = "hiGeneralTracks"
0129 process.muons.inputCollectionLabels = ["hiGeneralTracks", "globalMuons", "standAloneMuons:UpdatedAtVtx", "tevMuons:firstHit", "tevMuons:picky", "tevMuons:dyt"]
0130 
0131 # paricle flow
0132 process.particleFlowClusterPS.thresh_Pt_Seed_Endcap = cms.double(99999.)
0133 process.pfTrack.UseQuality = True # ! Should check that loose and tight tracks don't screw up PF
0134 process.pfTrack.TrackQuality = cms.string('loose')
0135 process.pfTrack.TkColList = cms.VInputTag("hiGeneralTracks")
0136 #process.pfTrack.GsfTracksInEvents = cms.bool(False)
0137 
0138 # do calo matching
0139 process.load("RecoHI.HiTracking.HICaloCompatibleTracks_cff")
0140 process.hiGeneralCaloMatchedTracks = process.hiCaloCompatibleTracks.clone(
0141     srcTracks = 'hiGeneralTracks'
0142     )
0143 
0144 process.hiParticleFlowReco *= process.hiGeneralCaloMatchedTracks
0145     
0146 process.hiCaloMatchFilteredTracks = cms.EDFilter("TrackSelector",
0147                                                  src = cms.InputTag("hiGeneralCaloMatchedTracks"),
0148                                                  cut = cms.string(
0149     'quality("highPuritySetWithPV")')                                                                                            
0150                                                  )
0151 
0152 process.hiParticleFlowReco*=process.hiCaloMatchFilteredTracks
0153 
0154 
0155 
0156 #  Track Analyzers
0157 ########################
0158 
0159 process.load("edwenger.HiTrkEffAnalyzer.HiTPCuts_cff")
0160 process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi")
0161 process.load("SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi")
0162 
0163 #process.cutsTPForEff.primaryOnly = False
0164 
0165 process.cutsTPForFak.ptMin = 0.2
0166 process.cutsTPForEff.ptMin = 0.2
0167 
0168 
0169 process.load("MitHig.PixelTrackletAnalyzer.trackAnalyzer_cff")
0170 
0171 process.anaTrack.trackSrc = 'hiGeneralCaloMatchedTracks'
0172 process.anaTrack.qualityString = "highPuritySetWithPV"
0173 
0174 process.anaTrack.trackPtMin = 0
0175 process.anaTrack.useQuality = False
0176 process.anaTrack.doPFMatching = False
0177 process.anaTrack.doSimTrack = True
0178 process.load("CmsHi.JetAnalysis.pfcandAnalyzer_cfi")
0179 process.pfcandAnalyzer.skipCharged = False
0180 process.pfcandAnalyzer.pfPtMin = 0
0181 process.interestingTrackEcalDetIds.TrackCollection = cms.InputTag("hiSelectedTracks")
0182 
0183 process.anaTrack_hiSel = process.anaTrack.clone(trackSrc='hiSelectedTracks')
0184 process.anaTrack_hiGen = process.anaTrack.clone(trackSrc='hiGeneralCaloMatchedTracks')
0185 
0186 process.anaTrack_hiGen.doPFMatching = True
0187 process.anaTrack_hiGen.pfCandSrc = 'particleFlowTmp'
0188 
0189 process.anaTrack_hiSel.qualityString = "highPurity"
0190 process.anaTrack_hiGen.qualityString = "highPurity"
0191 
0192 process.load("edwenger.HiTrkEffAnalyzer.hitrkEffAnalyzer_cff")
0193 
0194 process.hitrkEffAnalyzer_hiSel = process.hitrkEffAnalyzer.clone(tracks = 'hiSelectedTracks')
0195 process.hitrkEffAnalyzer_hiGen = process.hitrkEffAnalyzer.clone(tracks = 'hiGeneralTracks')
0196 process.hitrkEffAnalyzer_hiGenCalo = process.hitrkEffAnalyzer.clone(
0197     tracks = 'hiGeneralCaloMatchedTracks',
0198     qualityString = 'highPuritySetWithPV'
0199 )
0200                           
0201 
0202 process.trackAnalyzers = cms.Sequence(
0203     process.anaTrack*
0204     process.anaTrack_hiSel*                                      
0205     process.anaTrack_hiGen                                     
0206     )        
0207 
0208 process.ana_step          = cms.Path(         #process.centralityFilter*
0209     process.cutsTPForEff*
0210     process.cutsTPForFak*
0211     process.trackAnalyzers
0212     )
0213 
0214 
0215 
0216 #####################################################################################
0217 # Edm Output
0218 #####################################################################################
0219 
0220 #process.out = cms.OutputModule("PoolOutputModule",
0221 #                               fileName = cms.untracked.string("/tmp/mnguyen/output.root")
0222 #                               )
0223 #process.save = cms.EndPath(process.out)