Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:33:26

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process('BDHadronTrackMonitorAnalyzerDQM')
0004 
0005 # import of standard configurations
0006 process.load('Configuration.StandardSequences.Services_cff')
0007 process.load('FWCore.MessageService.MessageLogger_cfi')
0008 process.load('Configuration.EventContent.EventContent_cff')
0009 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0010 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0011 
0012 # load DQM
0013 process.load("DQMServices.Core.DQM_cfg")
0014 process.load("DQMServices.Components.DQMEnvironment_cfi")
0015 
0016 # Input source
0017 process.source = cms.Source("PoolSource",
0018     fileNames = cms.untracked.vstring()
0019 )
0020 
0021 
0022 process.PoolSource.fileNames = [
0023     '/store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/002033F7-36B9-E611-A30B-0025905A48EC.root'
0024         #'root://xrootd-cms.infn.it//store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/002033F7-36B9-E611-A30B-0025905A48EC.root',
0025     #'root://xrootd-cms.infn.it//store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/00A6E94A-3DB9-E611-AAAD-0CC47A4D7604.root',
0026     #'root://xrootd-cms.infn.it//store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/00EB8925-41B9-E611-BF1E-0CC47A78A456.root',
0027     #'root://xrootd-cms.infn.it//store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/020F6DD1-36B9-E611-B893-0CC47A4D7604.root',
0028     #'root://xrootd-cms.infn.it//store/relval/CMSSW_8_1_0_pre16/RelValTTbar_13/GEN-SIM-RECODEBUG/PU25ns_81X_upgrade2017_realistic_v22_HS_rsb-v1/10000/027E621E-3FB9-E611-9415-0025905A6104.root'
0029     ]
0030 
0031 
0032 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContent, patEventContentNoCleaning
0033 process.DQMoutput = cms.OutputModule("DQMRootOutputModule",
0034                                      fileName = cms.untracked.string("OUT.root")
0035                                      )
0036                             
0037 process.maxEvents = cms.untracked.PSet(
0038     input = cms.untracked.int32(10)
0039 )
0040 
0041 process.options = cms.untracked.PSet(
0042     wantSummary = cms.untracked.bool(False)
0043 )
0044 
0045 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0046 
0047 
0048 # Other statements
0049 from Configuration.AlCa.GlobalTag import GlobalTag
0050 #process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')  #for MC
0051 process.GlobalTag.globaltag = "80X_mcRun2_asymptotic_v4"
0052 
0053 postfix = "PFlow"
0054 
0055 from PhysicsTools.PatAlgos.tools.pfTools import *
0056 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
0057 
0058 patAlgosToolsTask = getPatAlgosToolsTask(process)
0059 
0060 usePF2PAT(
0061             process,
0062             runPF2PAT=True,
0063             jetAlgo="AK4",
0064             runOnMC=True,
0065             postfix=postfix,
0066             jetCorrections=('AK4PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute'], 'None'),
0067             pvCollection=cms.InputTag('offlinePrimaryVertices')
0068 )
0069 
0070  ## Top projections in PF2PAT
0071 getattr(process,"pfPileUpJME"+postfix).checkClosestZVertex = False
0072 getattr(process,"pfNoPileUpJME"+postfix).enable = True
0073 getattr(process,"pfNoMuonJMEPFBRECO"+postfix).enable = False
0074 getattr(process,"pfNoElectronJMEPFBRECO"+postfix).enable = False
0075 
0076 
0077 # switch jet collection to make PAT collection
0078 from PhysicsTools.PatAlgos.tools.jetTools import *
0079 switchJetCollection(
0080         process,
0081         jetSource = cms.InputTag('ak4PFJetsCHS'),
0082         #'ak4PFJets'
0083         pfCandidates = cms.InputTag('particleFlow'),
0084         pvSource = cms.InputTag('offlinePrimaryVertices'),
0085         svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'),
0086         muSource = cms.InputTag('muons'),
0087         elSource = cms.InputTag('gedGsfElectrons'),
0088         btagInfos = [
0089                     'pfImpactParameterTagInfos'
0090                     ,'pfSecondaryVertexTagInfos'
0091                     ,'pfInclusiveSecondaryVertexFinderTagInfos'
0092                     ,'pfSecondaryVertexNegativeTagInfos'
0093                     ,'pfInclusiveSecondaryVertexFinderNegativeTagInfos'
0094                     ,'softPFMuonsTagInfos'
0095                     ,'softPFElectronsTagInfos'
0096                     ,'pfInclusiveSecondaryVertexFinderCvsLTagInfos'
0097                     ,'pfInclusiveSecondaryVertexFinderNegativeCvsLTagInfos'
0098         ],
0099         btagDiscriminators = ['pfJetBProbabilityBJetTags'
0100                             ,'pfJetProbabilityBJetTags'
0101                             ,'pfCombinedSecondaryVertexV2BJetTags'
0102         ],
0103         jetCorrections = ('AK4PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute'], 'None'),
0104         genJetCollection = cms.InputTag('ak4GenJetsNoNu'),
0105         genParticles = cms.InputTag('genParticles'),
0106         postfix=postfix
0107 )
0108 
0109 
0110 ## Add TagInfos to PAT jets
0111 if hasattr(process,'patJets'+postfix) and getattr( getattr(process,'patJets'+postfix), 'addBTagInfo' ):
0112     setattr( getattr(process,'patJets'+postfix), 'addTagInfos', cms.bool(True) )
0113 
0114 
0115 # my analyzer
0116 process.load('Validation.RecoB.BDHadronTrackMonitoring_cfi')
0117 process.BDHadronTrackMonitoringAnalyze.PatJetSource = cms.InputTag('selectedPatJets'+postfix)
0118 
0119 process.load("SimTracker.TrackHistory.TrackHistory_cff")
0120 process.load("SimTracker.TrackHistory.TrackClassifier_cff")
0121 process.load("SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi")
0122 process.load("SimTracker.TrackAssociation.trackingParticleRecoTrackAsssociation_cfi")
0123 process.load("SimTracker.TrackerHitAssociation.tpClusterProducer_cfi")
0124 patAlgosToolsTask.add(process.quickTrackAssociatorByHits)
0125 patAlgosToolsTask.add(process.tpClusterProducer)
0126 
0127 process.BDHadronTrackMonitoringAnalyzer = cms.Path(process.BDHadronTrackMonitoringAnalyze)
0128 #process.dqmsave_step = cms.Path(process.DQMSaver)
0129 process.DQMoutput_step = cms.EndPath(process.DQMoutput)
0130 
0131 
0132 
0133 # Schedule definition
0134 process.schedule = cms.Schedule(
0135     process.BDHadronTrackMonitoringAnalyzer,
0136     process.DQMoutput_step,
0137 #    process.dqmsave_step,
0138     tasks=[patAlgosToolsTask]
0139     )