Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:38

0001 #ifndef ApvAnalysis_SimplePedestalCalculator_h
0002 #define ApvAnalysis_SimplePedestalCalculator_h
0003 
0004 #include "CalibTracker/SiStripAPVAnalysis/interface/TkPedestalCalculator.h"
0005 #include <map>
0006 /**
0007  * Concrete implementation of  TkPedestalCalculator for Simple.
0008  */
0009 
0010 class SimplePedestalCalculator : public TkPedestalCalculator {
0011 public:
0012   SimplePedestalCalculator(int evnt_ini);
0013   ~SimplePedestalCalculator() override;
0014 
0015   void resetPedestals() override {
0016     thePedestal.clear();
0017     theRawNoise.clear();
0018   }
0019   void setPedestals(ApvAnalysis::PedestalType& in) override { thePedestal = in; }
0020   void setRawNoise(ApvAnalysis::PedestalType& in) { theRawNoise = in; }
0021 
0022   void updateStatus() override;
0023 
0024   void updatePedestal(ApvAnalysis::RawSignalType& in) override;
0025 
0026   ApvAnalysis::PedestalType rawNoise() const override { return theRawNoise; }
0027   ApvAnalysis::PedestalType pedestal() const override { return thePedestal; }
0028 
0029   void newEvent() override;
0030 
0031 private:
0032   void init();
0033   void initializePedestal(ApvAnalysis::RawSignalType& in);
0034   void refinePedestal(ApvAnalysis::RawSignalType& in);
0035 
0036 protected:
0037   ApvAnalysis::PedestalType thePedestal;
0038   ApvAnalysis::PedestalType theRawNoise;
0039   std::vector<int> thePedSum, thePedSqSum;
0040   std::vector<unsigned short> theEventPerStrip;
0041   int numberOfEvents;
0042   int eventsRequiredToCalibrate;
0043   //  int eventsRequiredToUpdate;
0044   //  float cutToAvoidSignal;
0045   bool alreadyUsedEvent;
0046 };
0047 #endif