-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhiforestanalyzer_cfg.py
59 lines (50 loc) · 2.93 KB
/
hiforestanalyzer_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#Loading necessary libraries
import FWCore.ParameterSet.Config as cms
from RecoMuon.TrackingTools.MuonServiceProxy_cff import *
import PhysicsTools.PythonAnalysis.LumiList as LumiList
import FWCore.ParameterSet.Types as CfgTypes
process = cms.Process('HiForest')
process.options = cms.untracked.PSet(SkipEvent = cms.untracked.vstring('ProductNotFound'))
#Number of events: put '-1' unless testing
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
#HiForest script init
process.load("HiForest_cff")
process.HiForest.inputLines = cms.vstring("HiForest V3",)
version = 'no git info'
process.HiForest.HiForestVersion = cms.string(version)
goodJSON = 'Cert_181530-183126_HI7TeV_PromptReco_Collisions11_JSON_MuonPhys.txt'
myLumis = LumiList.LumiList(filename = goodJSON).getCMSSWString().split(',')
import FWCore.Utilities.FileUtils as FileUtils
files2011data = FileUtils.loadListFromFile ('CMS_HIRun2011_HIDiMuon_RECO_04Mar2013-v1_root_file_index.txt')
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(*files2011data
)
)
process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
process.source.lumisToProcess.extend(myLumis)
#Global Tag: change the name according to the instructions
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.connect = cms.string('sqlite_file:/cvmfs/cms-opendata-conddb.cern.ch/GR_R_44_V15.db')
process.GlobalTag.globaltag = 'GR_R_44_V15::All'
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("Configuration.StandardSequences.MagneticField_cff")
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
#Define the output root file (change each run not to overwrite previous output)
process.TFileService = cms.Service("TFileService",
fileName=cms.string("HiForestAOD_DATAtest2011.root"))
#Init Trigger Analyzer
process.hltanalysis = cms.EDAnalyzer('TriggerInfoAnalyzer',
processName = cms.string("HLT"),
triggerName = cms.string("@"),
datasetName = cms.string("HIDiMuon"), #'HICorePhysics' to look at Core Physics only
triggerResults = cms.InputTag("TriggerResults","","HLT"),
triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT")
)
#Collect event data
process.demo = cms.EDAnalyzer('Analyzer') #present analyzer is for muons - see details in Analyzer.cc for possible modifications
process.dump=cms.EDAnalyzer('EventContentAnalyzer') #easy check of Event structure and names without using the TBrowser
process.ana_step = cms.Path(process.hltanalysis+
#process.dump+ #uncomment if necessary to check the name. Do not forget to change the number of events to '1'
process.demo+
process.HiForest
)