CMS 3D CMS Logo

DQMSequences_cfi.py
Go to the documentation of this file.
4 
5 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
6 dqmInfoTauV = DQMEDAnalyzer(
7  "DQMEventInfo",
8  subSystemFolder = cms.untracked.string('RecoTauV')
9  )
10 
11 
12 produceDenoms = cms.Sequence(
13  produceDenominatorRealData+
14  produceDenominatorRealElectronsData+
15  produceDenominatorRealMuonsData
16  )
17 
18 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForALLQCDDataset'), hltPaths = cms.vstring('HLT_IsoMu24_eta2p1_v*') ) ) )
19 TauValNumeratorAndDenominatorRealData.visit(seqModifier)
20 
21 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForALLEleDataset'), hltPaths = cms.vstring('HLT_Ele20_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_SC4_Mass50_v*') ) ) )
22 TauValNumeratorAndDenominatorRealElectronsData.visit(seqModifier)
23 
24 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForALLMuDataset'), hltPaths = cms.vstring('HLT_IsoMu24_eta2p1_v*') ) ) )
25 TauValNumeratorAndDenominatorRealMuonsData.visit(seqModifier)
26 
27 pfTauRunDQMValidation = cms.Sequence(
28  TauValNumeratorAndDenominatorRealData+
29  TauValNumeratorAndDenominatorRealElectronsData+
30  TauValNumeratorAndDenominatorRealMuonsData+
31  dqmInfoTauV
32  )
33 
34 runTauEff = cms.Sequence(
35  efficienciesRealData+
36  efficienciesRealElectronsData+
37  efficienciesRealMuonsData+
38  normalizePlotsRealMuonsData
39  )
40 
41 #----------------------------------------------------------------------------------------------------------------------------------------
42 # Denominators according to dataset
43 #----------------------------------------------------------------------------------------------------------------------------------------
44 ## produceDenomsMu = cms.Sequence(
45 ## produceDenominatorRealData+
46 ## produceDenominatorRealMuonsData
47 ## )
48 produceDenomsSingleMu = cms.Sequence(
49  produceDenominatorRealData+
50  produceDenominatorRealMuonsData
51  )
52 produceDenomsJet = cms.Sequence(produceDenominatorRealData)
53 produceDenomsMultiJet = cms.Sequence(produceDenomsJet)
54 
55 produceDenomsDoubleElectron = cms.Sequence(produceDenominatorRealElectronsData)
56 produceDenomsTauPlusX = cms.Sequence(produceDenomsDoubleElectron)
57 
58 #----------------------------------------------------------------------------------------------------------------------------------------
59 # Main modules according to dataset
60 #----------------------------------------------------------------------------------------------------------------------------------------
61 proc.GeneralMuSequence = cms.Sequence( proc.TauValNumeratorAndDenominatorRealData * proc.TauValNumeratorAndDenominatorRealMuonsData )
62 
63 #Mu Dataset
64 ## procAttributes = dir(proc) #Takes a snapshot of what there in the process
65 ## helpers.cloneProcessingSnippet( proc, proc.GeneralMuSequence, 'AtMu') #clones the sequence inside the process with AtMu postfix
66 ## seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForMuDataset'), hltPaths = cms.vstring('HLT_IsoMu24_eta2p1_v*') ) ) )
67 ## proc.GeneralMuSequenceAtMu.visit(seqModifier)
68 ## #checks what's new in the process (the cloned sequences and modules in them)
69 ## newProcAttributes = filter( lambda x: (x not in procAttributes) and (x.find('AtMu') != -1), dir(proc) )
70 ## #spawns a local variable with the same name as the proc attribute, needed for future process.load
71 ## for newAttr in newProcAttributes:
72 ## locals()[newAttr] = getattr(proc,newAttr)
73 
74 ## pfTauRunDQMValidationMu = cms.Sequence(
75 ## TauValNumeratorAndDenominatorRealDataAtMu+
76 ## TauValNumeratorAndDenominatorRealMuonsDataAtMu+
77 ## dqmInfoTauV
78 ## )
79 
80 #SingleMu Dataset
81 procAttributes = dir(proc) #Takes a snapshot of what there in the process
82 helpers.cloneProcessingSnippet( proc, proc.GeneralMuSequence, 'AtSingleMu') #clones the sequence inside the process with AtSingleMu postfix
83 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForSingleMuDataset'), hltPaths = cms.vstring('HLT_IsoMu24_eta2p1_v*') ) ) )
84 proc.GeneralMuSequenceAtSingleMu.visit(seqModifier)
85 #checks what's new in the process (the cloned sequences and modules in them)
86 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('AtSingleMu') != -1)]
87 #spawns a local variable with the same name as the proc attribute, needed for future process.load
88 for newAttr in newProcAttributes:
89  locals()[newAttr] = getattr(proc,newAttr)
90 
91 pfTauRunDQMValidationSingleMu = cms.Sequence(
92  GeneralMuSequenceAtSingleMu+
93  dqmInfoTauV
94  )
95 
96 #Jet Dataset
97 procAttributes = dir(proc) #Takes a snapshot of what there in the process
98 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorRealData, 'AtJet') #clones the sequence inside the process with AtJet postfix
99 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForJetDataset'), hltPaths = cms.vstring('HLT_Jet30_L1FastJet_v*') ) ) )
100 proc.TauValNumeratorAndDenominatorRealDataAtJet.visit(seqModifier)
101 #checks what's new in the process (the cloned sequences and modules in them)
102 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('AtJet') != -1)]
103 #spawns a local variable with the same name as the proc attribute, needed for future process.load
104 for newAttr in newProcAttributes:
105  locals()[newAttr] = getattr(proc,newAttr)
106 
107 pfTauRunDQMValidationJet = cms.Sequence(
108  TauValNumeratorAndDenominatorRealDataAtJet+
109  dqmInfoTauV
110  )
111 
112 #MultiJet Dataset
113 procAttributes = dir(proc) #Takes a snapshot of what there in the process
114 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorRealData, 'AtMultiJet') #clones the sequence inside the process with AtMultiJet postfix
115 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForMultiJetDataset'), hltPaths = cms.vstring('OUR_HLT_FALLBACK_PATH') ) ) )
116 proc.TauValNumeratorAndDenominatorRealDataAtMultiJet.visit(seqModifier)
117 #checks what's new in the process (the cloned sequences and modules in them)
118 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('AtMultiJet') != -1)]
119 #spawns a local variable with the same name as the proc attribute, needed for future process.load
120 for newAttr in newProcAttributes:
121  locals()[newAttr] = getattr(proc,newAttr)
122 
123 pfTauRunDQMValidationMultiJet = cms.Sequence(
124  TauValNumeratorAndDenominatorRealDataAtMultiJet+
125  dqmInfoTauV
126  )
127 
128 #DoubleElectron Dataset
129 procAttributes = dir(proc) #Takes a snapshot of what there in the process
130 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorRealElectronsData, 'AtDoubleElectron') #clones the sequence inside the process with AtDoubleElectron postfix
131 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForDoubleElectronDataset'), hltPaths = cms.vstring('HLT_Ele20_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_SC4_Mass50_v*') ) ) )
132 proc.TauValNumeratorAndDenominatorRealElectronsDataAtDoubleElectron.visit(seqModifier)
133 #checks what's new in the process (the cloned sequences and modules in them)
134 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('AtDoubleElectron') != -1)]
135 #spawns a local variable with the same name as the proc attribute, needed for future process.load
136 for newAttr in newProcAttributes:
137  locals()[newAttr] = getattr(proc,newAttr)
138 
139 pfTauRunDQMValidationDoubleElectron = cms.Sequence(
140  TauValNumeratorAndDenominatorRealElectronsDataAtDoubleElectron+
141  dqmInfoTauV
142  )
143 
144 #TauPlusX Dataset
145 procAttributes = dir(proc) #Takes a snapshot of what there in the process
146 helpers.cloneProcessingSnippet( proc, proc.TauValNumeratorAndDenominatorRealElectronsData, 'TauPlusX') #clones the sequence inside the process with TauPlusX postfix
147 seqModifier = ApplyFunctionToSequence( lambda module: setTrigger( module, cms.PSet( hltDBKey = cms.string('TauTriggerForTauPlusXDataset'), hltPaths = cms.vstring('HLT_Ele20_CaloIdVT_CaloIsoRhoT_TrkIdT_TrkIsoT_LooseIsoPFTau20_v*') ) ) )
148 proc.TauValNumeratorAndDenominatorRealElectronsDataTauPlusX.visit(seqModifier)
149 #checks what's new in the process (the cloned sequences and modules in them)
150 newProcAttributes = [x for x in dir(proc) if (x not in procAttributes) and (x.find('TauPlusX') != -1)]
151 #spawns a local variable with the same name as the proc attribute, needed for future process.load
152 for newAttr in newProcAttributes:
153  locals()[newAttr] = getattr(proc,newAttr)
154 
155 pfTauRunDQMValidationTauPlusX = cms.Sequence(
156  TauValNumeratorAndDenominatorRealElectronsDataTauPlusX+
157  dqmInfoTauV
158  )
159 
160 #----------------------------------------------------------------------------------------------------------------------------------------
161 # Efficiencies production according to dataset
162 #----------------------------------------------------------------------------------------------------------------------------------------
163 ## runTauEffMu = cms.Sequence(
164 ## efficienciesRealMuonsData+
165 ## efficienciesRealData+
166 ## normalizePlotsRealMuonsData
167 ## )
168 runTauEffSingleMu = cms.Sequence(
169  efficienciesRealMuonsData+
170  efficienciesRealData+
171  normalizePlotsRealMuonsData
172  )
173 
174 runTauEffJet = cms.Sequence(TauEfficienciesRealData)
175 runTauEffMutiJet = cms.Sequence(runTauEffJet)
176 
177 runTauEffDoubleElectron = cms.Sequence(produceDenominatorRealElectronsData)
178 runTauEffTauPlusX = cms.Sequence(runTauEffDoubleElectron)
179 
180 ##Full sequences, including normalizations
181 ## TauEfficienciesRealData+
182 ## TauEfficienciesRealElectronsData+
183 ## TauEfficienciesRealMuonsData
184 
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False)
Definition: helpers.py:256
def setTrigger(module, pset)
dbl *** dir
Definition: mlp_gen.cc:35