ATLAS Offline Software
LArWaveHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARWAVEHELPER_H
6 #define LARWAVEHELPER_H
7 
8 #include "LArWave.h"
9 #include "LArWaveCumul.h"
11 #include <math.h>
12 
13 
15 
16  public:
17 
18  LArWave translate (const LArWave& theWave, int nShift, double baseline = 0.) const;
19  LArWave Dtranslate (const LArWave& theWave, double tShift, double baseline = 0.) const;
21  unsigned int getMin (const LArWave& theWave) const;
23  unsigned int getMax (const LArWave& theWave) const;
25  double getDMax (const LArWave& theWave, double &tMax)const;
27  LArWave derive (const LArWave& theWave) const;
29  LArWave derive_smooth(const LArWave& theWave) const;
31  LArWave autocorr (const LArWave& theWave) const;
32 
33  LArWave subSample(const LArWave& theWave,unsigned Nfirst,unsigned deltaN) const;
34  double getBaseline(const LArWave& theWave,unsigned nBase) const;
35  double getSumTail(const LArWave& theWave,unsigned iFirst) const;
36  double getSumRegion(const LArWave& theWave,unsigned iFirst,unsigned iLast) const;
37  double getSumSquareTail(const LArWave& theWave,unsigned iFirst) const;
38  double getSumSquareRegion(const LArWave& theWave,unsigned iFirst,unsigned iLast) const;
39  double getArea(const LArWave& theWave)const;
40  double getWidth(const LArWave& theWave)const;
41  double getMaxAmp(const LArWave& theWave)const;
42  double getT0(const LArWave& theWave)const;
43  double getT5(const LArWave& theWave)const;
44  unsigned getStart(const LArWave& theWave)const;
45  unsigned getZeroCross(const LArWave& theWave)const;
46  double getJitter(const LArWaveCumul& theWave)const;
47 
49 
50  std::vector<double> linfit(const LArWave& theWave,unsigned iFirst,unsigned iLast,
51  double& rho) const;
52  std::vector<double> expfit(const LArWave& theWave,unsigned iFirst,unsigned iLast,
53  double& rho) const;
54  std::vector<double> polyfit(const LArWave& theWave,unsigned iFirst,unsigned iLast,
55  unsigned Ndeg) const;
56 
57  // the following returns a linear master waveform and a "dac0" intercept
58  // [0] is dac0, [1] is master waveform
59  std::vector<LArWave> linearMasterWave(const std::vector<const LArWave*>& vWaves,const std::vector<double>& vAmpli) const;
60 
61  private:
62 
63  unsigned fact(unsigned N) const { return ( N<2 ) ? 1 : N*fact(N-1) ; };
64 
65  std::vector<double> linfit(const std::vector<double>& X,const std::vector<double>& Y,
66  double& rho) const;
67  std::vector<double> expfit(const std::vector<double>& X,const std::vector<double>& Y,
68  double& rho) const;
69  std::vector<double> polyfit(const std::vector<double>& X,const std::vector<double>& Y,
70  unsigned Ndeg) const;
71  unsigned get_fit_vectors(const LArWave& theWave,unsigned iFirst,unsigned iLast,
72  std::vector<double>& X,std::vector<double>& Y) const;
73 
74 } ;
75 
76 
77 #endif // LARWAVEHELPER_H
LArWave
Definition: LArWave.h:31
LArWaveHelper::getSumRegion
double getSumRegion(const LArWave &theWave, unsigned iFirst, unsigned iLast) const
Definition: LArWaveHelper.cxx:370
LArWaveCumul
Definition: LArWaveCumul.h:30
LArWaveHelper::getStart
unsigned getStart(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:409
LArWaveHelper::getWidth
double getWidth(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:209
LArWaveHelper::getBaseline
double getBaseline(const LArWave &theWave, unsigned nBase) const
Definition: LArWaveHelper.cxx:347
LArWaveHelper::translate
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
Definition: LArWaveHelper.cxx:11
LArWaveHelper
Definition: LArWaveHelper.h:14
LArWaveHelper::getJitter
double getJitter(const LArWaveCumul &theWave) const
Definition: LArWaveHelper.cxx:429
LArWaveHelper::getMaxAmp
double getMaxAmp(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:129
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
LArWaveHelper::getMax
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
Definition: LArWaveHelper.cxx:89
LArWaveHelper::getDMax
double getDMax(const LArWave &theWave, double &tMax) const
return amplitude aproximation from poly2 fit around maxima, and it's time
Definition: LArWaveHelper.cxx:103
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
LArWaveHelper::get_fit_vectors
unsigned get_fit_vectors(const LArWave &theWave, unsigned iFirst, unsigned iLast, std::vector< double > &X, std::vector< double > &Y) const
Definition: LArWaveHelper.cxx:657
LArWaveHelper::getDerivedQuantities
LArWaveDerivedQuantitiesP getDerivedQuantities(const LArWaveCumul &theWave) const
Definition: LArWaveHelper.cxx:452
LArWaveHelper::getSumTail
double getSumTail(const LArWave &theWave, unsigned iFirst) const
Definition: LArWaveHelper.cxx:355
LArWaveHelper::getT5
double getT5(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:183
LArWaveHelper::getSumSquareRegion
double getSumSquareRegion(const LArWave &theWave, unsigned iFirst, unsigned iLast) const
Definition: LArWaveHelper.cxx:392
baseline
@ baseline
Definition: SUSYToolsTester.cxx:99
LArWaveHelper::fact
unsigned fact(unsigned N) const
Definition: LArWaveHelper.h:63
LArWaveDerivedQuantitiesP
Definition: LArWaveDerivedQuantitiesP.h:10
LArWaveHelper::linearMasterWave
std::vector< LArWave > linearMasterWave(const std::vector< const LArWave * > &vWaves, const std::vector< double > &vAmpli) const
Definition: LArWaveHelper.cxx:494
LArWaveHelper::linfit
std::vector< double > linfit(const LArWave &theWave, unsigned iFirst, unsigned iLast, double &rho) const
Definition: LArWaveHelper.cxx:467
LArWaveHelper::Dtranslate
LArWave Dtranslate(const LArWave &theWave, double tShift, double baseline=0.) const
Definition: LArWaveHelper.cxx:28
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
LArWaveHelper::polyfit
std::vector< double > polyfit(const LArWave &theWave, unsigned iFirst, unsigned iLast, unsigned Ndeg) const
Definition: LArWaveHelper.cxx:483
LArWaveHelper::getSumSquareTail
double getSumSquareTail(const LArWave &theWave, unsigned iFirst) const
Definition: LArWaveHelper.cxx:387
LArWaveHelper::getZeroCross
unsigned getZeroCross(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:421
LArWaveHelper::getMin
unsigned int getMin(const LArWave &theWave) const
return index of minimum sample
Definition: LArWaveHelper.cxx:74
LArWaveCumul.h
LArWaveHelper::getArea
double getArea(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:141
LArWaveHelper::derive_smooth
LArWave derive_smooth(const LArWave &theWave) const
smoothed derivative
Definition: LArWaveHelper.cxx:270
LArWaveHelper::autocorr
LArWave autocorr(const LArWave &theWave) const
autocorrelation function (not normalized)
Definition: LArWaveHelper.cxx:318
LArWaveHelper::subSample
LArWave subSample(const LArWave &theWave, unsigned Nfirst, unsigned deltaN) const
Definition: LArWaveHelper.cxx:334
LArWave.h
LArWaveHelper::derive
LArWave derive(const LArWave &theWave) const
crude derivative
Definition: LArWaveHelper.cxx:252
LArWaveDerivedQuantitiesP.h
LArWaveHelper::expfit
std::vector< double > expfit(const LArWave &theWave, unsigned iFirst, unsigned iLast, double &rho) const
Definition: LArWaveHelper.cxx:475
LArWaveHelper::getT0
double getT0(const LArWave &theWave) const
Definition: LArWaveHelper.cxx:162
fitman.rho
rho
Definition: fitman.py:532