ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
D3PDMakerTest
python
difftuple_text.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
#
4
# File: D3PDMakerTest/python/difftuple_text.py
5
# Author: snyder@bnl.gov
6
# Date: Oct, 2010
7
# Purpose: Diff a root tuple file against a text dump.
8
#
9
10
import
operator
11
import
os
12
import
types
13
import
re
14
import
string
15
import
fnmatch
16
import
ROOT
17
from
functools
import
reduce
18
from
D3PDMakerTest.split_list
import
split_list, split_list1
19
20
ignore_event_differences =
False
21
22
23
# NEW:OLD
24
renames = {
25
}
26
27
rename_keys = {
28
# Hack for ordering difference when scell tuple is on.
29
'caloMeta/EventInfoD3PDObject_000005'
:
'caloMeta/EventInfoD3PDObject_000004'
,
30
'physicsMeta/EventInfoD3PDObject_000003'
:
'physicsMeta/EventInfoD3PDObject_000002'
,
31
'physicsTrigDecMeta/EventInfoD3PDObject_000004'
:
'physicsTrigDecMeta/EventInfoD3PDObject_000003'
,
32
}
33
34
def
atlasProduction
(ver):
35
return
(ver
and
36
(ver.find(
'17.2'
)>=0
or
37
ver.find(
'17.3'
)>=0)
and
38
#ver.find('AtlasProduction')>=0 and
39
ver.find(
'AtlasPhysics'
)==-1
and
40
ver.find(
'usatlas+u/snyder'
)==-1)
41
42
43
# List of branches to ignore for various versions.
44
# Format is a list of tuples: (V, V, V, [BRANCHES...])
45
# We consider the strings V in turn and see if they're contained
46
# in CMTPATH. If the first V is `-', then we ignore the branches
47
# if there are any matches. Otherwise, we ignore the branches
48
# unless there are any matches.
49
# If V is callable, then instead of looking for at match in CMTPATH,
50
# we call it with CMTPATH as an argument.
51
# The list of branches can include glob patterns.
52
_ignore_branches = [
53
# temp
54
(
'17.2'
,
55
[
'EF_*'
,
56
'L1_*'
,
57
'L2_*'
,
58
'trig_roidescriptor_*'
,
59
'trig_bgCode'
,
60
'trig_L1_esum_*'
,
61
'trig_L2_sitrack_*'
,
62
'trig_L2_idscan_*'
,
63
'trig_L2_tilemufeature_*'
,
64
'trig_L2_muonfeature_*'
,
65
'trig_L2_muonfeaturedetails_*'
,
66
'trig_L2_isomuonfeature_*'
,
67
'trig_L2_combmuonfeature_*'
,
68
'trig_L2_tiletrackmufeature_*'
,
69
'trig_L2_sitrackfinder_*'
,
70
'trig_L2_el_*'
,
71
'trig_L2_ph_*'
,
72
'trig_L2_met_*'
,
73
'trig_L2_feb_met_*'
,
74
'trig_DB_*'
,
75
'trackjet_*'
,
76
'el*_EF_*'
,
77
'ph*_EF_*'
,
78
'mu*_EF*'
,
79
'el*_L1_*'
,
80
'ph*_L1_*'
,
81
'mu*_L1_*'
,
82
'el*_L2_*'
,
83
'ph*_L2_*'
,
84
'mu*_L2*'
,
85
'trig_EF_trigmuonefisolation_*'
,
86
#'trig_EF_trigmuonef_*',
87
'trig_EF_trigmugirl_*'
,
88
'trig_EF_met_*'
,
89
]),
90
91
# changed in devval
92
(
'17.2'
,
93
[
'*_BCH_CORR_CELL'
,
94
'*_BCH_CORR_DOTX'
,
95
'*_BCH_CORR_JET'
,
96
'*_BCH_CORR_JET_FORCELL'
,
97
'*_ENG_BAD_CELLS'
,
98
'*_N_BAD_CELLS'
,
99
'*_N_BAD_CELLS_CORR'
,
100
'*_BAD_CELLS_CORR_E'
,
101
'*_n90'
,
102
'*_isBadMedium'
,
103
'*_isBadTight'
,
104
'*_isBadLooseMinus'
,
105
'*_tgap3f'
,
106
'*_hecf'
,
107
'backgroundFlags'
,
108
'lumiFlags'
,
109
'el*_isEMLoose'
,
110
'trig_EF_el*_isEMLoose'
,
111
'el*_isEMMedium'
,
112
'trig_EF_el*_isEMMedium'
,
113
'el*_isEMTight'
,
114
'trig_EF_el*_isEMTight'
,
115
'el*_looseIso'
,
116
'trig_EF_el*_looseIso'
,
117
'el*_mediumIso'
,
118
'trig_EF_el*_mediumIso'
,
119
'el*_tightIso'
,
120
'trig_EF_el*_tightIso'
,
121
'el*_loosePP'
,
122
'trig_EF_el*_loosePP'
,
123
'el*_loosePPIso'
,
124
'trig_EF_el*_loosePPIso'
,
125
'el*_mediumPP'
,
126
'trig_EF_el*_mediumPP'
,
127
'el*_mediumPPIso'
,
128
'trig_EF_el*_mediumPPIso'
,
129
'el*_tightPP'
,
130
'trig_EF_el*_tightPP'
,
131
'el*_tightPPIso'
,
132
'trig_EF_el*_tightPPIso'
,
133
'el*_mediumWithoutTrack'
,
134
'trig_EF_el*_mediumWithoutTrack'
,
135
'el*_mediumIsoWithoutTrack'
,
136
'trig_EF_el*_mediumIsoWithoutTrack'
,
137
'el*_tightWithoutTrack'
,
138
'trig_EF_el*_tightWithoutTrack'
,
139
'el*_tightIsoWithoutTrack'
,
140
'trig_EF_el*_tightIsoWithoutTrack'
,
141
'el*_loose'
,
142
'trig_EF_el*_loose'
,
143
'el*_medium'
,
144
'trig_EF_el*_medium'
,
145
'el*_tight'
,
146
'trig_EF_el*_tight'
,
147
'el*_reta'
,
148
'el*_rphi'
,
149
'el*_hastrack'
,
150
'el*_convanglematch'
,
151
'el*_convtrackmatch'
,
152
'el*_etacorrmag'
,
153
'trig_EF_el*_etacorrmag'
,
154
'el*_deltaPhiFromLast'
,
155
'el*_deltaPhiRot'
,
156
'el*_trackd0_physics'
,
157
'trig_EF_el*_trackd0_physics'
,
158
'el*_etaSampling1'
,
159
'el*_hasconv'
,
160
'el*_convvtxx'
,
161
'el*_convvtxy'
,
162
'el*_convvtxz'
,
163
'el*_Rconv'
,
164
'el*_zconv'
,
165
'el*_convvtxchi2'
,
166
'el*_pt1conv'
,
167
'el*_convtrk1nBLHits'
,
168
'el*_convtrk1nPixHits'
,
169
'el*_convtrk1nSCTHits'
,
170
'el*_convtrk1nTRTHits'
,
171
'el*_pt2conv'
,
172
'el*_convtrk2nBLHits'
,
173
'el*_convtrk2nPixHits'
,
174
'el*_convtrk2nSCTHits'
,
175
'el*_convtrk2nTRTHits'
,
176
'el*_ptconv'
,
177
'el*_pzconv'
,
178
'el*_EtringnoisedR03sig2'
,
179
'el*_EtringnoisedR03sig3'
,
180
'el*_EtringnoisedR03sig4'
,
181
'trig_EF_el*_EtringnoisedR03sig2'
,
182
'trig_EF_el*_EtringnoisedR03sig3'
,
183
'trig_EF_el*_EtringnoisedR03sig4'
,
184
'el*_ptcone20_zpv05'
,
185
'el*_ptcone30_zpv05'
,
186
'el*_ptcone40_zpv05'
,
187
'el*_nucone20_zpv05'
,
188
'el*_nucone30_zpv05'
,
189
'el*_nucone40_zpv05'
,
190
'el*_originbkg'
,
191
'el*_typebkg'
,
192
'el*_isolationlikelihoodjets'
,
193
'el*_isolationlikelihoodhqelectrons'
,
194
'el*_electronweight'
,
195
'el*_electronbgweight'
,
196
'el*_softeweight'
,
197
'el*_softebgweight'
,
198
'el*_neuralnet'
,
199
'el*_Hmatrix'
,
200
'el*_Hmatrix5'
,
201
'el*_adaboost'
,
202
'el*_softeneuralnet'
,
203
'el*_ringernn'
,
204
'el*_refittedTrack_*'
,
205
'el*_nPixSharedHits'
,
206
'el*_nPixSplitHits'
,
207
'trig_EF_el*_nPixSplitHits'
,
208
'el*_nPixHoles'
,
209
'trig_EF_el*_nPixHoles'
,
210
'el*_nSCTSharedHits'
,
211
'el*_nSCTDoubleHoles'
,
212
'el*_nTRTHoles'
,
213
'trig_EF_el*_nTRTHoles'
,
214
'el*_nSCTHoles'
,
215
'trig_EF_el*_nSCTHoles'
,
216
'el*_nSCTDeadSensors'
,
217
'trig_EF_el*_nSCTDeadSensors'
,
218
'el*_nBLayerSplitHits'
,
219
'trig_EF_el*_nBLayerSplitHits'
,
220
'el*_nBLSharedHits'
,
221
'el*_nPixelDeadSensors'
,
222
'trig_EF_el*_nPixelDeadSensors'
,
223
'el*_nTRTXenonHits'
,
224
'trig_EF_el*_nTRTXenonHits'
,
225
'el*_vertx'
,
226
'el*_verty'
,
227
'el*_vertz'
,
228
'el*_vertweight'
,
229
'el*_LM'
,
230
'el*_ES0_real'
,
231
'el*_ES1_real'
,
232
'el*_ES2_real'
,
233
'el*_ES3_real'
,
234
'el*_EcellS0'
,
235
'el*_etacellS0'
,
236
'el*_topoEtcone60'
,
237
'el*_ED_Njets'
,
238
'el*_ED_median'
,
239
'el*_ED_sigma'
,
240
'el*_Etcone40_ED_corrected'
,
241
'el*_Etcone40_corrected'
,
242
'el*_topoEtcone20_corrected'
,
243
'el*_topoEtcone30_corrected'
,
244
'el*_topoEtcone40_corrected'
,
245
'el*_rawcl_*'
,
246
'el*_goodOQ'
,
247
'el*_isConv'
,
248
'el*_nConv'
,
249
'el*_convFlag'
,
250
'el*_isEM'
,
251
'trig_EF_el*_isEM'
,
252
'el*_TRTHighTHitsRatio'
,
253
'trig_EF_el*_TRTHighTHitsRatio'
,
254
'el*_TRTHighTOutliersRatio'
,
255
'trig_EF_el*_TRTHighTOutliersRatio'
,
256
'el*_expectHitInBLayer'
,
257
'trig_EF_el*_expectHitInBLayer'
,
258
'el*_likelihoodsPixeldEdx'
,
259
'trig_EF_el*_likelihoodsPixeldEdx'
,
260
'el*_massPixeldEdx'
,
261
'trig_EF_el*_massPixeldEdx'
,
262
'el*_nGoodHitsPixeldEdx'
,
263
'trig_EF_el*_nGoodHitsPixeldEdx'
,
264
'el*_pixeldEdx'
,
265
'trig_EF_el*_pixeldEdx'
,
266
'el*_nSiHits'
,
267
'trig_EF_el*_nSiHits'
,
268
'el*_nSingleTrackConv'
,
269
'el*_nDoubleTrackConv'
,
270
'el*_HPV_*'
,
271
'el*_CaloPointing_*'
,
272
'el*_truth_bremLoc'
,
273
'el*_truth_bremSi'
,
274
'el*_truth_sumbrem'
,
275
'el*_truth_charge'
,
276
'el*_truth_mothercharge'
,
277
'el*_truth_motherstatus'
,
278
'mcevt_event_number'
,
279
'mcevt_signal_process_id'
,
280
'mcevt_nparticle'
,
281
'mcevt_pileUpType'
,
282
'mc_n'
,
283
'mc_phi'
,
284
'mc_eta'
,
285
'mc_m'
,
286
'mc_pt'
,
287
'mc_barcode'
,
288
'mc_pdgId'
,
289
'mc_status'
,
290
'mc_charge'
,
291
'mc_child_index'
,
292
'mc_parent_index'
,
293
'mc_children'
,
294
'mc_parents'
,
295
'mc_vx_x'
,
296
'mc_vx_y'
,
297
'mc_vx_z'
,
298
'mc_vx_barcode'
,
299
'el*_truth_index'
,
300
'ph*_isEMLoose'
,
301
'trig_EF_ph*_isEMLoose'
,
302
'ph*_isEMMedium'
,
303
'trig_EF_ph*_isEMMedium'
,
304
'ph*_isEMTight'
,
305
'trig_EF_ph*_isEMTight'
,
306
'ph*_isEM'
,
307
'trig_EF_ph*_isEM'
,
308
'ph*_loose'
,
309
'trig_EF_ph*_loose'
,
310
'ph*_tight'
,
311
'trig_EF_ph*_tight'
,
312
'ph*_type'
,
313
'ph*_origin'
,
314
'ph*_truth_E'
,
315
'ph*_truth_matched'
,
316
'ph*_truth_pt'
,
317
'ph*_truth_eta'
,
318
'ph*_truth_phi'
,
319
'ph*_truth_barcode'
,
320
'ph*_truth_status'
,
321
'ph*_truth_motherbarcode'
,
322
'ph*_truth_mothertype'
,
323
'ph*_truth_mothercharge'
,
324
'ph*_truth_motherstatus'
,
325
'ph*_truth_index'
,
326
'ph*_truth_charge'
,
327
'ph*_deltaRRecPhoton'
,
328
'ph*_goodOQ'
,
329
'ph*_Etcone45'
,
330
'trig_EF_ph*_Etcone45'
,
331
'ph*_EtringnoisedR03sig2'
,
332
'ph*_EtringnoisedR03sig3'
,
333
'ph*_EtringnoisedR03sig4'
,
334
'ph*_ptcone20_zpv05'
,
335
'ph*_ptcone30_zpv05'
,
336
'ph*_ptcone40_zpv05'
,
337
'ph*_nucone20_zpv05'
,
338
'ph*_nucone30_zpv05'
,
339
'ph*_nucone40_zpv05'
,
340
'ph*_isolationlikelihoodjets'
,
341
'ph*_isolationlikelihoodhqelectrons'
,
342
'ph*_loglikelihood'
,
343
'ph*_photonweight'
,
344
'ph*_photonbgweight'
,
345
'ph*_neuralnet'
,
346
'ph*_Hmatrix'
,
347
'ph*_Hmatrix5'
,
348
'ph*_adaboost'
,
349
'ph*_ringernn'
,
350
'ph*_etas3'
,
351
'ph*_phis3'
,
352
'ph*_Es3'
,
353
'ph*_rawcl_*'
,
354
'ph*_rings_E'
,
355
'ph*_convMatchDeltaPhi1'
,
356
'ph*_convMatchDeltaPhi2'
,
357
'ph*_convMatchDeltaEta1'
,
358
'ph*_convMatchDeltaEta2'
,
359
'ph*_vx_px'
,
360
'ph*_vx_py'
,
361
'ph*_vx_pz'
,
362
'ph*_vx_m'
,
363
'ph*_vx_E'
,
364
'ph*_vx_sumPt'
,
365
'ph*_vx_convTrk_patternReco*'
,
366
'ph*_vx_convTrk_nSCTSharedHits'
,
367
'ph*_vx_convTrk_nBLSharedHits'
,
368
'ph*_vx_convTrk_nTRTDeadStraws'
,
369
'ph*_vx_convTrk_nPixelDeadSensors'
,
370
'ph*_vx_convTrk_nSCTDeadSensors'
,
371
'ph*_vx_convTrk_nPixHoles'
,
372
'ph*_vx_convTrk_nPixSplitHits'
,
373
'ph*_vx_convTrk_nPixSharedHits'
,
374
'ph*_vx_convTrk_nSCTDoubleHoles'
,
375
'ph*_vx_convTrk_nTRTXenonHits'
,
376
'ph*_vx_convTrk_nTRTHoles'
,
377
'ph*_vx_convTrk_nSCTHoles'
,
378
'ph*_vx_convTrk_nBLayerSplitHits'
,
379
'ph*_vx_convTrk_nCSCEtaHits'
,
380
'ph*_vx_convTrk_nCSCPhiHits'
,
381
'ph*_vx_convTrk_nCscEtaHoles'
,
382
'ph*_vx_convTrk_nCscPhiHoles'
,
383
'ph*_vx_convTrk_nTGCEtaHits'
,
384
'ph*_vx_convTrk_nTGCPhiHits'
,
385
'ph*_vx_convTrk_nTgcEtaHoles'
,
386
'ph*_vx_convTrk_nTgcPhiHoles'
,
387
'ph*_vx_convTrk_nRPCEtaHits'
,
388
'ph*_vx_convTrk_nRPCPhiHits'
,
389
'ph*_vx_convTrk_nRpcEtaHoles'
,
390
'ph*_vx_convTrk_nRpcPhiHoles'
,
391
'ph*_vx_convTrk_nMDTHits'
,
392
'ph*_vx_convTrk_nMdtHoles'
,
393
'ph*_vx_convTrk_nHits'
,
394
'ph*_vx_convTrk_nHoles'
,
395
'ph*_vx_convTrk_nSiHits'
,
396
'ph*_vx_convTrk_hitPattern'
,
397
'ph*_vx_convTrk_TRTHighTHitsRatio'
,
398
'ph*_vx_convTrk_TRTHighTOutliersRatio'
,
399
'ph*_vx_convTrk_weight'
,
400
'ph*_truth_isConv'
,
401
'ph*_truth_Rconv'
,
402
'ph*_truth_zconv'
,
403
'ph*_topoEtcone60'
,
404
'ph*_vx_Chi2'
,
405
'ph*_vx_Dcottheta'
,
406
'ph*_vx_Dphi'
,
407
'ph*_vx_Dist'
,
408
'ph*_vx_DR1R2'
,
409
'ph*_CaloPointing_eta'
,
410
'ph*_CaloPointing_sigma_eta'
,
411
'ph*_CaloPointing_zvertex'
,
412
'ph*_CaloPointing_sigma_zvertex'
,
413
'ph*_HPV_eta'
,
414
'ph*_HPV_sigma_eta'
,
415
'ph*_HPV_zvertex'
,
416
'ph*_HPV_sigma_zvertex'
,
417
'ph*_NN_passes'
,
418
'ph*_NN_discriminant'
,
419
'ph*_ES0_real'
,
420
'ph*_ES1_real'
,
421
'ph*_ES2_real'
,
422
'ph*_ES3_real'
,
423
'ph*_EcellS0'
,
424
'ph*_etacellS0'
,
425
'ph*_ED_median'
,
426
'ph*_ED_sigma'
,
427
'ph*_ED_Njets'
,
428
'ph*_Etcone40_ED_corrected'
,
429
'ph*_Etcone40_corrected'
,
430
'ph*_convIP'
,
431
'ph*_convIPRev'
,
432
'ph*_el_index'
,
433
'ph*_convanglematch'
,
434
'ph*_zvertex'
,
435
'ph*_errz'
,
436
'ph*_etap'
,
437
'ph*_depth'
,
438
'trig_EF_ph*_convanglematch'
,
439
'ph*_convtrackmatch'
,
440
'trig_EF_ph*_convtrackmatch'
,
441
'ph*_isRecovered'
,
442
'trig_EF_ph*_isRecovered'
,
443
'ph*_looseAR'
,
444
'trig_EF_ph*_looseAR'
,
445
'ph*_looseARIso'
,
446
'trig_EF_ph*_looseARIso'
,
447
'ph*_tightAR'
,
448
'trig_EF_ph*_tightAR'
,
449
'ph*_tightARIso'
,
450
'trig_EF_ph*_tightARIso'
,
451
'ph*_tightIso'
,
452
'trig_EF_ph*_tightIso'
,
453
'ph*_looseIso'
,
454
'trig_EF_ph*_looseIso'
,
455
'ph*_topoEtcone20_corrected'
,
456
'ph*_topoEtcone30_corrected'
,
457
'ph*_topoEtcone40_corrected'
,
458
'ph*_convFlag'
,
459
'el*_Unrefittedtrack_*'
,
460
'el_gxx_*'
,
461
'ef_el_*'
,
462
'elfilt_*'
,
463
'elfilt2_*'
,
464
'elfilt4_*'
,
465
'elfilt3_*'
,
466
'emu_*'
,
467
'cocl_m'
,
468
'cocl_raw_eta_*'
,
469
'cocl_raw_phi_*'
,
470
'cocl_eta_*'
,
471
'cocl_phi_*'
,
472
'cocl_E_em'
,
473
'cocl_E_had'
,
474
'cocl_etamax_*'
,
475
'mu*_energyLossErr'
,
476
'mu*_energyLossPar'
,
477
'mu*_etCore'
,
478
'mu*_caloMuonIdTag'
,
479
'mu*_caloLRLikelihood'
,
480
'mu*_muonType'
,
481
'mu*_bestMatch'
,
482
'mu*_isStandAloneMuon'
,
483
'mu*_isCombinedMuon'
,
484
'mu*_isLowPtReconstructedMuon'
,
485
'mu*_isSegmentTaggedMuon'
,
486
'mu*_isCaloMuonId'
,
487
'mu*_alsoFoundByLowPt'
,
488
'mu*_alsoFoundByCaloMuonId'
,
489
'mu*_isSiliconAssociatedForwardMuon'
,
490
'mu*_ie_*'
,
491
'mu*_ms_*'
,
492
'mu*_cov_d0_exPV'
,
493
'mu*_cov_phi_exPV'
,
494
'mu*_cov_qoverp_exPV'
,
495
'mu*_cov_theta_exPV'
,
496
'mu*_cov_z0_exPV'
,
497
'mu*_err_d0_exPV'
,
498
'mu*_err_phi_exPV'
,
499
'mu*_err_qoverp_exPV'
,
500
'mu*_err_theta_exPV'
,
501
'mu*_err_z0_exPV'
,
502
'mu*_nMDTBIHits'
,
503
'mu*_nMDTBMHits'
,
504
'mu*_nMDTBOHits'
,
505
'mu*_nMDTBEEHits'
,
506
'mu*_nMDTBIS78Hits'
,
507
'mu*_nMDTEIHits'
,
508
'mu*_nMDTEMHits'
,
509
'mu*_nMDTEOHits'
,
510
'mu*_nMDTEEHits'
,
511
'mu*_nRPCLayer1EtaHits'
,
512
'mu*_nRPCLayer2EtaHits'
,
513
'mu*_nRPCLayer3EtaHits'
,
514
'mu*_nRPCLayer1PhiHits'
,
515
'mu*_nRPCLayer2PhiHits'
,
516
'mu*_nRPCLayer3PhiHits'
,
517
'mu*_nTGCLayer1EtaHits'
,
518
'mu*_nTGCLayer2EtaHits'
,
519
'mu*_nTGCLayer3EtaHits'
,
520
'mu*_nTGCLayer4EtaHits'
,
521
'mu*_nTGCLayer1PhiHits'
,
522
'mu*_nTGCLayer2PhiHits'
,
523
'mu*_nTGCLayer3PhiHits'
,
524
'mu*_nTGCLayer4PhiHits'
,
525
'mu*_barrelSectors'
,
526
'mu*_endcapSectors'
,
527
'mu*_primarySector'
,
528
'mu*_secondarySector'
,
529
'mu*_innerSmallHits'
,
530
'mu*_innerLargeHits'
,
531
'mu*_middleSmallHits'
,
532
'mu*_middleLargeHits'
,
533
'mu*_outerSmallHits'
,
534
'mu*_outerLargeHits'
,
535
'mu*_extendedSmallHits'
,
536
'mu*_extendedLargeHits'
,
537
'mu*_innerSmallHoles'
,
538
'mu*_innerLargeHoles'
,
539
'mu*_middleSmallHoles'
,
540
'mu*_middleLargeHoles'
,
541
'mu*_outerSmallHoles'
,
542
'mu*_outerLargeHoles'
,
543
'mu*_extendedSmallHoles'
,
544
'mu*_extendedLargeHoles'
,
545
'mu*_phiLayer1Hits'
,
546
'mu*_phiLayer2Hits'
,
547
'mu*_phiLayer3Hits'
,
548
'mu*_phiLayer4Hits'
,
549
'mu*_etaLayer1Hits'
,
550
'mu*_etaLayer2Hits'
,
551
'mu*_etaLayer3Hits'
,
552
'mu*_etaLayer4Hits'
,
553
'mu*_phiLayer1Holes'
,
554
'mu*_phiLayer2Holes'
,
555
'mu*_phiLayer3Holes'
,
556
'mu*_phiLayer4Holes'
,
557
'mu*_etaLayer1Holes'
,
558
'mu*_etaLayer2Holes'
,
559
'mu*_etaLayer3Holes'
,
560
'mu*_etaLayer4Holes'
,
561
'mu*_nCSCEtaHits'
,
562
'mu*_nCSCEtaHoles'
,
563
'mu*_nCSCPhiHits'
,
564
'mu*_nCSCPhiHoles'
,
565
'mu*_nCSCUnspoiledEtaHits'
,
566
'mu*_nMDTHits'
,
567
'mu*_nMDTHoles'
,
568
'mu*_nRPCEtaHits'
,
569
'mu*_nRPCEtaHoles'
,
570
'mu*_nRPCPhiHits'
,
571
'mu*_nRPCPhiHoles'
,
572
'mu*_nTGCEtaHits'
,
573
'mu*_nTGCEtaHoles'
,
574
'mu*_nTGCPhiHits'
,
575
'mu*_nTGCPhiHoles'
,
576
'mu*_nTRTOutliers'
,
577
'mu*_nPixHits'
,
578
'mu*_nTRTDeadStraws'
,
579
'mu*_ntrigEtaLayers'
,
580
'mu*_nBLHits'
,
581
'mu*_nphiLayers'
,
582
'mu*_nprecisionLayers'
,
583
'mu*_nTRTHits'
,
584
'mu*_type'
,
585
'mu*_origin'
,
586
'mu*_truth_eta'
,
587
'mu*_truth_phi'
,
588
'mu*_truth_dr'
,
589
'mu*_truth_pt'
,
590
'mu*_truth_matched'
,
591
'mu*_truth_status'
,
592
'mu*_truth_barcode'
,
593
'mu*_truth_E'
,
594
'mu*_truth_mothertype'
,
595
'mu*_truth_motherbarcode'
,
596
'mu*_beta'
,
597
'mu*_matchchi2'
,
598
'mu*_matchndof'
,
599
'mu*_isMuonLikelihood'
,
600
'mu*_trackIPEstimate_*unbiased'
,
601
'mu*_track*unbiased'
,
602
'mu*_loose'
,
603
'mu*_medium'
,
604
'mu*_tight'
,
605
'mu*_truth_mothercharge'
,
606
'mu*_truth_motherstatus'
,
607
'mu*_truth_charge'
,
608
'mu*_mc_index'
,
609
'mu*_dr'
,
610
'mu*_numberOfSegments'
,
611
'vxp_ndof'
,
612
'vxp_py'
,
613
'vxp_trk_weight'
,
614
'vxp_trk_z0'
,
615
'vxp_trk_d0'
,
616
'vxp_trk_unbiased_z0'
,
617
'vxp_trk_unbiased_d0'
,
618
'vxp_trk_err_unbiased_z0'
,
619
'vxp_trk_err_unbiased_d0'
,
620
'vxp_trk_qoverp'
,
621
'vxp_trk_chi2'
,
622
'muonTruth_m'
,
623
'muonTruth_status'
,
624
'MET_*'
,
625
'METJetsInfo_*'
,
626
'met_*'
,
627
'cl_MET_*'
,
628
'tau_MET_*'
,
629
'trk_MET_*'
,
630
'jet_*_MET_*'
,
631
'el*_MET_*'
,
632
'ph*_MET_*'
,
633
'mu*_MET_*'
,
634
'trig_HLT_*'
,
635
#'el_truth_*',
636
'mcevt_alphaQCD'
,
637
'mcevt_alphaQED'
,
638
'mcevt_event_scale'
,
639
#'el_type',
640
'trig_L2_emcl_energyInSample'
,
641
'trig_L2_trk_idscan_*'
,
642
'trig_L2_trk_sitrack_*'
,
643
'trig_EF_emcl*_avg_lar_q'
,
644
'trig_EF_emcl*_avg_tile_q'
,
645
'trig_EF_emcl*_badlarq_frac'
,
646
'trig_EF_emcl*_deltaPhi'
,
647
'trig_EF_emcl*_deltaTheta'
,
648
'trig_EF_emcl*_eng_pos'
,
649
'trig_EF_emcl*_nvertexfraction'
,
650
'trig_EF_emcl*_vertexfraction'
,
651
'trig_EF_emcl*_significance'
,
652
'trig_EF_el_EF_*'
,
653
'trig_EF_ph_EF_*'
,
654
'trig_L1_mu_thrValue'
,
655
'trig_L1_mu_pt'
,
656
'ph_Etcone15'
,
657
'ph_Etcone25'
,
658
'ph_Etcone35'
,
659
'ph_Etcone15_pt_corrected'
,
660
'ph_Etcone25_pt_corrected'
,
661
'ph_Etcone35_pt_corrected'
,
662
'trig_EF_trigmuonef_*'
,
663
'trig_EF_el_Etcone15'
,
664
'trig_EF_el_Etcone25'
,
665
'trig_EF_el_Etcone35'
,
666
'trig_EF_ph_Etcone15'
,
667
'trig_EF_ph_Etcone25'
,
668
'trig_EF_ph_Etcone35'
,
669
'trig_L1_mu_*'
,
670
'egtruth_etaCalo'
,
671
'egtruth_phiCalo'
,
672
'ph_topoEM*'
,
673
'trig_EF_el_m'
,
674
'trig_EF_el_pt'
,
675
'trig_EF_el_Et'
,
676
'trig_EF_el_px'
,
677
'trig_EF_el_py'
,
678
'trig_EF_el_pz'
,
679
'trig_EF_el_eta'
,
680
'trig_EF_el_phi'
,
681
'trig_EF_el_ptcone20'
,
682
'el_m'
,
683
'el_E'
,
684
'el_Et'
,
685
'el_px'
,
686
'el_py'
,
687
'el_pz'
,
688
'el_pt'
,
689
'el_eta'
,
690
'el_phi'
,
691
'el_jet_dr'
,
692
'ph_nucone*'
,
693
'mu_nucone*'
,
694
'mu_etconeNoEm*'
,
695
'ph_Etcone20_pt_corrected'
,
696
'ph_Etcone30_pt_corrected'
,
697
'ph_Etcone40_pt_corrected'
,
698
'trig_L1_emtau_thrPattern'
,
699
'mcevt_pdf_scale'
,
700
701
# fwd eles?
702
'el*_f3'
,
703
'el*_f3core'
,
704
'el*_E233'
,
705
'el*_E277'
,
706
'el*_E237'
,
707
'el*_weta2'
,
708
'el*_Ethad'
,
709
'el*_Ethad1'
,
710
'el*_depth'
,
711
'el*_zvertex'
,
712
'el*_errz'
,
713
'el*_etap'
,
714
'el*_f1core'
,
715
'el*_f1'
,
716
'el*_Emins1'
,
717
'el*_fside'
,
718
'el*_Emax2'
,
719
'el*_ws3'
,
720
'el*_wstot'
,
721
'el*_emaxs1'
,
722
'el*_Etcone40_pt_corrected'
,
723
'el*_Etcone35_pt_corrected'
,
724
'el*_Etcone30_pt_corrected'
,
725
'el*_Etcone25_pt_corrected'
,
726
'el*_Etcone20_pt_corrected'
,
727
'el*_Etcone15_pt_corrected'
,
728
'el*_nucone20'
,
729
'el*_nucone30'
,
730
'el*_nucone40'
,
731
'el*_ptcone20'
,
732
'el*_ptcone30'
,
733
'el*_ptcone40'
,
734
'el*_Etcone15'
,
735
'el*_Etcone20'
,
736
'el*_Etcone25'
,
737
'el*_Etcone30'
,
738
'el*_Etcone35'
,
739
'el*_Etcone40'
,
740
'el*_Etcone45'
,
741
'el*_pos7'
,
742
'el*_deltaeta1'
,
743
'el*_deltaeta2'
,
744
'el*_deltaphi2'
,
745
'el*_deltaphiRescaled'
,
746
'el*_rphiallcalo'
,
747
'el*_topoEtcone20'
,
748
'el*_topoEtcone30'
,
749
'el*_topoEtcone40'
,
750
'el*_deltaEs'
,
751
'el*_deltaEmax2'
,
752
'trig_EF_el_Etcone45'
,
753
]),
754
755
# Changed in devval.
756
(
'17.2'
,
757
[
'StreamRDO_ref'
,
758
'StreamESD_ref'
,
759
]),
760
761
# Changed by TriggerMenuPython in devval.
762
(
'17.2'
,
763
[
'trig_RoI_*'
,
764
'trig_Nav_*'
]),
765
766
# Changed in devval.
767
(
'17.2'
,
768
[
'trk_blayerPrediction_*'
,
769
]),
770
# This also differs between 32/64 bits.
771
# For now, we're generating reference files on 32-bits, so ignore
772
# on 64-bits.
773
(
'-'
,
'x86_64'
,
774
[
'trk_blayerPrediction_*'
,
775
]),
776
777
# TauDiscriminant changes not in AtlasProduction.
778
(
'-'
, atlasProduction,
779
[
'tau_*'
,
780
]),
781
782
# MissingET-03-03-41 not in AtlasProduction.
783
# Newer version in devval.
784
(
'-'
, atlasProduction,
'/dev'
,
'/18'
,
'17.7'
,
'17.X'
,
'/mig0'
,
'localbuild'
,
785
[
'MET_RefFinal_STVF_*'
,
786
]),
787
788
789
# Changed in TauDiscriminant-01-07-28 in devval.
790
(
'17.2'
,
791
[
'tau_EleBDTTight'
,
792
]),
793
794
# Changed in devval and in 17.2.9.
795
(
'17.2.9'
,
796
[
'mu*_SpaceTime_*'
,
797
]),
798
799
# Changed in devval --- TMVA change in root 34?
800
(
'17.2'
,
801
[
'ph_NN_passes'
,
802
'ph_NN_discriminant'
,
803
]),
804
805
# Changed by CaloClusterCorrection-00-07-74 in devval.
806
(
'17.2'
,
807
[
'*_rawcl_pt'
,
808
'*_rawcl_eta'
,
809
]),
810
811
# TriggerD3PDMaker-00-01-99, TrigAnalysisInterfaces-00-02-00,
812
# TrigBunchCrossingTool-00-03-10, TriggerMenuNtuple-00-01-47
813
# in AtlasPhysics but not AtlasProduction...
814
(
'-'
, atlasProduction,
815
[
'UnpairedBunches'
,
816
'UnpairedBunchIntensities'
,
817
'BunchIntensities'
,
818
'FilledBunchIntBeam1'
,
819
'FilledBunchIntBeam2'
,
820
'UnpairedBeam1'
,
821
'UnpairedBeam2'
,
822
'UnpairedIntBeam1'
,
823
'UnpairedIntBeam2'
,
824
'trig_RoI_*'
,
825
'trig_Nav_*'
,
826
]),
827
828
# Changed in devval.
829
(
'17.2'
,
830
[
'StreamRAW_ref'
]),
831
832
# Jet changes, not in AtlasProduction.
833
(
'-'
, atlasProduction,
834
[
'jet_*ActiveArea*'
,
835
'jet_*_jvtx_x'
,
836
'jet_*_jvtx_y'
,
837
'jet_*_jvtx_z'
,
838
'jet_*_jvtxfFull'
,
839
'jet_*_jvtxf'
,
840
'jet_*_nTrk'
,
841
'jet_*_nTrk_pv0_500MeV'
,
842
'jet_*_sumPtTrk'
,
843
'jet_*_sumPtTrk_pv0_500MeV'
,
844
'jet_*_flavor_component_ip3d_pc'
,
845
'jet_*_flavor_component_sv1_pc'
,
846
'jet_OriginIndex'
,
847
'jet_*TruthMF'
,
848
'jet_*TruthMFindex'
,
849
'jet_*CENTER_LAMBDA'
,
850
'jet_*SECOND_LAMBDA'
,
851
'jet_*SECOND_R'
,
852
'jet_*CLUSTER_PT'
,
853
'jet_antikt4truth_isBad*'
,
854
'jet_antikt4h1tower_isBad*'
,
855
'jet_antikt4h1topo_isBad*'
,
856
'jet_antikt6h1tower_isBad*'
,
857
]),
858
859
# Changed by TrkGeometry-00-23-05 in devval.
860
(
'17.2'
,
861
[
'*_materialTraversed'
,
862
]),
863
864
# Jet changes in devval.
865
(
'17.2'
,
866
[
'jet_*_ActiveArea*'
,
867
'jet_*_TruthMFindex'
,
868
'jet_*_TruthMF'
,
869
'jet_*_jvtxf'
,
870
'jet_*_jvtxfFull'
,
871
'jet_*_isBad*'
,
872
'jet_*_nTrk'
,
873
'jet_*_sumPtTrk'
,
874
'jet_*_jvtx_x'
,
875
'jet_*_jvtx_y'
,
876
'jet_*_jvtx_z'
,
877
'jet_*CENTER_LAMBDA'
,
878
'jet_*SECOND_LAMBDA'
,
879
'jet_*SECOND_R'
,
880
'jet_*CLUSTER_PT'
,
881
]),
882
883
# Pool changes in devval.
884
(
'17.2'
,
885
[
'Token'
,
886
]),
887
888
# Change by det descr bugfix in devval.
889
(
'17.2'
,
890
[
'ph_rawcl_etas1'
]),
891
892
# Changed by TrkExTools-02-37-82 in devval.
893
(
'17.2'
,
894
[
'mu_curvatureSig'
,
895
'mu_id_curvatureSig'
]),
896
897
# Changed in devval.
898
(
'17.2'
,
899
[
'mu_*neighbourSig'
]),
900
901
# Changed in devval.
902
(
'17.2'
,
903
[
'trig_L2_passedThrough'
,
904
'trig_L2_resurrected'
,
905
'trig_L2_passedPhysics'
,
906
'trig_L2_passedRaw'
,
907
'trig_EF_passedThrough'
,
908
'trig_EF_resurrected'
,
909
'trig_EF_passedPhysics'
,
910
'trig_EF_passedRaw'
,
911
'HLTRerunPrescaleMap'
,
912
]),
913
914
# Changed in devval.
915
(
'17.2'
,
916
[
'trig_roidescriptor_forID_etaMinus'
,
917
'trig_roidescriptor_forID_etaPlus'
,
918
]),
919
920
# Changed in devval.
921
(
'17.2'
,
922
[
'el_jettrack_*'
,
923
'el_trackd0pvunbiased'
,
924
'el_tracksigd0pvunbiased'
,
925
'el_trackz0pvunbiased'
,
926
'el_tracksigz0pvunbiased'
,
927
'el_trackIPEstimate*'
,
928
'trk_*_wrtBL'
,
929
'mu*_spec_surf_*'
,
930
]),
931
]
932
933
934
_ignore_keys = [
935
# temp
936
(
'17.2'
,
937
[
'*Meta/ElectronD3PDObject*'
,
938
'*Meta/MissingETCompositionD3PDObject*'
,
939
'*Meta/JetD3PDObject*'
,
940
'*Meta/EMTauROID3PDObject*'
,
941
'*Meta/GenEventD3PDObject*'
,
942
'*Meta/RefFinalMETD3PDObject*'
,
943
'*Meta/TopoMETD3PDObject*'
,
944
'*Meta/DBKeysD3PDObject*'
,
945
'*Meta/TrigDecisionD3PDObject*'
,
946
'*Meta/TrigInDetTrackD3PDObject*'
,
947
'*Meta/TrigMuonEFInfoD3PDObject*'
,
948
'*Meta/TrigPhotonD3PDObject*'
,
949
'*Meta/TruthMuonD3PDObject*'
,
950
'*Meta/egammaTruthD3PDObject*'
,
951
'*Meta/MissingETTruthD3PDObject*'
,
952
'*Meta/MuonD3PDObject*'
,
953
'*Meta/MuonROID3PDObject*'
,
954
'*Meta/TrigDBKeysD3PDObject*'
,
955
'*Meta/TrigEMClusterD3PDObject*'
,
956
'*Meta/TrigElectronD3PDObject*'
,
957
'*Meta/TrigMETD3PDObject*'
,
958
'*Meta/TruthParticleD3PDObject*'
,
959
'*Meta/CombLinksD3PDObject*'
,
960
'*Meta/CollisionDecisionD3PDObject*'
,
961
'*Meta/PhotonD3PDObject*'
,
962
'*Meta/PrimaryVertexD3PDObject*'
,
963
'*Meta/TileMuFeatureD3PDObject*'
,
964
'*Meta/TileTrackMuFeatureD3PDObject*'
,
965
'*Meta/TrigMuonEFIsolationD3PDObject*'
,
966
'*Meta/triggerBitsD3PDObject*'
,
967
'*Meta/ChainEntryD3PDObject*'
,
968
'*Meta/ClusterD3PDObject*'
,
969
'*Meta/BGCodeD3PDObject*'
,
970
'*Meta/CorrectionClusterD3PDObject*'
,
971
'*Meta/EFElectronD3PDObject*'
,
972
'*Meta/EFPhotonD3PDObject*'
,
973
'*Meta/JetsInfoMETD3PDObject*'
,
974
'*Meta/MBTSD3PDObject*'
,
975
'*Meta/MBTSTimeD3PDObject*'
,
976
'*Meta/MBTSTriggerBitsD3PDObject*'
,
977
'*Meta/MuonFeatureD3PDObject*'
,
978
'*Meta/MuonFeatureDetailsD3PDObject*'
,
979
'*Meta/CombinedMuonFeatureD3PDObject*'
,
980
'*Meta/EmTauROID3PDObject*'
,
981
'*Meta/EnergySumD3PDObject*'
,
982
'*Meta/METD3PDObject*'
,
983
'*Meta/TrigRoiDescD3PDObject*'
,
984
'*Meta/BunchConfigIDD3PDObject*'
,
985
'*Meta/IsoMuonFeatureD3PDObject*'
,
986
'*Meta/MissingETGoodnessD3PDObject*'
,
987
'*Meta/EnergySumROID3PDObject*'
,
988
'*Meta/EventInfoD3PDObject*'
,
989
'*Meta/BunchConfTree'
,
990
'*Meta/TrigConfTree'
,
991
'egammaTrigDec'
,
992
'egammaTrigDecMeta/*'
,
993
'trigtest'
,
994
'trigtestMeta/*'
,
995
'Lumi/egamma'
996
]),
997
998
# TauDiscriminant-01-07-19 / TauD3PDMaker-01-08-19 not in 17.2.X.Y.
999
(
'-'
, atlasProduction,
1000
[
'*Meta/TauD3PDObject_*'
]),
1001
1002
1003
# JetTagD3PDMaker-00-01-89 not in AtlasProduction.
1004
(
'-'
, atlasProduction,
1005
[
'*Meta/JetD3PDObject_*'
]),
1006
1007
1008
# Types change when moving to 64-bit ids.
1009
(
'17.2'
,
1010
[
'trackMeta/PixelClusterD3PDObject_*'
]),
1011
]
1012
1013
1014
def
compile_list
(ignore_list):
1015
for
vlist
in
ignore_list:
1016
l = vlist[-1]
1017
for
i
in
range(len(l)):
1018
l[i] = re.compile (fnmatch.translate (l[i]))
1019
return
1020
1021
1022
compile_list
(_ignore_branches)
1023
compile_list
(_ignore_keys)
1024
1025
1026
def
get_ver
():
1027
ver = os.environ.get (
'CMTPATH'
)
1028
if
ver:
1029
ver = string.split (ver,
':'
)
1030
ver = [s
for
s
in
ver
if
s.find(
'AtlasSetup'
) < 0]
1031
ver.append (os.environ.get (
'CMTCONFIG'
))
1032
ver = string.join (ver,
':'
)
1033
else
:
1034
ver =
'localbuild'
1035
return
ver
1036
1037
1038
def
ignore_p
(match, ignore_list):
1039
ver =
get_ver
()
1040
1041
for
vlist
in
ignore_list:
1042
vv = vlist[:-1]
1043
ignore =
True
1044
if
vv
and
vv[0] ==
'-'
:
1045
ignore =
False
1046
vv = vv[1:]
1047
for
v
in
vv:
1048
if
(callable(v)
and
v(ver)
or
1049
not
callable(v)
and
ver
and
ver.find (v) >= 0):
1050
ignore =
not
ignore
1051
break
1052
if
not
ignore:
continue
1053
for
b
in
vlist[-1]:
1054
if
b.match (match):
1055
return
True
1056
return
False
1057
1058
1059
# Should a branch be ignored?
1060
def
ignore_br_p
(br):
1061
return
ignore_p (br, _ignore_branches)
1062
1063
1064
def
ignore_key_p
(key):
1065
return
ignore_p (key, _ignore_keys)
1066
1067
1068
def
read_val
(val):
1069
if
not
val:
return
val
1070
1071
if
val.find (
'+'
) >= 0:
1072
psplit = split_list1 (val,
'+'
)
1073
if
len(psplit) > 1:
1074
#psplit = split_list1 (val, '+')
1075
#if len(psplit) > 1:
1076
good =
True
1077
for
i
in
range(len(psplit)):
1078
psplit[i] = read_val (psplit[i])
1079
if
not
isinstance(psplit[i], list):
1080
good =
False
1081
break
1082
if
good:
1083
return
reduce (operator.__add__, psplit)
1084
1085
if
val[-1] ==
'L'
:
1086
try
:
1087
return
int(val)
1088
except
TypeError:
1089
pass
1090
1091
if
val[0]
in
'0123456789-'
:
1092
if
val.find (
'.'
) < 0:
1093
try
:
1094
return
int(val)
1095
except
TypeError:
1096
pass
1097
except
ValueError:
1098
pass
1099
1100
try
:
1101
return
float (val)
1102
except
TypeError:
1103
pass
1104
except
ValueError:
1105
pass
1106
1107
try
:
1108
(count, elt) = val.split (
'*'
, 1)
1109
count = int (count)
1110
if
elt.startswith(
'['
)
and
elt.endswith(
']'
):
1111
return
count * [
read_val
(elt[1:-1])]
1112
except
ValueError:
1113
pass
1114
1115
if
val[0] ==
'['
:
1116
return
[
read_val
(s)
for
s
in
split_list(val)]
1117
return
val
1118
1119
1120
class
Reader
(object):
1121
def
__init__
(self, f):
1122
self.
saved
=
None
1123
self.
f
= f
1124
return
1125
1126
1127
def
getline
(self):
1128
if
self.
saved
is
not
None
:
1129
out = self.
saved
1130
self.
saved
=
None
1131
return
out
1132
l = self.
f
.readline()
1133
if
not
l:
1134
return
None
1135
if
len(l) > 0
and
l[-1] ==
'\n'
:
1136
l = l[:-1]
1137
return
l
1138
1139
1140
def
ungetline
(self, l):
1141
assert
self.
saved
is
None
1142
self.
saved
= l
1143
return
1144
1145
1146
class
Tree
(object):
1147
def
__init__
(self, reader):
1148
self.
dummy
=
False
1149
self.
reader
= reader
1150
self.
branches
= {}
1151
self.
read
()
1152
return
1153
1154
1155
def
read
(self):
1156
while
True
:
1157
l = self.
reader
.getline()
1158
if
l
is
None
:
break
1159
if
not
l:
continue
1160
if
l ==
'[Dummy tree skipped]'
:
1161
self.
dummy
=
True
1162
break
1163
if
l.startswith (
'Branches'
):
1164
l = self.
reader
.getline()
1165
if
not
l.startswith (
'-------'
):
1166
self.
reader
.ungetline (l)
1167
break
1168
self.
read_by_branches
()
1169
return
1170
1171
if
not
l.startswith (
'Event '
):
1172
self.
reader
.ungetline (l)
1173
break
1174
iev = int(l.split()[1])
1175
l = self.
reader
.getline()
1176
if
not
l.startswith (
'-------'
):
1177
self.
reader
.ungetline (l)
1178
break
1179
self.
read_branches
(iev)
1180
return
1181
1182
1183
def
read_by_branches
(self):
1184
lasttag =
''
1185
while
True
:
1186
l = self.
reader
.getline()
1187
if
not
l:
break
1188
if
l.startswith (
':'
):
1189
lasttag = l[1:]
1190
continue
1191
(name, val) = l.split (
None
, 1)
1192
if
name ==
'$'
: name =
''
1193
name = lasttag + name
1194
br = self.
branches
.setdefault (name, {})
1195
val = read_val (val)
1196
for
(iev, v)
in
enumerate(val):
1197
br[iev] = v
1198
return
1199
1200
1201
def
read_branches
(self, iev):
1202
while
True
:
1203
l = self.
reader
.getline()
1204
if
not
l:
break
1205
(name, val) = l.split (
None
, 1)
1206
br = self.
branches
.setdefault (name, {})
1207
br[iev] = read_val (val)
1208
return
1209
1210
1211
1212
class
String
(object):
1213
def
__init__
(self, reader):
1214
self.
val
=
''
1215
while
True
:
1216
l = reader.getline()
1217
if
l
is
None
:
break
1218
ipos = l.find (
'__END_OF_STRING__'
)
1219
if
ipos >= 0:
1220
self.
val
= self.
val
+ l[:ipos]
1221
break
1222
else
:
1223
self.
val
= self.
val
+ l +
'\n'
1224
return
1225
1226
1227
class
Hist
(object):
1228
def
__init__
(self, reader):
1229
l = reader.getline()
1230
self.
bins
= []
1231
self.
errs
= []
1232
if
l.startswith (
'bins:'
):
1233
self.
bins
= read_val (string.strip (l[5:]))
1234
l = reader.getline()
1235
if
l.startswith (
'errs:'
):
1236
self.
errs
= read_val (string.strip (l[5:]))
1237
return
1238
1239
1240
class
Dumpreader
(object):
1241
def
__init__
(self, f):
1242
self.
reader
= Reader (f)
1243
self.
keys
= {}
1244
self.
read
()
1245
return
1246
1247
1248
def
read
(self):
1249
while
True
:
1250
l = self.
reader
.getline()
1251
if
l
is
None
:
break
1252
if
not
l:
continue
1253
if
l.find (
'wrong interface id'
) >= 0:
continue
1254
ll = l.split()
1255
if
len(ll) != 2:
1256
print
(
'Unknown line'
, l)
1257
break
1258
(typ, key) = ll
1259
if
typ ==
'Tree'
:
1260
self.
keys
[key] = Tree (self.
reader
)
1261
elif
typ ==
'String'
:
1262
self.
keys
[key] = String (self.
reader
)
1263
elif
typ ==
'TH1'
:
1264
self.
keys
[key] = Hist (self.
reader
)
1265
else
:
1266
print
(
'Unknown type'
, typ)
1267
break
1268
1269
1270
def
read_tree
(self):
1271
return
None
1272
1273
1274
def
dictkey_diff
(d1, d2, msg, filter = None):
1275
keys = [k
for
k
in
d1.keys()
if
k
not
in
d2]
1276
if
filter: keys = [k
for
k
in
keys
if
not
filter(k)]
1277
if
keys:
1278
keys.sort()
1279
print
(msg)
1280
for
k
in
keys:
1281
print
(
' '
, k)
1282
return
1283
1284
1285
def
apply_renames
(d1, d2, renames):
1286
for
(knew, kold)
in
renames.items():
1287
if
(d2.has_key (kold)
and
not
d2.has_key (knew)
and
1288
not
d1.has_key (kold)
and
d1.has_key (knew)):
1289
d2[knew] = d2[kold]
1290
del d2[kold]
1291
return
1292
1293
1294
def
diff_string
(k, s1, s2):
1295
if
s1.val != s2.val:
1296
print
(
'String'
, k,
'has value'
, s1.val,
1297
'in new file but value'
, s2.val,
'in reference file'
)
1298
return
1299
1300
1301
inttypes = [types.IntType, types.LongType]
1302
def
compare
(o1, o2, thresh = 1e-6, ithresh = None, eltcmp = None):
1303
if
eltcmp
and
not
isinstance(o1, list):
1304
return
eltcmp (o1, o2)
1305
# Allow comparing int/long int.
1306
if
type
(o1)
in
inttypes
and
type
(o2)
in
inttypes:
1307
if
o1 < 0: o1 = o1 + (1<<32)
1308
if
o2 < 0: o2 = o2 + (1<<32)
1309
return
o1 == o2
1310
# Promote int to float if needed.
1311
if
type
(o1)
in
inttypes
and
isinstance(o2, float):
1312
o1 = float(o1)
1313
elif
type
(o2)
in
inttypes
and
isinstance(o1, float):
1314
o2 = float(o2)
1315
1316
if
type
(o1)
is
not
type
(o2):
1317
return
False
1318
if
isinstance(o1, list):
1319
if
len(o1) != len(o2):
1320
return
False
1321
1322
# Inline this to speed up this common case.
1323
if
len(o1) > 0
and
isinstance(o1[0], float)
and
not
ithresh
and
not
callable(thresh)
and
not
eltcmp:
1324
xabs = abs
1325
for
i
in
range(len(o1)):
1326
x1 = o1[i]
1327
x2 = o2[i]
1328
ax1 = xabs(x1)
1329
ax2 = xabs(x2)
1330
num = x1-x2
1331
den = ax1 + ax2
1332
if
den == 0:
continue
1333
x = xabs(num / den)
1334
if
x > thresh:
1335
print
(
'fnmismatch'
, x1, x2, x, thresh)
1336
return
False
1337
return
True
1338
1339
for
i
in
range(len(o1)):
1340
if
not
compare (o1[i], o2[i],
1341
thresh=thresh,
1342
ithresh=ithresh,
1343
eltcmp=eltcmp):
1344
return
False
1345
return
True
1346
if
type
(o1).__name__
in
[
'map<string,int>'
,
1347
'map<string,float>'
,
1348
'map<string,string>'
]:
1349
return
ROOT.D3PDTest.MapDumper.equal (o1, o2)
1350
if
isinstance(o1, float):
1351
if
callable(ithresh):
1352
ret = ithresh(o1, o2)
1353
if
ret
is
True
or
ret
is
False
:
return
ret
1354
elif
ithresh
and
abs(o1) < ithresh
and
abs(o2) < ithresh:
1355
return
True
1356
num = o1-o2
1357
den = abs(o1)+abs(o2)
1358
if
den == 0:
return
True
1359
x = abs(num / den)
1360
if
callable(thresh): thresh = thresh(den)
1361
if
x > thresh:
1362
print
(
'fmismatch'
, o1, o2, x, thresh)
1363
return
False
1364
return
True
1365
return
o1 == o2
1366
1367
1368
def
mc_eta_thresh
(x):
1369
if
x > 36:
return
1e-2
1370
if
x > 34:
return
2e-3
1371
if
x > 32:
return
2e-4
1372
if
x > 30:
return
1e-4
1373
if
x > 28:
return
1e-5
1374
return
1e-6
1375
1376
1377
def
eg_pid_compare
(o1, o2):
1378
if
o1 == 0xffffffff
and
o2 == 0:
return
True
1379
return
None
1380
1381
1382
def
compare_detElementId
(o1, o2):
1383
if
o1 == o2:
return
True
1384
if
o1 == (o2 << 32):
return
True
1385
return
False
1386
1387
1388
def
compare_pixid
(o1, o2):
1389
if
o1 == o2:
return
True
1390
o2a = ((o2&0x7fffffff)-1)<<28
1391
if
o1 == o2a :
return
True
1392
return
False
1393
1394
1395
def
compare_abs
(o1, o2):
1396
return
compare (abs(o1), abs(o2))
1397
1398
1399
branch_thresh = [
1400
1401
[
'mu*_cov_theta_qoverp_exPV'
, (2e-2, 2e-14)],
1402
[
'mu_cov_phi_exPV'
, 4e-4],
1403
[
'mu*_cov_*_exPV'
, 1e-2],
1404
[
'mu*_d0_exPV'
, 5e-3],
1405
[
'mu*_z0_exPV'
, 2e-5],
1406
[
'mu*_theta_exPV'
, 1e-5],
1407
[
'mu*_spec_surf_*'
, 6e-2],
1408
[
'mu*_trackz0pv'
, 2e-6],
1409
[
'mu*_trackd0pv'
, 1e-5],
1410
[
'mu*_trackz0pvunbiased'
, 2e-6],
1411
[
'mu*_trackd0pvunbiased'
, 1e-5],
1412
[
'mu*_trackd0beam'
, 2e-5],
1413
[
'mu*_trackIPEstimate_d0_unbiasedpvunbiased'
, 1e-5],
1414
[
'mu*_trackIPEstimate_z0_unbiasedpvunbiased'
, 1e-5],
1415
[
'mu*_trackIPEstimate_d0_biasedpvunbiased'
, 1e-5],
1416
[
'mu*_trackIPEstimate_z0_biasedpvunbiased'
, 1e-5],
1417
1418
[
'trk_z0_wrtPV'
, 2e-4],
1419
[
'trk_d0_wrtPV'
, 2e-4],
1420
[
'trk_phi_wrtPV'
, 1e-4],
1421
1422
[
'trk_err_theta_wrtPV'
, 1e-5],
1423
[
'trk_err_phi_wrtPV'
, 2e-5],
1424
1425
[
'trk_phi_wrtBL'
, 2e-2],
1426
[
'trk_z0_wrtBL'
, 1],
1427
[
'trk_d0_wrtBL'
, 3e-1],
1428
1429
[
'trk_theta_err_wrtBL'
, 3e-2],
1430
[
'trk_qoverp_err_wrtBL'
, 1e-4],
1431
[
'trk_phi_err_wrtBL'
, 3e-2],
1432
[
'trk_z0_err_wrtBL'
, 6e-2],
1433
[
'trk_d0_err_wrtBL'
, 7e-2],
1434
1435
[
'trk_d0_phi_err_wrtBL'
, 1e-1],
1436
[
'trk_d0_qoverp_err_wrtBL'
, 4e-3],
1437
[
'trk_d0_theta_err_wrtBL'
, 1],
1438
[
'trk_d0_z0_err_wrtBL'
, 1],
1439
[
'trk_phi_theta_err_wrtBL'
, 1],
1440
[
'trk_phi_qoverp_err_wrtBL'
, 4e-3],
1441
[
'trk_theta_qoverp_err_wrtBL'
, 1],
1442
[
'trk_z0_phi_err_wrtBL'
, 1],
1443
[
'trk_z0_qoverp_err_wrtBL'
, 1],
1444
[
'trk_z0_theta_err_wrtBL'
, 8e-2],
1445
1446
[
'trk_d0_wrtBS'
, 2e-4],
1447
[
'trk_z0_wrtBS'
, 5e-5],
1448
[
'trk_phi_wrtBS'
, 5e-5],
1449
1450
[
'trk_err_theta_wrtBS'
, 1e-5],
1451
[
'trk_err_phi_wrtBS'
, 2e-5],
1452
1453
[
'trk_cov_theta_qoverp_wrtBS'
, (4e-1, 1e-14)],
1454
[
'trk_cov_phi_theta_wrtBS'
, 5e-2],
1455
[
'trk_cov_phi_qoverp_wrtBS'
, 4e-5],
1456
[
'trk_cov_z0_qoverp_wrtBS'
, 5e-3],
1457
[
'trk_cov_z0_phi_wrtBS'
, 2e-3],
1458
[
'trk_cov_z0_theta_wrtBS'
, 1e-5],
1459
[
'trk_cov_d0_phi_wrtBS'
, 1e-5],
1460
[
'trk_cov_d0_z0_wrtBS'
, 3e-1],
1461
[
'trk_cov_d0_theta_wrtBS'
, 6e-3],
1462
1463
[
'trk_mc_z0'
, 4e-2],
1464
[
'trk_mc_d0'
, 2e-2],
1465
[
'trk_mc_phi'
, 2e-2],
1466
[
'trk_mc_theta'
, 1e-3],
1467
1468
[
'vxp_trk_d0'
, (9e-4, 2e-4)],
1469
[
'vxp_trk_z0'
, 9e-4],
1470
[
'vxp_trk_phi'
, 5e-5],
1471
[
'vxp_trk_theta'
, 2e-5],
1472
[
'vxp_trk_unbiased_d0'
, (1e-3, 2e-4)],
1473
[
'vxp_trk_unbiased_z0'
, 1e-3],
1474
1475
[
'el*_jettrack_m'
, 6e-6],
1476
[
'el*_jettrack_reducedPt'
, 2e-6],
1477
[
'el*_jettrack_ptrel'
, 1e-5],
1478
[
'el*_jettrack_dr'
, 1e-5],
1479
[
'el*_jettrack_phi'
, 1e-5],
1480
1481
[
'el*_jetcone_dr'
, 1e-5],
1482
[
'el*_jetcone_ptrel'
, 2e-5],
1483
1484
[
'el*_refittedTrack_d0_err_wrtBL'
, 1e-4],
1485
[
'el*_refittedTrack_phi_err_wrtBL'
, 3e-3],
1486
[
'el*_refittedTrack_theta_err_wrtBL'
, 4e-5],
1487
[
'el*_refittedTrack_phi_theta_err_wrtBL'
, (2e-2, 1e-10)],
1488
[
'el*_refittedTrack_phi_qoverp_err_wrtBL'
, 5e-3],
1489
[
'el*_refittedTrack_theta_qoverp_err_wrtBL'
, 1],
1490
[
'el*_refittedTrack_z0_theta_err_wrtBL'
, 3e-4],
1491
[
'el*_refittedTrack_z0_qoverp_err_wrtBL'
, 6e-3],
1492
[
'el*_refittedTrack_z0_phi_err_wrtBL'
, 9e-3],
1493
[
'el*_refittedTrack_d0_wrtBL'
, 6e-4],
1494
[
'el*_refittedTrack_d0_phi_err_wrtBL'
, 3e-3],
1495
[
'el*_refittedTrack_d0_z0_err_wrtBL'
, 5e-4],
1496
[
'el*_refittedTrack_d0_theta_err_wrtBL'
, 6e-2],
1497
[
'el*_refittedTrack_d0_qoverp_err_wrtBL'
, 6e-4],
1498
[
'el*_tracksigz0pvunbiased'
, 1e-5],
1499
[
'el*_trackz0pvunbiased'
, 7e-4],
1500
[
'el*_trackd0pvunbiased'
, 2e-4],
1501
[
'el*_trackz0pv'
, 6e-4],
1502
[
'el*_trackd0pv'
, 1e-4],
1503
[
'el*_trackz0beam'
, 4e-5],
1504
[
'el*_trackd0beam'
, 1e-3],
1505
[
'el*_trackIPEstimate_z0_unbiasedpvunbiased'
, 1e-3],
1506
[
'el*_trackIPEstimate_d0_unbiasedpvunbiased'
, 2e-4],
1507
[
'el*_trackIPEstimate_sigz0_unbiasedpvunbiased'
, 1e-5],
1508
[
'el*_trackIPEstimate_z0_biasedpvunbiased'
, 6e-4],
1509
[
'el*_trackIPEstimate_d0_biasedpvunbiased'
, 1e-4],
1510
[
'el*_trackIPEstimate_sigz0_biasedpvunbiased'
, 1e-5],
1511
[
'el*_m'
, (1e-4, 2e-3)],
1512
[
'ph*_m'
, (1e-4, 2e-3)],
1513
[
'mu*_m'
, (1e-4, 2e-3)],
1514
[
'trig_EF_el*_m'
, (1e-4, 2e-3)],
1515
[
'trig_EF_ph*_m'
, (1e-4, 2e-3)],
1516
1517
[
'*_cl_eta0Calo'
, 1e-3],
1518
[
'*_cl_etaCalo'
, 1e-3],
1519
1520
[
'ph_vx_Dist'
, (6e-4, 2e-2)],
1521
1522
[
'egtruth_phiCalo'
, 3e-5],
1523
[
'egtruth_etaCalo'
, 6e-5],
1524
1525
]
1526
1527
for
l
in
branch_thresh:
1528
l[0] = re.compile (fnmatch.translate (l[0]))
1529
1530
1531
def
diff_branch
(k, kb, v1, v2):
1532
head =
'%s branch %s:'
% (k, kb)
1533
ev1 = v1.keys()
1534
ev2 = v2.keys()
1535
ev1.sort()
1536
ev2.sort()
1537
if
ev1 != ev2:
1538
if
ignore_event_differences:
1539
ev1 = list(
set
(ev1).
intersection
(
set
(ev2)))
1540
ev1.sort()
1541
else
:
1542
print
(head,
'Different set of events; new file: '
,
1543
ev1,
'reference file'
, ev2)
1544
return
1545
1546
ithresh =
None
1547
eltcmp =
None
1548
1549
thresh = 1e-6
1550
for
(pat, th)
in
branch_thresh:
1551
if
pat.match (kb):
1552
if
isinstance(th, tuple):
1553
thresh = th[0]
1554
ithresh = th[1]
1555
else
:
1556
thresh = th
1557
break
1558
1559
# GSF reco run in d3pd job, so we have dbg/opt diffs.
1560
if
kb.startswith (
'el_gsf_'
): thresh = 1e-4
1561
if
kb ==
'el_gsf_deltaeta2'
: thresh = 3e-3
1562
if
kb ==
'el_gsf_deltaphi2'
: thresh = 2e-1
1563
if
kb ==
'el_gsf_deltaphiRescaled'
: thresh = 2e-2
1564
if
kb ==
'el_gsf_deltaeta1'
: thresh = 3e-3
1565
if
kb ==
'el_gsf_trackz0pv'
: thresh = 1e-1
1566
if
kb ==
'el_gsf_covqoverp'
: thresh = 5e-2
1567
if
kb ==
'el_gsf_L2_dr'
: thresh = 3e-2
1568
if
kb ==
'el_gsf_EF_dr'
: thresh = 7e-2
1569
if
kb ==
'el_gsf_covd0theta'
: thresh = 3e-4
1570
if
kb ==
'el_gsf_electronweight'
: thresh = 2e-2
1571
if
kb ==
'el_gsf_electronbgweight'
: thresh = 3e-1
1572
if
kb ==
'el_gsf_adaboost'
: thresh = 7e-2
1573
if
kb ==
'el_gsf_neuralnet'
: thresh = 2e-1
1574
if
kb ==
'el_gsf_isolationlikelihoodhqelectrons'
: thresh = 4e-2
1575
if
kb ==
'el_gsf_jet_dr'
: thresh = 2e-2
1576
if
kb ==
'el_gsf_Et'
: thresh = 3e-3
1577
if
kb ==
'el_gsf_E'
: thresh = 4e-3
1578
if
kb ==
'sc_yCells'
: thresh = 2e-6
1579
if
kb.startswith (
'el_gsf_p'
): thresh = 3e-3
1580
if
kb.startswith (
'el_gsf_refittedTrack_cov'
): thresh = 3e-1
1581
if
kb.startswith (
'el_gsf_trackcov'
): thresh = 5e-1
1582
if
kb.startswith (
'el_gsf_tracksig'
): thresh = 4e-2
1583
if
kb.startswith (
'el_gsf_trackd0'
): thresh = 6e-2
1584
if
kb.startswith (
'el_gsf_trackz0'
): thresh = 3e-2
1585
if
kb.startswith (
'el_gsf_trackfitchi2'
): thresh = 7e-3
1586
if
kb.startswith (
'el_gsf_trackqoverp'
): thresh = 2e-2
1587
if
kb.startswith (
'el_gsf_trackpt'
): thresh = 2e-2
1588
if
kb.startswith (
'el_gsf_refittedTrack_d0'
): thresh = 3e-3
1589
if
kb.startswith (
'el_gsf_refittedTrack_LMqoverp'
): thresh = 3e-3
1590
if
kb.startswith (
'el_gsf_refittedTrack_qoverp'
): thresh = 2e-2
1591
if
kb.startswith (
'el_gsf_refittedTrack_covphitheta'
): thresh = 5e-1
1592
if
kb.startswith (
'el_gsf_mvaptcone'
): ithresh = 1e-10
1593
if
kb ==
'el_gsf_m'
:
1594
thresh = 2e-2
1595
ithresh = 0.01
1596
1597
if
kb.find(
'jet_'
)>=0
and
kb.endswith (
'_m'
): ithresh = 0.1
1598
if
kb.find(
'jetcone_'
)>=0
and
kb.endswith (
'_m'
): ithresh = 1e-3
1599
if
kb.find(
'muonTruth_'
)>=0
and
kb.endswith (
'_m'
): ithresh = 0.5
1600
if
kb ==
'mc_m'
:
1601
ithresh = 0.1
1602
thresh = 2e-5
1603
if
kb.endswith (
'_effTopoInvMass'
): thresh = 1e-2
1604
if
kb.endswith (
'_topoInvMass'
): thresh = 1e-2
1605
if
(kb.endswith (
'_topoMeanDeltaR'
)
or
1606
kb.endswith (
'_effTopoMeanDeltaR'
)):
1607
ithresh = 1e-6
1608
if
kb.find (
'_rawcl_etas'
) >= 0: thresh = 2e-4
1609
if
kb.endswith (
'_convIP'
): thresh = 4e-4
1610
if
kb.endswith (
'_convIPRev'
): thresh = 6e-5
1611
if
kb.endswith (
'_emscale_E'
): thresh = 9e-5
1612
if
kb.endswith (
'_emscale_eta'
): thresh = 9e-5
1613
if
kb.endswith (
'_emscale_m'
): ithresh = 0.1
1614
if
kb.endswith (
'_constscale_E'
): thresh = 9e-5
1615
if
kb.endswith (
'_constscale_eta'
): thresh = 9e-5
1616
if
kb ==
'mc_eta'
: thresh = mc_eta_thresh
1617
if
kb.endswith (
'_seg_locX'
): ithresh = 2e-12
1618
if
kb.endswith (
'_seg_locY'
): ithresh = 2e-12
1619
if
kb ==
'MET_Goodness_DeltaEt_JetAlgs_Jet'
: ithresh = 3e-11
1620
if
kb ==
'MET_Goodness_EEM_Jet'
: thresh = 2e-5
1621
if
kb ==
'MET_Goodness_HECf_Jet'
: thresh = 3e-6
1622
if
kb.find (
'_blayerPrediction'
) >= 0: thresh = 1e-2
1623
if
kb.endswith (
'_hecf'
): thresh = 4e-6
1624
if
kb.endswith (
'_SpaceTime_t'
): thresh = 4e-6
1625
if
kb.endswith (
'_SpaceTime_weight'
): thresh = 2e-5
1626
if
kb.endswith (
'_SpaceTime_tError'
): thresh = 8e-6
1627
if
kb.endswith (
'_calcVars_ChPiEMEOverCaloEME'
): thresh = 1e-5
1628
if
kb.endswith (
'_vx_m'
): ithresh = 1e-2
1629
if
kb.endswith (
'MET_Goodness_DeltaEt_JetAlgs_Jet'
): ithresh = 1e-10
1630
1631
# Diffs btn 32/64-bit
1632
if
kb ==
'mc_perigee_theta'
: thresh = 1
1633
if
kb ==
'mc_perigee_d0'
: thresh = 1
1634
if
kb ==
'mc_perigee_phi'
: thresh = 1
#(ev 2,9)
1635
if
kb ==
'mc_perigee_z0'
: thresh = 1
1636
if
kb ==
'tau_likelihood'
: thresh = 1e-5
1637
if
kb ==
'tau_SafeLikelihood'
: thresh = 1e-5
1638
if
kb ==
'el_gsf_softeweight'
: thresh = 1e-1
1639
if
kb ==
'el_gsf_softebgweight'
: thresh = 2e-2
1640
1641
if
kb.endswith (
'_mvaptcone20'
): ithresh = 1e-10
1642
if
kb.endswith (
'_mvaptcone30'
): ithresh = 1e-10
1643
if
kb.endswith (
'_mvaptcone40'
): ithresh = 1e-10
1644
1645
# more 32/64 dbg/opt diffs
1646
if
kb ==
'tau_SafeLikelihood'
: thresh = 0.4
1647
if
kb ==
'tau_likelihood'
: thresh = 0.4
1648
if
kb ==
'tau_BDTJetScore'
: thresh = 1.0
1649
if
kb ==
'tau_calcVars_corrFTrk'
: thresh = 0.02
1650
if
kb ==
'tau_calcVars_corrCentFrac'
: thresh = 0.4
1651
if
kb ==
'tau_JetBDTSigLoose'
: thresh = 1.0
1652
if
kb ==
'tau_JetBDTSigMedium'
: thresh = 1.0
1653
if
kb ==
'tau_JetBDTSigTight'
: thresh = 1.0
1654
if
kb ==
'tau_tauLlhMedium'
: thresh = 1.0
1655
if
kb ==
'tau_pi0_cl1_pt'
: thresh = 1e-5
1656
1657
if
kb.endswith (
'_neighbourSig'
): thresh = 1e-4
1658
if
kb.endswith (
'_curvatureSig'
): thresh = 1e-4
1659
1660
if
kb ==
'pixClus_detElementId'
: eltcmp = compare_detElementId
1661
if
kb ==
'pixClus_id'
: eltcmp = compare_pixid
1662
if
kb ==
'trig_EF_emcl_pt'
: eltcmp = compare_abs
1663
1664
for
e
in
ev1:
1665
head =
'%s branch %s event %d:'
% (k, kb, e)
1666
b1 = v1[e]
1667
b2 = v2[e]
1668
1669
# Promote int to float if needed.
1670
if
type
(b1)
in
inttypes
and
isinstance(b2, float):
1671
b1 = float(b1)
1672
elif
type
(b2)
in
inttypes
and
isinstance(b1, float):
1673
b2 = float(b2)
1674
1675
if
type
(b1)
is
not
type
(b2):
1676
print
(head,
'Type differs; new file: '
,
type
(b1).__name__,
1677
'reference file:'
,
type
(b2).__name__)
1678
elif
not
compare (b1, b2, thresh = thresh, ithresh = ithresh,
1679
eltcmp = eltcmp):
1680
print
(head,
'Branch mismatch'
)
1681
print
(
' new file:'
, b1)
1682
print
(
' ref file:'
, b2)
1683
1684
return
1685
1686
def
diff_tree
(k, t1, t2):
1687
if
t1.dummy
and
t2.dummy:
return
1688
apply_renames (t1.branches, t2.branches, renames)
1689
dictkey_diff (t1.branches, t2.branches,
'%s: Branches only in new file:'
%k,
1690
ignore_br_p)
1691
dictkey_diff (t2.branches, t1.branches,
'%s: Branches only in reference file:'
%k,
1692
ignore_br_p)
1693
for
kb
in
t1.branches:
1694
if
t2.branches.has_key (kb):
1695
if
not
ignore_br_p
(kb):
1696
diff_branch (k, kb, t1.branches[kb], t2.branches[kb])
1697
return
1698
1699
1700
def
diff_hist
(k, h1, h2):
1701
if
not
compare (h1.bins, h2.bins):
1702
print
(
'Hist'
, k,
'has bins'
, h1.bins)
1703
print
(
'in new file but bins'
, h2.bins)
1704
print
(
'in reference file'
)
1705
if
not
compare (h1.errs, h2.errs):
1706
print
(
'Hist'
, k,
'has errs'
, h1.errs)
1707
print
(
'in new file but errs'
, h2.errs)
1708
print
(
'in reference file'
)
1709
return
1710
1711
1712
def
diff_files
(d1, d2):
1713
apply_renames (d1.keys, d2.keys, rename_keys)
1714
dictkey_diff (d1.keys, d2.keys,
'Keys only in new file:'
,
1715
ignore_key_p)
1716
dictkey_diff (d2.keys, d1.keys,
'Keys only in reference file:'
,
1717
ignore_key_p)
1718
for
k
in
d1.keys.keys():
1719
if
k
in
d2.keys
and
not
ignore_key_p (k):
1720
v1 = d1.keys[k]
1721
v2 = d2.keys[k]
1722
if
type
(v1)
is
not
type
(v2):
1723
print
(
'Key'
, k,
'has type'
,
type
(v1).__name__,
1724
'in new file, but type'
,
type
(v2).__name__,
1725
'in reference file'
)
1726
elif
type
(v1)
is
String:
1727
diff_string (k, v1, v2)
1728
elif
type
(v1)
is
Tree:
1729
diff_tree (k, v1, v2)
1730
elif
type
(v1)
is
Hist:
1731
diff_hist (k, v1, v2)
1732
else
:
1733
print
(
'Unknown type for diff:'
,
type
(v1).__name__)
1734
return
1735
1736
1737
if
__name__ ==
'__main__'
:
1738
import
sys
1739
import
subprocess
1740
1741
if
sys.argv[1] ==
'--ignore-event-differences'
:
1742
ignore_event_differences =
True
1743
del sys.argv[1]
1744
1745
# New tuple
1746
p = subprocess.Popen (
'python -m D3PDMakerTest.dumptuple_any %s'
%
1747
sys.argv[1],
1748
shell =
True
,
1749
stdout = subprocess.PIPE)
1750
d1 = Dumpreader (p.stdout)
1751
# Reference file
1752
d2 = Dumpreader (open (sys.argv[2]))
1753
1754
diff_files (d1, d2)
1755
1756
python.difftuple_text.Dumpreader
Definition
difftuple_text.py:1240
python.difftuple_text.Dumpreader.reader
reader
Definition
difftuple_text.py:1242
python.difftuple_text.Dumpreader.read_tree
read_tree(self)
Definition
difftuple_text.py:1270
python.difftuple_text.Dumpreader.__init__
__init__(self, f)
Definition
difftuple_text.py:1241
python.difftuple_text.Dumpreader.read
read(self)
Definition
difftuple_text.py:1248
python.difftuple_text.Dumpreader.keys
dict keys
Definition
difftuple_text.py:1243
python.difftuple_text.Hist
Definition
difftuple_text.py:1227
python.difftuple_text.Hist.errs
list errs
Definition
difftuple_text.py:1231
python.difftuple_text.Hist.__init__
__init__(self, reader)
Definition
difftuple_text.py:1228
python.difftuple_text.Hist.bins
list bins
Definition
difftuple_text.py:1230
python.difftuple_text.Reader
Definition
difftuple_text.py:1120
python.difftuple_text.Reader.getline
getline(self)
Definition
difftuple_text.py:1127
python.difftuple_text.Reader.saved
saved
Definition
difftuple_text.py:1122
python.difftuple_text.Reader.ungetline
ungetline(self, l)
Definition
difftuple_text.py:1140
python.difftuple_text.Reader.__init__
__init__(self, f)
Definition
difftuple_text.py:1121
python.difftuple_text.Reader.f
f
Definition
difftuple_text.py:1123
python.difftuple_text.String
Definition
difftuple_text.py:1212
python.difftuple_text.String.val
str val
Definition
difftuple_text.py:1214
python.difftuple_text.String.__init__
__init__(self, reader)
Definition
difftuple_text.py:1213
python.difftuple_text.Tree
Definition
difftuple_text.py:1146
python.difftuple_text.Tree.dummy
bool dummy
Definition
difftuple_text.py:1148
python.difftuple_text.Tree.read_branches
read_branches(self, iev)
Definition
difftuple_text.py:1201
python.difftuple_text.Tree.read
read(self)
Definition
difftuple_text.py:1155
python.difftuple_text.Tree.branches
dict branches
Definition
difftuple_text.py:1150
python.difftuple_text.Tree.read_by_branches
read_by_branches(self)
Definition
difftuple_text.py:1183
python.difftuple_text.Tree.__init__
__init__(self, reader)
Definition
difftuple_text.py:1147
python.difftuple_text.Tree.reader
reader
Definition
difftuple_text.py:1149
set
STL class.
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition
compareFlatTrees.cxx:25
python.difftuple_text.ignore_br_p
ignore_br_p(br)
Definition
difftuple_text.py:1060
python.difftuple_text.diff_tree
diff_tree(k, t1, t2)
Definition
difftuple_text.py:1686
python.difftuple_text.apply_renames
apply_renames(d1, d2, renames)
Definition
difftuple_text.py:1285
python.difftuple_text.compare_pixid
compare_pixid(o1, o2)
Definition
difftuple_text.py:1388
python.difftuple_text.diff_branch
diff_branch(k, kb, v1, v2)
Definition
difftuple_text.py:1531
python.difftuple_text.dictkey_diff
dictkey_diff(d1, d2, msg, filter=None)
Definition
difftuple_text.py:1274
python.difftuple_text.atlasProduction
atlasProduction(ver)
Definition
difftuple_text.py:34
python.difftuple_text.compare_detElementId
compare_detElementId(o1, o2)
Definition
difftuple_text.py:1382
python.difftuple_text.eg_pid_compare
eg_pid_compare(o1, o2)
Definition
difftuple_text.py:1377
python.difftuple_text.read_val
read_val(val)
Definition
difftuple_text.py:1068
python.difftuple_text.compare_abs
compare_abs(o1, o2)
Definition
difftuple_text.py:1395
python.difftuple_text.compile_list
compile_list(ignore_list)
Definition
difftuple_text.py:1014
python.difftuple_text.diff_hist
diff_hist(k, h1, h2)
Definition
difftuple_text.py:1700
python.difftuple_text.get_ver
get_ver()
Definition
difftuple_text.py:1026
python.difftuple_text.ignore_p
ignore_p(match, ignore_list)
Definition
difftuple_text.py:1038
python.difftuple_text.ignore_key_p
ignore_key_p(key)
Definition
difftuple_text.py:1064
python.difftuple_text.diff_files
diff_files(d1, d2)
Definition
difftuple_text.py:1712
python.difftuple_text.diff_string
diff_string(k, s1, s2)
Definition
difftuple_text.py:1294
python.difftuple_text.compare
compare(o1, o2, thresh=1e-6, ithresh=None, eltcmp=None)
Definition
difftuple_text.py:1302
python.difftuple_text.mc_eta_thresh
mc_eta_thresh(x)
Definition
difftuple_text.py:1368
type
Generated on
for ATLAS Offline Software by
1.17.0