-
Notifications
You must be signed in to change notification settings - Fork 42
/
TreeProducerETau.py
96 lines (85 loc) · 4.71 KB
/
TreeProducerETau.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Author: Izaak Neutelings (June 2020)
# Sources:
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/HiggsToTauTauWorking2016#Synchronisation
# https://cms-nanoaod-integration.web.cern.ch/integration/master-102X/mc102X_doc.html
from TauFW.PicoProducer.analysis.TreeProducerTauPair import TreeProducerTauPair
class TreeProducerETau(TreeProducerTauPair):
"""Class to create and prepare a custom output file & tree."""
def __init__(self, filename, module, **kwargs):
print("Loading TreeProducerETau for %r"%(filename))
super(TreeProducerETau,self).__init__(filename,module,**kwargs)
################
# ELECTRON #
################
self.addBranch('pt_1', 'f')
self.addBranch('eta_1', 'f')
self.addBranch('phi_1', 'f')
self.addBranch('m_1', 'f')
self.addBranch('y_1', 'f')
self.addBranch('dxy_1', 'f')
self.addBranch('dz_1', 'f')
self.addBranch('q_1', 'i')
self.addBranch('iso_1', 'f', title="pfRelIso03_all")
self.addBranch('cutBased_1', '?')
###self.addBranch('mvaFall17Iso_1', 'f')
self.addBranch('mvaFall17Iso_WP80_1', '?')
self.addBranch('mvaFall17Iso_WP90_1', '?')
self.addBranch('mvaFall17noIso_WP80_1', '?')
self.addBranch('mvaFall17noIso_WP90_1', '?')
###########
# TAU #
###########
self.addBranch('pt_2', 'f')
self.addBranch('eta_2', 'f')
self.addBranch('phi_2', 'f')
self.addBranch('m_2', 'f')
self.addBranch('y_2', 'f')
self.addBranch('dxy_2', 'f')
self.addBranch('dz_2', 'f')
self.addBranch('q_2', 'i')
self.addBranch('dm_2', 'i')
self.addBranch('iso_2', 'f', title="rawIso")
self.addBranch('idiso_2', 'i', title="rawIso WPs")
self.addBranch('rawAntiEle_2', 'f')
self.addBranch('rawMVAoldDM2017v2_2', 'f')
self.addBranch('rawMVAnewDM2017v2_2', 'f')
self.addBranch('rawDeepTau2017v2p1VSe_2', 'f')
self.addBranch('rawDeepTau2017v2p1VSmu_2', 'f')
self.addBranch('rawDeepTau2017v2p1VSjet_2', 'f')
self.addBranch('rawDeepTau2018v2p5VSe_2', 'f')
self.addBranch('rawDeepTau2018v2p5VSmu_2', 'f')
self.addBranch('rawDeepTau2018v2p5VSjet_2', 'f')
self.addBranch('idAntiEle_2', 'i')
self.addBranch('idAntiMu_2', 'i')
self.addBranch('idDecayMode_2', '?', title="oldDecayModeFinding")
self.addBranch('idDecayModeNewDMs_2', '?', title="newDecayModeFinding")
self.addBranch('idMVAoldDM2017v2_2', 'i')
self.addBranch('idMVAnewDM2017v2_2', 'i')
self.addBranch('idDeepTau2017v2p1VSe_2', 'i')
self.addBranch('idDeepTau2017v2p1VSmu_2', 'i')
self.addBranch('idDeepTau2017v2p1VSjet_2', 'i')
self.addBranch('idDeepTau2018v2p5VSe_2', 'i')
self.addBranch('idDeepTau2018v2p5VSmu_2', 'i')
self.addBranch('idDeepTau2018v2p5VSjet_2', 'i')
self.addBranch('leadTkPtOverTauPt_2', 'f')
self.addBranch('chargedIso_2', 'f')
self.addBranch('neutralIso_2', 'f')
self.addBranch('photonsOutsideSignalCone_2', 'f')
self.addBranch('puCorr_2', 'f')
self.addBranch('jpt_match_2', 'f', -1, title="pt of jet matching tau")
if self.module.ismc:
self.addBranch('jpt_genmatch_2', 'f', -1, title="pt of gen jet matching tau")
self.addBranch('genmatch_1', 'i', -1)
self.addBranch('genmatch_2', 'i', -1)
self.addBranch('genvistaupt_2', 'f', -1)
self.addBranch('genvistaueta_2', 'f', -9)
self.addBranch('genvistauphi_2', 'f', -9)
self.addBranch('gendm_2', 'i', -1)
self.addBranch('idisoweight_1', 'f', 1., title="electron ID/iso efficiency SF")
self.addBranch('idweight_2', 'f', 1., title="tau ID efficiency SF")
self.addBranch('ltfweight_2', 'f', 1., title="lepton -> tau fake rate SF")
if self.module.dosys: # systematic variation (only for nominal tree)
self.addBranch('idweightUp_2', 'f', 1.)
self.addBranch('idweightDown_2', 'f', 1.)
self.addBranch('ltfweightUp_2', 'f', 1.)
self.addBranch('ltfweightDown_2', 'f', 1.)