mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorCalibration@12 113b152e-814d-439b-b186-022a431db7b5
35 lines
640 B
C++
35 lines
640 B
C++
#ifndef MOENCHCOMMONMODE_H
|
|
#define MOENCHCOMMONMODE_H
|
|
|
|
#include "commonModeSubtraction.h"
|
|
|
|
class moenchCommonMode : public commonModeSubtraction {
|
|
|
|
public:
|
|
moenchCommonMode(int nn=1000) : commonModeSubtraction(nn,4){} ;
|
|
|
|
|
|
virtual void addToCommonMode(double val, int ix=0, int iy=0) {
|
|
(void)iy;
|
|
int isc=ix/40;
|
|
if (isc>=0 && isc<4) {
|
|
cmPed[isc]+=val;
|
|
nCm[isc]++;
|
|
}
|
|
|
|
};
|
|
|
|
virtual double getCommonMode(int ix=0, int iy=0) {
|
|
(void)iy;
|
|
int isc=ix/40;
|
|
if (isc>=0 && isc<4) {
|
|
if (nCm[isc]>0) return cmPed[isc]/nCm[isc]-cmStat[isc].Mean();
|
|
}
|
|
return 0;};
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif
|