#include <SiTrivialInduceChargeOnStrips.h>
Public Member Functions | |
void | induce (const SiChargeCollectionDrifter::collection_type &collection_points, const StripGeomDetUnit &det, std::vector< double > &localAmplitudes, size_t &recordMinAffectedStrip, size_t &recordMaxAffectedStrip, const TrackerTopology *tTopo) const |
Compute the charge on the strip and add induced charged. | |
SiTrivialInduceChargeOnStrips (const edm::ParameterSet &conf, double g) | |
Constructor. | |
virtual | ~SiTrivialInduceChargeOnStrips () |
Private Member Functions | |
double | chargeDeposited (size_t strip, size_t Nstrips, double amplitude, double chargeSpread, double chargePosition) const |
Compute Normal distribution of deposit and fraction of signal. | |
Static Private Member Functions | |
static unsigned int | indexOf (const std::string &) |
return the corresponding index of subdetector type from the detunit and Topo | |
static unsigned int | typeOf (const StripGeomDetUnit &, const TrackerTopology *tTopo) |
return index of subdetector type in type vector | |
Private Attributes | |
const double | geVperElectron |
const double | Nsigma |
const std::vector< std::vector < double > > | signalCoupling |
Static Private Attributes | |
static const int | Ntypes = 14 |
static const std::string | type [] = { "IB1", "IB2","OB1","OB2","W1a","W2a","W3a","W1b","W2b","W3b","W4","W5","W6","W7"} |
Definition at line 9 of file SiTrivialInduceChargeOnStrips.h.
SiTrivialInduceChargeOnStrips::SiTrivialInduceChargeOnStrips | ( | const edm::ParameterSet & | conf, |
double | g | ||
) |
Constructor.
Definition at line 52 of file SiTrivialInduceChargeOnStrips.cc.
: signalCoupling(fillSignalCoupling(conf, Ntypes, type)), Nsigma(3.), geVperElectron(g) { }
virtual SiTrivialInduceChargeOnStrips::~SiTrivialInduceChargeOnStrips | ( | ) | [inline, virtual] |
Definition at line 13 of file SiTrivialInduceChargeOnStrips.h.
{}
double SiTrivialInduceChargeOnStrips::chargeDeposited | ( | size_t | strip, |
size_t | Nstrips, | ||
double | amplitude, | ||
double | chargeSpread, | ||
double | chargePosition | ||
) | const [inline, private] |
Compute Normal distribution of deposit and fraction of signal.
Definition at line 97 of file SiTrivialInduceChargeOnStrips.cc.
References geVperElectron.
Referenced by induce().
{ double integralUpToStrip = (strip == 0) ? 0. : ( ROOT::Math::normal_cdf( strip, chargeSpread, chargePosition) ); double integralUpToNext = (strip+1 == Nstrips) ? 1. : ( ROOT::Math::normal_cdf( strip+1, chargeSpread, chargePosition) ); double percentOfSignal = integralUpToNext - integralUpToStrip; return percentOfSignal * amplitude / geVperElectron; }
unsigned int SiTrivialInduceChargeOnStrips::indexOf | ( | const std::string & | t | ) | [inline, static, private] |
void SiTrivialInduceChargeOnStrips::induce | ( | const SiChargeCollectionDrifter::collection_type & | collection_points, |
const StripGeomDetUnit & | det, | ||
std::vector< double > & | localAmplitudes, | ||
size_t & | recordMinAffectedStrip, | ||
size_t & | recordMaxAffectedStrip, | ||
const TrackerTopology * | tTopo | ||
) | const [virtual] |
Compute the charge on the strip and add induced charged.
Implements SiInduceChargeOnStrips.
Definition at line 58 of file SiTrivialInduceChargeOnStrips.cc.
References chargeDeposited(), Nsigma, signalCoupling, and typeOf().
{ const std::vector<double>& coupling = signalCoupling.at(typeOf(det,tTopo)); const StripTopology& topology = dynamic_cast<const StripTopology&>(det.specificTopology()); size_t Nstrips = topology.nstrips(); for (SiChargeCollectionDrifter::collection_type::const_iterator signalpoint = collection_points.begin(); signalpoint != collection_points.end(); signalpoint++ ) { //In strip coordinates: double chargePosition = topology.strip(signalpoint->position()); double chargeSpread = signalpoint->sigma() / topology.localPitch(signalpoint->position()); size_t fromStrip = size_t(std::max( 0, int(std::floor( chargePosition - Nsigma*chargeSpread)))); size_t untilStrip = size_t(std::min( Nstrips, size_t(std::ceil( chargePosition + Nsigma*chargeSpread) ))); for (size_t strip = fromStrip; strip < untilStrip; strip++) { double chargeDepositedOnStrip = chargeDeposited( strip, Nstrips, signalpoint->amplitude(), chargeSpread, chargePosition); size_t affectedFromStrip = size_t(std::max( 0, int(strip - coupling.size() + 1))); size_t affectedUntilStrip = size_t(std::min( Nstrips, strip + coupling.size()) ); for (size_t affectedStrip = affectedFromStrip; affectedStrip < affectedUntilStrip; affectedStrip++) { localAmplitudes.at( affectedStrip ) += chargeDepositedOnStrip * coupling.at(abs( affectedStrip - strip )) ; } if( affectedFromStrip < recordMinAffectedStrip ) recordMinAffectedStrip = affectedFromStrip; if( affectedUntilStrip > recordMaxAffectedStrip ) recordMaxAffectedStrip = affectedUntilStrip; } } return; }
unsigned int SiTrivialInduceChargeOnStrips::typeOf | ( | const StripGeomDetUnit & | det, |
const TrackerTopology * | tTopo | ||
) | [inline, static, private] |
return index of subdetector type in type vector
Definition at line 40 of file SiTrivialInduceChargeOnStrips.cc.
References indexOf().
Referenced by induce().
{ DetId id = det.geographicalId(); switch (det.specificType().subDetector()) { case GeomDetEnumerators::TIB: {return (tTopo->tibLayer(id) < 3) ? indexOf("IB1") : indexOf("IB2");} case GeomDetEnumerators::TOB: {return (tTopo->tobLayer(id) > 4) ? indexOf("OB1") : indexOf("OB2");} case GeomDetEnumerators::TID: {return indexOf("W1a") -1 + tTopo->tidRing(id);} //fragile: relies on ordering of 'type' case GeomDetEnumerators::TEC: {return indexOf("W1b") -1 + tTopo->tecRing(id);} //fragile: relies on ordering of 'type' default: throw cms::Exception("Invalid subdetector") << id(); } }
const double SiTrivialInduceChargeOnStrips::geVperElectron [private] |
Definition at line 38 of file SiTrivialInduceChargeOnStrips.h.
Referenced by chargeDeposited().
const double SiTrivialInduceChargeOnStrips::Nsigma [private] |
Definition at line 37 of file SiTrivialInduceChargeOnStrips.h.
Referenced by induce().
const int SiTrivialInduceChargeOnStrips::Ntypes = 14 [static, private] |
Definition at line 34 of file SiTrivialInduceChargeOnStrips.h.
Referenced by indexOf().
const std::vector<std::vector<double> > SiTrivialInduceChargeOnStrips::signalCoupling [private] |
Definition at line 35 of file SiTrivialInduceChargeOnStrips.h.
Referenced by induce().
const std::string SiTrivialInduceChargeOnStrips::type = { "IB1", "IB2","OB1","OB2","W1a","W2a","W3a","W1b","W2b","W3b","W4","W5","W6","W7"} [static, private] |
Definition at line 33 of file SiTrivialInduceChargeOnStrips.h.
Referenced by indexOf().