|
118 | 118 | parser.add_argument('--no-tpc-digitchunking', action='store_true', help=argparse.SUPPRESS) |
119 | 119 | parser.add_argument('--no-strangeness-tracking', action='store_true', default=False, help="Disable strangeness tracking") |
120 | 120 | parser.add_argument('--combine-tpc-clusterization', action='store_true', help=argparse.SUPPRESS) #<--- useful for small productions (pp, low interaction rate, small number of events) |
121 | | -parser.add_argument('--first-orbit', default=0, type=int, help=argparse.SUPPRESS) # to set the first orbit number of the run for HBFUtils (only used when anchoring) |
| 121 | +parser.add_argument('--first-orbit', default=256, type=int, help=argparse.SUPPRESS) # to set the first orbit number of the run for HBFUtils (only used when anchoring); default 256 for convenience to allow for some orbits-early |
122 | 122 | # (consider doing this rather in O2 digitization code directly) |
123 | 123 | parser.add_argument('--orbits-early', default=0, type=float, help=argparse.SUPPRESS) # number of orbits to start simulating earlier |
124 | 124 | # to reduce start of timeframe effects in MC --> affects collision context |
@@ -244,21 +244,44 @@ def retrieve_sor(run_number): |
244 | 244 | """ |
245 | 245 | retrieves start of run (sor) |
246 | 246 | from the RCT/Info/RunInformation table with a simple http request |
247 | | - in case of problems, 0 will be returned |
| 247 | + in case of problems, 0 will be returned. Simple http request has advantage |
| 248 | + of not needing to initialize a Ccdb object. |
248 | 249 | """ |
| 250 | + |
249 | 251 | url="http://alice-ccdb.cern.ch/browse/RCT/Info/RunInformation/"+str(run_number) |
250 | 252 | ansobject=requests.get(url) |
251 | 253 | tokens=ansobject.text.split("\n") |
252 | 254 |
|
| 255 | + # determine start of run, earlier values take precedence (see also implementation in BasicCCDBManager::getRunDuration) |
| 256 | + STF=0 |
| 257 | + # extract SOR by pattern matching |
| 258 | + for t in tokens: |
| 259 | + match_object=re.match(r"\s*(STF\s*=\s*)([0-9]*)\s*", t) |
| 260 | + if match_object != None: |
| 261 | + STF=int(match_object[2]) |
| 262 | + break |
| 263 | + if STF > 0: |
| 264 | + return STF |
| 265 | + |
| 266 | + SOX=0 |
| 267 | + # extract SOX by pattern matching |
| 268 | + for t in tokens: |
| 269 | + match_object=re.match(r"\s*(STF\s*=\s*)([0-9]*)\s*", t) |
| 270 | + if match_object != None: |
| 271 | + SOX=int(match_object[2]) |
| 272 | + break |
| 273 | + if SOX > 0: |
| 274 | + return SOX |
| 275 | + |
253 | 276 | SOR=0 |
254 | 277 | # extract SOR by pattern matching |
255 | 278 | for t in tokens: |
256 | 279 | match_object=re.match("\s*(SOR\s*=\s*)([0-9]*)\s*", t) |
257 | 280 | if match_object != None: |
258 | | - SOR=match_object[2] |
| 281 | + SOR=int(match_object[2]) |
259 | 282 | break |
260 | | - |
261 | | - return int(SOR) |
| 283 | + |
| 284 | + return SOR |
262 | 285 |
|
263 | 286 |
|
264 | 287 | # check and sanitize config-key values (extract and remove diamond vertex arguments into finalDiamondDict) |
|
0 commit comments