33
44
55class WFN :
6- # a simple class to number workflows dynamically
7- def __init__ (self , offset ):
6+ def __init__ (self , offset : int ):
87 self .offset = offset
9- self .index = 0
10- self .subindex = 1
11-
12- def __call__ (self ):
13- if self .subindex == 100 :
14- print ("this is not going to work nicely" )
15- self .subindex = 0 / 0
16- r = float (f'{ self .offset } .{ self .index } { self .subindex :02d} ' )
17- self .subindex += 1
18- return r
19-
20- def next (self , index = None ):
8+ self .index = 1
9+ self .thousands = 0
10+ self .hundreds = 0
11+
12+ def __call__ (self ) -> float :
13+ if self .index >= 100 :
14+ raise ValueError ("Overflow: Leading-index exceeded limit (100)" )
15+ value_str = f"{ self .offset } .{ self .thousands } { self .hundreds } { self .index :02d} "
16+ result = float (value_str )
17+ self .index += 1
18+ return result
19+
20+ def subnext (self ) -> None :
21+ self .hundreds += 1
22+ self .index = 1
23+ if self .hundreds >= 10 :
24+ raise ValueError ("Overflow: Sub-index (hundreds) exceeded limit (999)" )
25+
26+ def next (self , index : int = None ) -> None :
2127 if index is None :
22- self .index += 1
28+ self .thousands += 1
29+ self .hundreds = 0
2330 else :
24- # manually set the index if given
25- assert index > self . index
26- self .index = index
27- self .subindex = 1
31+ if index <= self . thousands :
32+ raise ValueError ( "New index must be greater than current index" )
33+ self .thousands = index
34+ self .hundreds = 0
2835
29- def subnext ( self ) :
30- # go to the next tenth for the subindex 10 because of 02d formating
31- self .subindex = math . ceil ( self . subindex / 10. ) * 10 + 1
36+ if self . thousands >= 10 :
37+ raise ValueError ( "Overflow: Sub-sub-index (thousands) exceeded limit (9999)" )
38+ self .index = 1
3239
3340
3441workflows = Matrix ()
@@ -378,7 +385,7 @@ def subnext(self):
378385
379386################################################################
380387_wfn = WFN (2500 )
381- ######## 2500.0xx ########
388+ ######## 2500.0xxx ########
382389# Run2, 10_6_X MiniAOD input (current recommendation for 2016--2018)
383390workflows [_wfn ()] = ['NANOmc106Xul16v2' , ['TTbarMINIAOD10.6_UL16v2' , 'NANO_mc10.6ul16v2' , 'HRV_NANO_mc' ]]
384391workflows [_wfn ()] = ['NANOmc106Xul17v2' , ['TTbarMINIAOD10.6_UL17v2' , 'NANO_mc10.6ul17v2' , 'HRV_NANO_mc' ]]
@@ -403,7 +410,7 @@ def subnext(self):
403410workflows [_wfn ()] = ['NANOdataUL18reMINI' , ['RunJetHT2018D_reminiaodUL' , 'REMINIAOD_data2018UL' , 'NANO_data_UL18reMINI' , 'HRV_NANO_data' ]] # noqa
404411
405412_wfn .next (1 )
406- ######## 2500.1xx ########
413+ ######## 2500.1xxx ########
407414# Run3, 13_0_X input (current recommendation for 2022--2023)
408415workflows [_wfn ()] = ['NANOmc130X' , ['TTbarMINIAOD13.0' , 'NANO_mc13.0' , 'HRV_NANO_mc' ]]
409416
@@ -421,7 +428,7 @@ def subnext(self):
421428_wfn .subnext ()
422429
423430_wfn .next (2 )
424- ######## 2500.2xx ########
431+ ######## 2500.2xxx ########
425432# Run3, 14_0_X input (2024 RAW/AOD)
426433# Standard NANO, MC
427434
@@ -474,7 +481,7 @@ def subnext(self):
474481workflows [_wfn ()] = ['NANOdata2024reMINI' , ['JetMET1_Run2024H_AOD_140X' , 'REMINIAOD_data2024' , 'NANO_data_2024_reMINI' , 'HRV_NANO_data' ]] # noqa
475482
476483_wfn .next (3 )
477- ######## 2500.3xx ########
484+ ######## 2500.3xxx ########
478485# Run3, 15_0_X input (2024 MINIv6+NANOv15 & 2025 data-taking)
479486# Standard NANO, MC
480487workflows [_wfn ()] = ['NANOmc150X' , ['TTbar_13p6_Summer24_MINIAOD_150X' , 'NANO_mc15.0' , 'HRV_NANO_mc' ]]
@@ -516,7 +523,7 @@ def subnext(self):
516523
517524
518525_wfn .next (9 )
519- ######## 2500.9xx ########
526+ ######## 2500.9xxx ########
520527# NANOGEN
521528workflows [_wfn ()] = ['' , ['TTbarMINIAOD10.6_UL18v2' , 'NANOGENFromMini' ]]
522529workflows [_wfn ()] = ['' , ['TTbarMINIAOD14.0' , 'NANOGENFromMini' ]]
0 commit comments