17 #include "cetlib/cpu_timer.h"
23 #include "art/Framework/Core/EDAnalyzer.h"
24 #include "art/Framework/Core/ModuleMacros.h"
25 #include "art/Framework/Principal/Event.h"
26 #include "art/Framework/Principal/Handle.h"
27 #include "art/Framework/Principal/Run.h"
28 #include "art/Framework/Principal/SubRun.h"
29 #include "art_root_io/TFileService.h"
30 #include "art/Framework/Core/ModuleMacros.h"
31 #include "art/Utilities/make_tool.h"
32 #include "canvas/Utilities/InputTag.h"
33 #include "canvas/Persistency/Common/FindManyP.h"
34 #include "messagefacility/MessageLogger/MessageLogger.h"
35 #include "fhiclcpp/ParameterSet.h"
36 #include "cetlib_except/exception.h"
42 #include "icarus_signal_processing/Filters/ICARUSFFT.h"
67 explicit TPCNoise(fhicl::ParameterSet
const&
p);
95 using FFTPointer = std::unique_ptr<icarus_signal_processing::ICARUSFFT<double>>;
183 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob();
194 std::cout <<
" after resizing " << std::endl;
200 std::cout <<
" after resizing " << std::endl;
207 std::cout <<
" after resizing " << std::endl;
213 std::cout <<
" after resizing " << std::endl;
219 std::cout <<
" after resizing " << std::endl;
230 std::cout <<
" after resizing " << std::endl;
236 std::cout <<
" after resizing " << std::endl;
242 std::cout <<
" after intrinsic i2 resizing " << std::endl;
246 double freqBin=0.6103515625;
247 fRawPowerHistoC=
new TH1D(
"rawpowerC",
"rawpowerC",2048,0.,2048*freqBin);
283 std::cout <<
" end constructor " << std::endl;
288 std::cout <<
" begin analyze " << std::endl;
289 art::ServiceHandle<geo::Geometry> geom;
293 std::cout <<
" after clearing " << std::endl;
298 std::cout <<
" after clearing " << std::endl;
301 fEvent = e.id().event();
302 std::cout <<
" event " << fEvent << std::endl;
304 std::cout <<
" run " << fRun << std::endl;
305 fSubRun = e.id().subRun();
306 std::cout <<
" subrun " << fSubRun << std::endl;
307 std::cout <<
"Processing event " << NEvents+1 <<
" for TPC Noise Analysis " <<
" Run " << fRun <<
", " <<
"Event " << fEvent <<
"." << std::endl;
314 art::Handle< std::vector<raw::RawDigit> > RawDigitHandle;
315 e.getByLabel(fRawDigitModuleLabel, fRawInstance, fRawDigitProcess, RawDigitHandle);
317 std::cout <<
" raw instance " << fRawInstance << std::endl;
319 for(
const auto& RawDigit : *RawDigitHandle)
322 unsigned int DataSize = RawDigit.Samples();
323 std::vector<short> RawADC;
324 RawADC.resize(DataSize);
328 std::vector<short> SortedADC(RawADC);
329 std::sort(SortedADC.begin(),SortedADC.end(),[](
const auto&
left,
const auto&
right){
return std::fabs(
left) < std::fabs(
right);});
330 float median(SortedADC.at(SortedADC.size()/2));
333 float mean(
float(std::accumulate(SortedADC.begin(),SortedADC.end(),0))/float(SortedADC.size()));
334 std::vector<geo::WireID> widVec = geom->ChannelToWire(RawDigit.Channel());
335 size_t plane = widVec[0].Plane;
336 size_t wire = widVec[0].Wire;
340 std::vector<float> ADCLessPed;
341 ADCLessPed.resize(SortedADC.size());
342 std::transform(SortedADC.begin(),SortedADC.end(),ADCLessPed.begin(),std::bind(std::minus<float>(),std::placeholders::_1,median));
345 float rms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.end(), ADCLessPed.begin(), 0.) / float(ADCLessPed.size())));
348 unsigned int MinBins((1.0 - 0.01)*ADCLessPed.size());
355 float truncrms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.begin() + MinBins, ADCLessPed.begin(), 0.) / float(MinBins)));
358 std::vector<double> power(DataSize);
359 std::vector<double> RawLessPed;
360 RawLessPed.resize(RawADC.size());
361 std::transform(RawADC.begin(),RawADC.end(),RawLessPed.begin(),std::bind(std::minus<double>(),std::placeholders::_1,median));
362 fFFT->getFFTPower(RawLessPed, power);
366 if(plane==0&&wire!=32&&wire<3000) {
367 std::transform(fRawPowerI1.at(0).begin(), fRawPowerI1.at(0).end(), power.begin(), fRawPowerI1.at(0).begin(), std::plus<float>()); ctI1++; }
368 if(plane==1) {
std::transform(fRawPowerI2.at(0).begin(), fRawPowerI2.at(0).end(), power.begin(), fRawPowerI2.at(0).begin(), std::plus<float>()); ctI2++; }
370 if(plane==2) {
std::transform(fRawPowerC.at(0).begin(), fRawPowerC.at(0).end(), power.begin(), fRawPowerC.at(0).begin(), std::plus<float>()); ctC++; }
373 fPed.push_back(median);
374 if(plane==2) fRawMeanC.push_back(mean);
375 if(plane==1) fRawMeanI2.push_back(mean);
376 if(plane==0) fRawMeanI1.push_back(mean);
377 if(plane==2) { fRawRMSC.push_back(rms); }
378 if(plane==0&&wire!=32&&wire<3000) { fRawRMSI1.push_back(rms); }
379 if(plane==1) { fRawRMSI2.push_back(rms); }
380 fRawRMSTrim.push_back(truncrms);
382 fChannel.push_back(RawDigit.Channel());
385 float intI1=0, intI2=0, intC=0;
386 std::vector<float> rpi1=fRawPowerI1.at(0);
387 std::vector<float> rpi2=fRawPowerI2.at(0);
388 std::vector<float> rpc=fRawPowerC.at(0);
389 for (
unsigned int j=0; j< rpi1.size(); j++) intI1+=rpi1.at(j);
390 for (
unsigned int j=0; j< rpi2.size(); j++) intI2+=rpi2.at(j);
391 for (
unsigned int j=0; j< rpc.size(); j++) intC+=rpc.at(j);
393 std::cout <<
" integral i1 " << intI1 <<
" integral i2 " << intI2 <<
" integral c " << intC << std::endl;
397 art::Handle< std::vector<raw::RawDigit> > IntrinsicHandle;
398 e.getByLabel(fRawDigitModuleLabel, fIntrinsicInstance, fRawDigitProcess, IntrinsicHandle);
402 std::cout <<
" intrinsic instance " << fIntrinsicInstance << std::endl;
403 for(
const auto& RawDigit : *IntrinsicHandle)
406 unsigned int DataSize = RawDigit.Samples();
407 std::vector<short> RawADC;
408 RawADC.resize(DataSize);
412 std::vector<short> SortedADC(RawADC);
413 std::sort(SortedADC.begin(),SortedADC.end(),[](
const auto&
left,
const auto&
right){
return std::fabs(
left) < std::fabs(
right);});
414 float median(SortedADC.at(SortedADC.size()/2));
417 float mean(
float(std::accumulate(SortedADC.begin(),SortedADC.end(),0))/float(SortedADC.size()));
420 std::vector<short> ADCLessPed;
421 ADCLessPed.resize(SortedADC.size());
422 std::transform(SortedADC.begin(),SortedADC.end(),ADCLessPed.begin(),std::bind(std::minus<float>(),std::placeholders::_1,median));
425 float rms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.end(), ADCLessPed.begin(), 0.) / float(ADCLessPed.size())));
428 unsigned int MinBins((1.0 - 0.2)*ADCLessPed.size());
435 float truncrms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.begin() + MinBins, ADCLessPed.begin(), 0.) / float(MinBins)));
438 std::vector<double> power(DataSize);
439 std::vector<double> RawLessPed;
440 RawLessPed.resize(RawADC.size());
441 std::transform(RawADC.begin(),RawADC.end(),RawLessPed.begin(),std::bind(std::minus<double>(),std::placeholders::_1,median));
442 fFFT->getFFTPower(RawLessPed, power);
443 std::vector<geo::WireID> widVec = geom->ChannelToWire(RawDigit.Channel());
444 size_t plane = widVec[0].Plane;
446 if(plane==0) {
std::transform(fIntrinsicPowerI1.at(0).begin(), fIntrinsicPowerI1.at(0).end(), power.begin(), fIntrinsicPowerI1.at(0).begin(), std::plus<float>()); }
447 if(plane==1) {
std::transform(fIntrinsicPowerI2.at(0).begin(), fIntrinsicPowerI2.at(0).end(), power.begin(), fIntrinsicPowerI2.at(0).begin(), std::plus<float>()); }
448 if(plane==2) {
std::transform(fIntrinsicPowerC.at(0).begin(), fIntrinsicPowerC.at(0).end(), power.begin(), fIntrinsicPowerC.at(0).begin(), std::plus<float>()); }
451 fIntrinsicMean.push_back(mean);
452 if(plane==2) { fIntrinsicRMSC.push_back(rms);}
453 if(plane==0)fIntrinsicRMSI1.push_back(rms);
454 if(plane==1) {fIntrinsicRMSI2.push_back(rms); }
456 fIntrinsicRMSTrim.push_back(truncrms);
466 art::Handle< std::vector<raw::RawDigit> > CoherentHandle;
467 e.getByLabel(fRawDigitModuleLabel, fCoherentInstance, fRawDigitProcess, CoherentHandle);
468 std::cout <<
" coherent instance " << fCoherentInstance << std::endl;
471 for(
const auto& RawDigit : *CoherentHandle)
475 unsigned int DataSize = RawDigit.Samples();
476 std::vector<short> RawADC;
477 RawADC.resize(DataSize);
481 std::vector<short> SortedADC(RawADC);
482 std::sort(SortedADC.begin(),SortedADC.end(),[](
const auto&
left,
const auto&
right){
return std::fabs(
left) < std::fabs(
right);});
483 float median(SortedADC.at(SortedADC.size()/2));
489 float mean(
float(std::accumulate(SortedADC.begin(),SortedADC.end(),0))/float(SortedADC.size()));
492 std::vector<short> ADCLessPed;
493 ADCLessPed.resize(SortedADC.size());
494 std::transform(SortedADC.begin(),SortedADC.end(),ADCLessPed.begin(),std::bind(std::minus<float>(),std::placeholders::_1,median));
497 float rms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.end(), ADCLessPed.begin(), 0.) / float(ADCLessPed.size())));
500 unsigned int MinBins((1.0 - 0.2)*ADCLessPed.size());
507 float truncrms(std::sqrt(std::inner_product(ADCLessPed.begin(), ADCLessPed.begin() + MinBins, ADCLessPed.begin(), 0.) / float(MinBins)));
510 std::vector<double> power(DataSize);
511 std::vector<double> RawLessPed;
512 RawLessPed.resize(RawADC.size());
513 std::transform(RawADC.begin(),RawADC.end(),RawLessPed.begin(),std::bind(std::minus<double>(),std::placeholders::_1,median));
514 fFFT->getFFTPower(RawLessPed, power);
515 std::vector<geo::WireID> widVec = geom->ChannelToWire(RawDigit.Channel());
516 size_t plane = widVec[0].Plane;
518 if(plane==0) {
std::transform(fCoherentPowerI1.at(0).begin(), fCoherentPowerI1.at(0).end(), power.begin(), fCoherentPowerI1.at(0).begin(), std::plus<float>()); }
519 if(plane==1) {
std::transform(fCoherentPowerI2.at(0).begin(), fCoherentPowerI2.at(0).end(), power.begin(), fCoherentPowerI2.at(0).begin(), std::plus<float>()); }
520 if(plane==2) {
std::transform(fCoherentPowerC.at(0).begin(), fCoherentPowerC.at(0).end(), power.begin(), fCoherentPowerC.at(0).begin(), std::plus<float>()); }
523 fCoherentMean.push_back(mean);
525 if(plane==2) { fCoherentRMSC.push_back(rms);}
526 if(plane==0)fCoherentRMSI1.push_back(rms);
527 if(plane==1) { fCoherentRMSI2.push_back(rms); }
528 fCoherentRMSTrim.push_back(truncrms);
544 fRawDigitModuleLabel = p.get< std::string >(
"RawDigitModuleLabel", std::string(
"daqTPC"));
546 fRawDigitProcess = p.get< std::string >(
"RawDigitProcess", std::string(
"decode"));
548 fRawInstance = p.get< std::string >(
"RawInstance", std::string(
"RAW"));
550 fIntrinsicInstance = p.get< std::string >(
"IntrinsicInstance", std::string(
"."));
552 fCoherentInstance = p.get< std::string >(
"CoherentInstance", std::string(
"Cor"));
554 fHistoFileName = p.get< std::string >(
"HistoFileName");
562 art::ServiceHandle<art::TFileService>
tfs;
564 fNoiseTree = tfs->makeAndRegister<TTree>(
"TPCNoise_t",
"TPC Noise");
565 fRawPowerTree = tfs->makeAndRegister<TTree>(
"TPCRawPower_t",
"TPC Raw Power");
566 fIntrinsicPowerTree = tfs->makeAndRegister<TTree>(
"TPCIntrinsicPower_t",
"TPC Intrinsic Power");
567 fCoherentPowerTree = tfs->makeAndRegister<TTree>(
"TPCCoherentPower_t",
"TPC Coherent Power");
570 fNoiseTree->Branch(
"Event", &fEvent,
"Event/I");
571 fNoiseTree->Branch(
"Run", &fRun,
"Run/I");
572 fNoiseTree->Branch(
"SubRun", &fSubRun,
"SubRun/I");
573 fNoiseTree->Branch(
"Channel", &fChannel);
574 fNoiseTree->Branch(
"Pedestal", &fPed);
575 fNoiseTree->Branch(
"RawMeanC", &fRawMeanC);
576 fNoiseTree->Branch(
"RawRMSC", &fRawRMSC);
578 fNoiseTree->Branch(
"RawTrimmedRMS", &fRawRMSTrim);
579 fNoiseTree->Branch(
"IntrinsicMean", &fIntrinsicMean);
580 fNoiseTree->Branch(
"IntrinsicRMSC", &fIntrinsicRMSC);
581 fNoiseTree->Branch(
"IntrinsicTrimmedRMS", &fIntrinsicRMSTrim);
588 double freqBin=0.6103515625;
591 std::cout <<
" ctI1 " << ctI1 <<
" ctI2 " << ctI2 <<
" ctC " << ctC << std::endl;
593 for(
unsigned int j=0;j<(fRawPowerI1.at(0)).
size();j++) {(fRawPowerI1.at(0)).at(j)/=2110;}
594 for(
unsigned int j=0;j<(fCoherentPowerI1.at(0)).
size();j++) {(fCoherentPowerI1.at(0)).at(j)/=2110;}
595 for(
unsigned int j=0;j<(fIntrinsicPowerI1.at(0)).
size();j++) {(fIntrinsicPowerI1.at(0)).at(j)/=2110;}
596 for(
unsigned int j=0;j<(fRawPowerI2.at(0)).
size();j++) {(fRawPowerI2.at(0)).at(j)/=5600;}
597 for(
unsigned int j=0;j<(fCoherentPowerI2.at(0)).
size();j++) {(fCoherentPowerI2.at(0)).at(j)/=5600;}
598 for(
unsigned int j=0;j<(fIntrinsicPowerI2.at(0)).
size();j++) {(fIntrinsicPowerI2.at(0)).at(j)/=5600;}
599 for(
unsigned int j=0;j<(fRawPowerC.at(0)).
size();j++) {(fRawPowerC.at(0)).at(j)/=5600;}
600 for(
unsigned int j=0;j<(fCoherentPowerC.at(0)).
size();j++) {(fCoherentPowerC.at(0)).at(j)/=5600;}
601 for(
unsigned int j=0;j<(fIntrinsicPowerC.at(0)).
size();j++) {(fIntrinsicPowerC.at(0)).at(j)/=5600;}
605 std::cout <<
"Averaging power vectors..." << std::endl;
606 std::vector<float> TMPVect;
607 fRawPowerTree->Branch(
"Power", &TMPVect);
609 for(
auto &it : fRawPowerC)
612 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
615 std::cout <<
" tmpvect size " << TMPVect.size() << std::endl;
616 for(
unsigned int jv=0;jv<TMPVect.size();jv++) {
617 std::cout <<
" filling raw power " << jv*freqBin << std::endl;
619 fRawPowerHistoC->Fill(jv*freqBin,TMPVect[jv]);
623 std::cout <<
" raw power entries " << fRawPowerHistoC->GetEntries() << std::endl;
624 std::cout <<
" raw power count " << count << std::endl;
625 fRawPowerHistoC->Scale(1./count);
626 std::cout <<
" after filling raw power histo " << std::endl;
627 fIntrinsicPowerTree->Branch(
"Power", &TMPVect);
629 for(
auto &it : fIntrinsicPowerC)
632 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
634 std::cout <<
" tmpvect size " << TMPVect.size() << std::endl;
636 std::cout <<
" after fill tmpvect size " << TMPVect.size() << std::endl;
637 for(
unsigned int jv=0;jv<TMPVect.size();jv++) {
640 fIntrinsicPowerHistoC->Fill(jv*freqBin,TMPVect[jv]);
642 fIntrinsicPowerHistoC->Scale(1./count);
643 std::cout <<
" after filling intrinsic power histo " << std::endl;
646 fCoherentPowerTree->Branch(
"Power", &TMPVect);
648 for(
auto &it : fCoherentPowerC)
651 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
656 for(
unsigned int jv=0;jv<TMPVect.size();jv++)
657 fCoherentPowerHistoC->Fill(jv*freqBin,TMPVect[jv]);
659 fCoherentPowerHistoC->Scale(1./count);
660 std::cout <<
" frawrmsc size " << fRawRMSC.size() << std::endl;
661 for(
unsigned int jj=0;jj<fRawRMSC.size();jj++)
662 fRawRMSHistoC->Fill(fRawRMSC.at(jj));
663 std::cout <<
" after filling raw rms histo " << std::endl;
664 for(
unsigned int j=0;j<fRawMeanC.size(); j++) {
665 std::cout <<
" filling media " << std::endl;
666 fMediaHistoC->Fill(fRawMeanC.at(j));
668 std::cout <<
" after filling media histo " << std::endl;
670 for(
unsigned int jj=0;jj<fIntrinsicRMSC.size();jj++)
671 fIntrinsicRMSHistoC->Fill(fIntrinsicRMSC.at(jj));
673 std::cout <<
" fillhisto cohrms size " << fCoherentRMSC.size() << std::endl;
675 for(
unsigned int j=0;j<fCoherentRMSC.size();j++) {
677 fCoherentRMSHistoC->Fill(fCoherentRMSC.at(j));
681 std::cout <<
"Averaging power vectors..." << std::endl;
683 fRawPowerTree->Branch(
"Power", &TMPVect);
685 for(
auto &it : fRawPowerI1)
687 std::cout <<
" i1 counter " << count++ << std::endl;
688 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
692 for(
unsigned int jv=0;jv<TMPVect.size();jv++)
694 fRawPowerHistoI1->Fill(jv*freqBin,TMPVect[jv]);
696 fRawPowerHistoI1->Scale(1./count);
697 std::cout <<
" after filling raw power histo " << std::endl;
698 fIntrinsicPowerTree->Branch(
"Power", &TMPVect);
700 for(
auto &it : fIntrinsicPowerI1)
702 std::cout <<
" i1 counter " << count++ << std::endl;
703 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
708 for(
unsigned int jv=0;jv<TMPVect.size();jv++) {
710 fIntrinsicPowerHistoI1->Fill(jv*freqBin,TMPVect[jv]);
712 fIntrinsicPowerHistoI1->Scale(1./count);
713 std::cout <<
" after filling intrinsic power histo " << std::endl;
716 fCoherentPowerTree->Branch(
"Power", &TMPVect);
718 for(
auto &it : fCoherentPowerI1)
720 std::cout <<
" i1 counter " << count++ << std::endl;
721 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
726 for(
unsigned int jv=0;jv<TMPVect.size();jv++)
727 fCoherentPowerHistoI1->Fill(jv*freqBin,TMPVect[jv]);
729 fCoherentPowerHistoI1->Scale(1./count);
730 std::cout <<
" rawrmsi1 size " << fRawRMSI1.size() << std::endl;
731 for(
unsigned int jj=0;jj<fRawRMSI1.size();jj++) {
732 std::cout <<
" filling rawrmsi1 value " << fRawRMSI1.at(jj) << std::endl;
733 fRawRMSHistoI1->Fill(fRawRMSI1.at(jj));
735 std::cout <<
" after filling raw rms histo entries " << fRawRMSHistoI1->GetEntries() << std::endl;
736 for(
unsigned int j=0;j<fRawMeanI1.size(); j++) {
738 fMediaHistoI1->Fill(fRawMeanI1.at(j));
740 std::cout <<
" after filling media histo " << std::endl;
742 for(
unsigned int jj=0;jj<fIntrinsicRMSI1.size();jj++)
743 fIntrinsicRMSHistoI1->Fill(fIntrinsicRMSI1.at(jj));
745 std::cout <<
" fillhisto cohrms size " << fCoherentRMSI1.size() << std::endl;
747 for(
unsigned int j=0;j<fCoherentRMSI1.size();j++) {
748 std::cout <<
" filling coherent RMS " << fCoherentRMSI1.at(j) << std::endl;
749 fCoherentRMSHistoI1->Fill(fCoherentRMSI1.at(j));
753 std::cout <<
"Averaging power vectors..." << std::endl;
755 fRawPowerTree->Branch(
"Power", &TMPVect);
757 for(
auto &it : fRawPowerI2)
760 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
763 std::cout <<
" tmpvect size " << TMPVect.size() << std::endl;
764 for(
unsigned int jv=0;jv<TMPVect.size();jv++)
766 fRawPowerHistoI2->Fill(jv*freqBin,TMPVect[jv]);
768 std::cout <<
" after filling raw power histo " << std::endl;
769 fRawPowerHistoI2->Scale(1./count);
770 fIntrinsicPowerTree->Branch(
"Power", &TMPVect);
772 for(
auto &it : fIntrinsicPowerI2)
775 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
777 std::cout <<
" tmpvect size " << TMPVect.size() << std::endl;
779 std::cout <<
" after fill tmpvect size " << TMPVect.size() << std::endl;
780 for(
unsigned int jv=0;jv<TMPVect.size();jv++) {
782 fIntrinsicPowerHistoI2->Fill(jv*freqBin,TMPVect[jv]);
784 fIntrinsicPowerHistoI2->Scale(1./count);
785 std::cout <<
" after filling intrinsic power histo " << std::endl;
788 fCoherentPowerTree->Branch(
"Power", &TMPVect);
790 for(
auto &it : fCoherentPowerI2)
793 std::transform(it.begin(), it.end(), it.begin(), std::bind(std::divides<float>(), std::placeholders::_1, NEvents));
798 for(
unsigned int jv=0;jv<TMPVect.size();jv++)
799 fCoherentPowerHistoI2->Fill(jv*freqBin,TMPVect[jv]);
801 fCoherentPowerHistoI2->Scale(1./count);
802 std::cout <<
" after filling coherent power histo " << std::endl;
803 for(
unsigned int jj=0;jj<fRawRMSI2.size();jj++)
804 fRawRMSHistoI2->Fill(fRawRMSI2.at(jj));
805 std::cout <<
" after filling raw rms histo " << std::endl;
806 for(
unsigned int j=0;j<fRawMeanI2.size(); j++) {
808 fMediaHistoI2->Fill(fRawMeanI2.at(j));
810 std::cout <<
" after filling media histo " << std::endl;
812 for(
unsigned int jj=0;jj<fIntrinsicRMSI2.size();jj++)
813 fIntrinsicRMSHistoI2->Fill(fIntrinsicRMSI2.at(jj));
815 std::cout <<
" fillhisto cohrms size " << fCoherentRMSI2.size() << std::endl;
817 for(
unsigned int j=0;j<fCoherentRMSI2.size();j++) {
818 std::cout <<
" filling coherent RMS " << fCoherentRMSI2.at(j) << std::endl;
819 fCoherentRMSHistoI2->Fill(fCoherentRMSI2.at(j));
822 TFile *f =
new TFile(fHistoFileName.c_str(),
"RECREATE");
824 std::cout <<
" coherent rms histo entries "<< std::endl;
826 fRawPowerHistoI2->Write();
827 fIntrinsicPowerHistoI2->Write();
828 fCoherentPowerHistoI2->Write();
829 fRawRMSHistoI2->Write();
830 fMediaHistoI2->Write();
831 fIntrinsicRMSHistoI2->Write();
832 fCoherentRMSHistoI2->Write();
834 std::cout <<
" after filling i2 histos " << std::endl;
836 fRawPowerHistoI1->Write();
837 fIntrinsicPowerHistoI1->Write();
838 fCoherentPowerHistoI1->Write();
839 fRawRMSHistoI1->Write();
840 fMediaHistoI1->Write();
841 fIntrinsicRMSHistoI1->Write();
842 fCoherentRMSHistoI1->Write();
844 std::cout <<
" after filling i1 histos " << std::endl;
846 fRawPowerHistoC->Write();
847 fIntrinsicPowerHistoC->Write();
848 fCoherentPowerHistoC->Write();
849 fRawRMSHistoC->Write();
850 fMediaHistoC->Write();
851 fIntrinsicRMSHistoC->Write();
852 fCoherentRMSHistoC->Write();
855 std::cout <<
" after filling c histos " << std::endl;
856 std::cout <<
"Ending job..." << std::endl;
std::string fRawDigitModuleLabel
std::vector< double > fCoherentRMSI1
std::vector< float > fRawMeanI1
std::vector< double > fIntrinsicRMSI1
std::string fHistoFileName
std::vector< double > fCoherentRMSI2
std::vector< float > fRawMeanI2
TH1D * fCoherentRMSHistoC
std::vector< double > fIntrinsicRMSC
TH1D * fIntrinsicPowerHistoI1
TH1D * fIntrinsicRMSHistoC
TH1D * fIntrinsicRMSHistoI2
void reconfigure(fhicl::ParameterSet const &pset)
TTree * fIntrinsicPowerTree
TH1D * fCoherentPowerHistoC
std::vector< std::vector< float > > fCoherentPowerI2
Definition of basic raw digits.
std::size_t size(FixedBins< T, C > const &) noexcept
TH1D * fCoherentPowerHistoI1
TH1D * fCoherentRMSHistoI1
void analyze(const art::Event &e)
std::vector< std::vector< float > > fRawPowerI1
TH1D * fIntrinsicPowerHistoI2
std::string fIntrinsicInstance
std::vector< double > fCoherentRMSC
TH1D * fIntrinsicRMSHistoI1
std::vector< unsigned short int > fChannel
TH1D * fIntrinsicPowerHistoC
TPCNoise(fhicl::ParameterSet const &p)
TH1D * fCoherentPowerHistoI2
std::unique_ptr< icarus_signal_processing::ICARUSFFT< double >> FFTPointer
std::vector< double > fRawRMSC
std::vector< double > fRawRMSI2
std::vector< std::vector< float > > fRawPowerI2
std::vector< double > fRawRMSTrim
std::vector< float > fPed
std::vector< double > fIntrinsicRMSTrim
TTree * fCoherentPowerTree
Collect all the RawData header files together.
std::string fCoherentInstance
Definition of data types for geometry description.
std::vector< float > fRawMeanC
std::vector< std::vector< float > > fCoherentPowerI1
std::vector< std::vector< float > > fIntrinsicPowerC
std::vector< double > fIntrinsicRMSI2
TH1D * fCoherentRMSHistoI2
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
std::vector< double > fCoherentRMSTrim
std::vector< float > fIntrinsicMean
std::vector< std::vector< float > > fRawPowerC
std::vector< float > fCoherentMean
art::ServiceHandle< art::TFileService > tfs
std::vector< std::vector< float > > fIntrinsicPowerI2
std::size_t count(Cont const &cont)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
std::vector< std::vector< float > > fCoherentPowerC
std::vector< std::vector< float > > fIntrinsicPowerI1
std::vector< double > fRawRMSI1
art framework interface to geometry description
BEGIN_PROLOG could also be cout
std::string fRawDigitProcess