13 SVD Charge Simulation Calibration importer (MC).
14 Script to import charge coupling constants for simulation into a local DB
17 from ROOT
import Belle2
18 from ROOT.Belle2
import SVDChargeSimCal
20 from basf2
import conditions
as b2conditions
22 now = datetime.datetime.now()
34 apvCoupling_L3_U = 0.00
41 apvCoupling_L3_V = 0.00
49 apvCoupling_fw_U = 0.00
56 apvCoupling_fw_V = 0.00
64 apvCoupling_bk_U = 0.00
71 apvCoupling_bk_V = 0.00
79 apvCoupling_or_U = 0.00
86 apvCoupling_or_V = 0.00
90 ''' default coupling constants importer'''
97 chargeSimCal = SVDChargeSimCal()
100 str(now.isoformat()) +
"_INFO:release-06_APVCouplings=0")
104 for layer
in geoCache.getLayers(Belle2.VXD.SensorInfoBase.SVD):
105 layerNumber = layer.getLayerNumber()
106 for ladder
in geoCache.getLadders(layer):
107 ladderNumber = ladder.getLadderNumber()
108 for sensor
in geoCache.getSensors(ladder):
109 sensorNumber = sensor.getSensorNumber()
111 print(
"setting ChargeSimulation for " +
112 str(layerNumber) +
"." + str(ladderNumber) +
"." + str(sensorNumber) +
"." + str(side))
115 apvCoupling = apvCoupling_L3_V
122 if sensorNumber == 1:
123 apvCoupling = apvCoupling_fw_V
130 if sensorNumber == layerNumber - 1:
131 apvCoupling = apvCoupling_bk_V
138 apvCoupling = apvCoupling_or_V
146 apvCoupling = apvCoupling_L3_U
153 if sensorNumber == 1:
154 apvCoupling = apvCoupling_fw_U
161 if sensorNumber == layerNumber - 1:
162 apvCoupling = apvCoupling_bk_U
169 apvCoupling = apvCoupling_or_U
176 chargeSimCal.couplingConstant[
'C0'] = c0
177 chargeSimCal.couplingConstant[
'C1'] = c1
178 chargeSimCal.couplingConstant[
'C2'] = c2
179 chargeSimCal.couplingConstant[
'C3'] = c3
180 chargeSimCal.couplingConstant[
'APVCoupling'] = apvCoupling
181 chargeSimCal.electronWeight = ew
182 payload.set(layerNumber, ladderNumber, sensorNumber, bool(side), 1, chargeSimCal)
187 b2conditions.prepend_globaltag(
"svd_onlySVDinGeoConfiguration")
189 main = b2.create_path()
192 eventinfosetter = b2.register_module(
'EventInfoSetter')
193 eventinfosetter.param({
'evtNumList': [1],
'expList': 0,
'runList': 0})
194 main.add_module(eventinfosetter)
196 main.add_module(
"Gearbox")
197 main.add_module(
"Geometry")
202 progress = b2.register_module(
'Progress')
203 main.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.