CMS 3D CMS Logo

ModuleToSequenceAssign.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 from __future__ import print_function
3 import FWCore.ParameterSet.Config as cms
5 
6 
7 process = cms.Process("SIZE");
8 process.load("Configuration.StandardSequences.RawToDigi_cff")
9 process.load("Configuration.StandardSequences.Reconstruction_cff")
10 process.load("Configuration.EventContent.EventContent_cff")
11 
12 
13 
14 #define pretty grouping (could be moved in a cff in the release)
15 process.PFlow = cms.Sequence(process.particleFlowCluster+process.particleFlowReco)
16 process.JetMet = cms.Sequence(process.recoJets+process.recoPFMET+process.recoPFJets+process.metrecoPlusHCALNoise+process.recoJetAssociations)
17 process.TkLocal = cms.Sequence(process.trackerlocalreco)
18 process.MuLocal = cms.Sequence(process.muonlocalreco)
19 process.CaloLocal = cms.Sequence(process.calolocalreco+process.caloTowersRec)
20 process.Ecal = cms.Sequence(process.ecalClusters+process.reducedRecHitsSequence)
21 process.Tracking = cms.Sequence(process.ckftracks)
22 process.BTagVtx = cms.Sequence(process.recopixelvertexing+process.vertexreco+process.btagging+process.offlineBeamSpot)
23 process.Muon = cms.Sequence(process.muonrecoComplete)
24 process.EGamma = cms.Sequence(process.egammarecoFull+process.electronGsfTracking)
25 process.Tau = cms.Sequence(process.tautagging+process.PFTau)
26 names = ["RawToDigi","TkLocal","MuLocal","CaloLocal","Ecal","Tracking","JetMet","BTagVtx","Muon","EGamma","Tau","PFlow"]
27 
29  #assign modules to pretty grouping
30  sequenceWithModules = { }
31  sequenceWithModulesString = { }
32  for name in names:
33  sequenceWithModules[name] = []
34  getModulesFromSequence(process.sequences[name],sequenceWithModules[name])
35  #also create the flat string based version instead of full config one
36  sequenceWithModulesString[name] = []
37  for module in sequenceWithModules[name]:
38  sequenceWithModulesString[name].append(module.label())
39  return (sequenceWithModules, sequenceWithModulesString)
40 
41 if __name__ == "__main__":
42  #print
43  (sequenceWithModules, sequenceWithModulesString) = assignModulesToSeqs()
44  for seq, mods in sequenceWithModules.items():
45  #for seq, mods in sequenceWithModulesString.items():
46  print("sequence: %s" % (seq))
47  for module in mods:
48  print(" module: %s" % (module))
49 
50 
51 
52 
53 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def getModulesFromSequence(sequence, list)
Definition: usedOutput.py:7