CMS 3D CMS Logo

caloParticleDebugger_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # The line below always has to be included to make VarParsing work
4 from FWCore.ParameterSet.VarParsing import VarParsing
5 options = VarParsing ('analysis')
6 options.parseArguments()
7 
8 process = cms.Process("Demo")
9 
10 process.load("FWCore.MessageService.MessageLogger_cfi")
11 process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
12 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
13 from Configuration.AlCa.GlobalTag import GlobalTag
14 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
15 
16 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
17 
18 
19 input_filename = 'default.root' if len(options.inputFiles) == 0 else options.inputFiles[0]
20 #input_filename='step2SingleElectronPt15Eta1p7_2p7_SimTracksters.root'
21 #input_filename='step2FineCaloSingleElectronPt15Eta1p7_2p7_SimTracksters.root'
22 #input_filename='step2SingleElectronPt15Eta1p7_2p7_CBWEAndSimTracksters.root'
23 #input_filename='step2FineCaloSingleElectronPt15Eta1p7_2p7_CBWEAndSimTracksters.root'
24 
25 process.source = cms.Source("PoolSource",
26  inputCommands = cms.untracked.vstring(['keep *',
27  'drop l1tEMTFHit2016Extras_simEmtfDigis_CSC_HLT',
28  'drop l1tEMTFHit2016Extras_simEmtfDigis_RPC_HLT',
29  'drop l1tEMTFHit2016s_simEmtfDigis__HLT',
30  'drop l1tEMTFTrack2016Extras_simEmtfDigis__HLT',
31  'drop l1tEMTFTrack2016s_simEmtfDigis__HLT']),
32  # replace 'myfile.root' with the source file you want to use
33  fileNames = cms.untracked.vstring(
34 # 'file:/data/rovere/HGCAL/study/CMSSW_9_4_0/src/SimGeneral/Debugging/test/20800.0_FourMuPt1_200+FourMuPt_1_200_pythia8_2023D20_GenSimHLBeamSpotFull+DigiFull_2023D20+RecoFullGlobal_2023D20+HARVESTFullGlobal_2023D20/step2.root'
35 # 'file:/data/rovere/HGCAL/study/CMSSW_9_4_0/src/SimGeneral/Debugging/test/20824.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2023D20_GenSimHLBeamSpotFull+DigiFull_2023D20+RecoFullGlobal_2023D20+HARVESTFullGlobal_2023D20/step2.root'
36 # 'file:/data/rovere/HGCAL/study/CMSSW_9_4_0/src/SimGeneral/Debugging/test/20002.0_SingleElectronPt35+SingleElectronPt35_pythia8_2023D17_GenSimHLBeamSpotFull+DigiFullTrigger_2023D17+RecoFullGlobal_2023D17+HARVESTFullGlobal_2023D17/step2.root'
37 # 'file:/data/rovere/HGCAL/study/CMSSW_9_4_0/src/SimGeneral/Debugging/test/20016.0_SingleGammaPt35Extended+DoubleGammaPt35Extended_pythia8_2023D17_GenSimHLBeamSpotFull+DigiFullTrigger_2023D17+RecoFullGlobal_2023D17+HARVESTFullGlobal_2023D17/step2.root'
38 # 'file:/data/rovere/HGCAL/study/CMSSW_9_4_0/src/SimGeneral/Debugging/test/20088.0_SinglePiPt25Eta1p7_2p7+SinglePiPt25Eta1p7_2p7_2023D17_GenSimHLBeamSpotFull+DigiFullTrigger_2023D17+RecoFullGlobal_2023D17+HARVESTFullGlobal_2023D17/step2.root'
39  'file:%s'%input_filename
40 
41  )
42 )
43 
44 process.load("SimGeneral.Debugging.caloParticleDebugger_cfi")
45 
46 # MessageLogger customizations
47 process.MessageLogger.cerr.enable = False
48 process.MessageLogger.cout.enable = False
49 labels = ['SimTracks', 'SimVertices', 'GenParticles', 'TrackingParticles', 'CaloParticles', 'SimClusters']
50 messageLogger = dict()
51 for category in labels:
52  main_key = '%sMessageLogger'%(category)
53  category_key = 'CaloParticleDebugger%s'%(category)
54  messageLogger[main_key] = dict(
55  filename = '%s_%s.log' % (input_filename.replace('.root',''), category),
56  threshold = 'INFO',
57  default = dict(limit=0)
58  )
59  messageLogger[main_key][category_key] = dict(limit=-1)
60  # First create defaults
61  setattr(process.MessageLogger.files, category, dict())
62  # Then modify them
63  setattr(process.MessageLogger.files, category, messageLogger[main_key])
64 
65 process.p = cms.Path(process.caloParticleDebugger)
GlobalTag
Definition: GlobalTag.py:1