1 |
appeltel |
1.1 |
######################################################################################
|
2 |
|
|
#
|
3 |
|
|
# PAT Sequence Script for Heavy Ion Testing
|
4 |
|
|
#
|
5 |
|
|
|
6 |
|
|
import FWCore.ParameterSet.Config as cms
|
7 |
|
|
|
8 |
|
|
process = cms.Process("PAT")
|
9 |
|
|
|
10 |
|
|
################################################################################
|
11 |
|
|
# Input Variable Parsing
|
12 |
|
|
#
|
13 |
|
|
# This script uses input variable parsing, which means that you
|
14 |
|
|
# can change the input and output files, as well as max events
|
15 |
|
|
# from the command line rather than having to edit the file
|
16 |
|
|
#
|
17 |
|
|
# Usage:
|
18 |
|
|
#
|
19 |
|
|
# cmsRun pat_hi_sequence_cfg.py files=/path/to/input1.root output=file:output.root maxEvents=10
|
20 |
|
|
#
|
21 |
|
|
# You can use multiple files= options to read in multiple inputs
|
22 |
|
|
#
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
import FWCore.ParameterSet.VarParsing as VarParsing
|
26 |
|
|
|
27 |
|
|
ivars = VarParsing.VarParsing('standard')
|
28 |
|
|
|
29 |
|
|
ivars.output = 'HIPAT_output_full.root'
|
30 |
|
|
ivars.maxEvents = -1
|
31 |
|
|
|
32 |
|
|
ivars.files = 'file:/afs/cern.ch/user/a/appeltel/public/HYDJET-b9-3_1_X_2009-MC_31X_V2.10.root'
|
33 |
|
|
|
34 |
|
|
ivars.parseArguments()
|
35 |
|
|
|
36 |
|
|
########################################################################################
|
37 |
|
|
# Input Files and max events
|
38 |
|
|
#
|
39 |
|
|
#
|
40 |
|
|
# Although MC data sets should not have duplicate event numbers, checking
|
41 |
|
|
# for duplicate events is turned off here for testing purposes.
|
42 |
|
|
#
|
43 |
|
|
|
44 |
|
|
process.source = cms.Source("PoolSource",
|
45 |
|
|
fileNames = cms.untracked.vstring( ivars.files ),
|
46 |
|
|
duplicateCheckMode = cms.untracked.string( 'noDuplicateCheck' )
|
47 |
|
|
)
|
48 |
|
|
|
49 |
|
|
process.maxEvents = cms.untracked.PSet(
|
50 |
|
|
input = cms.untracked.int32(ivars.maxEvents)
|
51 |
|
|
)
|
52 |
|
|
|
53 |
|
|
########################################################################################
|
54 |
|
|
# Timing and memory services
|
55 |
|
|
#
|
56 |
|
|
|
57 |
|
|
# process.Timing = cms.Service("Timing")
|
58 |
|
|
|
59 |
|
|
# process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
|
60 |
|
|
# oncePerEventMode = cms.untracked.bool(True),
|
61 |
|
|
# ignoreTotal = cms.untracked.int32(0)
|
62 |
|
|
#)
|
63 |
|
|
|
64 |
|
|
process.options = cms.untracked.PSet(
|
65 |
|
|
Rethrow = cms.untracked.vstring('ProductNotFound')
|
66 |
|
|
)
|
67 |
|
|
|
68 |
|
|
##################################################################################
|
69 |
|
|
#
|
70 |
|
|
# hiGenParticles - (Temporary)
|
71 |
|
|
#
|
72 |
|
|
# Currently not in production sequence, needed for pat::Jets
|
73 |
|
|
#
|
74 |
|
|
|
75 |
|
|
process.load("CmsHi.Utilities.HiGenParticles_cfi")
|
76 |
|
|
|
77 |
|
|
process.hiGenParticles.src = cms.vstring("generator")
|
78 |
|
|
process.hiGenTemp = cms.Path( process.hiGenParticles )
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
##################################################################################
|
82 |
|
|
# Additional Reconstruction (Muons - Temporary)
|
83 |
|
|
#
|
84 |
|
|
# Until the reco::Muon object is added to standard HI reconstruction,
|
85 |
|
|
# the object will be produced in this script for testing.
|
86 |
|
|
#
|
87 |
|
|
#
|
88 |
|
|
process.load("Configuration.StandardSequences.RawToDigi_cff")
|
89 |
|
|
process.load("RecoLocalMuon.Configuration.RecoLocalMuon_cff")
|
90 |
|
|
process.load("RecoMuon.Configuration.RecoMuon_cff")
|
91 |
|
|
process.load("RecoMuon.MuonIdentification.muonIdProducerSequence_cff")
|
92 |
|
|
process.load("Configuration.StandardSequences.MagneticField_cff")
|
93 |
|
|
process.load("Configuration.StandardSequences.Geometry_cff")
|
94 |
|
|
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
|
95 |
|
|
process.GlobalTag.globaltag = 'MC_31X_V2::All'
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
# process.muons.inputCollectionLabels = ['globalPrimTracks', 'globalMuons', 'standAloneMuons:UpdatedAtVtx']
|
99 |
|
|
# process.muons.TrackExtractorPSet.inputTrackCollection = 'globalPrimTracks'
|
100 |
|
|
# process.calomuons.inputTracks = 'globalPrimTracks'
|
101 |
|
|
# process.muIsoDepositTk.ExtractorPSet.inputTrackCollection = 'globalPrimTracks'
|
102 |
|
|
# process.globalMuons.TrackerCollectionLabel = 'globalPrimTracks'
|
103 |
|
|
|
104 |
|
|
process.muons.JetExtractorPSet.JetCollectionLabel = cms.InputTag("iterativeConePu5CaloJets")
|
105 |
|
|
process.muIsoDepositJets.ExtractorPSet.JetCollectionLabel = cms.InputTag("iterativeConePu5CaloJets")
|
106 |
|
|
|
107 |
|
|
process.muonRecoTemp = cms.Path(
|
108 |
|
|
process.muonCSCDigis *
|
109 |
|
|
process.muonDTDigis *
|
110 |
|
|
process.muonRPCDigis *
|
111 |
|
|
process.muonlocalreco *
|
112 |
|
|
process.muontracking_with_TeVRefinement *
|
113 |
|
|
process.muonIdProducerSequence *
|
114 |
|
|
process.muIsolation
|
115 |
|
|
)
|
116 |
|
|
|
117 |
|
|
###################################################################################
|
118 |
|
|
#
|
119 |
|
|
# PAT Track Production
|
120 |
|
|
#
|
121 |
appeltel |
1.2 |
# For now, selection is run on the track collection globalPrimTracks and renamed generalTracks
|
122 |
appeltel |
1.1 |
# which most high level reconstruction algorithms look for by default. The other track
|
123 |
|
|
# collections are dropped in the EventContent to avoid confusion when looking for
|
124 |
|
|
# the correct collection of tracks to analyze.
|
125 |
|
|
#
|
126 |
|
|
|
127 |
appeltel |
1.2 |
import RecoHI.HiTracking.SelectHITracks_cfi
|
128 |
|
|
process.generalTracks = RecoHI.HiTracking.SelectHITracks_cfi.selectHiTracks.clone()
|
129 |
appeltel |
1.1 |
|
130 |
|
|
process.hiTracks = cms.Path( process.generalTracks )
|
131 |
|
|
|
132 |
|
|
##################################################################################
|
133 |
|
|
#
|
134 |
|
|
# PAT object production
|
135 |
|
|
#
|
136 |
|
|
|
137 |
|
|
process.load("CmsHi.HiPatAlgos.HiPatPhotonSequence_cfi")
|
138 |
|
|
process.load("CmsHi.HiPatAlgos.HiPatJetSequence_cfi")
|
139 |
|
|
process.load("CmsHi.HiPatAlgos.HiPatMuonSequence_cfi")
|
140 |
|
|
|
141 |
|
|
|
142 |
|
|
process.patHIProductionSequence = cms.Path(
|
143 |
|
|
process.hiPatJetSequence *
|
144 |
|
|
process.hiPatPhotonSequence *
|
145 |
|
|
process.hiPatMuonSequence
|
146 |
|
|
)
|
147 |
|
|
|
148 |
|
|
####################################################################################
|
149 |
|
|
#
|
150 |
|
|
# PAT object selection
|
151 |
|
|
#
|
152 |
|
|
|
153 |
|
|
process.load("PhysicsTools.PatAlgos.selectionLayer1.muonSelector_cfi")
|
154 |
|
|
process.load("PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi")
|
155 |
|
|
process.load("PhysicsTools.PatAlgos.selectionLayer1.photonSelector_cfi")
|
156 |
|
|
|
157 |
|
|
process.selectedLayer1Muons.cut = cms.string('pt > 0. & abs(eta) < 12.')
|
158 |
|
|
process.selectedLayer1Jets.cut = cms.string('pt > 0. & abs(eta) < 12.')
|
159 |
|
|
process.selectedLayer1Photons.cut = cms.string('pt > 0. & abs(eta) < 12.')
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
process.patHISelectionSequence = cms.Path(
|
163 |
|
|
process.selectedLayer1Muons +
|
164 |
|
|
process.selectedLayer1Photons +
|
165 |
|
|
process.selectedLayer1Jets
|
166 |
|
|
)
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
#####################################################################################
|
170 |
|
|
# Event Content
|
171 |
|
|
#
|
172 |
|
|
|
173 |
|
|
process.HIPATObjects = cms.PSet(
|
174 |
|
|
outputCommands = cms.untracked.vstring('drop *',
|
175 |
|
|
'keep patPhotons_selected*_*_*',
|
176 |
|
|
'keep patMuons_selected*_*_*',
|
177 |
|
|
'keep patJets_selected*_*_*',
|
178 |
|
|
'keep recoCentrality_*_*_*',
|
179 |
|
|
'keep recoEvtPlane_*_*_*',
|
180 |
|
|
'keep recoTracks_generalTracks_*_*'
|
181 |
|
|
)
|
182 |
|
|
)
|
183 |
|
|
|
184 |
|
|
#######################################################################################
|
185 |
|
|
# Output file
|
186 |
|
|
#
|
187 |
|
|
|
188 |
|
|
process.output = cms.OutputModule("PoolOutputModule",
|
189 |
|
|
process.HIPATObjects,
|
190 |
|
|
compressionLevel = cms.untracked.int32(2),
|
191 |
|
|
commitInterval = cms.untracked.uint32(1),
|
192 |
|
|
fileName = cms.untracked.string(ivars.output)
|
193 |
|
|
)
|
194 |
|
|
|
195 |
|
|
process.out = cms.EndPath( process.output )
|
196 |
|
|
|
197 |
|
|
process.schedule = cms.Schedule(
|
198 |
|
|
process.hiGenTemp,
|
199 |
|
|
process.hiTracks,
|
200 |
|
|
process.muonRecoTemp,
|
201 |
|
|
process.patHIProductionSequence,
|
202 |
|
|
process.patHISelectionSequence,
|
203 |
|
|
process.out
|
204 |
|
|
)
|
205 |
|
|
|