Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ApvAnalysis_SimpleNoiseCalculator_H
0002 #define ApvAnalysis_SimpleNoiseCalculator_H
0003 
0004 #include "CalibTracker/SiStripAPVAnalysis/interface/TkNoiseCalculator.h"
0005 /**
0006  * Concrete implementation of TkNoiseCalculator  for Simple.
0007  */
0008 
0009 class SimpleNoiseCalculator : public TkNoiseCalculator {
0010 public:
0011   // Use the constructor without arguments, since the other will soon
0012   // be obsolete.
0013   SimpleNoiseCalculator();
0014   SimpleNoiseCalculator(int evnt_ini, bool useDB);
0015   ~SimpleNoiseCalculator() override;
0016 
0017   void setStripNoise(ApvAnalysis::PedestalType& in) override {
0018     theNoise.clear();
0019     theNoise = in;
0020   }
0021   ApvAnalysis::PedestalType noise() const override { return theNoise; }
0022   float stripNoise(int in) const override { return theNoise[in]; }
0023   int nevents() const { return numberOfEvents; }
0024 
0025   void updateStatus() override;
0026   void resetNoise() override { theNoise.clear(); }
0027   void updateNoise(ApvAnalysis::PedestalType& in) override;
0028   void newEvent() override;
0029 
0030   ApvAnalysis::PedestalType stripCMPSubtractedSignal() const { return theCMPSubtractedSignal; }
0031 
0032 protected:
0033   void init();
0034 
0035 protected:
0036   ApvAnalysis::PedestalType theNoise;
0037   ApvAnalysis::PedestalType theCMPSubtractedSignal;
0038   std::vector<double> theNoiseSum, theNoiseSqSum;
0039   std::vector<unsigned short> theEventPerStrip;
0040   int numberOfEvents;
0041   bool alreadyUsedEvent;
0042   bool useDB_;
0043 
0044   int eventsRequiredToCalibrate_;
0045   // int eventsRequiredToUpdate_;
0046   // float cutToAvoidSignal_;
0047 };
0048 #endif