9 #include "CLHEP/Random/RandGaussQ.h" 10 #include "CLHEP/Units/GlobalPhysicalConstants.h" 11 #include "CLHEP/Units/GlobalSystemOfUnits.h" 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;
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
const CSCLayer * theLayer
const CSCChamberSpecs * theSpecs
CSCSignalMap theSignalMap
const CSCLayerGeometry * theLayerGeometry
CSCDetId layerId() const
the CSCDetId corresponding to the current layer
float wireNoise(float timeInterval) const
CSCWireElectronicsSim(const edm::ParameterSet &p)
configurable parameters
void fillDigis(CSCWireDigiCollection &digis, CLHEP::HepRandomEngine *)
int numberOfWireGroups() const
void initParameters() override
initialization for each layer
int wireGroup(int wire) const
float calculateAmpResponse(float t) const override
virtual void addLinks(int channelIndex)
float getBinValue(int i) const
virtual float timeOfFlightCalibration(int wireGroup) const
int readoutElement(int element) const override
int channelIndex(int channel) const override
we code strip indices from 1-80, and wire indices start at 100
Power< A, B >::type pow(const A &a, const B &b)
GlobalPoint centerOfWireGroup(int wireGroup) const
std::vector< double > theTimingCalibrationError