|
19 | 19 | from ROOT import gSystem |
20 | 20 | from ROOT.Belle2 import CDCDedxRunGainAlgorithm, CDCDedxCosineAlgorithm, CDCDedxWireGainAlgorithm |
21 | 21 | from ROOT.Belle2 import CDCDedxCosEdgeAlgorithm, CDCDedxBadWireAlgorithm, CDCDedxInjectTimeAlgorithm |
| 22 | +from ROOT.Belle2 import CDCDedx1DCellAlgorithm |
| 23 | + |
22 | 24 | from caf.framework import Calibration |
23 | 25 | from caf.strategies import SequentialRunByRun, SequentialBoundaries |
24 | 26 | from prompt import CalibrationSettings, INPUT_DATA_FILTERS |
@@ -130,10 +132,11 @@ def get_calibrations(input_data, **kwargs): |
130 | 132 | "timegain1": 0, # Injection time gain |
131 | 133 | "rungain1": 0, # Run Gain Pre (No Payload saving) |
132 | 134 | "coscorr0": 0, # Cosine Corr Gain Pre (No Payload saving) |
133 | | - "coscorr1": 0, # Cosine Corr Gain |
134 | 135 | "cosedge0": 0, # Cosine edge Corr Gain |
135 | 136 | "badwire0": 0, # Bad wire |
136 | 137 | "wiregain0": 0, # WireGain Gain |
| 138 | + "onedcell0": 0, # OneD cell correction |
| 139 | + "coscorr1": 0, # Cosine Corr Gain |
137 | 140 | "rungain2": 0 # Final Run Gain to take Wire and Cosine correction in effect |
138 | 141 | } |
139 | 142 | elif calib_mode == "quick": |
@@ -173,6 +176,8 @@ def get_calibrations(input_data, **kwargs): |
173 | 176 | alg = [badwire_algo()] |
174 | 177 | elif cal_name == "wiregain": |
175 | 178 | alg = [wiregain_algo()] |
| 179 | + elif cal_name == "onedcell": |
| 180 | + alg = [onedcell_algo()] |
176 | 181 | else: |
177 | 182 | basf2.B2FATAL(f"The calibration is not defined, check spelling: calib {i}: {calib_keys[i]}") |
178 | 183 |
|
@@ -220,11 +225,11 @@ def pre_collector(name='rg'): |
220 | 225 |
|
221 | 226 | reco_path = basf2.create_path() |
222 | 227 | recon.prepare_cdst_analysis(path=reco_path) |
223 | | - if (name == "timegain"): |
| 228 | + if (name == "timegain" or name == "onedcell"): |
224 | 229 | trg_bhabhaskim = reco_path.add_module("TriggerSkim", triggerLines=["software_trigger_cut&skim&accept_radee"]) |
225 | 230 | trg_bhabhaskim.if_value("==0", basf2.Path(), basf2.AfterConditionPath.END) |
226 | | - # ps_bhabhaskim = reco_path.add_module("Prescale", prescale=0.80) |
227 | | - # ps_bhabhaskim.if_value("==0", basf2.Path(), basf2.AfterConditionPath.END) |
| 231 | + ps_bhabhaskim = reco_path.add_module("Prescale", prescale=0.80) |
| 232 | + ps_bhabhaskim.if_value("==0", basf2.Path(), basf2.AfterConditionPath.END) |
228 | 233 |
|
229 | 234 | elif (name == "cosedge"): |
230 | 235 | trg_bhabhaskim = reco_path.add_module( |
@@ -278,6 +283,15 @@ def collector(granularity='all', name=''): |
278 | 283 | elif name == "wiregain": |
279 | 284 | CollParam = {'isWire': True, 'isDedxhit': True, 'granularity': granularity} |
280 | 285 |
|
| 286 | + elif name == "onedcell": |
| 287 | + CollParam = { |
| 288 | + 'isPt': True, |
| 289 | + 'isCosth': True, |
| 290 | + 'isLayer': True, |
| 291 | + 'isDedxhit': True, |
| 292 | + 'isEntaRS': True, |
| 293 | + 'granularity': granularity} |
| 294 | + |
281 | 295 | else: |
282 | 296 | CollParam = {'isRun': True, 'granularity': 'run'} |
283 | 297 |
|
@@ -370,6 +384,18 @@ def wiregain_algo(): |
370 | 384 | return algo |
371 | 385 |
|
372 | 386 |
|
| 387 | +def onedcell_algo(): |
| 388 | + """ |
| 389 | + Create oned cell calibration algorithim. |
| 390 | + Returns: |
| 391 | + algo : oned cell correction algorithm |
| 392 | + """ |
| 393 | + algo = CDCDedx1DCellAlgorithm() |
| 394 | + algo.enableExtraPlots(True) |
| 395 | + algo.setMergePayload(True) |
| 396 | + return algo |
| 397 | + |
| 398 | + |
373 | 399 | class CDCDedxCalibration(Calibration): |
374 | 400 | ''' |
375 | 401 | CDCDedxCalibration is a specialized calibration for cdcdedx. |
@@ -402,7 +428,7 @@ def __init__(self, |
402 | 428 | input_files=input_file_dict[2], |
403 | 429 | pre_collector_path=pre_collector(cal_name) |
404 | 430 | ) |
405 | | - elif cal_name == "coscorr" or cal_name == "cosedge": |
| 431 | + elif cal_name == "coscorr" or cal_name == "cosedge" or cal_name == "onedcell": |
406 | 432 | collection = Collection(collector=collector(granularity=collector_granularity, name=cal_name), |
407 | 433 | input_files=input_file_dict[1], |
408 | 434 | pre_collector_path=pre_collector(cal_name) |
|
0 commit comments