Skip to content

Commit 1f83a4a

Browse files
committed
Merge branch 'cherry-pick-1ccfc785-2' into 'release/09-00'
Merge branch 'feature/change_sequence_dedx_calibration' into 'release/09-00' See merge request belle2/software/basf2!3871
2 parents 268acd0 + a60cbec commit 1f83a4a

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

calibration/scripts/prompt/calibrations/caf_cdcdedx.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from ROOT import gSystem
2020
from ROOT.Belle2 import CDCDedxRunGainAlgorithm, CDCDedxCosineAlgorithm, CDCDedxWireGainAlgorithm
2121
from ROOT.Belle2 import CDCDedxCosEdgeAlgorithm, CDCDedxBadWireAlgorithm, CDCDedxInjectTimeAlgorithm
22+
from ROOT.Belle2 import CDCDedx1DCellAlgorithm
23+
2224
from caf.framework import Calibration
2325
from caf.strategies import SequentialRunByRun, SequentialBoundaries
2426
from prompt import CalibrationSettings, INPUT_DATA_FILTERS
@@ -130,10 +132,11 @@ def get_calibrations(input_data, **kwargs):
130132
"timegain1": 0, # Injection time gain
131133
"rungain1": 0, # Run Gain Pre (No Payload saving)
132134
"coscorr0": 0, # Cosine Corr Gain Pre (No Payload saving)
133-
"coscorr1": 0, # Cosine Corr Gain
134135
"cosedge0": 0, # Cosine edge Corr Gain
135136
"badwire0": 0, # Bad wire
136137
"wiregain0": 0, # WireGain Gain
138+
"onedcell0": 0, # OneD cell correction
139+
"coscorr1": 0, # Cosine Corr Gain
137140
"rungain2": 0 # Final Run Gain to take Wire and Cosine correction in effect
138141
}
139142
elif calib_mode == "quick":
@@ -173,6 +176,8 @@ def get_calibrations(input_data, **kwargs):
173176
alg = [badwire_algo()]
174177
elif cal_name == "wiregain":
175178
alg = [wiregain_algo()]
179+
elif cal_name == "onedcell":
180+
alg = [onedcell_algo()]
176181
else:
177182
basf2.B2FATAL(f"The calibration is not defined, check spelling: calib {i}: {calib_keys[i]}")
178183

@@ -220,11 +225,11 @@ def pre_collector(name='rg'):
220225

221226
reco_path = basf2.create_path()
222227
recon.prepare_cdst_analysis(path=reco_path)
223-
if (name == "timegain"):
228+
if (name == "timegain" or name == "onedcell"):
224229
trg_bhabhaskim = reco_path.add_module("TriggerSkim", triggerLines=["software_trigger_cut&skim&accept_radee"])
225230
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)
228233

229234
elif (name == "cosedge"):
230235
trg_bhabhaskim = reco_path.add_module(
@@ -278,6 +283,15 @@ def collector(granularity='all', name=''):
278283
elif name == "wiregain":
279284
CollParam = {'isWire': True, 'isDedxhit': True, 'granularity': granularity}
280285

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+
281295
else:
282296
CollParam = {'isRun': True, 'granularity': 'run'}
283297

@@ -370,6 +384,18 @@ def wiregain_algo():
370384
return algo
371385

372386

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+
373399
class CDCDedxCalibration(Calibration):
374400
'''
375401
CDCDedxCalibration is a specialized calibration for cdcdedx.
@@ -402,7 +428,7 @@ def __init__(self,
402428
input_files=input_file_dict[2],
403429
pre_collector_path=pre_collector(cal_name)
404430
)
405-
elif cal_name == "coscorr" or cal_name == "cosedge":
431+
elif cal_name == "coscorr" or cal_name == "cosedge" or cal_name == "onedcell":
406432
collection = Collection(collector=collector(granularity=collector_granularity, name=cal_name),
407433
input_files=input_file_dict[1],
408434
pre_collector_path=pre_collector(cal_name)

0 commit comments

Comments
 (0)