Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:38

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
0004 
0005 process = cms.Process("bphAnalysis")
0006 
0007 patAlgosToolsTask = getPatAlgosToolsTask(process)
0008 
0009 #process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0010 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0011 #filename = open('/lustre/cmswork/ronchese/pat_ntu/cmssw910/chkMini02/src/PDAnalysis/EDM/prod/datafiles_Vmini/mc/BsToJpsiPhi_BMuonFilter_TuneCUEP8M1_13TeV-pythia8-evtgen_mini910/BsToJpsiPhi_BMuonFilter_TuneCUEP8M1_13TeV-pythia8-evtgen_mini910_020.list', 'r')
0012 #fileList = cms.untracked.vstring( filename.readlines() )
0013 
0014 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0015 process.load("Configuration.StandardSequences.MagneticField_cff")
0016 process.load('Configuration.StandardSequences.Services_cff')
0017 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0018 process.load('FWCore.MessageService.MessageLogger_cfi')
0019 process.load('Configuration.EventContent.EventContent_cff')
0020 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0021 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0022 patAlgosToolsTask.add(process.MEtoEDMConverter)
0023 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0024 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0025 process.load("TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
0026 
0027 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0028 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0029 
0030 # for BPH skim input
0031 process.CandidateSelectedTracks = cms.EDProducer( "ConcreteChargedCandidateProducer",
0032                 src=cms.InputTag("oniaSelectedTracks::RECO"),
0033                 particleType=cms.string('pi+')
0034 )
0035 
0036 from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
0037 process.patSelectedTracks = patGenericParticles.clone(src=cms.InputTag("CandidateSelectedTracks"))
0038 patAlgosToolsTask.add(process.patSelectedTracks)
0039 # end BPH skim input
0040 
0041 process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(
0042 #
0043 ### use this to access the nearest copy of the input file, querying the catalog
0044 #
0045     '/store/data/Run2016E/Charmonium/USER/BPHSkim-PromptReco-v2/000/276/831/00000/00FD1519-714D-E611-B686-FA163E321AE0.root'
0046 ### use this to access the input file if by any reason you want to specify 
0047 ### the data server
0048 #    'root://xrootd-cms.infn.it//store/data/Run2016E/Charmonium/USER/BPHSkim-PromptReco-v2/000/276/831/00000/00FD1519-714D-E611-B686-FA163E321AE0.root'
0049 #
0050 ### use this to access an input file locally available
0051 #    'file:/...complete_file_path.../XXXX.root'
0052 ))
0053 
0054 from Configuration.AlCa.GlobalTag import GlobalTag
0055 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')
0056 
0057 from HeavyFlavorAnalysis.SpecificDecay.recoSelectForWrite_cfi import recoSelect
0058 
0059 process.bphWriteSpecificDecay = cms.EDProducer('BPHWriteSpecificDecay',
0060     pVertexLabel = cms.string('offlinePrimaryVertices::RECO'),
0061 
0062 # for BPH skim input
0063     gpCandsLabel = cms.string('patSelectedTracks'),
0064     ccCandsLabel = cms.string('onia2MuMuPAT::RECO'),
0065 # for MiniAOD input
0066 #    patMuonLabel = cms.string('slimmedMuons'),
0067 #    pcCandsLabel = cms.string('packedPFCandidates::RECO'),
0068 #    kSCandsLabel = cms.string('slimmedKshortVertices::RECO'),
0069 #    lSCandsLabel = cms.string('slimmedLambdaVertices::RECO'),
0070 
0071     oniaName = cms.string('oniaFitted'),
0072     sdName   = cms.string('kx0Cand'),
0073     ssName   = cms.string('phiCand'),
0074     buName   = cms.string('buFitted'),
0075     bdName   = cms.string('bdFitted'),
0076     bsName   = cms.string('bsFitted'),
0077     k0Name   = cms.string('k0Fitted'),
0078     l0Name   = cms.string('l0Fitted'),
0079     b0Name   = cms.string('b0Fitted'),
0080     lbName   = cms.string('lbFitted'),
0081     bcName     = cms.string('bcFitted'),
0082     x3872Name  = cms.string('x3872Fitted'),
0083     writeVertex   = cms.bool( True ),
0084     writeMomentum = cms.bool( True ),
0085     recoSelect = cms.VPSet(recoSelect)
0086 )
0087 
0088 process.out = cms.OutputModule(
0089     "PoolOutputModule",
0090     fileName = cms.untracked.string('reco.root'),
0091     outputCommands = cms.untracked.vstring(
0092 # for BPH skim input
0093       "keep *",
0094       "keep *_bphWriteSpecificDecay_*_*",
0095       "drop *_patSelectedTracks_*_*",
0096       "drop *_CandidateSelectedTracks_*_*",
0097       "drop *_TriggerResults_*_bphAnalysis",
0098       "drop *_random*_*_bphAnalysis"
0099 # for MINIAOD input
0100 #      "keep *_bphWriteSpecificDecay_*_*",
0101 #      "keep *_TriggerResults_*_HLT",
0102 #      "keep *_offlineSlimmedPrimaryVertices_*_*"
0103     ),
0104 )
0105 
0106 process.p = cms.Path(
0107 # for BPH skim input
0108     process.CandidateSelectedTracks *
0109 # end BPH skim input
0110     process.bphWriteSpecificDecay
0111 )
0112 
0113 process.e = cms.EndPath(process.out, patAlgosToolsTask)
0114