|
|
Go to the documentation of this file.
15 #include "CLHEP/Random/RandFlat.h"
17 #define CBOLTZ (1.38E-23)
18 #define e_SI (1.6E-19)
45 LogDebug(
"StripDigiInfo") <<
"APVs running in peak mode (poor time resolution)";
48 LogDebug(
"StripDigiInfo") <<
"APVs running in deconvolution mode (good time resolution)";
83 CLHEP::HepRandomEngine* engine) {
93 std::vector<bool> badChannels;
95 badChannels.insert(badChannels.begin(),
numStrips,
false);
98 fs = deadChannelHandle->
decode(*it);
100 badChannels[
strip] =
true;
114 std::vector<std::pair<const PSimHit*, int> >::const_iterator simHitIter =
input.begin();
115 std::vector<std::pair<const PSimHit*, int> >::const_iterator simHitIterEnd =
input.end();
117 for (; simHitIter != simHitIterEnd; ++simHitIter) {
121 if (std::fabs(((*simHitIter).first)->tof() -
cosmicShift -
138 bool isHadron =
particle->isHadron();
139 if (
charge != 0 && isHadron) {
143 std::cout <<
"-------------------HIP--------------" << std::endl;
144 std::cout <<
"Killing APVs " << FirstAPV <<
" - " << LastAPV <<
" " << detID << std::endl;
146 badChannels[
strip] =
true;
175 if (badChannels[
strip])
186 badChannels[RefStrip]) {
190 float noiseRMS = noiseHandle->
getNoise(RefStrip, detNoiseRange);
191 float gainValue = gainHandle->
getStripGain(RefStrip, detGainRange);
232 std::vector<float> noiseRMSv;
234 noiseRMSv.insert(noiseRMSv.begin(),
numStrips, 0.);
238 if (!badChannels[
strip])
245 badChannels[RefStrip]) {
251 if (!badChannels[
strip])
252 noiseRMSv[
strip] = noiseRMS;
282 std::vector<float> vPeds;
284 vPeds.insert(vPeds.begin(),
numStrips, 0.);
288 if (!badChannels[
strip])
293 if (!badChannels[
strip])
316 const std::vector<float>& afterNoise,
317 unsigned int detID) {
319 for (DigitalVecType::const_iterator
i =
digis.begin();
i !=
digis.end();
i++) {
322 HitToDigisMapType::const_iterator mi(htd.find(
i->strip()));
325 HitCounterToDigisMapType::const_iterator cmi(hctd.find(
i->strip()));
326 std::map<const PSimHit*, Amplitude> totalAmplitudePerSimHit;
327 for (
std::vector<std::pair<const PSimHit*, Amplitude> >::const_iterator simul = (*mi).second.begin();
328 simul != (*mi).second.end();
330 totalAmplitudePerSimHit[(*simul).first] += (*simul).second;
334 double totalAmplitude1 = afterNoise[(*mi).first];
338 for (std::map<const PSimHit*, Amplitude>::const_iterator iter = totalAmplitudePerSimHit.begin();
339 iter != totalAmplitudePerSimHit.end();
342 float fraction = (*iter).second / totalAmplitude1;
347 for (
std::vector<std::pair<const PSimHit*, int> >::const_iterator simcount = (*cmi).second.begin();
348 simcount != (*cmi).second.end();
350 if ((*iter).first == (*simcount).first)
351 sim_counter = (*simcount).second;
354 ((*iter).first)->trackId(),
356 ((*iter).first)->eventId(),
366 const std::vector<float>& afterNoise,
367 unsigned int detID) {
370 for (DigitalRawVecType::const_iterator
i =
digis.begin();
i !=
digis.end();
i++) {
374 HitToDigisMapType::const_iterator mi(htd.find(nstrip));
375 HitCounterToDigisMapType::const_iterator cmi(hctd.find(nstrip));
378 std::map<const PSimHit*, Amplitude> totalAmplitudePerSimHit;
379 for (
std::vector<std::pair<const PSimHit*, Amplitude> >::const_iterator simul = (*mi).second.begin();
380 simul != (*mi).second.end();
382 totalAmplitudePerSimHit[(*simul).first] += (*simul).second;
386 double totalAmplitude1 = afterNoise[(*mi).first];
389 int sim_counter_raw = 0;
390 for (std::map<const PSimHit*, Amplitude>::const_iterator iter = totalAmplitudePerSimHit.begin();
391 iter != totalAmplitudePerSimHit.end();
394 float fraction = (*iter).second / totalAmplitude1;
400 for (
std::vector<std::pair<const PSimHit*, int> >::const_iterator simcount = (*cmi).second.begin();
401 simcount != (*cmi).second.end();
403 if ((*iter).first == (*simcount).first)
404 sim_counter_raw = (*simcount).second;
407 ((*iter).first)->trackId(),
409 ((*iter).first)->eventId(),
const ParticleData * particle
std::vector< float > locAmpl
void push_link(const DigitalVecType &, const HitToDigisMapType &, const HitCounterToDigisMapType &, const std::vector< float > &, unsigned int)
static const std::string input
void addCMNoise(std::vector< float > &, float, std::vector< bool > &, CLHEP::HepRandomEngine *) const override
const Range getRange(const uint32_t detID) const
void addNoise(std::vector< float > &, size_t &, size_t &, int, float, CLHEP::HepRandomEngine *) const override
std::pair< ContainerIterator, ContainerIterator > Range
size_t firstChannelWithSignal
std::map< int, std::vector< std::pair< const PSimHit *, int > >, std::less< int > > HitCounterToDigisMapType
DigitalRawVecType convertRaw(const std::vector< float > &, edm::ESHandle< SiStripGain > &, unsigned int detid) override
data decode(const unsigned int &value) const
void addNoiseVR(std::vector< float > &, std::vector< float > &, CLHEP::HepRandomEngine *) const override
void run(edm::DetSet< SiStripDigi > &, edm::DetSet< SiStripRawDigi > &, const std::vector< std::pair< const PSimHit *, int > > &, StripGeomDetUnit const *, GlobalVector, float, edm::ESHandle< SiStripGain > &, edm::ESHandle< SiStripThreshold > &, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripPedestals > &, edm::ESHandle< SiStripBadStrip > &, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
T getUntrackedParameter(std::string const &, T const &) const
const Range getRange(const uint32_t detID) const
SiDigitalConverter::DigitalRawVecType DigitalRawVecType
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
void suppress(const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripThreshold > &)
const Plane & surface() const
The nominal surface of the GeomDet.
void addBaselineShift(std::vector< float > &, std::vector< bool > &) const override
std::pair< ContainerIterator, ContainerIterator > Range
SiHitDigitizer * theSiHitDigitizer
std::pair< ContainerIterator, ContainerIterator > Range
const SiStripApvGain::Range getRange(uint32_t detID) const
size_t lastChannelWithSignal
SiDigitalConverter::DigitalVecType DigitalVecType
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const HitCounterToDigisMapType & dumpCounterLink() const
DigiSimLinkPileUpSignals::HitCounterToDigisMapType HitCounterToDigisMapType
void push_link_raw(const DigitalRawVecType &, const HitToDigisMapType &, const HitCounterToDigisMapType &, const std::vector< float > &, unsigned int)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const Range getRange(const uint32_t &detID) const
const HitToDigisMapType & dumpLink() const
DetId geographicalId() const
The label of this GeomDet.
DigiSimLinkAlgorithm(const edm::ParameterSet &conf)
SiGaussianTailNoiseAdder * theSiNoiseAdder
SiStripFedZeroSuppression * theSiZeroSuppress
std::vector< StripDigiSimLink > link_coll
void addPedestals(std::vector< float > &, std::vector< float > &) const override
unsigned short firstStrip
double theTOFCutForDeconvolution
const ParticleDataTable * pdt
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
constexpr uint32_t rawId() const
get the raw id
DigitalVecType convert(const std::vector< float > &, edm::ESHandle< SiStripGain > &, unsigned int detid) override
std::pair< ContainerIterator, ContainerIterator > Range
void processHit(const PSimHit *, const StripGeomDetUnit &, GlobalVector, float, std::vector< float > &, size_t &, size_t &, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
std::vector< float > detAmpl
T getParameter(std::string const &) const
std::map< int, std::vector< std::pair< const PSimHit *, Amplitude > >, std::less< int > > HitToDigisMapType
virtual void add(const std::vector< float > &locAmpl, const size_t &firstChannelWithSignal, const size_t &lastChannelWithSignal, const PSimHit *hit, const int &counter)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
DigitalRawVecType rawdigis
float getPed(const uint16_t &strip, const Range &range) const
static float getNoise(uint16_t strip, const Range &range)
bool APVSaturationFromHIP
DigiSimLinkPileUpSignals::HitToDigisMapType HitToDigisMapType
DigiSimLinkPileUpSignals * theDigiSimLinkPileUpSignals
std::vector< unsigned int >::const_iterator ContainerIterator
SiTrivialDigitalConverter * theSiDigitalConverter