CMS 3D CMS Logo

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