TT6NoiseCalculator

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#ifndef ApvAnalysis_TT6NoiseCalculator_H
#define ApvAnalysis_TT6NoiseCalculator_H

#include "CalibTracker/SiStripAPVAnalysis/interface/TkNoiseCalculator.h"
/**
 * Concrete implementation of TkNoiseCalculator  for TT6.
 */

class TT6NoiseCalculator : public TkNoiseCalculator {
public:
  // Use the constructor without arguments, since the other will soon
  // be obsolete.
  TT6NoiseCalculator();
  TT6NoiseCalculator(int evnt_ini, int evnt_iter, float sig_cut);
  ~TT6NoiseCalculator() override;

  void setStripNoise(ApvAnalysis::PedestalType& in) override {
    theNoise.clear();
    theNoise = in;
  }
  ApvAnalysis::PedestalType noise() const override { return theNoise; }
  float stripNoise(int in) const override { return theNoise[in]; }
  int nevents() const { return numberOfEvents; }

  void updateStatus() override;
  void resetNoise() override { theNoise.clear(); }
  void updateNoise(ApvAnalysis::PedestalType& in) override;
  void newEvent() override;

  ApvAnalysis::PedestalType stripCMPSubtractedSignal() const { return theCMPSubtractedSignal; }

protected:
  void init();

protected:
  ApvAnalysis::PedestalType theNoise;
  ApvAnalysis::PedestalType theCMPSubtractedSignal;
  std::vector<double> theNoiseSum, theNoiseSqSum;
  std::vector<unsigned short> theEventPerStrip;
  int numberOfEvents;
  bool alreadyUsedEvent;

  int eventsRequiredToCalibrate_;
  int eventsRequiredToUpdate_;
  float cutToAvoidSignal_;
};
#endif