#include <CSCStripElectronicsSim.h>
Public Member Functions | |
void | createDigi (int istrip, const CSCAnalogSignal &signal, std::vector< CSCStripDigi > &result) |
CSCStripElectronicsSim (const edm::ParameterSet &p) | |
configurable parameters | |
void | fillDigis (CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators) |
void | fillMissingLayer (const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis) |
CSCAnalogSignal | makeNoiseSignal (int element) |
void | setStripConditions (CSCStripConditions *cond) |
virtual | ~CSCStripElectronicsSim () |
Private Member Functions | |
void | addCrosstalk () |
void | addCrosstalk (const CSCAnalogSignal &signal, int thisStrip, int otherStrip) |
float | calculateAmpResponse (float t) const |
std::list< int > | channelsToRead (const std::list< int > &keyStrips, int window) const |
float | comparatorReading (const CSCAnalogSignal &signal, float time) const |
calculates the comparator reading, including saturation and offsets | |
void | doSaturation (CSCStripDigi &digi) |
void | fillStripDigis (const std::list< int > &keyStrips, CSCStripDigiCollection &digis) |
std::list< int > | getKeyStrips (const std::vector< CSCComparatorDigi > &comparators) const |
finds the key strips from these comparators | |
std::list< int > | getKeyStripsFromMC () const |
get ths strips that have detector hits | |
void | getReadoutRange (int inputStrip, int &minStrip, int &maxStrip) |
void | initParameters () |
initialization for each layer | |
virtual int | readoutElement (int strip) const |
void | runComparator (std::vector< CSCComparatorDigi > &result) |
void | selfTest () const |
Private Attributes | |
bool | doCrosstalk_ |
bool | doSuppression_ |
int | nScaBins_ |
int | sca_peak_bin |
float | sca_time_bin_size |
CSCStripAmpResponse | theAmpResponse |
float | theAverageTimeOfFlight |
int | theComparatorClockJump |
float | theComparatorDeadTime |
float | theComparatorNoise |
float | theComparatorRMSOffset |
double | theComparatorSamplingTime |
float | theComparatorSaturation |
float | theComparatorThreshold |
double | theComparatorTimeBinOffset |
double | theComparatorTimeOffset |
float | theComparatorWait |
CSCCrosstalkGenerator * | theCrosstalkGenerator |
float | theDaqDeadTime |
std::vector< double > | theSCATimingOffsets |
CSCStripConditions * | theStripConditions |
float | theTimingOffset |
Model the readout electronics chain for EMU CSC strips
Definition at line 23 of file CSCStripElectronicsSim.h.
CSCStripElectronicsSim::CSCStripElectronicsSim | ( | const edm::ParameterSet & | p | ) | [explicit] |
configurable parameters
Definition at line 20 of file CSCStripElectronicsSim.cc.
References doCrosstalk_, CSCBaseElectronicsSim::fillAmpResponse(), and theCrosstalkGenerator.
: CSCBaseElectronicsSim(p), theAmpResponse(theShapingTime, CSCStripAmpResponse::RADICAL), theComparatorThreshold(20.), theComparatorNoise(0.), theComparatorRMSOffset(2.), theComparatorSaturation(1057.), theComparatorWait(50.), theComparatorDeadTime(100.), theDaqDeadTime(200.), theTimingOffset(0.), nScaBins_(p.getParameter<int>("nScaBins")), doSuppression_(p.getParameter<bool>("doSuppression")), doCrosstalk_(p.getParameter<bool>("doCrosstalk")), theStripConditions(0), theCrosstalkGenerator(0), theComparatorClockJump(2), sca_time_bin_size(50.), sca_peak_bin(p.getParameter<int>("scaPeakBin")), theComparatorTimeBinOffset(p.getParameter<double>("comparatorTimeBinOffset")), theComparatorTimeOffset(p.getParameter<double>("comparatorTimeOffset")), theComparatorSamplingTime(p.getParameter<double>("comparatorSamplingTime")), theSCATimingOffsets(p.getParameter<std::vector<double> >("scaTimingOffsets")) { if(doCrosstalk_) { theCrosstalkGenerator = new CSCCrosstalkGenerator(); } fillAmpResponse(); }
CSCStripElectronicsSim::~CSCStripElectronicsSim | ( | ) | [virtual] |
Definition at line 53 of file CSCStripElectronicsSim.cc.
References doCrosstalk_, and theCrosstalkGenerator.
{ if(doCrosstalk_) { delete theCrosstalkGenerator; } }
void CSCStripElectronicsSim::addCrosstalk | ( | ) | [private] |
Definition at line 363 of file CSCStripElectronicsSim.cc.
References CSCBaseElectronicsSim::nElements, python::multivaluedict::sort(), SortSignalsByTotal(), and CSCBaseElectronicsSim::theSignalMap.
Referenced by fillDigis().
{ // this is needed so we can add a noise signal to the map // without messing up any iterators std::vector<CSCAnalogSignal> realSignals; realSignals.reserve(theSignalMap.size()); CSCSignalMap::iterator mapI = theSignalMap.begin(), mapEnd = theSignalMap.end(); for( ; mapI != mapEnd; ++mapI) { realSignals.push_back((*mapI).second); } sort(realSignals.begin(), realSignals.end(), SortSignalsByTotal); std::vector<CSCAnalogSignal>::iterator realSignalItr = realSignals.begin(), realSignalsEnd = realSignals.end(); for( ; realSignalItr != realSignalsEnd; ++realSignalItr) { int thisStrip = (*realSignalItr).getElement(); // add it to each neighbor if(thisStrip > 1) { int otherStrip = thisStrip - 1; addCrosstalk(*realSignalItr, thisStrip, otherStrip); } if(thisStrip < nElements) { int otherStrip = thisStrip + 1; addCrosstalk(*realSignalItr, thisStrip, otherStrip); } } }
void CSCStripElectronicsSim::addCrosstalk | ( | const CSCAnalogSignal & | signal, |
int | thisStrip, | ||
int | otherStrip | ||
) | [private] |
Definition at line 391 of file CSCStripElectronicsSim.cc.
References CSCStripConditions::crosstalk(), CSCBaseElectronicsSim::find(), CSCCrosstalkGenerator::getCrosstalk(), CSCBaseElectronicsSim::layerId(), TrapezoidalPlaneBounds::length(), readoutElement(), CSCCrosstalkGenerator::setParameters(), CSCAnalogSignal::superimpose(), theCrosstalkGenerator, CSCBaseElectronicsSim::theLayerGeometry, and theStripConditions.
{ float capacitiveCrosstalk, resistiveCrosstalk; bool leftRight = (otherStrip > thisStrip); theStripConditions->crosstalk(layerId(), thisStrip, theLayerGeometry->length(), leftRight, capacitiveCrosstalk, resistiveCrosstalk); theCrosstalkGenerator->setParameters(capacitiveCrosstalk, 0., resistiveCrosstalk); CSCAnalogSignal crosstalkSignal( theCrosstalkGenerator->getCrosstalk(signal) ); find(readoutElement(otherStrip)).superimpose(crosstalkSignal); // Now subtract the crosstalk signal from the original signal crosstalkSignal *= -1.; find(thisStrip).superimpose(crosstalkSignal); }
float CSCStripElectronicsSim::calculateAmpResponse | ( | float | t | ) | const [private, virtual] |
Implements CSCBaseElectronicsSim.
Definition at line 84 of file CSCStripElectronicsSim.cc.
References CSCStripAmpResponse::calculateAmpResponse(), and theAmpResponse.
{ return theAmpResponse.calculateAmpResponse(t); }
std::list< int > CSCStripElectronicsSim::channelsToRead | ( | const std::list< int > & | keyStrips, |
int | window | ||
) | const [private] |
finds what strips to read. Will either take 5 strips around the keystrip, or the whole CFEB, based on doSuppression_
Definition at line 257 of file CSCStripElectronicsSim.cc.
References doSuppression_, i, CSCBaseElectronicsSim::nElements, readoutElement(), query::result, and svgfig::window().
Referenced by fillStripDigis(), and selfTest().
{ std::list<int> result; std::list<int>::const_iterator keyStripItr = keyStrips.begin(); if(doSuppression_) { for( ; keyStripItr != keyStrips.end(); ++keyStripItr) { // pick the five strips around the comparator for(int istrip = (*keyStripItr)-window; istrip <= (*keyStripItr)+window; ++istrip) { if(istrip>0 && istrip<= nElements) { result.push_back(readoutElement(istrip)); } } } result.sort(); result.unique(); } else { // read the whole CFEB, 16 strips std::list<int> cfebsToRead; for( ; keyStripItr != keyStrips.end(); ++keyStripItr) { int cfeb = (readoutElement(*keyStripItr)-1)/16; cfebsToRead.push_back(cfeb); int remainder = (readoutElement(*keyStripItr)-1)%16; // if we're within 3 strips of an edge, take neighboring CFEB, too if(remainder < window && cfeb != 0) { cfebsToRead.push_back(cfeb-1); } // the 'readouElement' makes it so that ME1/1 has just one CFEB int maxCFEBs = readoutElement(nElements)/16 - 1; if(remainder >= 16-window && cfeb != maxCFEBs) { cfebsToRead.push_back(cfeb+1); } } cfebsToRead.sort(); cfebsToRead.unique(); // now convert the CFEBS to strips for(std::list<int>::const_iterator cfebItr = cfebsToRead.begin(); cfebItr != cfebsToRead.end(); ++cfebItr) { for(int i = 1; i <= 16; ++i) { result.push_back((*cfebItr)*16 + i); } } } return result; }
float CSCStripElectronicsSim::comparatorReading | ( | const CSCAnalogSignal & | signal, |
float | time | ||
) | const [private] |
calculates the comparator reading, including saturation and offsets
Definition at line 106 of file CSCStripElectronicsSim.cc.
References CSCAnalogSignal::getValue(), min, theComparatorRMSOffset, theComparatorSaturation, and CSCBaseElectronicsSim::theRandGaussQ.
Referenced by runComparator().
{ return std::min(signal.getValue(time), theComparatorSaturation) + theComparatorRMSOffset* theRandGaussQ->fire(); }
void CSCStripElectronicsSim::createDigi | ( | int | istrip, |
const CSCAnalogSignal & | signal, | ||
std::vector< CSCStripDigi > & | result | ||
) |
Definition at line 410 of file CSCStripElectronicsSim.cc.
References CSCBaseElectronicsSim::addLinks(), CSCChamberSpecs::chamberType(), CSCBaseElectronicsSim::channelIndex(), doSaturation(), CSCAnalogSignal::getValue(), CSCBaseElectronicsSim::layerId(), LogTrace, nScaBins_, CSCStripConditions::pedestal(), sca_time_bin_size, CSCStripConditions::smearedGain(), lumiQTWidget::t, theAverageTimeOfFlight, CSCBaseElectronicsSim::theRandGaussQ, theSCATimingOffsets, CSCBaseElectronicsSim::theSignalStartTime, CSCBaseElectronicsSim::theSpecs, theStripConditions, and CSCBaseElectronicsSim::theTimingCalibrationError.
Referenced by fillStripDigis().
{ // fill in the sca information std::vector<int> scaCounts(nScaBins_); float pedestal = theStripConditions->pedestal(layerId(), channel); float gain = theStripConditions->smearedGain(layerId(), channel); int chamberType = theSpecs->chamberType(); float timeSmearing = theRandGaussQ->fire() * theTimingCalibrationError[chamberType]; // undo the correction for TOF, instead, using some nominal // value from ME2/1 float t0 = theSignalStartTime+theSCATimingOffsets[chamberType] + timeSmearing + 29. - theAverageTimeOfFlight; for(int scaBin = 0; scaBin < nScaBins_; ++scaBin) { float t = t0 + scaBin*sca_time_bin_size; scaCounts[scaBin] = static_cast< int > ( pedestal + signal.getValue(t) * gain ); } CSCStripDigi newDigi(channel, scaCounts); // do saturation of 12-bit ADC doSaturation(newDigi); result.push_back(newDigi); addLinks(channelIndex(channel)); LogTrace("CSCStripElectronicsSim") << newDigi; }
void CSCStripElectronicsSim::doSaturation | ( | CSCStripDigi & | digi | ) | [private] |
Definition at line 439 of file CSCStripElectronicsSim.cc.
References CSCStripDigi::getADCCounts(), min, and CSCStripDigi::setADCCounts().
Referenced by createDigi().
{ std::vector<int> scaCounts(digi.getADCCounts()); for(unsigned scaBin = 0; scaBin < scaCounts.size(); ++scaBin) { scaCounts[scaBin] = std::min(scaCounts[scaBin], 4095); } digi.setADCCounts(scaCounts); }
void CSCStripElectronicsSim::fillDigis | ( | CSCStripDigiCollection & | digis, |
CSCComparatorDigiCollection & | comparators | ||
) |
Definition at line 323 of file CSCStripElectronicsSim.cc.
References addCrosstalk(), doCrosstalk_, fillStripDigis(), getKeyStripsFromMC(), CSCBaseElectronicsSim::layerId(), and runComparator().
Referenced by CSCDigitizer::doAction().
{ if(doCrosstalk_) { addCrosstalk(); } std::vector<CSCComparatorDigi> comparatorOutputs; runComparator(comparatorOutputs); // copy these to the result if(!comparatorOutputs.empty()) { CSCComparatorDigiCollection::Range range(comparatorOutputs.begin(), comparatorOutputs.end()); comparators.put(range, layerId()); } //std::list<int> keyStrips = getKeyStrips(comparatorOutputs); std::list<int> keyStrips = getKeyStripsFromMC(); fillStripDigis(keyStrips, digis); }
void CSCStripElectronicsSim::fillMissingLayer | ( | const CSCLayer * | layer, |
const CSCComparatorDigiCollection & | comparators, | ||
CSCStripDigiCollection & | digis | ||
) |
Definition at line 449 of file CSCStripElectronicsSim.cc.
References CSCDetId::chamberId(), CSCDetId, fillStripDigis(), getKeyStrips(), CSCBaseElectronicsSim::setLayer(), CSCBaseElectronicsSim::theLayerId, and CSCBaseElectronicsSim::theSignalMap.
Referenced by CSCDigitizer::doAction().
{ theSignalMap.clear(); setLayer(layer); CSCDetId chamberId(theLayerId.chamberId()); // find all comparator key strips in this chamber std::list<int> chamberKeyStrips; for(CSCComparatorDigiCollection::DigiRangeIterator comparatorItr = comparators.begin(); comparatorItr != comparators.end(); ++comparatorItr) { // could be more efficient if(CSCDetId((*comparatorItr).first).chamberId() == chamberId) { std::vector<CSCComparatorDigi> layerComparators((*comparatorItr).second.first, (*comparatorItr).second.second); std::list<int> layerKeyStrips = getKeyStrips(layerComparators); chamberKeyStrips.insert(chamberKeyStrips.end(), layerKeyStrips.begin(), layerKeyStrips.end()); } } chamberKeyStrips.sort(); chamberKeyStrips.unique(); fillStripDigis(chamberKeyStrips, digis); }
void CSCStripElectronicsSim::fillStripDigis | ( | const std::list< int > & | keyStrips, |
CSCStripDigiCollection & | digis | ||
) | [private] |
Definition at line 346 of file CSCStripElectronicsSim.cc.
References channelsToRead(), createDigi(), CSCBaseElectronicsSim::find(), and CSCBaseElectronicsSim::layerId().
Referenced by fillDigis(), and fillMissingLayer().
{ std::list<int> stripsToDo = channelsToRead(keyStrips, 3); std::vector<CSCStripDigi> stripDigis; stripDigis.reserve(stripsToDo.size()); for(std::list<int>::const_iterator stripItr = stripsToDo.begin(); stripItr != stripsToDo.end(); ++stripItr) { createDigi( *stripItr, find(*stripItr), stripDigis); } CSCStripDigiCollection::Range stripRange(stripDigis.begin(), stripDigis.end()); digis.put(stripRange, layerId()); }
std::list< int > CSCStripElectronicsSim::getKeyStrips | ( | const std::vector< CSCComparatorDigi > & | comparators | ) | const [private] |
finds the key strips from these comparators
Definition at line 225 of file CSCStripElectronicsSim.cc.
References abs, query::result, and CSCBaseElectronicsSim::theOffsetOfBxZero.
Referenced by fillMissingLayer().
{ std::list<int> result; for(std::vector<CSCComparatorDigi>::const_iterator compItr = comparators.begin(); compItr != comparators.end(); ++compItr) { if(std::abs(compItr->getTimeBin()-theOffsetOfBxZero) <= 2) { result.push_back(compItr->getStrip()); } } // need sort for unique to work. result.sort(); result.unique(); return result; }
std::list< int > CSCStripElectronicsSim::getKeyStripsFromMC | ( | ) | const [private] |
get ths strips that have detector hits
Definition at line 244 of file CSCStripElectronicsSim.cc.
References first, query::result, CSCBaseElectronicsSim::theDetectorHitMap, and create_public_pileup_plots::transform.
Referenced by fillDigis().
{ // assumes the detector hit map is filled std::list<int> result; transform(theDetectorHitMap.begin(), theDetectorHitMap.end(), back_inserter(result), boost::bind(&DetectorHitMap::value_type::first,_1)); result.sort(); result.unique(); return result; }
void CSCStripElectronicsSim::getReadoutRange | ( | int | inputStrip, |
int & | minStrip, | ||
int & | maxStrip | ||
) | [private] |
void CSCStripElectronicsSim::initParameters | ( | ) | [private, virtual] |
initialization for each layer
Implements CSCBaseElectronicsSim.
Definition at line 59 of file CSCStripElectronicsSim.cc.
References CSCChamberSpecs::chamberType(), CSCBaseElectronicsSim::nElements, nScaBins_, CSCLayerGeometry::numberOfStrips(), GloballyPositioned< T >::position(), sca_peak_bin, sca_time_bin_size, GeomDet::surface(), theAverageTimeOfFlight, CSCBaseElectronicsSim::theBunchTimingOffsets, theComparatorThreshold, CSCBaseElectronicsSim::theLayer, CSCBaseElectronicsSim::theLayerGeometry, CSCBaseElectronicsSim::theNumberOfSamples, CSCBaseElectronicsSim::theSamplingTime, CSCBaseElectronicsSim::theShapingTime, CSCBaseElectronicsSim::theSignalStartTime, CSCBaseElectronicsSim::theSignalStopTime, CSCBaseElectronicsSim::theSpecs, and theTimingOffset.
{ nElements = theLayerGeometry->numberOfStrips(); theComparatorThreshold = 20.; //selfTest(); //calculate the offset to the peak float averageDistance = theLayer->surface().position().mag(); theAverageTimeOfFlight = averageDistance * cm / c_light; // Units of c_light: mm/ns int chamberType = theSpecs->chamberType(); theTimingOffset = theShapingTime + theAverageTimeOfFlight + theBunchTimingOffsets[chamberType]; //TODO make sure config gets overridden theSignalStartTime = theTimingOffset - (sca_peak_bin-1) * sca_time_bin_size; theSignalStopTime = theSignalStartTime + nScaBins_*sca_time_bin_size; theNumberOfSamples = nScaBins_*static_cast<int>(sca_time_bin_size/theSamplingTime); }
CSCAnalogSignal CSCStripElectronicsSim::makeNoiseSignal | ( | int | element | ) | [virtual] |
Reimplemented from CSCBaseElectronicsSim.
Definition at line 90 of file CSCStripElectronicsSim.cc.
References CSCBaseElectronicsSim::doNoise_, CSCAnalogSignal::getValue(), CSCBaseElectronicsSim::layerId(), CSCStripConditions::noisify(), nScaBins_, sca_time_bin_size, CSCBaseElectronicsSim::theNumberOfSamples, CSCBaseElectronicsSim::theSamplingTime, CSCBaseElectronicsSim::theSignalStartTime, and theStripConditions.
{ std::vector<float> noiseBins(nScaBins_); CSCAnalogSignal tmpSignal(element, sca_time_bin_size, noiseBins); if(doNoise_) { theStripConditions->noisify(layerId(), tmpSignal); } // now rebin it std::vector<float> binValues(theNumberOfSamples); for(int ibin=0; ibin < theNumberOfSamples; ++ibin) { binValues[ibin] = tmpSignal.getValue(ibin*theSamplingTime); } CSCAnalogSignal finalSignal(element, theSamplingTime, binValues, 0., theSignalStartTime); return finalSignal; }
int CSCStripElectronicsSim::readoutElement | ( | int | strip | ) | const [private, virtual] |
Implements CSCBaseElectronicsSim.
Definition at line 79 of file CSCStripElectronicsSim.cc.
References CSCLayerGeometry::channel(), and CSCBaseElectronicsSim::theLayerGeometry.
Referenced by addCrosstalk(), channelsToRead(), runComparator(), and selfTest().
{ return theLayerGeometry->channel(strip); }
void CSCStripElectronicsSim::runComparator | ( | std::vector< CSCComparatorDigi > & | result | ) | [private] |
Definition at line 114 of file CSCStripElectronicsSim.cc.
References comparatorReading(), CSCBaseElectronicsSim::find(), CSCAnalogSignal::getValue(), CSCBaseElectronicsSim::nElements, convertSQLitetoXML_cfg::output, readoutElement(), python::multivaluedict::sort(), CSCBaseElectronicsSim::theBunchSpacing, theComparatorDeadTime, theComparatorSamplingTime, theComparatorThreshold, theComparatorTimeBinOffset, theComparatorTimeOffset, theComparatorWait, CSCBaseElectronicsSim::theOffsetOfBxZero, CSCBaseElectronicsSim::theSignalMap, CSCBaseElectronicsSim::theSignalStartTime, CSCBaseElectronicsSim::theSignalStopTime, theTimingOffset, and cond::rpcobgas::time.
Referenced by fillDigis().
{ // first, make a list of all the comparators we actually // need to run std::list<int> comparatorsWithSignal; CSCSignalMap::iterator signalMapItr; for(signalMapItr = theSignalMap.begin(); signalMapItr != theSignalMap.end(); ++signalMapItr) { // Elements in signal map count from 1 // 1,2->0, 3,4->1, 5,6->2, ... comparatorsWithSignal.push_back( ((*signalMapItr).first-1)/2 ); } // no need to sort comparatorsWithSignal.unique(); for(std::list<int>::iterator listItr = comparatorsWithSignal.begin(); listItr != comparatorsWithSignal.end(); ++listItr) { int iComparator = *listItr; // find signal1 and signal2 // iComparator counts from 0 // icomp =0->1,2, =1->3,4, =2->5,6, ... const CSCAnalogSignal & signal1 = find(readoutElement(iComparator*2 + 1)); const CSCAnalogSignal & signal2 = find(readoutElement(iComparator*2 + 2)); for(float time = theSignalStartTime +theComparatorTimeOffset; time < theSignalStopTime-theComparatorWait; time += theComparatorSamplingTime) { if(comparatorReading(signal1, time) > theComparatorThreshold || comparatorReading(signal2, time) > theComparatorThreshold) { // wait a bit, so we can run the comparator at the signal peak float comparatorTime = time; time += theComparatorWait; float height1 = comparatorReading(signal1, time); float height2 = comparatorReading(signal2, time); int output = 0; int strip = 0; // distrip logic; comparator output is for pairs of strips: // hit bin dec // x--- 100 4 // -x-- 101 5 // --x- 110 6 // ---x 111 7 // just to prevent a copy const CSCAnalogSignal * mainSignal = 0; // pick the higher of the two strips in the pair if(height1 > height2) { mainSignal = &signal1; float leftStrip = 0.; if(iComparator > 0) { leftStrip = comparatorReading(find(readoutElement(iComparator*2)), time); } // if this strip is higher than either of its neighbors, make a comparator digi if(leftStrip < height1 && height1 > theComparatorThreshold) { output = (leftStrip < height2); strip = iComparator*2 + 1; } } else { mainSignal = &signal2; float rightStrip = 0.; if(iComparator*2+3 <= nElements) { rightStrip = comparatorReading(find(readoutElement(iComparator*2+3)), time); } if(rightStrip < height2 && height2 > theComparatorThreshold) { output = (height1 < rightStrip); strip = iComparator*2 + 2; } } if(strip != 0) { float bxFloat = (comparatorTime-theTimingOffset)/theBunchSpacing + theComparatorTimeBinOffset + theOffsetOfBxZero; // Comparator digi as of Nov-2006 adapted to real data: time word has 16 bits with set bit // flagging appropriate bunch crossing, and bx 0 corresponding to 9th bit i.e. // 1st bit set (bit 0) <-> bx -9 // 2nd 1 <-> bx -8 // ... ... .... // 8th 9 <-> bx 0 // 9th 10 <-> bx +1 // ... ... .... // 16th 15 <-> bx +6 // Parameter theOffsetOfBxZero = 9 @@WARNING! This offset may be changed (hardware)! int timeWord = 0; // and this will remain if too early or late if ( (bxFloat>= 0) && (bxFloat<16) ) timeWord = (1 << static_cast<int>(bxFloat) ); // set appropriate bit CSCComparatorDigi newDigi(strip, output, timeWord); result.push_back(newDigi); } // wait for the comparator to reset time += theComparatorDeadTime; // really should be zero, but strip signal doesn't go negative yet float resetThreshold = 1; while(time < theSignalStopTime && mainSignal->getValue(time) > resetThreshold) { time += theComparatorSamplingTime; } } // if over threshold } // loop over time samples } // loop over comparators // sort by time sort(result.begin(), result.end()); }
void CSCStripElectronicsSim::selfTest | ( | ) | const [private] |
Definition at line 474 of file CSCStripElectronicsSim.cc.
References channelsToRead(), doSuppression_, CSCBaseElectronicsSim::nElements, and readoutElement().
{ // make sure the zero suppression algorithms work std::list<int> keyStrips, stripsRead; // bool isGanged = (readoutElement(nElements) == 16); keyStrips.push_back(readoutElement(19)); keyStrips.push_back(readoutElement(30)); keyStrips.push_back(readoutElement(32)); stripsRead = channelsToRead(keyStrips, 3); if(doSuppression_) { unsigned int expectedSize = isGanged ? 10 : 12; assert(stripsRead.size() == expectedSize); assert(stripsRead.front() == readoutElement(17)); } else { unsigned int expectedSize = isGanged ? 16 : 48; assert(stripsRead.size() == expectedSize); assert(stripsRead.front() == 1); } }
void CSCStripElectronicsSim::setStripConditions | ( | CSCStripConditions * | cond | ) | [inline] |
Definition at line 37 of file CSCStripElectronicsSim.h.
References theStripConditions.
Referenced by CSCDigitizer::setStripConditions().
{theStripConditions = cond;}
bool CSCStripElectronicsSim::doCrosstalk_ [private] |
Definition at line 101 of file CSCStripElectronicsSim.h.
Referenced by CSCStripElectronicsSim(), fillDigis(), and ~CSCStripElectronicsSim().
bool CSCStripElectronicsSim::doSuppression_ [private] |
Definition at line 100 of file CSCStripElectronicsSim.h.
Referenced by channelsToRead(), and selfTest().
int CSCStripElectronicsSim::nScaBins_ [private] |
Definition at line 99 of file CSCStripElectronicsSim.h.
Referenced by createDigi(), initParameters(), and makeNoiseSignal().
int CSCStripElectronicsSim::sca_peak_bin [private] |
Definition at line 110 of file CSCStripElectronicsSim.h.
Referenced by initParameters().
float CSCStripElectronicsSim::sca_time_bin_size [private] |
Definition at line 107 of file CSCStripElectronicsSim.h.
Referenced by createDigi(), initParameters(), and makeNoiseSignal().
Reimplemented from CSCBaseElectronicsSim.
Definition at line 50 of file CSCStripElectronicsSim.h.
Referenced by calculateAmpResponse().
float CSCStripElectronicsSim::theAverageTimeOfFlight [private] |
Definition at line 120 of file CSCStripElectronicsSim.h.
Referenced by createDigi(), and initParameters().
int CSCStripElectronicsSim::theComparatorClockJump [private] |
Definition at line 105 of file CSCStripElectronicsSim.h.
float CSCStripElectronicsSim::theComparatorDeadTime [private] |
Definition at line 94 of file CSCStripElectronicsSim.h.
Referenced by runComparator().
float CSCStripElectronicsSim::theComparatorNoise [private] |
Definition at line 88 of file CSCStripElectronicsSim.h.
float CSCStripElectronicsSim::theComparatorRMSOffset [private] |
Definition at line 89 of file CSCStripElectronicsSim.h.
Referenced by comparatorReading().
double CSCStripElectronicsSim::theComparatorSamplingTime [private] |
Definition at line 115 of file CSCStripElectronicsSim.h.
Referenced by runComparator().
float CSCStripElectronicsSim::theComparatorSaturation [private] |
Definition at line 91 of file CSCStripElectronicsSim.h.
Referenced by comparatorReading().
float CSCStripElectronicsSim::theComparatorThreshold [private] |
Definition at line 87 of file CSCStripElectronicsSim.h.
Referenced by initParameters(), and runComparator().
double CSCStripElectronicsSim::theComparatorTimeBinOffset [private] |
Definition at line 112 of file CSCStripElectronicsSim.h.
Referenced by runComparator().
double CSCStripElectronicsSim::theComparatorTimeOffset [private] |
Definition at line 114 of file CSCStripElectronicsSim.h.
Referenced by runComparator().
float CSCStripElectronicsSim::theComparatorWait [private] |
Definition at line 93 of file CSCStripElectronicsSim.h.
Referenced by runComparator().
Definition at line 103 of file CSCStripElectronicsSim.h.
Referenced by addCrosstalk(), CSCStripElectronicsSim(), and ~CSCStripElectronicsSim().
float CSCStripElectronicsSim::theDaqDeadTime [private] |
Definition at line 95 of file CSCStripElectronicsSim.h.
std::vector<double> CSCStripElectronicsSim::theSCATimingOffsets [private] |
Definition at line 117 of file CSCStripElectronicsSim.h.
Referenced by createDigi().
Definition at line 102 of file CSCStripElectronicsSim.h.
Referenced by addCrosstalk(), createDigi(), makeNoiseSignal(), and setStripConditions().
float CSCStripElectronicsSim::theTimingOffset [private] |
Definition at line 97 of file CSCStripElectronicsSim.h.
Referenced by initParameters(), and runComparator().