CMS 3D CMS Logo

Classes | Functions | Variables
customisers Namespace Reference

Classes

class  module_manipulate
 Customizer for skimming ########################### There are four different parts. More...
 

Functions

def customiseCleaning (process, changeProcessname=True, reselect=False)
 
def customiseFilterTTbartoMuMu (process)
 
def customiseFilterZToMuMu (process)
 MC specific Customizer ###########################. More...
 
def customiseGenerator (process, changeProcessname=True, reselect=False)
 
def customiseGenerator_Reselect (process)
 
def customiseKeepPrunedGenParticles (process, reselect=False)
 
def customiseLHE (process, changeProcessname=True, reselect=False)
 
def customiseLHEandCleaning (process, reselect=False)
 cross Customizers ########################### More...
 
def customiseLHEandCleaning_Reselect (process)
 
def customiseMCFilter (process)
 
def customiseMerging (process, changeProcessname=True, reselect=False)
 
def customiseMerging_Reselect (process, changeProcessname=True)
 
def customiseSelecting (process, reselect=False)
 
def customiseSelecting_Reselect (process)
 
def customisoptions (process)
 additionla Customizer ########################### More...
 
def fix_input_tags (process, formodules=["generalTracks", cscSegments, dt4DSegments, rpcRecHits)
 
def keepCleaned ()
 Customizer for cleaining ###########################. More...
 
def keepLHE ()
 Customizer for simulaton ###########################. More...
 
def keepMerged (dataTier="SELECT")
 Customizer for merging ###########################. More...
 
def keepSelected (dataTier)
 Customizer for Selecting ###########################. More...
 
def keepSimulated ()
 
def modify_outputModules (process, keep_drop_list=[], module_veto_list=[])
 

Variables

 instance
 
 manipulator_name
 
 module_name
 
 steps
 
 to_bemanipulate
 

Function Documentation

◆ customiseCleaning()

def customisers.customiseCleaning (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 142 of file customisers.py.

References customisoptions(), keepCleaned(), keepSelected(), and modify_outputModules().

Referenced by customiseLHEandCleaning().

142 def customiseCleaning(process, changeProcessname=True,reselect=False):
143  if changeProcessname:
144  process._Process__name = "CLEAN"
145  if reselect:
146  dataTier="RESELECT"
147  else:
148  dataTier="SELECT"
149 
150  from TrackingTools.TrackAssociator.default_cfi import TrackAssociatorParameterBlock
151  TrackAssociatorParameterBlock.TrackAssociatorParameters.CSCSegmentCollectionLabel = cms.InputTag("cscSegments","",dataTier)
152  TrackAssociatorParameterBlock.TrackAssociatorParameters.CaloTowerCollectionLabel = cms.InputTag("towerMaker","",dataTier)
153  TrackAssociatorParameterBlock.TrackAssociatorParameters.DTRecSegment4DCollectionLabel = cms.InputTag("dt4DSegments","",dataTier)
154  TrackAssociatorParameterBlock.TrackAssociatorParameters.EBRecHitCollectionLabel = cms.InputTag("ecalRecHit","EcalRecHitsEB",dataTier)
155  TrackAssociatorParameterBlock.TrackAssociatorParameters.EERecHitCollectionLabel = cms.InputTag("ecalRecHit","EcalRecHitsEE",dataTier)
156  TrackAssociatorParameterBlock.TrackAssociatorParameters.HBHERecHitCollectionLabel = cms.InputTag("hbhereco","",dataTier)
157  TrackAssociatorParameterBlock.TrackAssociatorParameters.HORecHitCollectionLabel = cms.InputTag("horeco","",dataTier)
158 
159 
160  MuonImput = cms.InputTag("selectedMuonsForEmbedding","","")
161  for akt_manimod in to_bemanipulate:
162  if "CLEAN" in akt_manimod.steps:
163  oldCollections_in = cms.VInputTag()
164  for instance in akt_manimod.instance:
165  oldCollections_in.append(cms.InputTag(akt_manimod.module_name,instance,dataTier))
166  setattr(process, akt_manimod.module_name, cms.EDProducer(akt_manimod.cleaner_name,MuonCollection = MuonImput,TrackAssociatorParameters = TrackAssociatorParameterBlock.TrackAssociatorParameters,oldCollection = oldCollections_in))
167  process.ecalPreshowerRecHit.TrackAssociatorParameters.usePreshower = cms.bool(True)
168  process = customisoptions(process)
169  return modify_outputModules(process,[keepSelected(dataTier),keepCleaned()],["MINIAODoutput"])
170 
171 
def keepCleaned()
Customizer for cleaining ###########################.
Definition: customisers.py:126
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:81
def customiseCleaning(process, changeProcessname=True, reselect=False)
Definition: customisers.py:142

◆ customiseFilterTTbartoMuMu()

def customisers.customiseFilterTTbartoMuMu (   process)

Definition at line 459 of file customisers.py.

References customiseMCFilter().

459 def customiseFilterTTbartoMuMu(process):
460  process.load("TauAnalysis.MCEmbeddingTools.TTbartoMuMuGenFilter_cfi")
461  process.MCFilter = cms.Path(process.TTbartoMuMuGenFilter)
462  return customiseMCFilter(process)
463 
def customiseMCFilter(process)
Definition: customisers.py:464
def customiseFilterTTbartoMuMu(process)
Definition: customisers.py:459

◆ customiseFilterZToMuMu()

def customisers.customiseFilterZToMuMu (   process)

MC specific Customizer ###########################.

Definition at line 453 of file customisers.py.

453 def customiseFilterZToMuMu(process):
454  process.load("TauAnalysis.MCEmbeddingTools.DYToMuMuGenFilter_cfi")
455  process.ZToMuMuFilter = cms.Path(process.dYToMuMuGenFilter)
456  process.schedule.insert(-1,process.ZToMuMuFilter)
457  return process
458 
def customiseFilterZToMuMu(process)
MC specific Customizer ###########################.
Definition: customisers.py:453

◆ customiseGenerator()

def customisers.customiseGenerator (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 214 of file customisers.py.

References customisoptions(), keepCleaned(), keepSelected(), keepSimulated(), modify_outputModules(), and print().

Referenced by customiseGenerator_Reselect().

214 def customiseGenerator(process, changeProcessname=True,reselect=False):
215  if reselect:
216  dataTier="RESELECT"
217  else:
218  dataTier="SELECT"
219  if changeProcessname:
220  process._Process__name = "SIMembedding"
221 
222 
223 
224  process.load('TauAnalysis.MCEmbeddingTools.EmbeddingVertexCorrector_cfi')
225  process.VtxSmeared = process.VtxCorrectedToInput.clone()
226  print("Correcting Vertex in genEvent to one from input. Replaced 'VtxSmeared' with the Corrector.")
227 
228  # Remove BeamSpot Production, use the one from selected data instead.
229  process.reconstruction.remove(process.offlineBeamSpot)
230 
231  # Disable noise simulation
232  process.mix.digitizers.castor.doNoise = cms.bool(False)
233 
234  process.mix.digitizers.ecal.doESNoise = cms.bool(False)
235  process.mix.digitizers.ecal.doENoise = cms.bool(False)
236 
237  process.mix.digitizers.hcal.doNoise = cms.bool(False)
238  process.mix.digitizers.hcal.doThermalNoise = cms.bool(False)
239  process.mix.digitizers.hcal.doHPDNoise = cms.bool(False)
240 
241  process.mix.digitizers.pixel.AddNoisyPixels = cms.bool(False)
242  process.mix.digitizers.pixel.AddNoise = cms.bool(False)
243 
244  process.mix.digitizers.strip.Noise = cms.bool(False)
245 
246 
247  process = customisoptions(process)
248 
249 
250  return modify_outputModules(process,[keepSelected(dataTier),keepCleaned(),keepSimulated()],["AODSIMoutput"])
251 
def keepCleaned()
Customizer for cleaining ###########################.
Definition: customisers.py:126
def customiseGenerator(process, changeProcessname=True, reselect=False)
Definition: customisers.py:214
def keepSimulated()
Definition: customisers.py:180
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:81

◆ customiseGenerator_Reselect()

def customisers.customiseGenerator_Reselect (   process)

Definition at line 252 of file customisers.py.

References customiseGenerator().

252 def customiseGenerator_Reselect(process):
253  return customiseGenerator(process,reselect=True)
254 
def customiseGenerator(process, changeProcessname=True, reselect=False)
Definition: customisers.py:214
def customiseGenerator_Reselect(process)
Definition: customisers.py:252

◆ customiseKeepPrunedGenParticles()

def customisers.customiseKeepPrunedGenParticles (   process,
  reselect = False 
)

Definition at line 264 of file customisers.py.

References customisoptions(), keepMerged(), and modify_outputModules().

264 def customiseKeepPrunedGenParticles(process,reselect=False):
265  if reselect:
266  dataTier="RESELECT"
267  else:
268  dataTier="SELECT"
269 
270  process.load('PhysicsTools.PatAlgos.slimming.genParticles_cff')
271  process.merge_step += process.prunedGenParticlesWithStatusOne
272  process.load('PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi')
273  process.merge_step += process.prunedGenParticles
274  process.load('PhysicsTools.PatAlgos.slimming.packedGenParticles_cfi')
275  process.merge_step += process.packedGenParticles
276 
277  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi')
278  process.merge_step += process.muonMatch
279  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.electronMatch_cfi')
280  process.merge_step += process.electronMatch
281  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.photonMatch_cfi')
282  process.merge_step += process.photonMatch
283  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.tauMatch_cfi')
284  process.merge_step += process.tauMatch
285  process.load('PhysicsTools.JetMCAlgos.TauGenJets_cfi')
286  process.merge_step += process.tauGenJets
287  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff')
288  process.merge_step += process.patJetPartons
289  process.load('PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi')
290  process.merge_step += process.patJetPartonMatch
291 
292  process.muonMatch.matched = "prunedGenParticles"
293  process.electronMatch.matched = "prunedGenParticles"
294  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
295  process.photonMatch.matched = "prunedGenParticles"
296  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
297  process.tauMatch.matched = "prunedGenParticles"
298  process.tauGenJets.GenParticles = "prunedGenParticles"
299 
302  process.patJetPartons.particles = "prunedGenParticles"
303  process.patJetPartonMatch.matched = "prunedGenParticles"
304  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
305  process.patJetGenJetMatch.matched = "slimmedGenJets"
306  process.patJetGenJetMatchAK8.matched = "slimmedGenJetsAK8"
307  process.patJetGenJetMatchAK8Puppi.matched = "slimmedGenJetsAK8"
308  process.patMuons.embedGenMatch = False
309  process.patElectrons.embedGenMatch = False
310  process.patPhotons.embedGenMatch = False
311  process.patTaus.embedGenMatch = False
312  process.patTausBoosted.embedGenMatch = False
313  process.patJets.embedGenPartonMatch = False
314  #also jet flavour must be switched
315  process.patJetFlavourAssociation.rParam = 0.4
316 
317  process.schedule.insert(0,process.merge_step)
318  process = customisoptions(process)
319  return modify_outputModules(process, [keepMerged(dataTier)])
320 
321 
def customiseKeepPrunedGenParticles(process, reselect=False)
Definition: customisers.py:264
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:256
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67

◆ customiseLHE()

def customisers.customiseLHE (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 196 of file customisers.py.

References customisoptions(), keepCleaned(), keepLHE(), keepSelected(), and modify_outputModules().

Referenced by customiseLHEandCleaning().

196 def customiseLHE(process, changeProcessname=True,reselect=False):
197  if reselect:
198  dataTier="RESELECT"
199  else:
200  dataTier="SELECT"
201  if changeProcessname:
202  process._Process__name = "LHEembedding"
203  process.load('TauAnalysis.MCEmbeddingTools.EmbeddingLHEProducer_cfi')
204  if reselect:
205  process.externalLHEProducer.vertices=cms.InputTag("offlineSlimmedPrimaryVertices","","RESELECT")
206  process.lheproduction = cms.Path(process.makeexternalLHEProducer)
207  process.schedule.insert(0,process.lheproduction)
208 
209 
210  process = customisoptions(process)
211  return modify_outputModules(process,[keepSelected(dataTier),keepCleaned(), keepLHE()],["MINIAODoutput"])
212 
213 
def keepCleaned()
Customizer for cleaining ###########################.
Definition: customisers.py:126
def keepLHE()
Customizer for simulaton ###########################.
Definition: customisers.py:173
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67
def customiseLHE(process, changeProcessname=True, reselect=False)
Definition: customisers.py:196
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:81

◆ customiseLHEandCleaning()

def customisers.customiseLHEandCleaning (   process,
  reselect = False 
)

cross Customizers ###########################

Definition at line 429 of file customisers.py.

References customiseCleaning(), and customiseLHE().

Referenced by customiseLHEandCleaning_Reselect().

429 def customiseLHEandCleaning(process,reselect=False):
430  process._Process__name = "LHEembeddingCLEAN"
431  process = customiseCleaning(process,changeProcessname=False,reselect=reselect)
432  process = customiseLHE(process,changeProcessname=False,reselect=reselect)
433  return process
434 
def customiseLHEandCleaning(process, reselect=False)
cross Customizers ###########################
Definition: customisers.py:429
def customiseLHE(process, changeProcessname=True, reselect=False)
Definition: customisers.py:196
def customiseCleaning(process, changeProcessname=True, reselect=False)
Definition: customisers.py:142

◆ customiseLHEandCleaning_Reselect()

def customisers.customiseLHEandCleaning_Reselect (   process)

Definition at line 435 of file customisers.py.

References customiseLHEandCleaning().

436  return customiseLHEandCleaning(process,reselect=True)
437 
def customiseLHEandCleaning_Reselect(process)
Definition: customisers.py:435
def customiseLHEandCleaning(process, reselect=False)
cross Customizers ###########################
Definition: customisers.py:429

◆ customiseMCFilter()

def customisers.customiseMCFilter (   process)

Definition at line 464 of file customisers.py.

Referenced by customiseFilterTTbartoMuMu().

464 def customiseMCFilter(process):
465  process.schedule.insert(-1,process.MCFilter)
466  outputModulesList = [key for key,value in process.outputModules.items()]
467  for outputModule in outputModulesList:
468  outputModule = getattr(process, outputModule)
469  outputModule.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring("MCFilter"))
470  return process
471 
def customiseMCFilter(process)
Definition: customisers.py:464

◆ customiseMerging()

def customisers.customiseMerging (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 322 of file customisers.py.

References customisoptions(), keepMerged(), modify_outputModules(), and print().

Referenced by customiseMerging_Reselect().

322 def customiseMerging(process, changeProcessname=True,reselect=False):
323  if changeProcessname:
324  process._Process__name = "MERGE"
325  if reselect:
326  dataTier="RESELECT"
327  else:
328  dataTier="SELECT"
329 
330 
331  process.source.inputCommands = cms.untracked.vstring()
332  process.source.inputCommands.append("keep *_*_*_*")
333 
334  #process.source.inputCommands.append("drop *_*_*_SELECT")
335  #process.source.inputCommands.append("drop *_*_*_SIMembedding")
336  #process.source.inputCommands.append("drop *_*_*_LHEembeddingCLEAN")
337  #process.source.inputCommands.extend(keepSimulated())
338  #process.source.inputCommands.extend(keepCleaned())
339 
340  process.load('Configuration.StandardSequences.Reconstruction_Data_cff')
341  process.merge_step = cms.Path()
342 
343 
344  for akt_manimod in to_bemanipulate:
345  if "MERGE" in akt_manimod.steps:
346  #if akt_manimod.module_name != 'particleFlowTmp':
347  # continue
348  print(akt_manimod.module_name)
349  mergCollections_in = cms.VInputTag()
350  for instance in akt_manimod.instance:
351  mergCollections_in.append(cms.InputTag(akt_manimod.merge_prefix+akt_manimod.module_name,instance,"SIMembedding"))
352  mergCollections_in.append(cms.InputTag(akt_manimod.merge_prefix+akt_manimod.module_name,instance,"LHEembeddingCLEAN"))
353  setattr(process, akt_manimod.module_name, cms.EDProducer(akt_manimod.merger_name,
354  mergCollections = mergCollections_in
355  )
356  )
357  process.merge_step +=getattr(process, akt_manimod.module_name)
358 
359 
360  process.merge_step += process.doAlldEdXEstimators
361  process.merge_step += process.vertexreco
362  process.unsortedOfflinePrimaryVertices.beamSpotLabel = cms.InputTag("offlineBeamSpot","",dataTier)
363  process.ak4CaloJetsForTrk.srcPVs = cms.InputTag("firstStepPrimaryVertices","",dataTier)
364 
365  process.muons.FillDetectorBasedIsolation = cms.bool(False)
366  process.muons.FillSelectorMaps = cms.bool(False)
367  process.muons.FillShoweringInfo = cms.bool(False)
368  process.muons.FillCosmicsIdMap = cms.bool(False)
369 
370  process.muonsFromCosmics.fillShowerDigis = cms.bool(False)
371  process.muonsFromCosmics1Leg.fillShowerDigis = cms.bool(False)
372 
373  process.merge_step += process.highlevelreco
374 
375  #process.merge_step.remove(process.reducedEcalRecHitsEE)
376  #process.merge_step.remove(process.reducedEcalRecHitsEB)
377 
378  process.merge_step.remove(process.ak4JetTracksAssociatorExplicit)
379 
380  process.merge_step.remove(process.pfTrack)
381  process.merge_step.remove(process.pfConversions)
382  process.merge_step.remove(process.pfV0)
383  process.merge_step.remove(process.particleFlowDisplacedVertexCandidate)
384  process.merge_step.remove(process.particleFlowDisplacedVertex)
385  process.merge_step.remove(process.pfDisplacedTrackerVertex)
386  process.merge_step.remove(process.pfTrackElec)
387  process.merge_step.remove(process.electronsWithPresel)
388  process.merge_step.remove(process.mvaElectrons)
389  process.merge_step.remove(process.particleFlowBlock)
390  process.merge_step.remove(process.particleFlowEGamma)
391  process.merge_step.remove(process.gedGsfElectronCores)
392  # process.merge_step.remove(process.gedGsfElectronsTmp)
393  process.merge_step.remove(process.gedPhotonCore)
394  process.merge_step.remove(process.ecalDrivenGsfElectronCores)
395  process.merge_step.remove(process.ecalDrivenGsfElectrons)
396  process.merge_step.remove(process.uncleanedOnlyElectronSeeds)
397  process.merge_step.remove(process.uncleanedOnlyAllConversions)
398  process.merge_step.remove(process.uncleanedOnlyPfTrack)
399  process.merge_step.remove(process.uncleanedOnlyPfTrackElec)
400  process.merge_step.remove(process.uncleanedOnlyGsfElectrons)
401  process.merge_step.remove(process.uncleanedOnlyElectronCkfTrackCandidates)
402  process.merge_step.remove(process.cosmicsVeto)
403  process.merge_step.remove(process.cosmicsVetoTrackCandidates)
404  # process.merge_step.remove(process.ecalDrivenGsfElectronCores)
405  # process.merge_step.remove(process.ecalDrivenGsfElectrons)
406  # process.merge_step.remove(process.gedPhotonsTmp)
407  # process.merge_step.remove(process.particleFlowTmp)
408  process.merge_step.remove(process.hcalnoise)
409  process.merge_step.remove(process.lowPtGsfElectronTask)
410  process.merge_step.remove(process.gsfTracksOpenConversions)
411 
412  process.load('CommonTools.ParticleFlow.genForPF2PAT_cff')
413 
414  process.merge_step += process.genForPF2PATSequence
415 
416  process.slimmingTask.remove(process.slimmedLowPtElectronsTask)
417 
418  process.schedule.insert(0,process.merge_step)
419  # process.load('PhysicsTools.PatAlgos.slimming.slimmedGenJets_cfi')
420 
421  process = customisoptions(process)
422  return modify_outputModules(process, [keepMerged(dataTier)])
423 
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:256
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def customiseMerging(process, changeProcessname=True, reselect=False)
Definition: customisers.py:322
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67

◆ customiseMerging_Reselect()

def customisers.customiseMerging_Reselect (   process,
  changeProcessname = True 
)

Definition at line 424 of file customisers.py.

References customiseMerging().

424 def customiseMerging_Reselect(process, changeProcessname=True):
425  return customiseMerging(process, changeProcessname=changeProcessname, reselect=True)
426 
def customiseMerging(process, changeProcessname=True, reselect=False)
Definition: customisers.py:322
def customiseMerging_Reselect(process, changeProcessname=True)
Definition: customisers.py:424

◆ customiseSelecting()

def customisers.customiseSelecting (   process,
  reselect = False 
)

Definition at line 96 of file customisers.py.

References customisoptions(), keepSelected(), and modify_outputModules().

Referenced by customiseSelecting_Reselect().

96 def customiseSelecting(process,reselect=False):
97  if reselect:
98  process._Process__name = "RESELECT"
99  dataTier="RESELECT"
100  else:
101  process._Process__name = "SELECT"
102  dataTier="SELECT"
103 
104  process.load('TauAnalysis.MCEmbeddingTools.SelectingProcedure_cff')
105  # don't rekey TrackExtra refs because the full original collections are anyways stored
106  process.slimmedMuons.trackExtraAssocs = []
107  process.patMuonsAfterKinCuts.src = cms.InputTag("slimmedMuons","",dataTier)
108  process.patMuonsAfterID = process.patMuonsAfterLooseID.clone()
109 
110  process.selecting = cms.Path(process.makePatMuonsZmumuSelection)
111  process.schedule.insert(-1, process.selecting)
112 
113  outputModulesList = [key for key,value in process.outputModules.items()]
114  for outputModule in outputModulesList:
115  outputModule = getattr(process, outputModule)
116  outputModule.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring("selecting"))
117  outputModule.outputCommands.extend(keepSelected(dataTier))
118 
119  process = customisoptions(process)
120  return modify_outputModules(process,[keepSelected(dataTier)])
121 
def customiseSelecting(process, reselect=False)
Definition: customisers.py:96
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:81

◆ customiseSelecting_Reselect()

def customisers.customiseSelecting_Reselect (   process)

Definition at line 122 of file customisers.py.

References customiseSelecting().

122 def customiseSelecting_Reselect(process):
123  return customiseSelecting(process,reselect=True)
124 
def customiseSelecting(process, reselect=False)
Definition: customisers.py:96
def customiseSelecting_Reselect(process)
Definition: customisers.py:122

◆ customisoptions()

def customisers.customisoptions (   process)

additionla Customizer ###########################

Definition at line 440 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator(), customiseKeepPrunedGenParticles(), customiseLHE(), customiseMerging(), and customiseSelecting().

440 def customisoptions(process):
441  if not hasattr(process, "options"):
442  process.options = cms.untracked.PSet()
443  process.options.emptyRunLumiMode = cms.untracked.string('doNotHandleEmptyRunsAndLumis')
444  if not hasattr(process, "bunchSpacingProducer"):
445  process.load('RecoLuminosity.LumiProducer.bunchSpacingProducer_cfi')
446  process.bunchSpacingProducer = process.bunchSpacingProducer.clone(overrideBunchSpacing = True)
447  process.options.numberOfThreads = cms.untracked.uint32(1)
448  process.options.numberOfStreams = cms.untracked.uint32(0)
449  return process
450 
def customisoptions(process)
additionla Customizer ###########################
Definition: customisers.py:440

◆ fix_input_tags()

def customisers.fix_input_tags (   process,
  formodules = ["generalTracks",
  cscSegments,
  dt4DSegments,
  rpcRecHits 
)

Definition at line 472 of file customisers.py.

References print().

472 def fix_input_tags(process, formodules = ["generalTracks","cscSegments","dt4DSegments","rpcRecHits"]):
473  def change_tags_process(test_input):
474  if isinstance(test_input, cms.InputTag):
475  if test_input.getModuleLabel() in formodules:
476  test_input.setProcessName(process._Process__name)
477 
478  def search_for_tags(pset):
479  if isinstance(pset, dict):
480  for key in pset:
481  if isinstance(pset[key], cms.VInputTag):
482  for akt_inputTag in pset[key]:
483  change_tags_process(akt_inputTag)
484  elif isinstance(pset[key], cms.PSet):
485  search_for_tags(pset[key].__dict__)
486  elif isinstance(pset[key], cms.VPSet):
487  for akt_pset in pset[key]:
488  search_for_tags(akt_pset.__dict__)
489  else:
490  change_tags_process(pset[key])
491  else:
492  print("must be python dict not a ",type(pset))
493 
494  for module in process.producers_():
495  search_for_tags(getattr(process, module).__dict__)
496  for module in process.filters_():
497  search_for_tags(getattr(process, module).__dict__)
498  for module in process.analyzers_():
499  search_for_tags(getattr(process, module).__dict__)
500 
501  return process
502 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def fix_input_tags(process, formodules=["generalTracks", cscSegments, dt4DSegments, rpcRecHits)
Definition: customisers.py:472

◆ keepCleaned()

def customisers.keepCleaned ( )

Customizer for cleaining ###########################.

Definition at line 126 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator(), and customiseLHE().

126 def keepCleaned():
127  ret_vstring = cms.untracked.vstring(
128 # "drop *_*_*_LHEembeddingCLEAN",
129 # "drop *_*_*_CLEAN"
130  )
131 
132  for akt_manimod in to_bemanipulate:
133  if "MERGE" in akt_manimod.steps:
134  ret_vstring.append("keep *_"+akt_manimod.module_name+"_*_LHEembeddingCLEAN")
135  ret_vstring.append("keep *_"+akt_manimod.module_name+"_*_CLEAN")
136  ret_vstring.append("keep *_standAloneMuons_*_LHEembeddingCLEAN")
137  ret_vstring.append("keep *_glbTrackQual_*_LHEembeddingCLEAN")
138  return ret_vstring
139 
140 
141 
def keepCleaned()
Customizer for cleaining ###########################.
Definition: customisers.py:126

◆ keepLHE()

def customisers.keepLHE ( )

Customizer for simulaton ###########################.

Definition at line 173 of file customisers.py.

Referenced by customiseLHE().

173 def keepLHE():
174  ret_vstring = cms.untracked.vstring()
175  ret_vstring.append("keep *_externalLHEProducer_*_LHEembedding")
176  ret_vstring.append("keep *_externalLHEProducer_*_LHEembeddingCLEAN")
177  return ret_vstring
178 
179 
def keepLHE()
Customizer for simulaton ###########################.
Definition: customisers.py:173

◆ keepMerged()

def customisers.keepMerged (   dataTier = "SELECT")

Customizer for merging ###########################.

Definition at line 256 of file customisers.py.

Referenced by customiseKeepPrunedGenParticles(), and customiseMerging().

256 def keepMerged(dataTier="SELECT"):
257  ret_vstring = cms.untracked.vstring()
258  ret_vstring.append("drop *_*_*_"+dataTier)
259  ret_vstring.append("keep *_prunedGenParticles_*_MERGE")
260  ret_vstring.append("keep *_generator_*_SIMembedding")
261  return ret_vstring
262 
263 
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:256

◆ keepSelected()

def customisers.keepSelected (   dataTier)

Customizer for Selecting ###########################.

Definition at line 81 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator(), customiseLHE(), and customiseSelecting().

81 def keepSelected(dataTier):
82  ret_vstring = cms.untracked.vstring(
83  # "drop *_*_*_"+dataTier,
84  "keep *_patMuonsAfterID_*_"+dataTier,
85  "keep *_slimmedMuons_*_"+dataTier,
86  "keep *_selectedMuonsForEmbedding_*_"+dataTier,
87  "keep recoVertexs_offlineSlimmedPrimaryVertices_*_"+dataTier,
88  "keep *_firstStepPrimaryVertices_*_"+dataTier,
89  "keep *_offlineBeamSpot_*_"+dataTier
90  )
91  for akt_manimod in to_bemanipulate:
92  if "CLEAN" in akt_manimod.steps:
93  ret_vstring.append("keep *_"+akt_manimod.module_name+"_*_"+dataTier)
94  return ret_vstring
95 
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:81

◆ keepSimulated()

def customisers.keepSimulated ( )

Definition at line 180 of file customisers.py.

Referenced by customiseGenerator().

180 def keepSimulated():
181  ret_vstring = cms.untracked.vstring()
182  for akt_manimod in to_bemanipulate:
183  if "MERGE" in akt_manimod.steps:
184  ret_vstring.append("keep *_"+akt_manimod.module_name+"_*_SIMembedding")
185  ret_vstring.append("keep *_genParticles_*_SIMembedding")
186  ret_vstring.append("keep *_standAloneMuons_*_SIMembedding")
187  ret_vstring.append("keep *_glbTrackQual_*_SIMembedding")
188  ret_vstring.append("keep *_generator_*_SIMembedding")
189  ret_vstring.append("keep *_addPileupInfo_*_SIMembedding")
190  ret_vstring.append("keep *_slimmedAddPileupInfo_*_*")
191  return ret_vstring
192 
193 
194 
195 
def keepSimulated()
Definition: customisers.py:180

◆ modify_outputModules()

def customisers.modify_outputModules (   process,
  keep_drop_list = [],
  module_veto_list = [] 
)

Definition at line 67 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator(), customiseKeepPrunedGenParticles(), customiseLHE(), customiseMerging(), and customiseSelecting().

67 def modify_outputModules(process, keep_drop_list = [], module_veto_list = [] ):
68  outputModulesList = [key for key,value in process.outputModules.items()]
69  for outputModule in outputModulesList:
70  if outputModule in module_veto_list:
71  continue
72  outputModule = getattr(process, outputModule)
73  for add_element in keep_drop_list:
74  outputModule.outputCommands.extend(add_element)
75  return process
76 
77 
78 
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:67

Variable Documentation

◆ instance

customisers.instance

Definition at line 45 of file customisers.py.

◆ manipulator_name

customisers.manipulator_name

Definition at line 38 of file customisers.py.

◆ module_name

customisers.module_name

Definition at line 38 of file customisers.py.

Referenced by FastTimerService::PlotsPerJob.book().

◆ steps

◆ to_bemanipulate

customisers.to_bemanipulate

Definition at line 35 of file customisers.py.