00001 #include "CommonTools/SiStripClusterization/interface/SiStripClusterizerAlgo.h" 00002 #include "CalibTracker/Records/interface/SiStripGainRcd.h" 00003 #include "CalibTracker/Records/interface/SiStripQualityRcd.h" 00004 #include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h" 00005 00006 // ----------------------------------------------------------------------------- 00007 // 00008 SiStripClusterizerAlgo::SiStripClusterizerAlgo( const edm::ParameterSet& pset) : 00009 noise_(0), 00010 quality_(0), 00011 gain_(0), 00012 nCacheId_(0), 00013 qCacheId_(0), 00014 gCacheId_(0) 00015 {} 00016 00017 // ----------------------------------------------------------------------------- 00018 // 00019 SiStripClusterizerAlgo::~SiStripClusterizerAlgo() {} 00020 00021 // ----------------------------------------------------------------------------- 00022 // 00023 void SiStripClusterizerAlgo::eventSetup( const edm::EventSetup& setup ) { 00024 00025 uint32_t n_cache_id = setup.get<SiStripNoisesRcd>().cacheIdentifier(); 00026 uint32_t q_cache_id = setup.get<SiStripQualityRcd>().cacheIdentifier(); 00027 uint32_t g_cache_id = setup.get<SiStripGainRcd>().cacheIdentifier(); 00028 00029 if ( nCacheId_ != n_cache_id ) { 00030 edm::ESHandle<SiStripNoises> n; 00031 setup.get<SiStripNoisesRcd>().get(n); 00032 noise_ = n.product(); 00033 nCacheId_ = n_cache_id; 00034 } 00035 00036 if ( qCacheId_ != q_cache_id ) { 00037 edm::ESHandle<SiStripQuality> q; 00038 setup.get<SiStripQualityRcd>().get(q); 00039 quality_ = q.product(); 00040 qCacheId_ = q_cache_id; 00041 } 00042 00043 if ( gCacheId_ != g_cache_id ) { 00044 edm::ESHandle<SiStripGain> g; 00045 setup.get<SiStripGainRcd>().get(g); 00046 gain_ = g.product(); 00047 gCacheId_ = g_cache_id; 00048 } 00049 00050 } 00051