CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoLocalTracker/SiStripClusterizer/src/StripClusterizerAlgorithm.cc

Go to the documentation of this file.
00001 #include "RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithm.h"
00002 
00003 #include "FWCore/Framework/interface/EventSetup.h"
00004 #include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
00005 #include "CalibTracker/Records/interface/SiStripGainRcd.h"
00006 #include "CalibTracker/Records/interface/SiStripQualityRcd.h"
00007 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00008 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
00009 #include <string>
00010 
00011 void StripClusterizerAlgorithm::
00012 initialize(const edm::EventSetup& es) {
00013   uint32_t n_cache_id = es.get<SiStripNoisesRcd>().cacheIdentifier();
00014   uint32_t g_cache_id = es.get<SiStripGainRcd>().cacheIdentifier();
00015   uint32_t q_cache_id = es.get<SiStripQualityRcd>().cacheIdentifier();
00016 
00017   if(n_cache_id != noise_cache_id) {
00018     es.get<SiStripNoisesRcd>().get( noiseHandle );
00019     noise_cache_id = n_cache_id;
00020   }
00021   if(g_cache_id != gain_cache_id) {
00022     es.get<SiStripGainRcd>().get( gainHandle );
00023     gain_cache_id = g_cache_id;
00024   }
00025   if(q_cache_id != quality_cache_id) {
00026     es.get<SiStripQualityRcd>().get( qualityLabel, qualityHandle );
00027     quality_cache_id = q_cache_id;
00028   }
00029 }
00030 
00031 
00032 void StripClusterizerAlgorithm::
00033 setDetId(const uint32_t id) {
00034   gainRange =  gainHandle->getRange(id); 
00035   noiseRange = noiseHandle->getRange(id);
00036   qualityRange = qualityHandle->getRange(id);
00037   detId = id;
00038 }
00039 
00040 void StripClusterizerAlgorithm::clusterize(const   edm::DetSetVector<SiStripDigi>& input,  output_t& output) {clusterize_(input, output);}
00041 void StripClusterizerAlgorithm::clusterize(const edmNew::DetSetVector<SiStripDigi>& input, output_t& output) {clusterize_(input, output);}
00042 
00043 StripClusterizerAlgorithm::
00044 InvalidChargeException::InvalidChargeException(const SiStripDigi& digi)
00045   : cms::Exception("Invalid Charge") {
00046   std::stringstream s;
00047   s << "Digi charge of " << digi.adc() << " ADC "
00048     << "is out of range on strip " << digi.strip() << ".  ";
00049   this->append(s.str());
00050 }