00001 #ifndef RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPPEDESTALSSUBTRACTOR_H 00002 #define RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPPEDESTALSSUBTRACTOR_H 00003 00004 #include "FWCore/Framework/interface/ESHandle.h" 00005 #include "FWCore/Framework/interface/EventSetup.h" 00006 00007 #include "DataFormats/Common/interface/DetSetVector.h" 00008 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h" 00009 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h" 00010 #include <vector> 00011 00012 class SiStripPedestalsSubtractor { 00013 00014 friend class SiStripRawProcessingFactory; 00015 00016 public: 00017 00018 void subtract(const edm::DetSet<SiStripRawDigi>&, std::vector<int16_t>&); 00019 void subtract(const uint32_t&, const uint16_t &, std::vector<int16_t>&); 00020 void init(const edm::EventSetup& ); 00021 00022 private: 00023 00024 SiStripPedestalsSubtractor(bool mode) : peds_cache_id(0), fedmode_(mode) {}; 00025 edm::ESHandle<SiStripPedestals> pedestalsHandle; 00026 std::vector<int> pedestals; 00027 uint32_t peds_cache_id; 00028 bool fedmode_; 00029 00030 template <class input_t> void subtract_(const uint32_t&,const uint16_t&, const input_t&, std::vector<int16_t>&); 00031 const int16_t& eval(const int16_t& in) { return in;} 00032 const uint16_t& eval(const SiStripRawDigi& in) { return in.adc();} 00033 00034 }; 00035 #endif