4 from AnaAlgorithm.AnaAlgSequence
import AnaAlgSequence
5 from AnaAlgorithm.DualUseConfig
import createAlgorithm, addPrivateTool
11 setMuonJetEMScale = True,
12 electronsSelection = "",
14 photonsSelection = "",
16 """Create a met analysis algorithm sequence
18 After creating the sequence object, it needs to be configured with a call
21 metSequence.configure( inputName = {
22 'jets' : 'AntiKt4EMPFlowJets_%SYS%',
23 'electrons' : 'AnalysisElectrons_%SYS%',
24 'photons' : 'AnalysisPhotons_%SYS%',
25 'muons' : 'AnalysisMuons_%SYS%',
26 'taus' : 'AnalysisTaus_%STS%',
28 outputName = 'AnalysisMET_%SYS%' )
30 Note that defining a jet container is mandatory, but all other input
31 containers are optional.
33 Selections on each container can also be defined
36 dataType -- The data type to run on ("data", "mc" or "afii")
37 metSuffix -- Suffix for the (core) MET objects to use from the input
39 useFJVT -- Use FJVT decision for the calculation
40 treatPUJets -- Treat pile-up jets in the MET significance calculation
43 if dataType
not in [
"data",
"mc",
"afii"] :
44 raise ValueError (
"invalid data type: " + dataType)
46 if not useFJVT
and treatPUJets:
47 raise ValueError (
"MET significance pile-up treatment requires fJVT")
50 btIndex = metSuffix.find(
'_BTagging')
52 metSuffix = metSuffix[:btIndex]
55 seq = AnaAlgSequence(
"MetAnalysisSequence" + postfix )
61 alg.makerTool.DoPFlow =
'PFlow' in metSuffix
or metSuffix==
"AnalysisMET"
62 alg.makerTool.DoSetMuonJetEMScale = setMuonJetEMScale
65 alg.makerTool.JetRejectionDec =
'passFJVT'
66 if dataType !=
"data" :
67 addPrivateTool( alg,
'systematicsTool',
'met::METSystematicsTool' )
68 alg.metCore =
'MET_Core_' + metSuffix
69 alg.metAssociation =
'METAssoc_' + metSuffix
70 alg.electronsSelection = electronsSelection
71 alg.muonsSelection = muonsSelection
72 alg.photonsSelection = photonsSelection
73 alg.tausSelection = tausSelection
75 inputPropName = {
'jets' :
'jets',
76 'electrons' :
'electrons',
77 'photons' :
'photons',
80 'invisible' :
'invisible'},
81 outputPropName =
'met' )
85 seq.append( alg, inputPropName =
'met' )
88 alg =
createAlgorithm(
'CP::MetSignificanceAlg',
'MetSignificanceAlg' + postfix )
90 alg.significanceTool.SoftTermParam = 0
91 alg.significanceTool.TreatPUJets = treatPUJets
92 alg.significanceTool.IsAFII = dataType ==
"afii"
93 seq.append( alg, inputPropName =
'met' )