160 std::vector<raw::RawDigit>
const& rawDigitVector(*rawDigitHandle);
162 std::vector<raw::RawDigit> filterRawDigitVector;
165 std::vector< std::pair<int,int> > ZeroFreq;
172 for (
size_t DigLoop=0; DigLoop < rawDigitVector.size(); ++DigLoop) {
173 int Channel = rawDigitVector[DigLoop].Channel();
174 size_t NADC = rawDigitVector[DigLoop].NADC();
175 double Pedestal = rawDigitVector[DigLoop].GetPedestal();
184 TH1F hRawDigit(
"hRawDigit",
"",NADC,0,NADC/2);
185 TH1F hRawFFT(
"hRawFFT" ,
"",NADC,0,NADC);
186 for (
size_t ADCs=0; ADCs < NADC; ++ADCs) {
187 hRawDigit.SetBinContent( ADCs+1, rawDigitVector[DigLoop].ADC(ADCs)-Pedestal );
189 for (
size_t ww=NADC; ww<NADC; ++ww)
190 hRawFFT.SetBinContent( ww, 0 );
192 hRawDigit.FFT( (&hRawFFT) ,
"MAG");
193 for (
size_t bin = 0;
bin < NADC; ++
bin) {
194 double BinVal = hRawFFT.GetBinContent(
bin+1);
195 double freq = 2000. *
bin / (double)NADC;
196 if (freq < 1000 && BinVal < 1e5 &&
fMakeTree) {
197 RawFFT->Fill( (Channel-0.5) , freq, BinVal );
203 std::unique_ptr<double[]> Re(
new double[NADC]);
204 std::unique_ptr<double[]> Im(
new double[NADC]);
205 TVirtualFFT *fft = TVirtualFFT::GetCurrentTransform();
206 fft->GetPointsComplex(Re.get(),Im.get());
210 for (
size_t aa=0; aa<ZeroFreq.size(); ++aa) {
211 for (
int bb=ZeroFreq[aa].first; bb<ZeroFreq[aa].second; ++bb) {
215 for (
int cc=0; cc<Range; ++cc) {
216 ReMeanVal += Re[ZeroFreq[aa].first-cc] + Re[ZeroFreq[aa].second+cc];
217 ImMeanVal += Im[ZeroFreq[aa].first-cc] + Im[ZeroFreq[aa].second+cc];
219 ReMeanVal = ReMeanVal / Range;
220 Re[bb] = Re[1500-bb] = ReMeanVal;
221 ImMeanVal = ImMeanVal / Range;
222 Im[bb] = Im[1500-bb] = ImMeanVal;
227 for (
size_t bin = 0;
bin < NADC; ++
bin) {
228 double freq = 2000. *
bin / NADC;
241 if (TMath::IsNaN(MagVal)) MagVal = 0;
244 if (freq < 1000 && MagVal < 1e5 &&
fMakeTree) {
245 FixFFT -> Fill( (Channel-0.5) , freq, MagVal );
251 TVirtualFFT *fft_back = TVirtualFFT::FFT(1, &NBins,
"C2R");
252 fft_back->SetPointsComplex(Re.get(),Im.get());
253 fft_back->Transform();
255 hb = TH1::TransformHisto(fft_back, hb,
"Re");
257 std::vector<short> NewADC;
258 for (
int BinNum=0; BinNum<NBins; ++BinNum) {
259 short Val = rawDigitVector[DigLoop].GetPedestal() + hb->GetBinContent(BinNum+1) / NBins;
260 NewADC.push_back( Val);
264 theRawDigit.
SetPedestal( rawDigitVector[DigLoop].GetPedestal(), rawDigitVector[DigLoop].GetSigma());
265 filterRawDigitVector.push_back( theRawDigit );
269 evt.
put(std::make_unique<decltype(filterRawDigitVector)>(
std::move(filterRawDigitVector)));
TF1 * fIndVFilterFunc
Parameterized induction filter function.
TF1 * fColFilterFunc
Parameterized collection filter function.
Collection of charge vs time digitized from a single readout channel.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::string fDigitModuleLabel
Planes which measure Z direction.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
std::string fDigitModuleInstance
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
ChannelMappingService::Channel Channel
QTextStream & bin(QTextStream &s)
TF1 * fIndUFilterFunc
Parameterized induction filter function.
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Namespace collecting geometry-related classes utilities.