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