Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:35

0001 #ifndef ApvAnalysis_TT6PedestalCalculator_h
0002 #define ApvAnalysis_TT6PedestalCalculator_h
0003 
0004 #include "CalibTracker/SiStripAPVAnalysis/interface/TkPedestalCalculator.h"
0005 #include <map>
0006 /**
0007  * Concrete implementation of  TkPedestalCalculator for TT6.
0008  */
0009 
0010 class TT6PedestalCalculator : public TkPedestalCalculator {
0011 public:
0012   TT6PedestalCalculator(int evnt_ini, int evnt_iter, float sig_cut);
0013   ~TT6PedestalCalculator() 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<double> 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