Belle II Software  release-08-01-10
ImportScintillatorDigitizationParameters.py
1 #!/usr/bin/env python3
2 
3 
10 
11 # Import KLM scintillator digitization parameters payloads.
12 
13 import sys
14 import basf2
15 import math
16 from ROOT.Belle2 import KLMDatabaseImporter, KLMScintillatorDigitizationParameters
17 
18 basf2.set_log_level(basf2.LogLevel.INFO)
19 
20 mc = False
21 if (len(sys.argv) >= 2):
22  if (sys.argv[1] == 'mc'):
23  mc = True
24 
25 dbImporter = KLMDatabaseImporter()
26 
27 digPar = KLMScintillatorDigitizationParameters()
28 # ADC resolution (maximal output value + 1).
29 digPar.setADCRange(4096)
30 # ADC sampling time in TDC periods (frequency is global clock * 8).
31 digPar.setADCSamplingTDCPeriods(1)
32 # Number of digitizations.
33 digPar.setNDigitizations(200)
34 # ADC pedestal.
35 digPar.setADCPedestal(3700)
36 # Photoelectron amplitude.
37 digPar.setADCPEAmplitude(20)
38 # ADC threshold (the difference with pedestal is 3 photoelectron amplitudes).
39 digPar.setADCThreshold(3640)
40 # ADC output value corresponding to saturation.
41 digPar.setADCSaturation(1000)
42 # Number of photoelectrons per 1 MeV.
43 digPar.setNPEperMeV(22)
44 # Cosine of the maximal angle of total internal reflection in the fiber.
45 digPar.setMinCosTheta(math.cos(26.7 / 180.0 * math.pi))
46 # Mirror reflective index.
47 digPar.setMirrorReflectiveIndex(0.95)
48 # Scintillator deexcitation time in ns.
49 digPar.setScintillatorDeExcitationTime(3.0)
50 # Fiber deexcitation time in ns.
51 digPar.setFiberDeExcitationTime(10.0)
52 # Effective light speed in the fiber in cm/ns.
53 digPar.setFiberLightSpeed(17.0)
54 # Fiber attenuation length.
55 digPar.setAttenuationLength(300.0)
56 # Photoelectron signal attenuation frequency in ns^{-1}.
57 # Value from T2K paper by F. Retiere: PoS (PD07) 017: 1.0 / 8.75.
58 digPar.setPEAttenuationFrequency(0.11428571428571428571)
59 # Mean SiPM noise (negative: turned off).
60 digPar.setMeanSiPMNoise(-1)
61 # Constant background.
62 digPar.setEnableConstBkg(False)
63 
64 if (mc):
65  dbImporter.setIOV(1002, 0, 1002, -1)
66  dbImporter.importScintillatorDigitizationParameters(digPar)
67 
68  dbImporter.setIOV(1003, 0, 1003, -1)
69  dbImporter.importScintillatorDigitizationParameters(digPar)
70 
71  dbImporter.setIOV(0, 0, 0, -1)
72  dbImporter.importScintillatorDigitizationParameters(digPar)
73 
74 else:
75  dbImporter.setIOV(0, 0, -1, -1)
76  dbImporter.importScintillatorDigitizationParameters(digPar)