ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/HiPatExamples/test/patHiEventContent_full_cfg.py
Revision: 1.1
Committed: Wed Jul 22 21:33:10 2009 UTC (15 years, 9 months ago) by appeltel
Content type: text/x-python
Branch: MAIN
Log Message:
Initial Revision

File Contents

# User Rev Content
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     #
122     # For now, the track collection globalPrimTracks is copied into generalTracks
123     # which most high level reconstruction algorithms look for by default. The other track
124     # collections are dropped in the EventContent to avoid confusion when looking for
125     # the correct collection of tracks to analyze.
126     #
127    
128     process.generalTracks = cms.EDFilter("TrackSelector",
129     src = cms.InputTag("globalPrimTracks"),
130     cut = cms.string('')
131     )
132    
133     process.hiTracks = cms.Path( process.generalTracks )
134    
135     ##################################################################################
136     #
137     # PAT object production
138     #
139    
140     process.load("CmsHi.HiPatAlgos.HiPatPhotonSequence_cfi")
141     process.load("CmsHi.HiPatAlgos.HiPatJetSequence_cfi")
142     process.load("CmsHi.HiPatAlgos.HiPatMuonSequence_cfi")
143    
144    
145     process.patHIProductionSequence = cms.Path(
146     process.hiPatJetSequence *
147     process.hiPatPhotonSequence *
148     process.hiPatMuonSequence
149     )
150    
151     ####################################################################################
152     #
153     # PAT object selection
154     #
155    
156     process.load("PhysicsTools.PatAlgos.selectionLayer1.muonSelector_cfi")
157     process.load("PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi")
158     process.load("PhysicsTools.PatAlgos.selectionLayer1.photonSelector_cfi")
159    
160     process.selectedLayer1Muons.cut = cms.string('pt > 0. & abs(eta) < 12.')
161     process.selectedLayer1Jets.cut = cms.string('pt > 0. & abs(eta) < 12.')
162     process.selectedLayer1Photons.cut = cms.string('pt > 0. & abs(eta) < 12.')
163    
164    
165     process.patHISelectionSequence = cms.Path(
166     process.selectedLayer1Muons +
167     process.selectedLayer1Photons +
168     process.selectedLayer1Jets
169     )
170    
171    
172     #####################################################################################
173     # Event Content
174     #
175    
176     process.HIPATObjects = cms.PSet(
177     outputCommands = cms.untracked.vstring('drop *',
178     'keep patPhotons_selected*_*_*',
179     'keep patMuons_selected*_*_*',
180     'keep patJets_selected*_*_*',
181     'keep recoCentrality_*_*_*',
182     'keep recoEvtPlane_*_*_*',
183     'keep recoTracks_generalTracks_*_*'
184     )
185     )
186    
187     #######################################################################################
188     # Output file
189     #
190    
191     process.output = cms.OutputModule("PoolOutputModule",
192     process.HIPATObjects,
193     compressionLevel = cms.untracked.int32(2),
194     commitInterval = cms.untracked.uint32(1),
195     fileName = cms.untracked.string(ivars.output)
196     )
197    
198     process.out = cms.EndPath( process.output )
199    
200     process.schedule = cms.Schedule(
201     process.hiGenTemp,
202     process.hiTracks,
203     process.muonRecoTemp,
204     process.patHIProductionSequence,
205     process.patHISelectionSequence,
206     process.out
207     )
208