File size: 16,526 Bytes
cfcbbc8 |
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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
Your task is to write a Python script that reads one of the ROOT files in '{BASE_DIR}/logs/file_list.txt' using uproot and stores the following observables in a NumPy array. The NumPy array should be named as either '{BASE_DIR}/arrays/data_A_raw.npy' or '{BASE_DIR}/arrays/signal_WH_raw.npy' Use "data_A.GamGam.root" for conversion to 'data_A_raw.npy' while "mc_345318.WpH125J_Wincl_gamgam.GamGam.root" for 'signal_WH_raw.npy'. You may use the ROOT file summary included below to see how the trees and branches in the ROOT file are labeled. It is very important to use the correct tree and branch names, so you should tell the worker agent exactly which trees and branches to extract. Note that some branches (for example, photon, lepton, and jet observables) will be arrays containing the corresponding observables for each particle, ordered from highest pT to lowest pT. Do NOT allow the worker to loop over all events; that will be very slow, and it is much better to read entire branches at a time.
For each event, you should save
- pT, eta, phi of each of the two photons.
- pT, eta, phi of the two highest-pT leptons in the event.
- pT, eta, phi of the six highest-pT jets in the event.
- ET and phi of the MET.
- MC weight.
- Flag for each photon indicating whether tight indentification(ID) requirements.
- Cross section.
- Sum of weights.
- Scale factors for photon, electron,muon, btagging, pileup, electron trigger, photon trigger.
Fill indices 44 and 45 with NaN values to serve as placeholders for the diphoton invariant mass and transverse momentum, which will be computed later.
The indices should be as follows (note that these names may not correspond to the branch names in the ROOT files):
0: photon 1 pT
1: photon 1 eta
2: photon 1 phi
3: photon 2 pT
4: photon 2 eta
5: photon 2 phi
6: lepton 1 pT
7: lepton 1 eta
8: lepton 1 phi
9: lepton 2 pT
10: lepton 2 eta
11: lepton 2 phi
12: jet 1 pT
13: jet 1 eta
14: jet 1 phi
15: jet 2 pT
16: jet 2 eta
17: jet 2 phi
18: jet 3 pT
19: jet 3 eta
20: jet 3 phi
21: jet 4 pT
22: jet 4 eta
23: jet 4 phi
24: jet 5 pT
25: jet 5 eta
26: jet 5 phi
27: jet 6 pT
28: jet 6 eta
29: jet 6 phi
30: met ET
31: met phi
32: MC weight
33: sum of weights
34: cross section
35: photon 1 tight ID?
36: photon 2 tight ID?
37: scaleFactor_PILEUP
38: scaleFactor_PHOTON
39: scaleFactor_PhotonTRIGGER
40: scaleFactor_ELE
41: scaleFactor_MUON
42: scaleFactor_LepTRIGGER
43: scaleFactor_BTAG
44: NaN values
45: NaN values
ROOT file summary
================================================================================
ROOT FILES ANALYSIS SUMMARY
================================================================================
COMMON BRANCHES ACROSS ALL FILES
========================================
Tree: mini;1
Common branches (81):
SumWeights, XSection, channelNumber, ditau_m, eventNumber, jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched, largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched, lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0, mcWeight, met_et, met_et_syst, met_phi, photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched, runNumber, scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU, tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched, trigE, trigM, trigP
================================================================================
File 1: data_A.GamGam.root
--------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 430344
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 2: data_B.GamGam.root
--------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 1528717
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 3: data_C.GamGam.root
--------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 2237187
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 4: data_D.GamGam.root
--------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 3602176
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 5: mc_341081.ttH125_gamgam.GamGam.root
-------------------------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 576491
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 6: mc_343981.ggH125_gamgam.GamGam.root
-------------------------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 1054711
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 7: mc_345041.VBFH125_gamgam.GamGam.root
--------------------------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 497468
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 8: mc_345318.WpH125J_Wincl_gamgam.GamGam.root
--------------------------------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 113765
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
File 9: mc_345319.ZH125J_Zincl_gamgam.GamGam.root
-------------------------------------------------
Total objects: 1
Trees found: 1
Tree: mini;1
Entries: 230900
Branches (81):
ditau: ditau_m
jet: jet_E, jet_MV2c10, jet_eta, jet_jvt, jet_n, jet_phi, jet_pt, jet_pt_syst, jet_trueflav, jet_truthMatched
largeRjet: largeRjet_D2, largeRjet_E, largeRjet_eta, largeRjet_m, largeRjet_n, largeRjet_phi, largeRjet_pt, largeRjet_pt_syst, largeRjet_tau32, largeRjet_truthMatched
lep: lep_E, lep_charge, lep_eta, lep_etcone20, lep_isTightID, lep_n, lep_phi, lep_pt, lep_pt_syst, lep_ptcone30, lep_trackd0pvunbiased, lep_tracksigd0pvunbiased, lep_trigMatched, lep_truthMatched, lep_type, lep_z0
met: met_et, met_et_syst, met_phi
other: SumWeights, XSection, channelNumber, eventNumber, mcWeight, runNumber, trigE, trigM, trigP
photon: photon_E, photon_convType, photon_eta, photon_etcone20, photon_isTightID, photon_n, photon_phi, photon_pt, photon_pt_syst, photon_ptcone30, photon_trigMatched, photon_truthMatched
scaleFactor: scaleFactor_BTAG, scaleFactor_ELE, scaleFactor_LepTRIGGER, scaleFactor_MUON, scaleFactor_PHOTON, scaleFactor_PILEUP, scaleFactor_PhotonTRIGGER, scaleFactor_TAU
tau: tau_BDTid, tau_E, tau_charge, tau_eta, tau_isTightID, tau_n, tau_nTracks, tau_phi, tau_pt, tau_pt_syst, tau_trigMatched, tau_truthMatched
==================================================
|