-
Notifications
You must be signed in to change notification settings - Fork 0
/
svn-patch
1187 lines (1179 loc) · 49.9 KB
/
svn-patch
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Index: MooreTests/Moore_RateTest.py
===================================================================
--- MooreTests/Moore_RateTest.py (revision 209302)
+++ MooreTests/Moore_RateTest.py (working copy)
@@ -132,13 +132,15 @@
# general test options
parser.add_option( "-n", "--evtmax", type="int", action = "store", dest = "EvtMax",
- default = 30000, help = "Number of events to run over" )
+ #default = 30000, help = "Number of events to run over" )
+ default = 1000, help = "Number of events to run over" )
parser.add_option( "--mode", action="store", dest="mode",
default='rate', help="Report rates or efficiencies?")
parser.add_option( "--settings", action = "store", dest="ThresholdSettings",
- default = 'Physics_pp_2017',
+ #default = 'Physics_pp_2017',
+ default = 'Physics_pp_June2016',
help = "ThresholdSettings used by Moore")
parser.add_option( "--TCK", action = "store", dest="TCK",
@@ -647,7 +649,7 @@
print '-'*84
print 'processed: %s events' %processed
print 'rates assume %s Hz from level-0' %input_rate if options.mode == "rate" else "Efficiencies in percent..."
- table_row("***","","*Rate [kHz]*","")
+ table_row("***","","Rate [kHz]","")
for level in ['Hlt1','Hlt2']:
ratescale = 1.e-3*input_rate
if options.mode == "efficiency":
Index: MooreTests/Moore_RateTest_options.py
===================================================================
--- MooreTests/Moore_RateTest_options.py (revision 0)
+++ MooreTests/Moore_RateTest_options.py (revision 0)
@@ -0,0 +1,742 @@
+#!/usr/bin/env python
+# Script to test the rates of a HLT configuration
+# Mika Vesterinen
+
+import os, sys, subprocess, re, optparse, math
+
+# Configuration
+import Gaudi.Configuration
+from Gaudi.Configuration import *
+from Configurables import GaudiSequencer as Sequence
+from Configurables import EventSelector, HltConf
+from Moore.Configuration import Moore
+from Gaudi.Configuration import appendPostConfigAction
+from multiprocessing import Process, Queue
+
+# GaudiPython
+import GaudiPython
+from GaudiPython import AppMgr
+LHCb = GaudiPython.gbl.LHCb
+
+HLT1RegexList = ["Hlt1LowMult.*",
+ "Hlt1(Di|Multi)Muon.*",
+ "Hlt1SingleMuon.*",
+ "Hlt1.*Electron.*",
+ "Hlt1B2.*",
+ "Hlt1IncPhi.*",
+ "Hlt1TrackMuon.*",
+ "Hlt1.*TrackMVA.*",
+ "Hlt1CalibTracking.*",
+ "Hlt1DiProton.*"]
+
+HLT2RegexList = ["Hlt2CharmHad.*",
+ "Hlt2CharmHad.*Turbo.*",
+ "Hlt2CharmHad(?!.*?Turbo).*",
+ "Hlt2DiMuon.*"]
+
+
+def linesFromTCK(q,TCK,TCKData):
+
+ _TCK = int(TCK,16)
+ print _TCK
+ type(_TCK)
+ tckbits = (_TCK & (3 << 28)) >> 28
+ if tckbits == 1:
+ from TCKUtils.utils import getHlt1Lines
+ if TCKData != "":
+ from Configurables import ConfigCDBAccessSvc
+ cas=ConfigCDBAccessSvc(File=TCKData+"/config.cdb")
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt1Lines(_TCK,cas=cas)])
+ else:
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt1Lines(_TCK)])
+ elif tckbits == 2:
+ from TCKUtils.utils import getHlt2Lines
+ if TCKData != "":
+ from Configurables import ConfigCDBAccessSvc
+ cas=ConfigCDBAccessSvc(File=TCKData+"/config.cdb")
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt2Lines(_TCK,cas=cas)])
+ else:
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt2Lines(_TCK)])
+
+ q.put(lines)
+
+def getrate(scale,numer,denom):
+ eff = float(numer)/float(denom)
+ err = math.sqrt((eff-eff**2)/denom)
+ return [scale*eff,scale*err]
+
+def table_row(iLine,name,incl,excl):
+ if type(iLine) == type(""):
+ print ('|%s|%s\t' %(iLine,name[:40] + (name[40:] and '...'))).expandtabs(50),
+ else:
+ print ('|%03d|%s\t' %(int(iLine),name[:40] + (name[40:] and '...'))).expandtabs(50),
+ print ('|%s\t|%s\t|' %(incl,excl)).expandtabs(16)
+
+def rawevent_size(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [b for b in xrange(LHCb.RawBank.LastType)]
+ ibanks.remove(LHCb.RawBank.DstData)
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def rawevent_size_turbo(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [LHCb.RawBank.ODIN,
+ LHCb.RawBank.L0DU,
+ LHCb.RawBank.HltSelReports,
+ LHCb.RawBank.HltDecReports,
+ LHCb.RawBank.HltRoutingBits,
+ LHCb.RawBank.HltVertexReports,
+ LHCb.RawBank.DAQ,
+ LHCb.RawBank.TestDet,
+ LHCb.RawBank.TAEHeader,
+ LHCb.RawBank.HltLumiSummary,
+ LHCb.RawBank.DstBank,
+ #LHCb.RawBank.DstData, ## account for this separately
+ LHCb.RawBank.DstAddress,
+ LHCb.RawBank.FileID,
+ LHCb.RawBank.GaudiSerialize,
+ LHCb.RawBank.GaudiHeader,
+ LHCb.RawBank.L0Calo,
+ LHCb.RawBank.L0CaloFull,
+ LHCb.RawBank.L0Muon,
+ LHCb.RawBank.L0MuonProcCand,
+ LHCb.RawBank.L0PU,
+ LHCb.RawBank.L0CaloError,
+ LHCb.RawBank.L0MuonCtrlAll,
+ LHCb.RawBank.L0MuonError,
+ LHCb.RawBank.L0MuonProcData,
+ LHCb.RawBank.L0MuonRaw,
+ LHCb.RawBank.L0DUError,
+ LHCb.RawBank.L0PUFull,
+ LHCb.RawBank.L0PUError]
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def rawevent_size_persistReco(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [LHCb.RawBank.DstData]
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def routing_bits(rawevent):
+ """Return a list with the 96 routing bit values."""
+ rbbanks = rawevent.banks(LHCb.RawBank.HltRoutingBits)
+ if rbbanks.size() < 1: return [0]*96 # some events don't have rb bank
+ assert rbbanks.size() == 1 # stop if we have multiple rb banks
+ d = rbbanks[rbbanks.size() - 1].data() # get last bank
+ bits = "{:032b}{:032b}{:032b}".format(d[2], d[1], d[0])
+ return map(int, reversed(bits))
+
+def main():
+
+ parser = optparse.OptionParser( usage = "usage: %prog [options]" )
+
+ # general test options
+
+ parser.add_option( "-n", "--evtmax", type="int", action = "store", dest = "EvtMax",
+ #default = 30000, help = "Number of events to run over" )
+ default = 30000, help = "Number of events to run over" )
+
+ parser.add_option( "--mode", action="store", dest="mode",
+ default='rate', help="Report rates or efficiencies?")
+
+ parser.add_option( "--settings", action = "store", dest="ThresholdSettings",
+ #default = 'Physics_pp_2017',
+ default = 'Physics_pp_June2016',
+ help = "ThresholdSettings used by Moore")
+
+ parser.add_option( "--TCK", action = "store", dest="TCK",
+ default = '',
+ help = "HLT TCK. If unspecified, then run from ThresholdSettings.")
+
+ parser.add_option( "--split",action="store",dest="split",
+ default="",help="Split mode for Moore ('' or 'Hlt1' or 'Hlt2')")
+
+ # options related to the input data
+
+ parser.add_option( "--inputdata",action="store",dest="inputdata",
+ default="2016NB_25ns_L0Filt0x1609",help="TestFileDB label, or path to raw file.")
+
+ parser.add_option( "-d", "--datatype", action="store", dest="DataType",
+ default="2016", help="DataType of inputdata")
+
+ parser.add_option( "--TFDBForTags",action="store",dest="TFDBForTags",
+ default="",help="Original test file db path, to pick up tags")
+
+ parser.add_option( "--dddbtag", action="store", dest="DDDBtag",
+ default='', help="DDDBTag to use. Rely on TestFileDB if unspecified." )
+
+ parser.add_option( "--conddbtag", action = "store", dest = "CondDBtag",
+ default = '', help = "CondDBTag to use. Rely on TestFileDB if unspecified." )
+
+ parser.add_option( "--Simulation", action = "store_true",
+ default = False, help = "Is this simulated data?")
+
+ parser.add_option( "--Online", action = "store_true",
+ default = False, help = "Are you running on plus on data from the farm?")
+
+ parser.add_option( "--L0TCK", action = "store", dest="L0TCK",
+ default = '',
+ help = "L0 TCK. Should specificy if the input data was filtered with something different to what is in the ThresholdSettings.")
+
+ # other options
+
+ parser.add_option( "--TCKData", action = "store", dest = "TCKData",
+ default = "", help = "TCKData")
+
+ parser.add_option( "--DisableRunStampCheck", action = "store_true",
+ default = False, help = "DisableRunStampCheck")
+
+ parser.add_option( "--EnableOutputStreaming", action = "store_true",
+ default = False, help = "EnableOutputStreaming")
+
+ parser.add_option( "--input_rate",type="float",action="store",dest="input_rate",
+ default=1.e6,help="Input rate from L0 in Hz")
+
+ parser.add_option( "--tuplefile",action="store",dest="tuplefile",
+ default="tuples.root",help="Output root file")
+
+ parser.add_option( "--outputFile",action="store",dest="outputFile",
+ default="",help="OutputFile")
+
+ parser.add_option( "--OutputLevel",type="int",action="store",dest="OutputLevel",
+ default=3,help="OutputLevel")
+
+ parser.add_option( "--hlt1changes",action="store",dest="hlt1changes",
+ default="DefHlt1",help="Changes to Hlt1 thresholds")
+
+ parser.add_option( "--AdditionalHlt2Lines",action="store",dest="AdditionalHlt2Lines",
+ default="",help="Semicolon separated list of lines")
+
+ parser.add_option( "--debug", action="store_true", dest="debug",
+ default=False, help="Debug?")
+
+ # Parse the arguments
+ (options, args) = parser.parse_args()
+
+ # write some information about the test (needed for the handler that makes the web page)
+ f = open("JobSettings.txt",'w')
+ f.write("%s_%s_%s" %(options.inputdata,options.ThresholdSettings,options.hlt1changes))
+
+ Lines = {}
+ Lines["Hlt1"] = set()
+ Lines["Hlt2"] = set()
+
+ ######### RUNNING FROM TCK ##############
+ if options.TCK != "":
+ queue = Queue()
+ p = Process(target=linesFromTCK, args=(queue, options.TCK,options.TCKData))
+ p.start()
+ p.join() # this blocks until the process terminates
+ Lines[options.split] = queue.get()
+ print Lines
+ tckbits = (int(options.TCK,16) & (3 << 28)) >> 28
+ mapping = {1:"Hlt1",2:"Hlt2"}
+ options.split = mapping[tckbits]
+ if options.TCKData != "":
+ Moore().TCKData = options.TCKData
+ Moore().Split = options.split
+ Moore().UseTCK = True
+ Moore().InitialTCK = options.TCK
+ if options.split == "Hlt1":
+ Moore().RemoveInputHltRawBanks = True
+ elif options.split == "Hlt2":
+ Moore().RemoveInputHltRawBanks = False
+ if options.split == "Hlt1":
+ from Configurables import HltConfigSvc
+ trans = { 'DeterministicPrescaler/Hlt1MBNoBiasPreScaler' : { 'AcceptFraction' : {'.*' : '0'}} }
+ prop="ApplyTransformation"
+ svc=HltConfigSvc()
+ svc.setProp(prop,trans)
+
+ ######### RUNNING FROM SETTINGS ##############
+ else:
+ from Configurables import HltConf
+ Moore().ThresholdSettings = options.ThresholdSettings
+ Moore().UseTCK = False
+ Moore().Split=options.split
+
+ # if specified, we can overide the L0TCK in the ThresholdSettings
+ # to use the one which which the input data set was filtered
+
+ if options.L0TCK != "":
+ HltConf().setProp("L0TCK",options.L0TCK)
+
+ # by default, the output streaming is disabled in HltConf
+ Moore().EnableOutputStreaming = options.EnableOutputStreaming
+
+ # Hlt raw banks should be removed when running in unsplit or Hlt1 mode
+ # They should not be removed when running in Hlt2 mode
+ if options.split in ["","Hlt1"]:
+ Moore().RemoveInputHltRawBanks = True
+ elif options.split == "Hlt2":
+ Moore().RemoveInputHltRawBanks = False
+
+ # By default, we remove the following lines
+ # - In the typical input dataset, we won't get the correct rate of lumi events
+ # - In the NB datasets, Hlt1MBNoBias will always fire (with its 10% prescale)
+ # - Also avoid the rate limited lines
+ HltConf().RemoveHlt1Lines = ["Hlt1MBNoBias",
+ "Hlt1MBNoBiasRateLimited",
+ "Hlt1Lumi",
+ "Hlt2Lumi"]
+
+ # option to add Hlt2 lines that aren't in the settings
+ # e.g. if you are developing a new line
+ if options.AdditionalHlt2Lines != "":
+ HltConf().AdditionalHlt2Lines = options.AdditionalHlt2Lines.split(";")
+
+ # the following is an example of how to overwrite some HltSettings
+ # this would be with
+ # > python Moore_RateTest.py --hlt1changes=EXAMPLE etc..
+ if options.hlt1changes != "":
+ from Hlt1Lines.Hlt1TrackLines import Hlt1TrackLinesConf
+ from Hlt1Lines.Hlt1MVALines import Hlt1MVALinesConf
+ OPTIONS = {"EXAMPLE":{Hlt1TrackLinesConf : { 'Muon_PT' : 1100.
+ , 'Muon_IPChi2' : 35.}
+ },
+ "TightHLT1":{Hlt1MVALinesConf : { 'TrackMVA':{'Param3':1.1},
+ 'TwoTrackMVA':{'Threshold':0.95},
+ }
+ }
+ }
+ if options.hlt1changes in OPTIONS.keys():
+ HltConf().OverwriteSettings = OPTIONS[options.hlt1changes]
+
+
+ # Settings that are common to "TCK" and "ThresholdSettings" modes
+ Moore().CheckOdin = False
+ Moore().ForceSingleL0Configuration = False
+ Moore().EnableTimer = 'Moore_RateTest.csv'
+ Moore().EvtMax = options.EvtMax
+ Moore().OutputLevel = options.OutputLevel
+ Moore().outputFile = options.outputFile
+ input_rate = options.input_rate
+
+
+
+ # Needed when running over real data
+ if not options.Simulation:
+ from Configurables import CondDB
+ CondDB().IgnoreHeartBeat = True
+ CondDB().EnableRunChangeHandler = True
+ CondDB().EnableRunStampCheck= not options.DisableRunStampCheck
+ if options.Online:
+ CondDB().UseDBSnapshot = True
+ CondDB().DBSnapshotDirectory = "/group/online/hlt/conditions"
+ CondDB().Tags["ONLINE"] = 'fake'
+ CondDB().Online = True
+ CondDB().EnableRunChangeHandler = True
+ CondDB().EnableRunStampCheck= False
+ if options.split=="Hlt2":
+ import sys
+ try:
+ import All
+ except ImportError:
+ rd = '/group/online/hlt/conditions/RunChangeHandler'
+ sys.path.append(rd)
+ import All
+ CondDB().RunChangeHandlerConditions = All.ConditionMap
+
+ if options.split=="Hlt1":
+ import sys
+ try:
+ import AllHlt1
+ except ImportError:
+ rd = '/group/online/hlt/conditions/RunChangeHandler'
+ sys.path.append(rd)
+ import AllHlt1
+ CondDB().RunChangeHandlerConditions = AllHlt1.ConditionMap
+
+ # inputdata
+ if ".mdf" in options.inputdata:
+ from GaudiConf import IOHelper
+ IOHelper("MDF").inputFiles([options.inputdata])
+ Moore().Simulation = options.Simulation
+ elif ".dst" in options.inputdata:
+ from GaudiConf import IOHelper
+ IOHelper().inputFiles(["PFN:"+options.inputdata])
+ Moore().Simulation = options.Simulation
+ else:
+ from PRConfig import TestFileDB
+ TestFileDB.test_file_db[options.inputdata].run(configurable=Moore())
+
+ # tags
+ # Only set the tags if specified
+ # This should be done if you neither provide TestFileDB label via --inputdata, nor provide it via --TFDBForTags
+ if options.CondDBtag != '':
+ Moore().CondDBtag = options.CondDBtag
+ if options.DDDBtag != '':
+ Moore().DDDBtag = options.DDDBtag
+ if options.TFDBForTags != '':
+ from PRConfig import TestFileDB
+ Moore().DDDBtag = TestFileDB.test_file_db[options.TFDBForTags].qualifiers['DDDB']
+ Moore().CondDBtag = TestFileDB.test_file_db[options.TFDBForTags].qualifiers['CondDB']
+ Moore().Simulation = TestFileDB.test_file_db[options.TFDBForTags].qualifiers['Simulation']
+ Moore().DataType = TestFileDB.test_file_db[options.TFDBForTags].qualifiers['DataType']
+
+ # deal with the Herschel decoding issue on MC (only when running from settings)
+ if Moore().getProp('Simulation') and options.ThresholdSettings != "":
+ from Configurables import HltConf
+ remove = ["Hlt1LowMultMaxVeloAndHerschel", "Hlt1LowMultVeloAndHerschel_Leptons", "Hlt1LowMultVeloAndHerschel_Hadrons","Hlt1LowMultMaxVeloAndHerschel","Hlt1LowMultVeloAndHerschel_Hadrons", "Hlt1LowMultVeloAndHerschel_Leptons"]
+ print '#'*100
+ print 'WARNING: SINCE YOU RUN ON A MC SAMPLE, WE ASSUME THAT WE NEED TO DISABLE ALL HLT1 LINES THAT REQUIRE DECODING OF HERSCHEL BANKS'
+ print 'DISABLING:', remove
+ print '#'*100
+ HltConf().RemoveHlt1Lines += remove
+
+ # print the Moore configurations
+ print options
+ print Moore()
+
+ # apply all ConfigurableUser instances
+ from GaudiKernel.Configurable import applyConfigurableUsers
+ applyConfigurableUsers()
+
+ ### getting ready for the event loop
+ gaudi = AppMgr()
+ gaudi.ExtSvc += ['ToolSvc']
+ gaudi.ExtSvc.append( 'DataOnDemandSvc' )
+ gaudi.initialize()
+
+ ### different way of getting the list of lines if running from threshold settings
+ persistRecoLines = []
+ if options.TCK == "":
+ for level in ["Hlt1","Hlt2"]:
+ for m in Sequence(level).Members:
+ Lines[level].add(m.name())
+ from HltLine.HltLine import hlt2Lines
+ persistRecoLines = [line.name() for line in hlt2Lines() if line.persistReco()]
+
+ ### remove certain lines from the accounting
+ remove = set()
+
+ rb_stats = [0]*96
+ for i in xrange(96):
+ rb_stats[i] = {"passed":0, "size":0.}
+
+ ### option to create a tuple with all of the decisions
+ if options.tuplefile != "":
+ from ROOT import (TTree, TFile,TNamed)
+ from array import array
+ TF = TFile(options.tuplefile,"RECREATE")
+ DecMaps = {} ## dicto of branches for the TTrees
+ DecTrees = {} ## dicto of TTrees
+ DecMaps["RB"] = {}
+
+
+ for format in ["Full","Turbo","persistReco"]:
+ brname = format+'EventSize'
+ DecMaps["RB"][brname] = array( 'f', [ 0 ] )
+ for i in xrange(96):
+ brname = format+"RB%s"%i
+ DecMaps["RB"][brname] = array( 'f', [ 0 ] )
+
+ DecMaps["persistRecoLines"] = {}
+ DecTrees["persistRecoLines"] = TTree('TuplePR','TuplePR')
+ for l in persistRecoLines:
+ DecMaps["persistRecoLines"][l] = array( 'i', [ 0 ] )
+ DecTrees["persistRecoLines"].Branch(l,DecMaps["persistRecoLines"][l], '%s/I'%l)
+ DecTrees["persistRecoLines"].Fill()
+ for level in ["Hlt1","Hlt2"]:
+ DecTrees[level] = TTree('Tuple%s'%level,'Tuple%s'%level)
+ DecMaps[level] = {}
+ for l in Lines[level]:
+ DecMaps[level][l] = array( 'i', [ 0 ] )
+ DecTrees[level].Branch(l,DecMaps[level][l], '%sDecision/I'%l)
+ for format in ["Full","Turbo",'persistReco']:
+ brname = format+'EventSize'
+ DecTrees[level].Branch(brname,DecMaps["RB"][brname],brname+'/F')
+ for i in [46,87,88,90]:
+ brname = format+"RB%s"%i
+ DecTrees[level].Branch(brname,DecMaps["RB"][brname],brname+'/F')
+
+
+ ### this will be dictionary of lines and their counters for the rates
+ line_stats = {}
+ for line in Lines["Hlt1"].union(Lines["Hlt2"]).union(set(["Hlt1Global","Hlt2Global"])):
+ line_stats[line] = {"passed_incl":0,
+ "passed_excl":0}
+
+ ### counters for various regex
+ Hlt1ByRegex = {}
+ nPassedByRegex = 0
+ for r in HLT1RegexList:
+ Hlt1ByRegex[r] = {"passed_incl":0,
+ "processed":0,
+ "passed_this_event":0,
+ "passed_excl":0}
+ Hlt1ByRegex["Other"] = {"passed_incl":0,
+ "processed":0,
+ "passed_this_event":0,
+ "passed_excl":0}
+ Hlt2ByRegex = {}
+ nPassedhlt2ByRegex = 0
+ for s in HLT2RegexList:
+ Hlt2ByRegex[s] = {"passed_incl":0,
+ "processed":0,
+ "passed_this_event":0,
+ "passed_excl":0}
+ Hlt2ByRegex["Other"] = {"passed_incl":0,
+ "processed":0,
+ "passed_this_event":0,
+ "passed_excl":0}
+
+ stream_stats = {"Turbo":{"filter":"Hlt2.(?!.*?TurboCalib).*Turbo"},
+ "Turcal":{"filter":"Hlt2.*TurboCalib"},
+ "Full":{"filter":"Hlt2.(?!.*?Turbo).(?!.*?TurboCalib)"}}
+ for k,v in stream_stats.iteritems():
+ v["pass_this_event"] = False
+ v["passed"] = 0
+
+ i = 0
+ processed = 0
+
+
+ import os
+ import time
+
+ os.system("callgrind_control -i on")
+ time.sleep(1)
+
+ #### start of the event loop
+ while i < Moore().EvtMax:
+ i+=1
+ # run the sequences on this event
+ gaudi.run(1)
+ processed +=1
+ if not gaudi.evtsvc()['Hlt1/DecReports']: break
+
+ ### reset the stream counters
+ for s in stream_stats.keys():
+ stream_stats[s]["pass_this_event"] = False
+
+ ### get the raw event size
+ rawevent = gaudi.evtsvc()['DAQ/RawEvent']
+ event_size_turbo = rawevent_size_turbo(rawevent)
+ event_size_persistReco = rawevent_size_persistReco(rawevent)
+ event_size = rawevent_size(rawevent)
+ rbits = routing_bits(rawevent)
+
+ if options.tuplefile != "":
+ DecMaps['RB']["FullEventSize"][0] = float(event_size)
+ DecMaps['RB']["TurboEventSize"][0] = float(event_size_turbo)
+ DecMaps['RB']["persistRecoEventSize"][0] = float(event_size_persistReco)
+ for rb in xrange(96):
+ brname = "RB%s" %rb
+ if rbits[rb]:
+ DecMaps['RB']["Full"+brname][0] = float(event_size)
+ DecMaps['RB']["Turbo"+brname][0] = float(event_size_turbo)
+ DecMaps['RB']["persistReco"+brname][0] = float(event_size_persistReco)
+ rb_stats[rb]['passed'] += 1
+ rb_stats[rb]['size'] += event_size
+
+ for rv in Hlt1ByRegex.values():
+ rv["passed_this_event"] = 0
+ rv["processed"] += 1
+
+ for rv in Hlt2ByRegex.values():
+ rv["passed_this_event"] = 0
+ rv["processed"] += 1
+
+ # loop over levels
+ for level in ["Hlt1","Hlt2"]:
+ # do the dec reports exist?
+ if not gaudi.evtsvc()['%s/DecReports'%level]: continue
+ # get the dec reports
+ reps = gaudi.evtsvc()['%s/DecReports'%level]
+ nPassed = 0
+
+ # loop over all HLT lines
+ for line in Lines[level]:
+ # protection. why is this needed though?
+ if not line+"Decision" in reps.decReports().keys(): continue
+
+ # did this line fire?
+ LINE_FIRED = reps.decReport(line+"Decision").decision()
+
+ # does this event fire any lines that match my "streams"?
+ if LINE_FIRED and level == "Hlt2" and not line == "Hlt2Global": # and not line in remove:
+ for s in stream_stats.keys():
+ if re.match(stream_stats[s]["filter"], line, flags=0):
+ stream_stats[s]["pass_this_event"] = True
+
+ # set the variable to be stored in the tuple (DecMaps is a dictionary of [Hlt1/Hlt2][line-name])
+ if options.tuplefile != "":
+ if LINE_FIRED:
+ DecMaps[level][line][0] = 1
+ else:
+ DecMaps[level][line][0] = 0
+
+ # increment the counter for this line
+ if LINE_FIRED:
+ line_stats[line]["passed_incl"] += 1
+ if not "Global" in line:
+ nPassed +=1 ### for the exclusives
+
+ if LINE_FIRED and level == "Hlt1":
+ for RE,RV in Hlt1ByRegex.iteritems():
+ if re.match(RE, line, flags=0):
+ RV["passed_this_event"] = 1.0
+
+ if LINE_FIRED and level == "Hlt2":
+ for RE,RV in Hlt2ByRegex.iteritems():
+ if re.match(RE, line, flags=0):
+ RV["passed_this_event"] = 1.0
+
+ ### outside event loop
+ if nPassed > 0:
+ line_stats["%sGlobal"%level]["passed_incl"] += 1
+ # now go back and count the number of exclusive fires of this line
+ # just need to ignore HltXGlobal
+ for line in Lines[level]:
+ if not line+"Decision" in reps.decReports().keys(): continue # protection
+ if reps.decReport(line+"Decision").decision() and nPassed == 1:
+ if not "Global" in line:
+ line_stats[line]["passed_excl"] += 1
+
+ # exclusive
+ if level == "Hlt1":
+ SUM = sum([RV["passed_this_event"] for RV in Hlt1ByRegex.values()])
+ if nPassed > 0 and SUM == 0:
+ #inclusive and exclusive are the same for the "other" category
+ Hlt1ByRegex["Other"]["passed_incl"] += 1
+ Hlt1ByRegex["Other"]["passed_excl"] += 1
+ for RE,RV in Hlt1ByRegex.iteritems():
+ if RV["passed_this_event"] == 1: RV["passed_incl"] +=1
+ if SUM == 1 and RV["passed_this_event"] == 1: RV["passed_excl"] +=1
+
+ if level == "Hlt2":
+ SUM = sum([RV["passed_this_event"] for RV in Hlt2ByRegex.values()])
+ if nPassed > 0 and SUM == 0:
+ #inclusive and exclusive are the same for the "other" category
+ Hlt2ByRegex["Other"]["passed_incl"] += 1
+ Hlt2ByRegex["Other"]["passed_excl"] += 1
+ for RE,RV in Hlt2ByRegex.iteritems():
+ if RV["passed_this_event"] == 1: RV["passed_incl"] +=1
+ if SUM == 1 and RV["passed_this_event"] == 1: RV["passed_excl"] +=1
+
+
+ # fill the tree
+ if options.tuplefile != "":
+ DecTrees[level].Fill()
+
+ # stream accounting
+ for s in stream_stats.keys():
+ if stream_stats[s]["pass_this_event"] == True:
+ stream_stats[s]["passed"] +=1
+
+ # the end
+ gaudi.stop()
+ gaudi.finalize()
+ gaudi.exit()
+
+ # write the root file
+ if options.tuplefile != "":
+ TF.cd()
+ # information (settings etc...) to be propagated to the web page via the root file
+ s1 = TNamed("settings",options.ThresholdSettings)
+ s2 = TNamed("inputdata",options.inputdata)
+ s1.Write()
+ s2.Write()
+ TF.Write()
+
+ #############################################
+ ###### print the summary tables #############
+ #############################################
+ for k,v in line_stats.iteritems():
+ v["processed"] = processed
+ for k,v in stream_stats.iteritems():
+ v["processed"] = processed
+
+ GlobalRates = {}
+ print '='*84
+ print 'HLT %s summary starts here' %("efficiency" if options.mode == "efficiency" else "rate")
+ print '='*84
+ #### print the global rates
+ print '%s Hlt1Lines' %(len(Lines['Hlt1']))
+ print '%s Hlt2Lines' %(len(Lines['Hlt2']))
+ print 'removed lines: %s' %remove
+ print '-'*84
+ print 'processed: %s events' %processed
+ print 'rates assume %s Hz from level-0' %input_rate if options.mode == "rate" else "Efficiencies in percent..."
+ for level in ['Hlt1','Hlt2']:
+ ratescale = 1.e-3*input_rate
+ if options.mode == "efficiency":
+ ratescale = 1.e2
+ rate = getrate(ratescale,line_stats["%sGlobal"%level]["passed_incl"],line_stats["%sGlobal"%level]["processed"])
+ table_row("---","%sGlobal"%level,"%.2f+-%.2f" %(rate[0],rate[1]),"--")
+ ### print the stream rates
+ for k,v in stream_stats.iteritems():
+ rate = getrate(ratescale,v["passed"],v["processed"])
+ table_row("---","Hlt2.*%s"%k,"%.2f+-%.2f" %(rate[0],rate[1]),"--")
+ ### output file sizes
+ if options.outputFile != "":
+ print '-'*84
+ import glob
+ for f in glob.glob(options.outputFile.split(".")[0]+"*."+options.outputFile.split(".")[1]):
+ size = os.path.getsize(f)/(1024.**2)
+ MBs = size*(input_rate/processed)
+ if options.split == "Hlt1" and line_stats["Hlt1Global"]["passed_incl"] > 0:
+ eventSize = 1.e3*size/float(line_stats["Hlt1Global"]["passed_incl"])
+ print '%s\t%.2f MB\t%.2f MB/s\t%.2f kB/evt' %(f,size,MBs,eventSize)
+ else:
+ print '%s\t%.2f MB\t%.2f MB/s' %(f,size,MBs)
+
+ ### by regex
+ print '-'*84
+ iLine = -1 ## counter for line
+ table_row("***","*Regex*","*Incl.*","*Excl.*")
+ OrderedStats = {}
+ for key, value in Hlt1ByRegex.iteritems():
+ OrderedStats[key] = value["passed_incl"]
+ for line_name, rate in sorted(OrderedStats.iteritems(), key=lambda (v,k): (k,v),reverse=True):
+ iLine += 1
+ rate_incl = getrate(ratescale,Hlt1ByRegex[line_name]["passed_incl"],Hlt1ByRegex[line_name]["processed"])
+ rate_excl = getrate(ratescale,Hlt1ByRegex[line_name]["passed_excl"],Hlt1ByRegex[line_name]["processed"])
+ table_row(iLine,line_name.replace("Decision",""),
+ "%.2f+-%.2f" %(rate_incl[0],rate_incl[1]),
+ "%.2f+-%.2f" %(rate_excl[0],rate_excl[1]))
+ print '-'*84
+ iLine = -1 ## counter for line
+ table_row("***","*Regex*","*Incl.*","*Excl.*")
+ OrderedStats = {}
+ for key, value in Hlt2ByRegex.iteritems():
+ OrderedStats[key] = value["passed_incl"]
+ for line_name, rate in sorted(OrderedStats.iteritems(), key=lambda (v,k): (k,v),reverse=True):
+ iLine += 1
+ rate_incl = getrate(ratescale,Hlt2ByRegex[line_name]["passed_incl"],Hlt2ByRegex[line_name]["processed"])
+ rate_excl = getrate(ratescale,Hlt2ByRegex[line_name]["passed_excl"],Hlt2ByRegex[line_name]["processed"])
+ table_row(iLine,line_name.replace("Decision",""),
+ "%.2f+-%.2f" %(rate_incl[0],rate_incl[1]),
+ "%.2f+-%.2f" %(rate_excl[0],rate_excl[1]))
+ print '-'*84
+
+ #### order by inclusive rate
+ for level in ['Hlt1','Hlt2']:
+ iLine = -1 ## counter for line
+ table_row("***","*Line*","*Incl.*","*Excl.*")
+ OrderedStats = {}
+ for key, value in line_stats.iteritems():
+ if level in key:
+ OrderedStats[key] = value["passed_incl"]
+ rate = getrate(ratescale,line_stats["%sGlobal"%level]["passed_incl"],line_stats["%sGlobal"%level]["processed"])
+ table_row(0,"%sGlobal"%level,
+ "%.2f+-%.2f" %(rate[0],rate[1]),
+ "0.0+-0.0")
+ for line_name, rate in sorted(OrderedStats.iteritems(), key=lambda (v,k): (k,v),reverse=True):
+
+ iLine += 1
+ rate_incl = getrate(ratescale,line_stats[line_name]["passed_incl"],line_stats[line_name]["processed"])
+ rate_excl = getrate(ratescale,line_stats[line_name]["passed_excl"],line_stats[line_name]["processed"])
+ if "Global" in line_name:
+ GlobalRates[level] = rate_incl
+ else:
+ table_row(iLine,line_name.replace("Decision",""),
+ "%.2f+-%.2f" %(rate_incl[0],rate_incl[1]),
+ "%.2f+-%.2f" %(rate_excl[0],rate_excl[1]))
+ print '='*84
+ print 'HLT %s summary ends here' %("efficiency" if options.mode == "efficiency" else "rate")
+ print '='*84
+
+
+if __name__ == "__main__":
+ sys.exit( main() )
Property changes on: MooreTests/Moore_RateTest_options.py
___________________________________________________________________
Added: svn:executable
+ *
Index: MooreTests/Moore_RateTest_options3.py
===================================================================
--- MooreTests/Moore_RateTest_options3.py (revision 0)
+++ MooreTests/Moore_RateTest_options3.py (revision 0)
@@ -0,0 +1,392 @@
+#!/usr/bin/env python
+# Script to test the rates of a HLT configuration
+# Mika Vesterinen
+
+import os, sys, subprocess, re, optparse, math
+
+# Configuration
+import Gaudi.Configuration
+from Gaudi.Configuration import *
+from Configurables import GaudiSequencer as Sequence
+from Configurables import EventSelector, HltConf
+from Moore.Configuration import Moore
+from Gaudi.Configuration import appendPostConfigAction
+from multiprocessing import Process, Queue
+
+HLT1RegexList = ["Hlt1LowMult.*",
+ "Hlt1(Di|Multi)Muon.*",
+ "Hlt1SingleMuon.*",
+ "Hlt1.*Electron.*",
+ "Hlt1B2.*",
+ "Hlt1IncPhi.*",
+ "Hlt1TrackMuon.*",
+ "Hlt1.*TrackMVA.*",
+ "Hlt1CalibTracking.*",
+ "Hlt1DiProton.*"]
+
+HLT2RegexList = ["Hlt2CharmHad.*",
+ "Hlt2CharmHad.*Turbo.*",
+ "Hlt2CharmHad(?!.*?Turbo).*",
+ "Hlt2DiMuon.*"]
+
+
+def linesFromTCK(q,TCK,TCKData):
+
+ _TCK = int(TCK,16)
+ print _TCK
+ type(_TCK)
+ tckbits = (_TCK & (3 << 28)) >> 28
+ if tckbits == 1:
+ from TCKUtils.utils import getHlt1Lines
+ if TCKData != "":
+ from Configurables import ConfigCDBAccessSvc
+ cas=ConfigCDBAccessSvc(File=TCKData+"/config.cdb")
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt1Lines(_TCK,cas=cas)])
+ else:
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt1Lines(_TCK)])
+ elif tckbits == 2:
+ from TCKUtils.utils import getHlt2Lines
+ if TCKData != "":
+ from Configurables import ConfigCDBAccessSvc
+ cas=ConfigCDBAccessSvc(File=TCKData+"/config.cdb")
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt2Lines(_TCK,cas=cas)])
+ else:
+ lines = set([l.replace("Hlt::Line/","") for l in getHlt2Lines(_TCK)])
+
+ q.put(lines)
+
+def getrate(scale,numer,denom):
+ eff = float(numer)/float(denom)
+ err = math.sqrt((eff-eff**2)/denom)
+ return [scale*eff,scale*err]
+
+def table_row(iLine,name,incl,excl):
+ if type(iLine) == type(""):
+ print ('|%s|%s\t' %(iLine,name[:40] + (name[40:] and '...'))).expandtabs(50),
+ else:
+ print ('|%03d|%s\t' %(int(iLine),name[:40] + (name[40:] and '...'))).expandtabs(50),
+ print ('|%s\t|%s\t|' %(incl,excl)).expandtabs(16)
+
+def rawevent_size(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [b for b in xrange(LHCb.RawBank.LastType)]
+ ibanks.remove(LHCb.RawBank.DstData)
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def rawevent_size_turbo(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [LHCb.RawBank.ODIN,
+ LHCb.RawBank.L0DU,
+ LHCb.RawBank.HltSelReports,
+ LHCb.RawBank.HltDecReports,
+ LHCb.RawBank.HltRoutingBits,
+ LHCb.RawBank.HltVertexReports,
+ LHCb.RawBank.DAQ,
+ LHCb.RawBank.TestDet,
+ LHCb.RawBank.TAEHeader,
+ LHCb.RawBank.HltLumiSummary,
+ LHCb.RawBank.DstBank,
+ #LHCb.RawBank.DstData, ## account for this separately
+ LHCb.RawBank.DstAddress,
+ LHCb.RawBank.FileID,
+ LHCb.RawBank.GaudiSerialize,
+ LHCb.RawBank.GaudiHeader,
+ LHCb.RawBank.L0Calo,
+ LHCb.RawBank.L0CaloFull,
+ LHCb.RawBank.L0Muon,
+ LHCb.RawBank.L0MuonProcCand,
+ LHCb.RawBank.L0PU,
+ LHCb.RawBank.L0CaloError,
+ LHCb.RawBank.L0MuonCtrlAll,
+ LHCb.RawBank.L0MuonError,
+ LHCb.RawBank.L0MuonProcData,
+ LHCb.RawBank.L0MuonRaw,
+ LHCb.RawBank.L0DUError,
+ LHCb.RawBank.L0PUFull,
+ LHCb.RawBank.L0PUError]
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def rawevent_size_persistReco(rawevent):
+ """Return the size in bytes of the raw event."""
+ ibanks = [LHCb.RawBank.DstData]
+ return sum(bank.totalSize() for i in ibanks for bank in rawevent.banks(i))
+
+def routing_bits(rawevent):
+ """Return a list with the 96 routing bit values."""
+ rbbanks = rawevent.banks(LHCb.RawBank.HltRoutingBits)
+ if rbbanks.size() < 1: return [0]*96 # some events don't have rb bank
+ assert rbbanks.size() == 1 # stop if we have multiple rb banks
+ d = rbbanks[rbbanks.size() - 1].data() # get last bank
+ bits = "{:032b}{:032b}{:032b}".format(d[2], d[1], d[0])
+ return map(int, reversed(bits))
+
+parser = optparse.OptionParser( usage = "usage: %prog [options]" )
+
+# general test options
+
+parser.add_option( "-n", "--evtmax", type="int", action = "store", dest = "EvtMax",
+ #default = 30000, help = "Number of events to run over" )
+ default = 30000, help = "Number of events to run over" )
+
+parser.add_option( "--mode", action="store", dest="mode",
+ default='rate', help="Report rates or efficiencies?")
+
+parser.add_option( "--settings", action = "store", dest="ThresholdSettings",
+ #default = 'Physics_pp_2017',
+ default = 'Physics_pp_June2016',
+ help = "ThresholdSettings used by Moore")
+
+parser.add_option( "--TCK", action = "store", dest="TCK",
+ default = '',
+ help = "HLT TCK. If unspecified, then run from ThresholdSettings.")
+
+parser.add_option( "--split",action="store",dest="split",
+ default="",help="Split mode for Moore ('' or 'Hlt1' or 'Hlt2')")
+
+# options related to the input data
+
+parser.add_option( "--inputdata",action="store",dest="inputdata",
+ default="2016NB_25ns_L0Filt0x1609",help="TestFileDB label, or path to raw file.")
+
+parser.add_option( "-d", "--datatype", action="store", dest="DataType",
+ default="2016", help="DataType of inputdata")
+
+parser.add_option( "--TFDBForTags",action="store",dest="TFDBForTags",
+ default="",help="Original test file db path, to pick up tags")
+
+parser.add_option( "--dddbtag", action="store", dest="DDDBtag",
+ default='', help="DDDBTag to use. Rely on TestFileDB if unspecified." )
+
+parser.add_option( "--conddbtag", action = "store", dest = "CondDBtag",
+ default = '', help = "CondDBTag to use. Rely on TestFileDB if unspecified." )
+
+parser.add_option( "--Simulation", action = "store_true",
+ default = False, help = "Is this simulated data?")
+
+parser.add_option( "--Online", action = "store_true",
+ default = False, help = "Are you running on plus on data from the farm?")
+
+parser.add_option( "--L0TCK", action = "store", dest="L0TCK",
+ default = '',
+ help = "L0 TCK. Should specificy if the input data was filtered with something different to what is in the ThresholdSettings.")
+
+# other options
+
+parser.add_option( "--TCKData", action = "store", dest = "TCKData",
+ default = "", help = "TCKData")
+
+parser.add_option( "--DisableRunStampCheck", action = "store_true",
+ default = False, help = "DisableRunStampCheck")
+
+parser.add_option( "--EnableOutputStreaming", action = "store_true",
+ default = False, help = "EnableOutputStreaming")
+
+parser.add_option( "--input_rate",type="float",action="store",dest="input_rate",
+ default=1.e6,help="Input rate from L0 in Hz")
+
+parser.add_option( "--tuplefile",action="store",dest="tuplefile",
+ default="tuples.root",help="Output root file")
+
+parser.add_option( "--outputFile",action="store",dest="outputFile",
+ default="",help="OutputFile")
+
+parser.add_option( "--OutputLevel",type="int",action="store",dest="OutputLevel",
+ default=3,help="OutputLevel")
+
+parser.add_option( "--hlt1changes",action="store",dest="hlt1changes",
+ default="DefHlt1",help="Changes to Hlt1 thresholds")
+
+parser.add_option( "--AdditionalHlt2Lines",action="store",dest="AdditionalHlt2Lines",
+ default="",help="Semicolon separated list of lines")
+
+parser.add_option( "--debug", action="store_true", dest="debug",
+ default=False, help="Debug?")
+
+# Parse the arguments
+(options, args) = parser.parse_args()
+
+# write some information about the test (needed for the handler that makes the web page)
+f = open("JobSettings.txt",'w')
+f.write("%s_%s_%s" %(options.inputdata,options.ThresholdSettings,options.hlt1changes))
+