CMS 3D CMS Logo

testHGCalReco_cfg.py
Go to the documentation of this file.
1 
11 import FWCore.ParameterSet.Config as cms
12 import os, sys, imp, re, random
13 import FWCore.ParameterSet.VarParsing as VarParsing
14 
15 
17 options = VarParsing.VarParsing('standard')
18 options.register('geometry',
19  "D92",
20  VarParsing.VarParsing.multiplicity.singleton,
21  VarParsing.VarParsing.varType.string,
22  "geometry of operations: D88, D92, D93, V17Shift, V18")
23 options.register('type',
24  "DDD",
25  VarParsing.VarParsing.multiplicity.singleton,
26  VarParsing.VarParsing.varType.string,
27  "type of operations: DDD, DD4hep")
28 options.register('data',
29  "mu",
30  VarParsing.VarParsing.multiplicity.singleton,
31  VarParsing.VarParsing.varType.string,
32  "data of operations: mu, tt")
33 options.register('tag',
34  "Def",
35  VarParsing.VarParsing.multiplicity.singleton,
36  VarParsing.VarParsing.varType.string,
37  "tag of operations: Def, Thr, 0Noise")
38 
39 options.parseArguments()
40 
41 print(options)
42 
43 
45 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
46 if (options.type == "DD4hep"):
47  from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
48  process = cms.Process('SingleMuonSim',Phase2C17I13M9,dd4hep)
49  if (options.geometry == "V17Shift"):
50  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + options.geometry + "Reco_cff"
51  elif (options.geometry == "V18"):
52  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + options.geometry + "Reco_cff"
53  else:
54  geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
55 else:
56  process = cms.Process('SingleMuonSim',Phase2C17I13M9)
57  if (options.geometry == "V17Shift"):
58  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
59  elif (options.geometry == "V18"):
60  geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
61  else:
62  geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
63 globalTag = "auto:phase2_realistic_T21"
64 inFile = "file:step2" + options.type + options.geometry + options.data + ".root"
65 outFile = "file:step3" + options.type + options.geometry + options.data + ".root"
66 fileName = "missing" + options.type + options.geometry + options.data + options.tag + ".root"
67 
68 print("Geometry file: ", geomFile)
69 print("Global Tag: ", globalTag)
70 print("Input file: ", inFile)
71 print("Output file: ", outFile)
72 print("Root file: ", fileName)
73 
74 # import of standard configurations
75 process.load('Configuration.StandardSequences.Services_cff')
76 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
77 process.load('FWCore.MessageService.MessageLogger_cfi')
78 process.load('Configuration.EventContent.EventContent_cff')
79 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
80 process.load(geomFile)
81 process.load('Configuration.StandardSequences.MagneticField_cff')
82 process.load('Configuration.StandardSequences.RawToDigi_cff')
83 process.load('Configuration.StandardSequences.Reconstruction_cff')
84 process.load('Configuration.StandardSequences.RecoSim_cff')
85 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
86 process.load('Validation.HGCalValidation.hgcMissingRecHit_cfi')
87 
88 process.MessageLogger.cerr.FwkReport.reportEvery = 1
89 if hasattr(process,'MessageLogger'):
90  process.MessageLogger.HGCalMiss=dict()
91  process.MessageLogger.HGCalError=dict()
92 
93 process.maxEvents = cms.untracked.PSet(
94  input = cms.untracked.int32(-1),
95  output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
96 )
97 
98 # Input source
99 process.source = cms.Source("PoolSource",
100  fileNames = cms.untracked.vstring(inFile),
101  secondaryFileNames = cms.untracked.vstring()
102 )
103 
104 process.options = cms.untracked.PSet(
105  FailPath = cms.untracked.vstring(),
106  IgnoreCompletely = cms.untracked.vstring(),
107  Rethrow = cms.untracked.vstring(),
108  SkipEvent = cms.untracked.vstring(),
109  accelerators = cms.untracked.vstring('*'),
110  allowUnscheduled = cms.obsolete.untracked.bool,
111  canDeleteEarly = cms.untracked.vstring(),
112  deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
113  dumpOptions = cms.untracked.bool(False),
114  emptyRunLumiMode = cms.obsolete.untracked.string,
115  eventSetup = cms.untracked.PSet(
116  forceNumberOfConcurrentIOVs = cms.untracked.PSet(
117  allowAnyLabel_=cms.required.untracked.uint32
118  ),
119  numberOfConcurrentIOVs = cms.untracked.uint32(0)
120  ),
121  fileMode = cms.untracked.string('FULLMERGE'),
122  forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
123  makeTriggerResults = cms.obsolete.untracked.bool,
124  numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
125  numberOfConcurrentRuns = cms.untracked.uint32(1),
126  numberOfStreams = cms.untracked.uint32(0),
127  numberOfThreads = cms.untracked.uint32(1),
128  printDependencies = cms.untracked.bool(False),
129  sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
130  throwIfIllegalParameter = cms.untracked.bool(True),
131  wantSummary = cms.untracked.bool(False)
132 )
133 
134 # Production Info
135 process.configurationMetadata = cms.untracked.PSet(
136  annotation = cms.untracked.string('step3 nevts:10'),
137  name = cms.untracked.string('Applications'),
138  version = cms.untracked.string('$Revision: 1.19 $')
139 )
140 
141 # Output definition
142 
143 process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule",
144  dataset = cms.untracked.PSet(
145  dataTier = cms.untracked.string('GEN-SIM-RECO'),
146  filterName = cms.untracked.string('')
147  ),
148  fileName = cms.untracked.string(outFile),
149  outputCommands = cms.untracked.vstring(
150  'keep *_*hbhe*_*_*',
151  'keep *_g4SimHits_*_*',
152  'keep *_*HGC*_*_*',
153  ),
154  splitLevel = cms.untracked.int32(0)
155 )
156 
157 # Additional output definition
158 process.TFileService = cms.Service("TFileService",
159  fileName = cms.string(fileName),
160  closeFileFast = cms.untracked.bool(True) )
161 
162 # Other statements
163 process.mix.playback = True
164 process.mix.digitizers = cms.PSet()
165 for a in process.aliases: delattr(process, a)
166 process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer")
167 from Configuration.AlCa.GlobalTag import GlobalTag
168 process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
169 
170 # Path and EndPath definitions
171 process.raw2digi_step = cms.Path(process.RawToDigi)
172 process.reconstruction_step = cms.Path(process.reconstruction)
173 process.recosim_step = cms.Path(process.recosim)
174 process.analysis_step = cms.Path(process.hgcMissingRecHit)
175 process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput)
176 
177 # Schedule definition
178 process.schedule = cms.Schedule(process.raw2digi_step,
179  process.reconstruction_step,
180  process.recosim_step,
181  process.analysis_step,
182  process.FEVTDEBUGHLToutput_step)
183 
184 # customisation of the process.
185 
186 # Automatic addition of the customisation function from SimGeneral.MixingModule.fullMixCustomize_cff
187 from SimGeneral.MixingModule.fullMixCustomize_cff import setCrossingFrameOn
188 
189 #call to customisation function setCrossingFrameOn imported from SimGeneral.MixingModule.fullMixCustomize_cff
190 process = setCrossingFrameOn(process)
191 
192 # End of customisation functions
193 
194 # Add early deletion of temporary data products to reduce peak memory need
195 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
196 process = customiseEarlyDelete(process)
197 # End adding early deletion
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def setCrossingFrameOn(process)