12SVD Charge Simulation Calibration importer (MC).
13Script to import charge coupling constants for simulation into a local DB
16from ROOT
import Belle2
17from ROOT.Belle2
import SVDChargeSimCal
19from basf2
import conditions
as b2conditions
21now = datetime.datetime.now()
33apvCoupling_L3_U = 0.00
40apvCoupling_L3_V = 0.00
48apvCoupling_fw_U = 0.00
55apvCoupling_fw_V = 0.00
63apvCoupling_bk_U = 0.00
70apvCoupling_bk_V = 0.00
78apvCoupling_or_U = 0.00
85apvCoupling_or_V = 0.00
89 ''' default coupling constants importer'''
96 chargeSimCal = SVDChargeSimCal()
99 str(now.isoformat()) +
"_INFO:release-06_APVCouplings=0")
103 for layer
in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
104 layerNumber = layer.getLayerNumber()
105 for ladder
in geoCache.getLadders(layer):
106 ladderNumber = ladder.getLadderNumber()
107 for sensor
in geoCache.getSensors(ladder):
108 sensorNumber = sensor.getSensorNumber()
110 print(
"setting ChargeSimulation for " +
111 str(layerNumber) +
"." + str(ladderNumber) +
"." + str(sensorNumber) +
"." + str(side))
114 apvCoupling = apvCoupling_L3_V
121 if sensorNumber == 1:
122 apvCoupling = apvCoupling_fw_V
129 if sensorNumber == layerNumber - 1:
130 apvCoupling = apvCoupling_bk_V
137 apvCoupling = apvCoupling_or_V
145 apvCoupling = apvCoupling_L3_U
152 if sensorNumber == 1:
153 apvCoupling = apvCoupling_fw_U
160 if sensorNumber == layerNumber - 1:
161 apvCoupling = apvCoupling_bk_U
168 apvCoupling = apvCoupling_or_U
175 chargeSimCal.couplingConstant[
'C0'] = c0
176 chargeSimCal.couplingConstant[
'C1'] = c1
177 chargeSimCal.couplingConstant[
'C2'] = c2
178 chargeSimCal.couplingConstant[
'C3'] = c3
179 chargeSimCal.couplingConstant[
'APVCoupling'] = apvCoupling
180 chargeSimCal.electronWeight = ew
181 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, chargeSimCal)
186b2conditions.prepend_globaltag(
"svd_onlySVDinGeoConfiguration")
188main = b2.create_path()
191eventinfosetter = b2.register_module(
'EventInfoSetter')
192eventinfosetter.param({
'evtNumList': [1],
'expList': 0,
'runList': 0})
193main.add_module(eventinfosetter)
195main.add_module(
"Gearbox")
196main.add_module(
"Geometry")
201progress = b2.register_module(
'Progress')
202main.add_module(progress)
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
base class for calibrations classes
static GeoCache & getInstance()
Return a reference to the singleton instance.
static Database & Instance()
Instance of a singleton Database.