#include <SiStripClusterInfo.h>
Public Member Functions | |
float | baryStrip () const |
uint16_t | charge () const |
std::pair< uint16_t, uint16_t > | chargeLR () const |
const SiStripCluster * | cluster () const |
uint32_t | detId () const |
uint16_t | firstStrip () const |
bool | IsAnythingBad () const |
bool | IsApvBad () const |
bool | IsFiberBad () const |
bool | IsModuleBad () const |
bool | IsModuleUsable () const |
uint8_t | maxCharge () const |
uint16_t | maxIndex () const |
uint16_t | maxStrip () const |
float | noise () const |
float | noiseRescaledByGain () const |
std::vector< SiStripCluster > | reclusterize (const edm::ParameterSet &) const |
float | signalOverNoise () const |
SiStripClusterInfo (const SiStripCluster &cluster, const edm::EventSetup &es, const int detid, const std::string &qualityLabel="") | |
const std::vector< uint8_t > & | stripCharges () const |
std::vector< float > | stripGains () const |
std::vector< float > | stripNoises () const |
std::vector< float > | stripNoisesRescaledByGain () const |
std::vector< bool > | stripQualitiesBad () const |
float | variance () const |
uint16_t | width () const |
Private Member Functions | |
float | calculate_noise (const std::vector< float > &) const |
Private Attributes | |
const SiStripCluster * | cluster_ptr |
uint32_t | detId_ |
const edm::EventSetup & | es |
edm::ESHandle< SiStripGain > | gainHandle |
edm::ESHandle< SiStripNoises > | noiseHandle |
edm::ESHandle< SiStripQuality > | qualityHandle |
std::string | qualityLabel |
Definition at line 14 of file SiStripClusterInfo.h.
SiStripClusterInfo::SiStripClusterInfo | ( | const SiStripCluster & | cluster, |
const edm::EventSetup & | es, | ||
const int | detid, | ||
const std::string & | qualityLabel = "" |
||
) |
Definition at line 13 of file SiStripClusterInfo.cc.
References es, gainHandle, edm::EventSetup::get(), noiseHandle, qualityHandle, and qualityLabel.
: cluster_ptr(&cluster), es(setup), qualityLabel(quality), detId_(detId) { es.get<SiStripNoisesRcd>().get(noiseHandle); es.get<SiStripGainRcd>().get(gainHandle); es.get<SiStripQualityRcd>().get(qualityLabel,qualityHandle); }
float SiStripClusterInfo::baryStrip | ( | ) | const [inline] |
Definition at line 28 of file SiStripClusterInfo.h.
References SiStripCluster::barycenter(), and cluster().
Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::fillMEs(), and SiStripMonitorTrack::fillModMEs().
{return cluster()->barycenter();}
float SiStripClusterInfo::calculate_noise | ( | const std::vector< float > & | noise | ) | const [private] |
Definition at line 100 of file SiStripClusterInfo.cc.
References i, mathSSE::sqrt(), stripCharges(), and width().
Referenced by noise(), and noiseRescaledByGain().
uint16_t SiStripClusterInfo::charge | ( | void | ) | const [inline] |
Definition at line 38 of file SiStripClusterInfo.h.
References begin, end, and stripCharges().
Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorTrack::fillMEs(), SiStripMonitorTrack::fillModMEs(), ShallowClustersProducer::produce(), and signalOverNoise().
{return accumulate( stripCharges().begin(), stripCharges().end(), uint16_t(0));}
std::pair< uint16_t, uint16_t > SiStripClusterInfo::chargeLR | ( | ) | const |
Definition at line 27 of file SiStripClusterInfo.cc.
References begin, end, max(), and stripCharges().
const SiStripCluster* SiStripClusterInfo::cluster | ( | ) | const [inline] |
Definition at line 23 of file SiStripClusterInfo.h.
References cluster_ptr.
Referenced by baryStrip(), firstStrip(), stripCharges(), and width().
{return cluster_ptr;}
uint32_t SiStripClusterInfo::detId | ( | ) | const [inline] |
Definition at line 25 of file SiStripClusterInfo.h.
References detId_.
Referenced by SiStripMonitorTrack::clusterInfos(), and ShallowClustersProducer::NearDigis::NearDigis().
{return detId_;}
uint16_t SiStripClusterInfo::firstStrip | ( | ) | const [inline] |
Definition at line 27 of file SiStripClusterInfo.h.
References cluster(), and SiStripCluster::firstStrip().
Referenced by IsApvBad(), IsFiberBad(), maxStrip(), ShallowClustersProducer::NearDigis::NearDigis(), ShallowClustersProducer::produce(), reclusterize(), stripGains(), stripNoises(), stripNoisesRescaledByGain(), and stripQualitiesBad().
{return cluster()->firstStrip();}
bool SiStripClusterInfo::IsAnythingBad | ( | ) | const |
Definition at line 114 of file SiStripClusterInfo.cc.
References IsApvBad(), IsFiberBad(), IsModuleBad(), and stripQualitiesBad().
Referenced by ShallowClustersProducer::produce().
{ std::vector<bool> stripBad = stripQualitiesBad(); return IsApvBad() || IsFiberBad() || IsModuleBad() || accumulate(stripBad.begin(), stripBad.end(), false, std::logical_or<bool>()); }
bool SiStripClusterInfo::IsApvBad | ( | ) | const |
Definition at line 126 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), qualityHandle, and width().
Referenced by IsAnythingBad().
{ return qualityHandle->IsApvBad( detId_, firstStrip()/128 ) || qualityHandle->IsApvBad( detId_, (firstStrip()+width())/128 ) ; }
bool SiStripClusterInfo::IsFiberBad | ( | ) | const |
Definition at line 133 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), qualityHandle, and width().
Referenced by IsAnythingBad().
{ return qualityHandle->IsFiberBad( detId_, firstStrip()/256 ) || qualityHandle->IsFiberBad( detId_, (firstStrip()+width())/256 ) ; }
bool SiStripClusterInfo::IsModuleBad | ( | ) | const |
Definition at line 140 of file SiStripClusterInfo.cc.
References detId_, and qualityHandle.
Referenced by IsAnythingBad().
{ return qualityHandle->IsModuleBad( detId_ ); }
bool SiStripClusterInfo::IsModuleUsable | ( | ) | const |
Definition at line 145 of file SiStripClusterInfo.cc.
References detId_, and qualityHandle.
{ return qualityHandle->IsModuleUsable( detId_ ); }
uint8_t SiStripClusterInfo::maxCharge | ( | ) | const [inline] |
Definition at line 39 of file SiStripClusterInfo.h.
References begin, end, and stripCharges().
Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::fillModMEs(), ShallowClustersProducer::NearDigis::NearDigis(), and ShallowClustersProducer::produce().
{return * max_element(stripCharges().begin(), stripCharges().end());}
uint16_t SiStripClusterInfo::maxIndex | ( | ) | const [inline] |
Definition at line 40 of file SiStripClusterInfo.h.
References begin, end, and stripCharges().
Referenced by SiStripMonitorTrack::fillModMEs(), maxStrip(), ShallowClustersProducer::NearDigis::NearDigis(), and ShallowClustersProducer::produce().
{return max_element(stripCharges().begin(), stripCharges().end()) - stripCharges().begin();}
uint16_t SiStripClusterInfo::maxStrip | ( | ) | const [inline] |
Definition at line 29 of file SiStripClusterInfo.h.
References firstStrip(), and maxIndex().
Referenced by ShallowClustersProducer::NearDigis::NearDigis(), and ShallowClustersProducer::produce().
{return firstStrip() + maxIndex();}
float SiStripClusterInfo::noise | ( | ) | const [inline] |
Definition at line 43 of file SiStripClusterInfo.h.
References calculate_noise(), and stripNoises().
Referenced by TrackerDpgAnalysis::analyze().
{ return calculate_noise(stripNoises());}
float SiStripClusterInfo::noiseRescaledByGain | ( | ) | const [inline] |
Definition at line 44 of file SiStripClusterInfo.h.
References calculate_noise(), and stripNoisesRescaledByGain().
Referenced by TrackerDpgAnalysis::analyze(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorTrack::fillMEs(), SiStripMonitorTrack::fillModMEs(), ShallowClustersProducer::produce(), and signalOverNoise().
{ return calculate_noise(stripNoisesRescaledByGain());}
std::vector< SiStripCluster > SiStripClusterInfo::reclusterize | ( | const edm::ParameterSet & | conf | ) | const |
Definition at line 150 of file SiStripClusterInfo.cc.
References algorithm(), SurfaceDeformationFactory::create(), detId_, es, firstStrip(), i, stripCharges(), stripGains(), and width().
{ std::vector<SiStripCluster> clusters; std::vector<uint8_t> charges = stripCharges(); std::vector<float> gains = stripGains(); for(unsigned i=0; i < charges.size(); i++) charges[i] = (charges[i] < 254) ? static_cast<uint8_t>(charges[i] * gains[i]) : charges[i]; std::auto_ptr<StripClusterizerAlgorithm> algorithm = StripClusterizerAlgorithmFactory::create(conf); algorithm->initialize(es); if( algorithm->stripByStripBegin( detId_ )) { for(unsigned i = 0; i<width(); i++) algorithm->stripByStripAdd( firstStrip()+i, charges[i], clusters ); algorithm->stripByStripEnd( clusters ); } return clusters; }
float SiStripClusterInfo::signalOverNoise | ( | ) | const [inline] |
Definition at line 46 of file SiStripClusterInfo.h.
References charge(), and noiseRescaledByGain().
Referenced by TrackerDpgAnalysis::analyze(), reco::modules::TrackerTrackHitFilter::checkStoN(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorTrack::fillMEs(), SiStripMonitorTrack::fillModMEs(), and ShallowClustersProducer::produce().
{ return charge()/noiseRescaledByGain(); }
const std::vector<uint8_t>& SiStripClusterInfo::stripCharges | ( | ) | const [inline] |
Definition at line 32 of file SiStripClusterInfo.h.
References SiStripCluster::amplitudes(), and cluster().
Referenced by calculate_noise(), charge(), chargeLR(), SiStripMonitorTrack::fillModMEs(), maxCharge(), maxIndex(), ShallowClustersProducer::NearDigis::NearDigis(), reclusterize(), and variance().
{return cluster()->amplitudes();}
std::vector< float > SiStripClusterInfo::stripGains | ( | ) | const |
Definition at line 77 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), gainHandle, i, and width().
Referenced by ShallowClustersProducer::produce(), and reclusterize().
{ SiStripApvGain::Range detGainRange = gainHandle->getRange(detId_); std::vector<float> gains; gains.reserve(width()); for(size_t i=0; i< width(); i++){ gains.push_back( gainHandle->getStripGain( firstStrip()+i, detGainRange) ); } return gains; }
std::vector< float > SiStripClusterInfo::stripNoises | ( | ) | const |
Definition at line 65 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), i, noiseHandle, and width().
Referenced by noise().
{ SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detId_); std::vector<float> noises; noises.reserve(width()); for(size_t i=0; i < width(); i++){ noises.push_back( noiseHandle->getNoise( firstStrip()+i, detNoiseRange) ); } return noises; }
std::vector< float > SiStripClusterInfo::stripNoisesRescaledByGain | ( | ) | const |
Definition at line 52 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), gainHandle, i, noiseHandle, python::entryComment::results, and width().
Referenced by noiseRescaledByGain(), and ShallowClustersProducer::produce().
{ SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detId_); SiStripApvGain::Range detGainRange = gainHandle->getRange(detId_); std::vector<float> results; results.reserve(width()); for(size_t i = 0, e = width(); i < e; i++){ results.push_back(noiseHandle->getNoise(firstStrip()+i, detNoiseRange) / gainHandle->getStripGain( firstStrip()+i, detGainRange)); } return results; }
std::vector< bool > SiStripClusterInfo::stripQualitiesBad | ( | ) | const |
Definition at line 89 of file SiStripClusterInfo.cc.
References detId_, firstStrip(), i, qualityHandle, and width().
Referenced by IsAnythingBad().
{ std::vector<bool> isBad; isBad.reserve(width()); for(int i=0; i< width(); i++) { isBad.push_back( qualityHandle->IsStripBad( detId_, firstStrip()+i) ); } return isBad; }
float SiStripClusterInfo::variance | ( | ) | const |
Definition at line 38 of file SiStripClusterInfo.cc.
References begin, end, i, lumiQueryAPI::q, and stripCharges().
Referenced by ShallowClustersProducer::produce().
uint16_t SiStripClusterInfo::width | ( | ) | const [inline] |
Definition at line 26 of file SiStripClusterInfo.h.
References SiStripCluster::amplitudes(), and cluster().
Referenced by TrackerDpgAnalysis::analyze(), calculate_noise(), SiStripMonitorTrack::clusterInfos(), SiStripMonitorTrack::fillMEs(), SiStripMonitorTrack::fillModMEs(), IsApvBad(), IsFiberBad(), ShallowClustersProducer::NearDigis::NearDigis(), ShallowClustersProducer::produce(), reclusterize(), stripGains(), stripNoises(), stripNoisesRescaledByGain(), and stripQualitiesBad().
{return cluster()->amplitudes().size();}
const SiStripCluster* SiStripClusterInfo::cluster_ptr [private] |
Definition at line 60 of file SiStripClusterInfo.h.
Referenced by cluster().
uint32_t SiStripClusterInfo::detId_ [private] |
Definition at line 66 of file SiStripClusterInfo.h.
Referenced by detId(), IsApvBad(), IsFiberBad(), IsModuleBad(), IsModuleUsable(), reclusterize(), stripGains(), stripNoises(), stripNoisesRescaledByGain(), and stripQualitiesBad().
const edm::EventSetup& SiStripClusterInfo::es [private] |
Definition at line 61 of file SiStripClusterInfo.h.
Referenced by reclusterize(), and SiStripClusterInfo().
Definition at line 63 of file SiStripClusterInfo.h.
Referenced by SiStripClusterInfo(), stripGains(), and stripNoisesRescaledByGain().
Definition at line 62 of file SiStripClusterInfo.h.
Referenced by SiStripClusterInfo(), stripNoises(), and stripNoisesRescaledByGain().
Definition at line 64 of file SiStripClusterInfo.h.
Referenced by IsApvBad(), IsFiberBad(), IsModuleBad(), IsModuleUsable(), SiStripClusterInfo(), and stripQualitiesBad().
std::string SiStripClusterInfo::qualityLabel [private] |
Definition at line 65 of file SiStripClusterInfo.h.
Referenced by SiStripClusterInfo().