9 #include "CLHEP/Random/RandGaussQ.h"
10 #include "CLHEP/Units/GlobalPhysicalConstants.h"
11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
37 int wireGroup = (*mapI).first;
39 LogTrace(
"CSCWireElectronicsSim") <<
"CSCWireElectronicsSim: dump of wire signal follows... " << signal;
40 int signalSize = signal.
getSize();
50 for (
int ibin = 0; ibin < signalSize; ++ibin) {
54 int lastbin = signalSize;
56 for (
i = ibin;
i < signalSize; ++
i) {
65 for (
i = ibin;
i < lastbin; ++
i) {
67 if (next_charge > qMax) {
72 int bin_firing_FD = 0;
73 for (
i = ibin;
i < lastbin; ++
i) {
108 int bxInt = static_cast<int>(bxFloat);
109 if (bxFloat >= 0 && bxFloat < 16) {
110 timeWord |= (1 << bxInt);
112 if (bxFloat - bxInt > 0.6) {
113 timeWord |= (1 << (bxInt + 1));
137 LogTrace(
"CSCWireElectronicsSim") <<
"CSCWireElectronicsSim: " << newDigi;
138 digis.insertDigi(
layerId(), newDigi);
145 static const float fC_by_ns = 1000000;
146 static const float resistor = 20000;
147 static const float amplifier_pole = 1 / 7.5;
148 static const float fastest_chamber_exp_risetime = 10.;
149 static const float p0 = amplifier_pole;
150 static const float p1 = 1 / fastest_chamber_exp_risetime;
152 static const float dp = p0 -
p1;
156 static const float norm = -12 * resistor *
p1 *
pow(p0 /
dp, 4) / fC_by_ns;
158 float enable_disc_volts =
160 static const float collectionFraction = 0.12;
161 static const float igain = 1. / 0.005;
162 return enable_disc_volts * igain * collectionFraction;
168 int middleWireGroup = wireGroup - wireGroup % 8 + 4;
170 if (middleWireGroup > numberOfWireGroups)
171 middleWireGroup = numberOfWireGroups;
174 float averageDist = centerOfGroupGroup.
mag();
175 float averageTOF = averageDist * cm / c_light;
177 LogTrace(
"CSCWireElectronicsSim") <<
"CSCWireElectronicsSim: TofCalib wg = " << wireGroup
178 <<
" mid wg = " << middleWireGroup <<
" av dist = " << averageDist
179 <<
" av tof = " << averageTOF;