FairRoot/PandaRoot
PndEmcWaveformDigitizer.cxx
Go to the documentation of this file.
3 
4 #include "PndEmcWaveform.h"
5 #include "TMath.h"
6 
7 
9  fNBits(0),
10  fEnergyRange(0.),
11  fInputScale(0.),
12  fTotalChannels(0),
13  fOneBitResolution(0.) {
14 }
15 
17  fNBits(nBits),
18  fEnergyRange(energyRange),
19  fInputScale(inputScale) {
20  fTotalChannels = (Int_t) (TMath::Power(2, nBits) + 0.5);
22 }
23 
25  for(std::vector<Double_t>::iterator it=GetWaveformReference(wf).begin(); it!=GetWaveformReference(wf).end(); ++it) {
26  Double_t channel = TMath::Floor((*it)/fOneBitResolution); //digitize
27  (*it) = (channel > fTotalChannels) ? fTotalChannels : channel; //clipping
28  }
29 }
30 
Double_t
virtual void Modify(PndEmcWaveform *wf)
represents a simulated waveform in an emc crystal
std::vector< Double_t > & GetWaveformReference(PndEmcWaveform *wf)