9 #include "CLHEP/Random/RandGaussQ.h" 10 #include "CLHEP/Units/GlobalPhysicalConstants.h" 11 #include "CLHEP/Units/GlobalSystemOfUnits.h" 48 mapI != lastSignal; ++mapI)
50 int wireGroup = (*mapI).first;
52 LogTrace(
"CSCWireElectronicsSim") <<
"CSCWireElectronicsSim: dump of wire signal follows... " 54 int signalSize = signal.
getSize();
62 threshold += CLHEP::RandGaussQ::shoot(engine) *
theWireNoise;
64 for(
int ibin = 0; ibin < signalSize; ++ibin)
70 int lastbin = signalSize;
72 for(i = ibin; i < signalSize; ++
i) {
81 for ( i = ibin; i < lastbin; ++
i)
84 if(next_charge > qMax) {
89 int bin_firing_FD = 0;
90 for ( i = ibin; i < lastbin; ++
i)
124 int bxInt =
static_cast<int>(bxFloat);
125 if(bxFloat >= 0 && bxFloat < 16)
127 timeWord |= (1 << bxInt );
129 if(bxFloat-bxInt > 0.6)
131 timeWord |= (1 << (bxInt+1) );
155 LogTrace(
"CSCWireElectronicsSim") << newDigi;
156 digis.insertDigi(
layerId(), newDigi);
164 static const float fC_by_ns = 1000000;
165 static const float resistor = 20000;
166 static const float amplifier_pole = 1/7.5;
167 static const float fastest_chamber_exp_risetime = 10.;
168 static const float p0=amplifier_pole;
169 static const float p1=1/fastest_chamber_exp_risetime;
171 static const float dp = p0 -
p1;
175 static const float norm = -12 * resistor * p1 *
pow(p0/dp, 4) / fC_by_ns;
177 float enable_disc_volts = norm*(
exp(-p0*t) *(1 +
182 static const float collectionFraction = 0.12;
183 static const float igain = 1./0.005;
184 return enable_disc_volts * igain * collectionFraction;
191 int middleWireGroup = wireGroup - wireGroup%8 + 4;
193 if(middleWireGroup > numberOfWireGroups)
194 middleWireGroup = numberOfWireGroups;
197 float averageDist = centerOfGroupGroup.
mag();
198 float averageTOF = averageDist * cm / c_light;
200 LogTrace(
"CSCWireElectronicsSim") <<
"CSCWireElectronicsSim: TofCalib wg = " << wireGroup <<
201 " mid wg = " << middleWireGroup <<
202 " av dist = " << averageDist <<
203 " 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