349 art::ServiceHandle<geo::Geometry> geom;
350 unsigned int fDataSize;
351 std::vector<short> rawadc;
361 art::Handle< std::vector<raw::RawDigit> > digitVecHandle;
362 std::vector<const raw::RawDigit*> rawDigitVec;
365 std::unique_ptr< std::vector<anab::TPCPurityInfo> > outputPtrVector(
new std::vector<anab::TPCPurityInfo>() );
371 std::ofstream purh(
"dump_purity_hits.out",std::ios::app);
375 evt.getByLabel(digitlabel, digitVecHandle);
376 std::vector<const raw::RawDigit*> rawDigitVec;
378 if (digitVecHandle.isValid())
383 for(
size_t idx = 0; idx < digitVecHandle->size(); idx++)
384 rawDigitVec.push_back(&digitVecHandle->at(idx));
386 std::sort(rawDigitVec.begin(),
392 std::vector<int> *www0=
new std::vector<int>;
393 std::vector<float> *sss0=
new std::vector<float>;
394 std::vector<float> *hhh0=
new std::vector<float>;
395 std::vector<float> *ehh0=
new std::vector<float>;
396 std::vector<int> *www2=
new std::vector<int>;
397 std::vector<float> *sss2=
new std::vector<float>;
398 std::vector<float> *hhh2=
new std::vector<float>;
399 std::vector<float> *ehh2=
new std::vector<float>;
400 std::vector<int> *ccc0=
new std::vector<int>;
401 std::vector<int> *ccc2=
new std::vector<int>;
402 std::vector<float> *aaa0=
new std::vector<float>;
403 std::vector<float> *aaa2=
new std::vector<float>;
406 short int used[4096];
407 for(
const auto& rawDigit : rawDigitVec)
411 std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
420 size_t iWire=wid.
Wire;
422 fDataSize = rawDigit->Samples();
423 rawadc.resize(fDataSize);
425 for(
int ijk=0;ijk<4096;ijk++)used[ijk]=0;
427 int pedestal = (int)rawDigit->GetPedestal();
428 float pedestal2 = rawDigit->GetPedestal();
429 float sigma_pedestal = rawDigit->GetSigma();
430 raw::Uncompress(rawDigit->ADCs(), rawadc, pedestal, rawDigit->Compression());
433 float quale_sample_massimo;
438 quale_sample_massimo=-1;
440 TH1F *h111 =
new TH1F(
"h111",
"delta aree",20000,0,0);
441 for (
unsigned int ijk=0; ijk<(fDataSize); ijk++)
443 if ((rawDigit->ADC(ijk)-pedestal2)>massimo && ijk>150 && ijk<(fDataSize-150) && used[ijk]==0)
445 massimo=(rawDigit->ADC(ijk)-pedestal2);
446 quale_sample_massimo=ijk;
449 float base_massimo_before=0;
450 float base_massimo_after=0;
451 for (
unsigned int ijk=quale_sample_massimo-135; ijk<quale_sample_massimo-35; ijk++)
453 base_massimo_before+=(rawDigit->ADC(ijk)-pedestal2)*0.01;
455 for (
unsigned int ijk=quale_sample_massimo+35; ijk<quale_sample_massimo+135; ijk++)
457 base_massimo_after+=(rawDigit->ADC(ijk)-pedestal2)*0.01;
459 float basebase=(base_massimo_after+base_massimo_before)*0.5;
460 h_basediff->Fill(fabs(base_massimo_after-base_massimo_before));
h_base1->Fill(base_massimo_before);
463 for (
unsigned int ijk=0; ijk<(fDataSize); ijk++)
465 if (ijk>(quale_sample_massimo-30) && ijk<(quale_sample_massimo+30)) {
466 if(fabs(base_massimo_after-base_massimo_before)<=sigma_pedestal)areaarea+=(rawDigit->ADC(ijk)-pedestal2-basebase);
467 if(fabs(base_massimo_after-base_massimo_before)>sigma_pedestal && base_massimo_after<base_massimo_before)areaarea+=(rawDigit->ADC(ijk)-pedestal2-base_massimo_after);
468 if(fabs(base_massimo_after-base_massimo_before)>sigma_pedestal && base_massimo_after>base_massimo_before)areaarea+=(rawDigit->ADC(ijk)-pedestal2-base_massimo_before);
472 if(used[ijk]==0)h111->Fill(rawDigit->ADC(ijk)-pedestal2-basebase);
475 sigma_pedestal=h111->GetRMS();
477 h_rms->Fill(sigma_pedestal);
478 if(
fdumphitsfcl==1)purh<<
evt.
event()<<
" " <<iWire<<
" "<<tpc<<
" "<<cryostat<<
" "<<basebase<<
" "<<base_massimo_after<<
" " <<base_massimo_before<<
" "<<pedestal2<<
" "<<sigma_pedestal<<
" " << quale_sample_massimo <<
" " << massimo << std::endl;
482 if(
fdumphitsfcl==1)purh<<iWire<<
" "<<tpc<<
" "<<cryostat<<
" CANDIDATE HIT " << quale_sample_massimo <<
" " << massimo << std::endl;
484 if(tpc==0)www0->push_back(iWire+64);
485 if(tpc==0)sss0->push_back(quale_sample_massimo);
486 if(tpc==0)hhh0->push_back(massimo);
487 if(tpc==0)ehh0->push_back(sigma_pedestal);
488 if(tpc==0)ccc0->push_back(-1);
489 if(tpc==1)www0->push_back(iWire+64+2536);
490 if(tpc==1)sss0->push_back(quale_sample_massimo);
491 if(tpc==1)hhh0->push_back(massimo);
492 if(tpc==1)ehh0->push_back(sigma_pedestal);
493 if(tpc==1)ccc0->push_back(-1);
494 if(tpc==2)www2->push_back(iWire+64);
495 if(tpc==2)sss2->push_back(quale_sample_massimo);
496 if(tpc==2)hhh2->push_back(massimo);
497 if(tpc==2)ehh2->push_back(sigma_pedestal);
498 if(tpc==2)ccc2->push_back(-1);
499 if(tpc==3)www2->push_back(iWire+64+2536);
500 if(tpc==3)sss2->push_back(quale_sample_massimo);
501 if(tpc==3)hhh2->push_back(massimo);
502 if(tpc==3)ehh2->push_back(sigma_pedestal);
503 if(tpc==3)ccc2->push_back(-1);
505 if(tpc==0)aaa0->push_back(areaarea);
506 if(tpc==1)aaa0->push_back(areaarea);
507 if(tpc==2)aaa2->push_back(areaarea);
508 if(tpc==3)aaa2->push_back(areaarea);
509 for(
int ijk=0;ijk<330;ijk++)
511 int ent_value=quale_sample_massimo+ijk-165;
520 for (
unsigned int ijk=0; ijk<www0->size(); ijk++)
522 for (
unsigned int ijk2=0; ijk2<www0->size(); ijk2++)
524 if (fabs((*www0)[ijk]-(*www0)[ijk2])<
fdwclusfcl && ijk!=ijk2 && fabs((*sss0)[ijk]-(*sss0)[ijk2])<
fdsclusfcl)
526 if ((*ccc0)[ijk]<0 && (*ccc0)[ijk2]<0)
531 else if ((*ccc0)[ijk]>0 && (*ccc0)[ijk2]<0)
533 (*ccc0)[ijk2]=(*ccc0)[ijk];
535 else if ((*ccc0)[ijk]<0 && (*ccc0)[ijk2]>0)
537 (*ccc0)[ijk]=(*ccc0)[ijk2];
539 else if ((*ccc0)[ijk]>0 && (*ccc0)[ijk2]>0)
541 for (
unsigned int ijk3=0; ijk3<www0->size(); ijk3++)
543 if(((*ccc0)[ijk3])==((*ccc0)[ijk2]))(*ccc0)[ijk3]=(*ccc0)[ijk];
551 for (
unsigned int ijk=0; ijk<www2->size(); ijk++)
554 for (
unsigned int ijk2=0; ijk2<www2->size(); ijk2++)
556 if (fabs((*www2)[ijk]-(*www2)[ijk2])<
fdwclusfcl && ijk!=ijk2 && fabs((*sss2)[ijk]-(*sss2)[ijk2])<
fdsclusfcl)
558 if ((*ccc2)[ijk]<0 && (*ccc2)[ijk2]<0)
563 else if ((*ccc2)[ijk]>0 && (*ccc2)[ijk2]<0)
565 (*ccc2)[ijk2]=(*ccc2)[ijk];
567 else if ((*ccc2)[ijk]<0 && (*ccc2)[ijk2]>0)
569 (*ccc2)[ijk]=(*ccc2)[ijk2];
571 else if ((*ccc2)[ijk]>0 && (*ccc2)[ijk2]>0)
573 for (
unsigned int ijk3=0; ijk3<www2->size(); ijk3++)
575 if(((*ccc2)[ijk3])==((*ccc2)[ijk2]))(*ccc2)[ijk3]=(*ccc2)[ijk];
583 Int_t clusters_creation[4][30000];
585 Int_t clusters_swire[4][30000];
586 Int_t clusters_lwire[4][30000];
587 Int_t clusters_ssample[4][30000];
588 Int_t clusters_lsample[4][30000];
590 Int_t clusters_nn[1000];
591 Int_t clusters_vi[1000];
592 Int_t clusters_qq[1000];
594 Int_t clusters_dw[1000];
595 Int_t clusters_ds[1000];
596 Double_t clusters_mw[1000];
597 Double_t clusters_ms[1000];
598 Double_t clusters_mintime[1000];
601 for (
unsigned int ijk=0; ijk<4; ijk++) {
602 for (
unsigned int ijk2=0; ijk2<30000; ijk2++) {
603 clusters_creation[ijk][ijk2]=0;
604 clusters_swire[ijk][ijk2]=100000;
605 clusters_lwire[ijk][ijk2]=0;
606 clusters_ssample[ijk][ijk2]=100000;
607 clusters_lsample[ijk][ijk2]=0;
608 if (ijk2<1000 && ijk>2) {
609 clusters_nn[ijk2]=-1;
610 clusters_vi[ijk2]=-1;
611 clusters_dw[ijk2]=-1;
612 clusters_ds[ijk2]=-1;
613 clusters_qq[ijk2]=-1;
614 clusters_mw[ijk2]=-1;
615 clusters_ms[ijk2]=-1;
616 clusters_mintime[ijk2]=-1;
621 for (
unsigned int ijk=0; ijk<www0->size(); ijk++)
623 if ((*ccc0)[ijk]>0) {
624 int numero=(*ccc0)[ijk];
625 clusters_creation[0][numero]+=1;
626 if((*www0)[ijk]<clusters_swire[0][numero])clusters_swire[0][numero]=(*www0)[ijk];
627 if((*www0)[ijk]>clusters_lwire[0][numero])clusters_lwire[0][numero]=(*www0)[ijk];
628 if((*sss0)[ijk]<clusters_ssample[0][numero])clusters_ssample[0][numero]=(*sss0)[ijk];
629 if((*sss0)[ijk]>clusters_lsample[0][numero])clusters_lsample[0][numero]=(*sss0)[ijk];
632 for (
unsigned int ijk=0; ijk<www2->size(); ijk++)
634 if ((*ccc2)[ijk]>0) {
635 int numero=(*ccc2)[ijk];
636 clusters_creation[2][numero]+=1;
637 if((*www2)[ijk]<clusters_swire[2][numero])clusters_swire[2][numero]=(*www2)[ijk];
638 if((*www2)[ijk]>clusters_lwire[2][numero])clusters_lwire[2][numero]=(*www2)[ijk];
639 if((*sss2)[ijk]<clusters_ssample[2][numero])clusters_ssample[2][numero]=(*sss2)[ijk];
640 if((*sss2)[ijk]>clusters_lsample[2][numero])clusters_lsample[2][numero]=(*sss2)[ijk];
644 int quanti_clusters=0;
645 for (
unsigned int ijk=0; ijk<4; ijk++) {
646 for (
unsigned int ijk2=0; ijk2<30000; ijk2++) {
647 if(clusters_creation[ijk][ijk2]>50)
650 clusters_qq[quanti_clusters]=clusters_creation[ijk][ijk2];
651 clusters_vi[quanti_clusters]=ijk;
652 clusters_nn[quanti_clusters]=ijk2;
653 clusters_dw[quanti_clusters]=clusters_lwire[ijk][ijk2]-clusters_swire[ijk][ijk2];
654 clusters_ds[quanti_clusters]=clusters_lsample[ijk][ijk2]-clusters_ssample[ijk][ijk2];
655 clusters_mw[quanti_clusters]=(clusters_lwire[ijk][ijk2]+clusters_swire[ijk][ijk2])*0.5;
656 clusters_ms[quanti_clusters]=(clusters_lsample[ijk][ijk2]+clusters_ssample[ijk][ijk2])*0.5;
657 clusters_mintime[quanti_clusters]=(clusters_ssample[ijk][ijk2]);
664 for(
int icl = 0; icl < quanti_clusters; ++icl){
665 if (clusters_qq[icl]>0) {
667 int tpc_number=clusters_vi[icl];
669 if (clusters_ds[icl]>2250 && clusters_dw[icl]>100)
672 std::vector<float> *whc=
new std::vector<float>;
673 std::vector<float> *shc=
new std::vector<float>;
674 std::vector<float> *ahc=
new std::vector<float>;
675 std::vector<float> *fahc=
new std::vector<float>;
677 if (clusters_vi[icl]==0) {
678 for (
unsigned int ijk=0; ijk<www0->size(); ijk++) {
679 if ((*ccc0)[ijk]==clusters_nn[icl]) {
680 whc->push_back((*www0)[ijk]);
681 shc->push_back((*sss0)[ijk]);
683 ahc->push_back((*aaa0)[ijk]);
684 fahc->push_back((*hhh0)[ijk]);
688 if (clusters_vi[icl]==2) {
689 for (
unsigned int ijk=0; ijk<www2->size(); ijk++) {
690 if ((*ccc2)[ijk]==clusters_nn[icl]) {
691 whc->push_back((*www2)[ijk]);
692 shc->push_back((*sss2)[ijk]);
693 ahc->push_back((*aaa2)[ijk]);
695 fahc->push_back((*hhh2)[ijk]);
706 float pendenza=0;
float intercetta=0;
int found_ok=0;
707 std::vector<int> *escluse=
new std::vector<int>;
714 for(
int j=0;j<(int)whc->size();j++)
718 Double_t wires[10000];
719 Double_t samples[10000];
721 Double_t quale[10000];
724 for(
int k=0;
k<(int)whc->size();
k++)
728 wires[quanti]=(*whc)[
k]*3;
729 samples[quanti]=(*shc)[
k]*0.628;
737 TGraphErrors *gr3 =
new TGraphErrors(quanti,wires,samples,ex,ey);
738 gr3->Fit(
"pol1",
"Q");
739 TF1 *fitfunc = gr3->GetFunction(
"pol1");
740 pendenza=fitfunc->GetParameter(1);
741 intercetta=fitfunc->GetParameter(0);
742 float distance_maximal=
fdisfcl;
743 int quella_a_distance_maximal=0;
745 for(
int jj=0;jj<quanti;jj++)
747 if((
abs((pendenza)*(wires[jj])-samples[jj]+intercetta)/sqrt((pendenza)*pendenza+1))>distance_maximal)
750 quella_a_distance_maximal=quale[jj];
751 distance_maximal=(
abs(pendenza*wires[jj]-samples[jj]+intercetta)/sqrt(pendenza*pendenza+1));
754 if(found_max==1)escluse->push_back(quella_a_distance_maximal);
755 if(found_max==0)found_ok=1;
760 std::vector<float> *hittime=
new std::vector<float>;
761 std::vector<float> *hitwire=
new std::vector<float>;
762 std::vector<float> *hitarea=
new std::vector<float>;
763 std::vector<float> *hittimegood=
new std::vector<float>;
764 std::vector<float> *hitareagood=
new std::vector<float>;
765 std::vector<float> *hitwiregood=
new std::vector<float>;
771 for(
int kkk=0;kkk<(int)whc->size();kkk++)
775 float distance=(
abs(pendenza*((*whc)[kkk]*3)-(*shc)[kkk]*0.628+intercetta))/sqrt(pendenza*pendenza+1);
779 hittime->push_back((*shc)[kkk]*0.4);
780 hitwire->push_back((*whc)[kkk]);
781 hitarea->push_back((*ahc)[kkk]);
791 Double_t area[10000];
792 Double_t nologarea[10000];
793 Double_t tempo[10000];
806 if(hitarea->size()>100)
808 h_ratio->Fill(((
float)whc->size())/((
float)clusters_dw[icl]));
809 h_ratio_3->Fill(clusters_ds[icl],((
float)whc->size())/((
float)clusters_dw[icl]));
814 float wire_minimo=100000;
815 float wire_massimo=0;
817 float delta_sample_selected=0;
818 float delta_wire_selected=0;
819 float wire_del_massimo=-1;
820 float wire_del_minimo=-1;
821 float sample_massimo=-1;
822 float sample_minimo=-1;
823 int quante_hit_nel_range_tempo=0;
824 purh<<
evt.
run() <<
" " <<
evt.
subRun() <<
" " <<
evt.
event() <<
" -1 " <<
" -1 " <<
" -1 " <<
" -1 " << std::endl;
825 for(
int kk=0;kk<(int)hitarea->size();kk++)
827 if(
fdumphitsfcl==1)purh<<
evt.
run() <<
" SELECTED " <<
evt.
subRun() <<
" " <<
evt.
event() <<
" " << tpc_number <<
" " << (*hitwire)[kk] <<
" " << (*hittime)[kk] <<
" " << (*hitarea)[kk] << std::endl;
829 quante_hit_nel_range_tempo+=1;
830 if((*hittime)[kk]>massimo)
832 massimo=(*hittime)[kk];
833 wire_del_massimo=(*hitwire)[kk];
837 if((*hittime)[kk]<minimo)
839 minimo=(*hittime)[kk];
840 wire_del_minimo=(*hitwire)[kk];
844 if((*hitwire)[kk]>wire_massimo)
846 wire_massimo=(*hitwire)[kk];
850 if((*hitwire)[kk]<wire_minimo)
852 wire_minimo=(*hitwire)[kk];
857 delta_sample_selected=(massimo-minimo)/0.4;
858 delta_wire_selected=wire_del_massimo-wire_del_minimo;
859 sample_massimo=massimo/0.4;
860 sample_minimo=minimo/0.4;
861 h_ratio_after->Fill(((
float)quante_hit_nel_range_tempo)/fabs(delta_wire_selected));
862 h_ratio_after_2->Fill(((
float)quante_hit_nel_range_tempo)/fabs(wire_massimo-wire_minimo+1));
863 h_ratio_after_3->Fill(delta_sample_selected,((
float)quante_hit_nel_range_tempo)/fabs(wire_massimo-wire_minimo+1));
872 float steptime=(massimo-minimo)/(gruppi+1);
879 for(
int stp=0;stp<=gruppi;stp++)
881 std::vector<float>* hitpertaglio=
new std::vector<float>;
884 for(
int kk=0;kk<(int)hitarea->size();kk++)
886 if((*hittime)[kk]>=(minimo+stp*steptime) && (*hittime)[kk]<=(minimo+(stp+1)*(steptime)))
887 hitpertaglio->push_back((*hitarea)[kk]*
exp((*hittime)[kk]/starting_value_tau));
896 for(
int kk=0;kk<(int)hitarea->size();kk++)
899 if((*hittime)[kk]>(minimo+stp*steptime) &&
900 (*hittime)[kk]<(minimo+(stp+1)*steptime) &&
901 (*hitarea)[kk]*
exp((*hittime)[kk]/starting_value_tau)<tagliomax &&
902 (*hitarea)[kk]*
exp((*hittime)[kk]/starting_value_tau)>tagliomin)
905 hitareagood->push_back((*hitarea)[kk]);
906 hittimegood->push_back((*hittime)[kk]);
907 hitwiregood->push_back((*hitwire)[kk]);
912 if(delta_sample_selected>1900)
914 for(
int k=0;
k<(int)whc->size();
k++)
916 h_hittime->Fill((*shc)[
k]-clusters_mintime[icl]);
918 for(
int k=0;
k<(int)hittime->size();
k++)
920 h_hittime_2->Fill((*hittime)[
k]/0.4-clusters_mintime[icl]);
923 for(
int k=0;
k<(int)hittimegood->size();
k++)
925 h_hittime_3->Fill((*hittimegood)[
k]/0.4-clusters_mintime[icl]);
929 for(
int k=0;
k<(int)hitareagood->size();
k++)
931 if(
fdumphitsfcl==1)purh<<
evt.
run() <<
" AFTER CLEAN " <<
evt.
subRun() <<
" " <<
evt.
event() <<
" " << tpc_number <<
" " << (*hitwiregood)[
k] <<
" " << (*hittimegood)[
k] <<
" " << (*hitareagood)[
k] << std::endl;
933 tempo[
k]=(*hittimegood)[
k];
934 area[
k]=log((*hitareagood)[
k]);
936 nologarea[
k]=((*hitareagood)[
k]);
944 TGraphErrors *gr31 =
new TGraphErrors(hitareagood->size(),tempo,area,ex,ey);
946 gr31->Fit(
"pol1",
"Q");
947 TF1 *fit = gr31->GetFunction(
"pol1");
948 float slope_purity=fit->GetParameter(1);
950 float intercetta_purezza=fit->GetParameter(0);
952 TH1F *h111 =
new TH1F(
"h111",
"delta aree",200,-10,10);
953 float sum_per_rms_test=0;
954 int quanti_in_h111=0;
955 for(
int k=0;
k<(int)hitareagood->size();
k++)
957 h111->Fill(area[
k]-slope_purity*tempo[
k]-intercetta_purezza);
958 sum_per_rms_test+=(area[
k]-slope_purity*tempo[
k]-intercetta_purezza)*(area[
k]-slope_purity*tempo[
k]-intercetta_purezza);
959 if((area[
k]-slope_purity*tempo[
k]-intercetta_purezza)>-10 && (area[
k]-slope_purity*tempo[
k]-intercetta_purezza)<10)quanti_in_h111+=1;
963 if(quanti_in_h111>1){
964 h111->Fit(
"gaus",
"Q");
965 TF1 *fitg = h111->GetFunction(
"gaus");
966 error=fitg->GetParameter(2);
975 TGraphErrors *gr4 =
new TGraphErrors(hitareagood->size(),tempo,nologarea,ex,ey);
976 gr4->Fit(
"expo",
"Q");
977 TF1 *fite = gr4->GetFunction(
"expo");
978 slope_purity=fite->GetParameter(1);
979 intercetta_purezza=fite->GetParameter(0);
980 float mean_hit_area=0;
981 float size_hit_area=hitareagood->size();
982 int quanti_in_h111e=0;
983 TH1F *h111e =
new TH1F(
"h111e",
"delta aree",100,-1000.,1000.);
984 for(
int k=0;
k<(int)hitareagood->size();
k++)
986 h111e->Fill(nologarea[
k]-
exp(slope_purity*tempo[
k]+intercetta_purezza));
987 mean_hit_area+=nologarea[
k]/size_hit_area;
988 if((nologarea[
k]-
exp(slope_purity*tempo[
k]+intercetta_purezza))>-1000. && (nologarea[
k]-
exp(slope_purity*tempo[
k]+intercetta_purezza))<1000)quanti_in_h111e+=1;
992 float error_expo=1000.;
993 if(quanti_in_h111e>1)
995 h111e->Fit(
"gaus",
"Q");
996 TF1 *fitge = h111e->GetFunction(
"gaus");
997 error_expo=fitge->GetParameter(2);
1003 for(
int k=0;
k<(int)hitareagood->size();
k++)
1013 TGraphErrors *gr32 =
new TGraphErrors(hitareagood->size(),tempo,area,ex,ey);
1014 gr32->Fit(
"pol1",
"Q");
1016 TF1 *fit2 = gr32->GetFunction(
"pol1");
1017 float slope_purity_2=fit2->GetParameter(1);
1018 float error_slope_purity_2=fit2->GetParError(1);
1020 float chiquadro=fit2->GetChisquare()/(hitareagood->size()-2);
1021 std::ofstream goodpuro(
"purity_results.out",std::ios::app);
1022 std::ofstream goodpuro2(
"purity_results2.out",std::ios::app);
1027 TGraphAsymmErrors *gr41 =
new TGraphAsymmErrors (hitareagood->size(),tempo,nologarea,ex,ex,ez,ek);
1028 gr41->Fit(
"expo",
"Q");
1029 TF1 *fitexo = gr41->GetFunction(
"expo");
1030 float slope_purity_exo=fitexo->GetParameter(1);
1031 float error_slope_purity_exo=fitexo->GetParError(1);
1040 if(fabs(slope_purity_2)<0.01 || fabs(slope_purity_exo)<0.01)
1042 if(fabs(slope_purity_2)<0.01)
purityvalues->Fill(-slope_purity_2*1000.);
1043 if(fabs(slope_purity_2)<0.01)goodpuro <<
evt.
run() <<
" " <<
evt.
subRun() <<
" " <<
evt.
event() <<
" " << tpc_number <<
" " << slope_purity_2 <<
" " << error_slope_purity_2 <<
" " << chiquadro <<
" " << clusters_dw[icl] <<
" " << clusters_ds[icl] << std::endl;
1045 if(fabs(slope_purity_exo)<0.01)goodpuro2<<
evt.
run() <<
" " <<
evt.
subRun() <<
" " <<
evt.
event() <<
" " << tpc_number+
fcryofcl*10 <<
" " << slope_purity_exo <<
" " << error_slope_purity_exo <<
" " << fitexo->GetChisquare()/(hitareagood->size()-2) <<
" " << clusters_dw[icl] <<
" " << clusters_ds[icl] <<
" " << clusters_mw[icl] <<
" " << clusters_ms[icl] <<
" " << delta_wire_selected <<
" " << delta_sample_selected <<
" " << sample_minimo <<
" " << sample_massimo <<
" " << wire_del_minimo <<
" " << wire_del_massimo <<
" " << wire_minimo <<
" " << wire_massimo <<
" " << whc->size() <<
" " << hitarea->size() <<
" " << quante_hit_nel_range_tempo <<
" " << error_expo <<
" " << clusters_mintime[icl] <<
" " << mean_hit_area << std::endl;
1048 if(fabs(slope_purity_exo)<0.01)
1056 chi_tree=fitexo->GetChisquare()/(hitareagood->size()-2);
1064 if(fabs(slope_purity_exo)<0.01)
purityvalues2->Fill(-slope_purity_exo*1000.);
1066 if(fabs(slope_purity_exo)<0.01 && tpc_number==0)
puritytpc0->Fill(-slope_purity_exo*1000.);
1067 if(fabs(slope_purity_exo)<0.01 && tpc_number==1)
puritytpc1->Fill(-slope_purity_exo*1000.);
1068 if(fabs(slope_purity_exo)<0.01 && tpc_number==2)
puritytpc2->Fill(-slope_purity_exo*1000.);
1069 if(fabs(slope_purity_exo)<0.01 && tpc_number==3)
puritytpc3->Fill(-slope_purity_exo*1000.);
1072 if(fabs(slope_purity_exo)<0.01)
1080 purity_info.
TPC = tpc_number;
1081 purity_info.
Wires = delta_wire_selected;
1082 purity_info.
Ticks = delta_sample_selected;
1103 purity_info.
FracError = error_slope_purity_exo / slope_purity_exo;
1114 purity_info.
Print();
1115 outputPtrVector->push_back(purity_info);
1172 evt.put(std::move(outputPtrVector));
Collection of charge vs time digitized from a single readout channel.
int Nothere(std::vector< int > *a, int b)
unsigned int PlaneID_t
Type for the ID number.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
CryostatID_t Cryostat
Index of cryostat.
WireID_t Wire
Index of the wire within its plane.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
PlaneID_t Plane
Index of the plane within its TPC.
Double_t FoundMeanLog(std::vector< float > *a, float b)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCID_t TPC
Index of the TPC within its cryostat.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
std::vector< art::InputTag > fDigitModuleLabel