00001 #ifndef ApvAnalysis_TT6PedestalCalculator_h 00002 #define ApvAnalysis_TT6PedestalCalculator_h 00003 00004 #include "CalibTracker/SiStripAPVAnalysis/interface/TkPedestalCalculator.h" 00005 #include<map> 00010 class TT6PedestalCalculator: public TkPedestalCalculator { 00011 public: 00012 00013 TT6PedestalCalculator(int evnt_ini, int evnt_iter, float sig_cut); 00014 virtual ~TT6PedestalCalculator(); 00015 00016 00017 00018 void resetPedestals() { 00019 thePedestal.clear(); 00020 theRawNoise.clear(); 00021 } 00022 void setPedestals (ApvAnalysis::PedestalType& in) {thePedestal=in;} 00023 void setRawNoise (ApvAnalysis::PedestalType& in) {theRawNoise=in;} 00024 00025 void updateStatus(); 00026 00027 void updatePedestal (ApvAnalysis::RawSignalType& in); 00028 00029 ApvAnalysis::PedestalType rawNoise() const { return theRawNoise;} 00030 ApvAnalysis::PedestalType pedestal() const { return thePedestal;} 00031 00032 00033 void newEvent(); 00034 00035 private: 00036 void init(); 00037 void initializePedestal (ApvAnalysis::RawSignalType& in); 00038 void refinePedestal (ApvAnalysis::RawSignalType& in); 00039 00040 protected: 00041 ApvAnalysis::PedestalType thePedestal; 00042 ApvAnalysis::PedestalType theRawNoise; 00043 std::vector<double> thePedSum,thePedSqSum; 00044 std::vector<unsigned short> theEventPerStrip; 00045 int numberOfEvents; 00046 int eventsRequiredToCalibrate; 00047 int eventsRequiredToUpdate; 00048 float cutToAvoidSignal; 00049 bool alreadyUsedEvent; 00050 00051 }; 00052 #endif