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();
48 threshold += CLHEP::RandGaussQ::shoot(engine) *
theWireNoise;
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") << 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 =
159 norm * (
exp(-p0 * t) * (1 + t * dp +
pow(t * dp, 2) / 2 +
pow(t * dp, 3) / 6) -
exp(-p1 * t));
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;
std::vector< double > theBunchTimingOffsets
float calculateAmpResponse(float t) const override
const CSCLayer * theLayer
const CSCChamberSpecs * theSpecs
CSCSignalMap theSignalMap
const CSCLayerGeometry * theLayerGeometry
float getBinValue(int i) const
CSCWireElectronicsSim(const edm::ParameterSet &p)
configurable parameters
int numberOfWireGroups() const
int channelIndex(int channel) const override
we code strip indices from 1-80, and wire indices start at 100
int wireGroup(int wire) const
float wireNoise(float timeInterval) const
void fillDigis(CSCWireDigiCollection &digis, CLHEP::HepRandomEngine *)
void initParameters() override
initialization for each layer
int readoutElement(int element) const override
GlobalPoint centerOfWireGroup(int wireGroup) const
virtual void addLinks(int channelIndex)
CSCDetId layerId() const
the CSCDetId corresponding to the current layer
virtual float timeOfFlightCalibration(int wireGroup) const
Power< A, B >::type pow(const A &a, const B &b)
std::vector< double > theTimingCalibrationError