00001 #ifndef RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPZEROSUPPRESSOR_H
00002 #define RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPZEROSUPPRESSOR_H
00003
00004 #include "DataFormats/Common/interface/DetSetVector.h"
00005 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00006 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 #include "FWCore/Framework/interface/ESHandle.h"
00011
00012 #include <vector>
00013
00014 class SiStripNoises;
00015 class SiStripThreshold;
00016
00017 class SiStripFedZeroSuppression {
00018 public:
00019
00020 SiStripFedZeroSuppression(uint16_t fedalgo):
00021 theFEDalgorithm(fedalgo){};
00022 ~SiStripFedZeroSuppression(){};
00023
00024 void init(const edm::EventSetup& es);
00025
00026 void suppress(const std::vector<SiStripDigi>&,std::vector<SiStripDigi>&,const uint32_t&,
00027 edm::ESHandle<SiStripNoises> &,edm::ESHandle<SiStripThreshold> &);
00028
00029 void suppress(const std::vector<SiStripDigi>&,std::vector<SiStripDigi>&,const uint32_t&);
00030
00031 void suppress(const edm::DetSet<SiStripRawDigi>&,edm::DetSet<SiStripDigi>&);
00032
00033 void suppress(const std::vector<int16_t>&,edm::DetSet<SiStripDigi>&);
00034
00035
00036 bool IsAValidDigi();
00037
00038 private:
00039
00040 inline uint16_t truncate(int16_t adc) const{
00041 if(adc>253) return ((adc>511) ? 255 : 254);
00042 return adc;
00043 };
00044
00045 private:
00046 edm::ESHandle<SiStripNoises> noiseHandle;
00047 edm::ESHandle<SiStripThreshold> thresholdHandle;
00048
00049 uint16_t theFEDalgorithm;
00050 int16_t theFEDlowThresh;
00051 int16_t theFEDhighThresh;
00052
00053 int16_t adc;
00054 int16_t adcPrev;
00055 int16_t adcNext;
00056 int16_t adcMaxNeigh;
00057 int16_t adcPrev2;
00058 int16_t adcNext2;
00059
00060 int16_t thePrevFEDlowThresh;
00061 int16_t thePrevFEDhighThresh;
00062 int16_t theNextFEDlowThresh;
00063 int16_t theNextFEDhighThresh;
00064
00065 int16_t theNeighFEDlowThresh;
00066 int16_t theNeighFEDhighThresh;
00067
00068 int16_t thePrev2FEDlowThresh;
00069 int16_t theNext2FEDlowThresh;
00070
00071
00072 std::vector<int16_t> highThr_, lowThr_;
00073 std::vector<float> highThrSN_, lowThrSN_;
00074 std::vector<float> noises_;
00075
00076 void fillThresholds_(const uint32_t detID, size_t size) ;
00077
00078 };
00079 #endif