18 #include "art_root_io/TFileService.h" 19 #include "art_root_io/TFileDirectory.h" 49 #include "TTimeStamp.h" 50 #include "TLorentzVector.h" 60 #include "TPaveStats.h" 330 art::TFileDirectory topdir = tfs->mkdir(
"trkgaps",
"Gap histograms");
331 art::TFileDirectory gap1 = topdir.mkdir(
"Gap 1");
332 art::TFileDirectory gap2 = topdir.mkdir(
"Gap 2");
333 art::TFileDirectory gap3 = topdir.mkdir(
"Gap 3");
334 art::TFileDirectory gap4 = topdir.mkdir(
"Gap 4");
335 art::TFileDirectory gap5 = topdir.mkdir(
"Gap 5");
357 evttime = tts.AsDouble();
361 efield[0] = detProp.Efield(0);
362 efield[1] = detProp.Efield(1);
363 efield[2] = detProp.Efield(2);
368 std::vector<art::Ptr<recob::Track> > tracklist;
369 if (evt.
getByLabel(fTrackModuleLabel,trackListHandle))
373 std::vector<art::Ptr<recob::Hit> > hitlist;
374 if (evt.
getByLabel(fHitsModuleLabel,hitListHandle))
378 std::vector<art::Ptr<recob::Cluster> > clusterlist;
379 if (evt.
getByLabel(fClusterModuleLabel,clusterListHandle))
383 evt.
getByLabel(fSimulationProducerLabel, simChannelHandle);
394 if (trackvh.
isValid()) cti = trackvh->begin();
397 ntracks_reco=tracklist.size();
404 double boundaries[6];
405 double TempBounds[6];
407 for (
int b=0;
b<6;
b++) boundaries[
b] = 0;
408 for (
int c1 = 0;
c1 < NCryo;
c1++ ) {
410 if ( boundaries[0] > TempBounds [0] ) boundaries[0] = TempBounds [0];
411 if ( boundaries[1] < TempBounds [1] ) boundaries[1] = TempBounds [1];
412 if ( boundaries[2] > TempBounds [2] ) boundaries[2] = TempBounds [2];
413 if ( boundaries[3] < TempBounds [3] ) boundaries[3] = TempBounds [3];
414 if ( boundaries[4] > TempBounds [4] ) boundaries[4] = TempBounds [4];
415 if ( boundaries[5] < TempBounds [5] ) boundaries[5] = TempBounds [5];
423 if ( trackListHandle.
isValid() ) {
424 art::FindManyP<recob::SpacePoint> fmsp (trackListHandle, evt, fTrackModuleLabel);
425 art::FindManyP<recob::Hit> fmht (trackListHandle, evt, fTrackModuleLabel);
426 art::FindMany<anab::Calorimetry> fmcal (trackListHandle, evt, fCalorimetryModuleLabel);
427 art::FindMany<anab::T0> fmt0 (trackListHandle, evt, fMCTruthT0ModuleLabel);
436 if ( fmt0.isValid() ) {
437 std::vector<const anab::T0*> T0s = fmt0.at(i);
438 for (
size_t t0size =0; t0size < T0s.size(); t0size++) {
439 trkMCTruthT0[i] = T0s[t0size]->Time();
451 std::vector< art::Ptr<recob::Hit> > allHits = fmht.at(i);
452 double Hit_Size = allHits.size();
459 std::tie(trackStart, trackEnd) = tracklist[i]->Extent();
460 larStart = tracklist[i]->VertexDirection();
461 larEnd = tracklist[i]->EndDirection();
463 trkstartx[i] = trackStart.X() - detProp.ConvertTicksToX( TickT0, allHits[Hit_Size-1]->
WireID().
Plane, allHits[Hit_Size-1]->
WireID().TPC, allHits[Hit_Size-1]->
WireID().Cryostat );
464 trkstarty[i] = trackStart.Y();
465 trkstartz[i] = trackStart.Z();
466 trkendx[i] = trackEnd.X() - detProp.ConvertTicksToX( TickT0, allHits[0]->
WireID().
Plane, allHits[0]->
WireID().TPC, allHits[0]->
WireID().Cryostat );
467 trkendy[i] = trackEnd.Y();
468 trkendz[i] = trackEnd.Z();
469 trkstartdcosx[i] = larStart.X();
470 trkstartdcosy[i] = larStart.Y();
471 trkstartdcosz[i] = larStart.Z();
472 trkenddcosx[i] = larEnd.X();
473 trkenddcosy[i] = larEnd.Y();
474 trkenddcosz[i] = larEnd.Z();
475 TLorentzVector v1(trackStart.X(),trackStart.Y(),trackStart.Z(),0);
476 TLorentzVector v2(trackEnd.X(),trackEnd.Y(),trackEnd.Z(),0);
477 trklen[i]=(v2-v1).
Rho();
481 trklen_L[i]=track.
Length();
487 trktheta_xz[i] = std::atan2(
dir.X(),
dir.Z());
488 trktheta_yz[i] = std::atan2(
dir.Y(),
dir.Z());
489 trketa_xy[i] = std::atan2(
dir.X(),
dir.Y());
490 trketa_zy[i] = std::atan2(
dir.Z(),
dir.Y());
491 trktheta[i]=
dir.Theta();
495 double distance_squared=0;
496 TVector3 V1(trackStart.X(),trackStart.Y(),trackStart.Z());
497 TVector3 V2(trackEnd.X(),trackEnd.Y(),trackEnd.Z());
498 TVector3 vOrth=(V2-V1).Orthogonal();
499 TVector3 pointVector=V1;
505 ntrkhits[i] = fmsp.at(i).size();
510 std::vector<art::Ptr<recob::SpacePoint> > spts = fmsp.at(i);
511 for (
size_t j = 0; j<spts.size(); ++j){
512 TVector3 sptVector(spts[j]->XYZ()[0],spts[j]->XYZ()[1],spts[j]->XYZ()[2]);
513 TVector3 vToPoint=sptVector-pointVector;
514 distance=(vOrth.Dot(vToPoint))/vOrth.Mag();
515 distance_squared+=distance *
distance;
517 if (spts[j]->XYZ()[0] < -1000)
continue;
518 else trkx[i][j] = spts[j]->XYZ()[0];
519 if (spts[j]->XYZ()[1] < -1000)
continue;
520 else trky[i][j] = spts[j]->XYZ()[1];
521 if (spts[j]->XYZ()[2] < -1000)
continue;
522 else trky[i][j] = spts[j]->XYZ()[2];
524 std::cout <<
"X, Y, Z: " << spts[j]->XYZ()[0] <<
", " << spts[j]->XYZ()[1] <<
", " << spts[j]->XYZ()[2] <<
std::endl;
527 distance_squared=distance_squared/spts.size();
528 trkd2[i]=distance_squared;
538 if (fmcal.isValid()){
539 std::vector<const anab::Calorimetry*> calos = fmcal.at(i);
541 for (
size_t jj = 0; jj<calos.size(); ++jj){
542 trkrange[i][jj] = calos[jj]->Range();
543 trkkinE[i][jj] = (calos[jj] -> KineticEnergy());
545 int tt= calos[jj] ->
dEdx().size();
546 for(
int k = 0;
k < tt; ++
k) {
547 trkdedx2[i][jj][
k] = (calos[jj] ->
dEdx())[
k];
548 trkdqdx[i][jj][
k] = (calos[jj] -> dQdx())[
k];
549 trkpitchHit[i][jj][
k] = (calos[jj] -> TrkPitchVec())[
k];
550 trkresrg[i][jj][
k] = (calos[jj] -> ResidualRange())[
k];
551 trkTPC[i][jj][
k] = (calos[jj]->PlaneID()).TPC;
552 trkplaneid[i][jj][
k] = (calos[jj]->PlaneID()).
Plane;
554 trkPosx[i][jj][
k] = (calos[jj]->XYZ())[
k].
x();
555 trkPosy[i][jj][
k] = (calos[jj]->XYZ())[
k].
y();
556 trkPosz[i][jj][
k] = (calos[jj]->XYZ())[
k].
z();
558 trkdQdxSum[i] += trkdqdx[i][jj][
k];
559 trkdEdxSum[i] += trkdedx2[i][jj][
k];
562 trkdQdxAverage[i] = trkdQdxSum[i] / calos.size();
563 trkdEdxAverage[i] = trkdEdxSum[i] / calos.size();
570 for (
int j = 0; j<3; ++j){
580 mf::LogWarning(
"GapWidth")<<
"caught exception "<<e<<
"\n setting pitch to 0";
590 if ( hitListHandle.
isValid() ) {
591 art::FindMany<recob::Track> fmtk (hitListHandle , evt, fTrackModuleLabel);
592 nhits = hitlist.size();
594 nclust = clusterlist.size();
595 for (
int i = 0; i < nhits2; ++i){
596 unsigned int channel = hitlist[i]->Channel();
598 hit_tpc[i] = wireid.
TPC;
599 hit_plane[i] = wireid.
Plane;
600 hit_wire[i] = wireid.
Wire;
602 hit_peakT[i] = hitlist[i]->PeakTime();
603 hit_charge[i] = hitlist[i]->Integral();
604 hit_ph[i] = hitlist[i]->PeakAmplitude();
605 if (fmtk.at(i).size()!=0 && fmtk.at(i)[0]->ID() <= 7){
606 std::cout <<
"Hit TrackID: " << fmtk.at(i)[0]->ID() <<
std::endl;
607 hit_trkid[i] = fmtk.at(i)[0]->ID();
613 gapit1[
event] = gap1.make<TH1D>(Form(
"gapit1, from event %d",
event),Form(
"Gap Width Against Translation, Event %d",
event), 101, -5.05, 5.05);
614 gapdif1[
event] = gap1.make<TH1D>(Form(
"gapdif1 from event %d",
event),Form(
"Gap Difference from Nominal, Event %d",
event), 101, -5.05, 5.05);
616 gapit2[
event] = gap2.make<TH1D>(Form(
"gapit2, from event %d",
event),Form(
"Gap Width Against Translation, Event %d",
event), 101, -5.05, 5.05);
617 gapdif2[
event] = gap2.make<TH1D>(Form(
"gapdif2 from event %d",
event),Form(
"Gap Difference from Nominal, Event %d",
event), 101, -5.05, 5.05);
619 gapit3[
event] = gap3.make<TH1D>(Form(
"gapit3, from event %d",
event),Form(
"Gap Width Against Translation, Event %d",
event), 101, -5.05, 5.05);
620 gapdif3[
event] = gap3.make<TH1D>(Form(
"gapdif3 from event %d",
event),Form(
"Gap Difference from Nominal, Event %d",
event), 101, -5.05, 5.05);
622 gapit4[
event] = gap4.make<TH1D>(Form(
"gapit4, from event %d",
event),Form(
"Gap Width Against Translation, Event %d",
event), 101, -5.05, 5.05);
623 gapdif4[
event] = gap4.make<TH1D>(Form(
"gapdif4 from event %d",
event),Form(
"Gap Difference from Nominal, Event %d",
event), 101, -5.05, 5.05);
625 gapit5[
event] = gap5.make<TH1D>(Form(
"gapit5, from event %d",
event),Form(
"Gap Width Against Translation, Event %d",
event), 101, -5.05, 5.05);
626 gapdif5[
event] = gap5.make<TH1D>(Form(
"gapdif5 from event %d",
event),Form(
"Gap Difference from Nominal, Event %d",
event), 101, -5.05, 5.05);
629 for (
int i = 0; i < ntracks_reco; i++) {
633 trackmidx[i] = (trkendx[i] + trkstartx[i])/2.;
634 trackmidy[i] = (trkendy[i] + trkstarty[i])/2.;
635 trackmidz[i] = (trkendz[i] + trkstartz[i])/2.;
637 if (trackmidx[i] > 0.) {
638 if (trackmidz[i] > 0. && trackmidz[i] < 51.) tracktpc[i]=1;
639 if (trackmidz[i] > 51. && trackmidz[i] < 103. && trackmidy[i] < 0.) tracktpc[i]=3;
640 if (trackmidz[i] > 51. && trackmidz[i] < 103. && trackmidy[i] > 0.) tracktpc[i]=5;
641 if (trackmidz[i] > 103. && trackmidz[i] < 155.) tracktpc[i]=7;
646 if (tracktpc[i] == 1) {
647 if (trkendy[i] > upper1) trkendy[i] = upper1;
648 if (trkstarty[i] > upper1) trkstarty[i] = upper1;
649 if (trkendy[i] < lower1) trkendy[i] = lower1;
650 if (trkstarty[i] < lower1) trkstarty[i] = lower1;
651 if (trkendz[i] < left1 ) trkendz[i] = left1;
652 if (trkstartz[i] < left1 ) trkstartz[i] = left1;
653 if (trkendz[i] > right1) trkendz[i] = right1;
654 if (trkstartz[i] > right1) trkstartz[i] = right1;
657 if (tracktpc[i] == 3) {
658 if (trkendy[i] > upper3) trkendy[i] = upper3;
659 if (trkstarty[i] > upper3) trkstarty[i] = upper3;
660 if (trkendy[i] < lower3) trkendy[i] = lower3;
661 if (trkstarty[i] < lower3) trkstarty[i] = lower3;
662 if (trkendz[i] < left3 ) trkendz[i] = left3;
663 if (trkstartz[i] < left3 ) trkstartz[i] = left3;
664 if (trkendz[i] > right3) trkendz[i] = right3;
665 if (trkstartz[i] > right3) trkstartz[i] = right3;
668 if (tracktpc[i] == 5) {
669 if (trkendy[i] > upper5) trkendy[i] = upper5;
670 if (trkstarty[i] > upper5) trkstarty[i] = upper5;
671 if (trkendy[i] < lower5) trkendy[i] = lower5;
672 if (trkstarty[i] < lower5) trkstarty[i] = lower5;
673 if (trkendz[i] < left5 ) trkendz[i] = left5;
674 if (trkstartz[i] < left5 ) trkstartz[i] = left5;
675 if (trkendz[i] > right5) trkendz[i] = right5;
676 if (trkstartz[i] > right5) trkstartz[i] = right5;
679 if (tracktpc[i] == 7) {
680 if (trkendy[i] > upper7) trkendy[i] = upper7;
681 if (trkstarty[i] > upper7) trkstarty[i] = upper7;
682 if (trkendy[i] < lower7) trkendy[i] = lower7;
683 if (trkstarty[i] < lower7) trkstarty[i] = lower7;
684 if (trkendz[i] < left7 ) trkendz[i] = left7;
685 if (trkstartz[i] < left7 ) trkstartz[i] = left7;
686 if (trkendz[i] > right7) trkendz[i] = right7;
687 if (trkstartz[i] > right7) trkstartz[i] = right7;
690 tracklengthXZ[i] = TMath::Power((TMath::Power(std::fabs(trkendz[i] - trkstartz[i]), 2) + TMath::Power(std::fabs(trkendx[i] - trkstartx[i]), 2)), 0.5);
691 tracklengthYZ[i] = TMath::Power((TMath::Power(std::fabs(trkendz[i] - trkstartz[i]), 2) + TMath::Power(std::fabs(trkendy[i] - trkstarty[i]), 2)), 0.5);
693 if (trkendz[i]>trkstartz[i])
xdiff = (trkendx[i] - trkstartx[i]);
694 else xdiff = (trkstartx[i] - trkendx[i]);
696 if (trkendz[i]>trkstartz[i])
ydiff = (trkendy[i] - trkstarty[i]);
697 else ydiff = (trkstarty[i] - trkendy[i]);
699 if (trkendz[i]>trkstartz[i])
zdiff = fabs(trkendz[i] - trkstartz[i]);
700 else zdiff = fabs(trkstartz[i] - trkendz[i]);
706 for (
int translationsteps = 0; translationsteps < 101; translationsteps ++){
710 for (
int i = 0; i < ntracks_reco; i++){
713 for (
int k = 0;
k < ntracks_reco;
k++){
732 if ((tracktpc[i] != tracktpc[
k]) && (
abs(tracktpc[i] - tracktpc[k]) <= 4) && (fabs(atan(trackgradientXZ[k]))*TMath::Pi()/180 - (atan(trackgradientXZ[i]))*TMath::Pi()/180 < 0.1) && (tracktpc[i] < tracktpc[k])) {
734 possiblex.push_back(fabs(trkendx[i] - trkendx[k]));
735 possiblex.push_back(fabs(trkendx[i] - trkstartx[k]));
736 possiblex.push_back(fabs(trkstartx[i] - trkendx[k]));
737 possiblex.push_back(fabs(trkstartx[i] - trkstartx[k]));
739 possibley.push_back(fabs(trkendy[i] - trkendy[k]));
740 possibley.push_back(fabs(trkendy[i] - trkstarty[k]));
741 possibley.push_back(fabs(trkstarty[i] - trkendy[k]));
742 possibley.push_back(fabs(trkstarty[i] - trkstarty[k]));
744 possiblez.push_back(fabs(trkendz[i] - trkendz[k]));
745 possiblez.push_back(fabs(trkendz[i] - trkstartz[k]));
746 possiblez.push_back(fabs(trkstartz[i] - trkendz[k]));
747 possiblez.push_back(fabs(trkstartz[i] - trkstartz[k]));
749 minx = * std::min_element(possiblex.begin(), possiblex.end());
750 miny = * std::min_element(possibley.begin(), possibley.end());
751 minz = * std::min_element(possiblez.begin(), possiblez.end());
753 for (
size_t g = 0;
g < possiblex.size();
g++) {
754 if (possiblex[
g] ==
minx) {
758 for (
size_t g = 0;
g < possibley.size();
g++) {
759 if (possibley[
g] == miny) {
763 for (
size_t g = 0;
g < possiblez.size();
g++) {
765 if (possiblez[
g] == minz) {
772 if ((tracktpc[i] == 1 && tracktpc[k] == 5) || (tracktpc[i] == 5 && tracktpc[
k] == 1)) {
781 if (trkendz[i] < trkstartz[k]){
804 if (trkendz[i] < trkendz[k]){
827 if (trkstartz[i] < trkstartz[k]){
849 if (trkstartz[i] < trkendz[k]){
870 TMinuit* mingen =
new TMinuit(1);
872 mingen->SetPrintLevel(-1);
873 mingen->DefineParameter(0,
"gap extension", -20, 0.001, -100, 100);
875 mingen->GetParameter(0,
z, error);
877 output[
event][0][0] = double(trkid[i]);
878 output[
event][0][1] = double(trkid[k]);
879 output[
event][0][2] = double(tracktpc[i]);
880 output[
event][0][3] = double(tracktpc[k]);
881 output[
event][0][4] = (minz +
z);
887 if ((tracktpc[i] == 5 && tracktpc[k] == 7) || (tracktpc[i] == 7 && tracktpc[
k] == 5)) {
893 if (trkendz[i] < trkstartz[k]){
916 if (trkendz[i] < trkendz[k]){
939 if (trkstartz[i] < trkstartz[k]){
961 if (trkstartz[i] < trkendz[k]){
982 TMinuit* mingen =
new TMinuit(1);
984 mingen->SetPrintLevel(-1);
985 mingen->DefineParameter(0,
"gap extension", -20, 0.001, -100, 100);
987 mingen->GetParameter(0,
z, error);
989 output[
event][1][0] = double(trkid[i]);
990 output[
event][1][1] = double(trkid[k]);
991 output[
event][1][2] = double(tracktpc[i]);
992 output[
event][1][3] = double(tracktpc[k]);
993 output[
event][1][4] = (minz +
z);
999 if ((tracktpc[i] == 1 && tracktpc[k] == 3) || (tracktpc[i] == 3 && tracktpc[
k] == 1)) {
1005 if (trkendz[i] < trkstartz[k]){
1028 if (trkendz[i] < trkendz[k]){
1051 if (trkstartz[i] < trkstartz[k]){
1073 if (trkstartz[i] < trkendz[k]){
1093 double error = 0.01;
1094 TMinuit* mingen =
new TMinuit(1);
1096 mingen->SetPrintLevel(-1);
1097 mingen->DefineParameter(0,
"gap extension", -20, 0.001, -100, 100);
1099 mingen->GetParameter(0,
z, error);
1101 output[
event][2][0] = double(trkid[i]);
1102 output[
event][2][1] = double(trkid[k]);
1103 output[
event][2][2] = double(tracktpc[i]);
1104 output[
event][2][3] = double(tracktpc[k]);
1105 output[
event][2][4] = (minz +
z);
1111 if ((tracktpc[i] == 3 && tracktpc[k] == 7) || (tracktpc[i] == 7 && tracktpc[
k] == 3)) {
1117 if (trkendz[i] < trkstartz[k]){
1140 if (trkendz[i] < trkendz[k]){
1163 if (trkstartz[i] < trkstartz[k]){
1185 if (trkstartz[i] < trkendz[k]){
1205 double error = 0.01;
1206 TMinuit* mingen =
new TMinuit(1);
1208 mingen->SetPrintLevel(-1);
1209 mingen->DefineParameter(0,
"gap extension", -20, 0.001, -100, 100);
1211 mingen->GetParameter(0,
z, error);
1213 output[
event][3][0] = double(trkid[i]);
1214 output[
event][3][1] = double(trkid[k]);
1215 output[
event][3][2] = double(tracktpc[i]);
1216 output[
event][3][3] = double(tracktpc[k]);
1217 output[
event][3][4] = (minz +
z);
1223 if ((tracktpc[i] == 3 && tracktpc[k] == 5) || (tracktpc[i] == 5 && tracktpc[
k] == 3)) {
1229 if (trkendz[i] < trkstartz[k]){
1254 if (trkendz[i] < trkendz[k]){
1279 if (trkstartz[i] < trkstartz[k]){
1303 if (trkstartz[i] < trkendz[k]){
1325 double error = 0.01;
1326 TMinuit* min5 =
new TMinuit(1);
1328 min5->SetPrintLevel(-1);
1329 min5->DefineParameter(0,
"gap extension", -20, 0.001, -100, 100);
1331 min5->GetParameter(0,
y, error);
1333 output[
event][4][0] = double(trkid[i]);
1334 output[
event][4][1] = double(trkid[k]);
1335 output[
event][4][2] = double(tracktpc[i]);
1336 output[
event][4][3] = double(tracktpc[k]);
1337 output[
event][4][4] = (miny +
y);
1349 gapit1[
event]->SetBinContent(translationsteps+1, output[
event][0][4]);
1350 gapdif1[
event]->SetBinContent(translationsteps+1, fabs(output[event][0][4] - 2.0789));
1352 gapit2[
event]->SetBinContent(translationsteps+1, output[event][1][4]);
1353 gapdif2[
event]->SetBinContent(translationsteps+1, fabs(output[event][1][4] - 2.079));
1355 gapit3[
event]->SetBinContent(translationsteps+1, output[event][2][4]);
1356 gapdif3[
event]->SetBinContent(translationsteps+1, fabs(output[event][2][4] - 2.5279));
1358 gapit4[
event]->SetBinContent(translationsteps+1, output[event][3][4]);
1359 gapdif4[
event]->SetBinContent(translationsteps+1, fabs(output[event][3][4] - 1.629));
1361 gapit5[
event]->SetBinContent(translationsteps+1, output[event][4][4]);
1362 gapdif5[
event]->SetBinContent(translationsteps+1, fabs(output[event][4][4] - 2.9091));
1378 fTree = tfs2->make<TTree>(
"gapwidth",
"analysis tree");
1380 fTree->Branch(
"run",&
run,
"run/I");
1381 fTree->Branch(
"subrun",&subrun,
"subrun/I");
1382 fTree->Branch(
"event",&
event,
"event/I");
1383 fTree->Branch(
"evttime",&evttime,
"evttime/D");
1384 fTree->Branch(
"efield",efield,
"efield[3]/D");
1385 fTree->Branch(
"t0",&
t0,
"t0/I");
1387 fTree->Branch(
"ntracks_reco",&ntracks_reco,
"ntracks_reco/I");
1388 fTree->Branch(
"ntrkhits",ntrkhits,
"ntrkhits[ntracks_reco]/I");
1389 fTree->Branch(
"trkid",trkid,
"trkid[ntracks_reco]/I");
1390 fTree->Branch(
"trkstartx",trkstartx,
"trkstartx[ntracks_reco]/D");
1391 fTree->Branch(
"trkstarty",trkstarty,
"trkstarty[ntracks_reco]/D");
1392 fTree->Branch(
"trkstartz",trkstartz,
"trkstartz[ntracks_reco]/D");
1393 fTree->Branch(
"trkendx",trkendx,
"trkendx[ntracks_reco]/D");
1394 fTree->Branch(
"trkendy",trkendy,
"trkendy[ntracks_reco]/D");
1395 fTree->Branch(
"trkendz",trkendz,
"trkendz[ntracks_reco]/D");
1396 fTree->Branch(
"trkstartdcosx",trkstartdcosx,
"trkstartdcosx[ntracks_reco]/D");
1397 fTree->Branch(
"trkstartdcosy",trkstartdcosy,
"trkstartdcosy[ntracks_reco]/D");
1398 fTree->Branch(
"trkstartdcosz",trkstartdcosz,
"trkstartdcosz[ntracks_reco]/D");
1399 fTree->Branch(
"trkenddcosx",trkenddcosx,
"trkenddcosx[ntracks_reco]/D");
1400 fTree->Branch(
"trkenddcosy",trkenddcosy,
"trkenddcosy[ntracks_reco]/D");
1401 fTree->Branch(
"trkenddcosz",trkenddcosz,
"trkenddcosz[ntracks_reco]/D");
1404 fTree->Branch(
"trkx",trkx,
"trkx[ntracks_reco][1000]/D");
1405 fTree->Branch(
"trky",trky,
"trky[ntracks_reco][1000]/D");
1406 fTree->Branch(
"trkz",trkz,
"trkz[ntracks_reco][1000]/D");
1410 fTree->Branch(
"trktheta_xz",trktheta_xz,
"trktheta_xz[ntracks_reco]/D");
1411 fTree->Branch(
"trktheta_yz",trktheta_yz,
"trktheta_yz[ntracks_reco]/D");
1412 fTree->Branch(
"trketa_xy",trketa_xy,
"trketa_xy[ntracks_reco]/D");
1413 fTree->Branch(
"trketa_zy",trketa_zy,
"trketa_zy[ntracks_reco]/D");
1414 fTree->Branch(
"trktheta",trktheta,
"trktheta[ntracks_reco]/D");
1415 fTree->Branch(
"trkphi",trkphi,
"trkphi[ntracks_reco]/D");
1416 fTree->Branch(
"trkd2",trkd2,
"trkd2[ntracks_reco]/D");
1419 fTree->Branch(
"trkdedx2",trkdedx2,
"trkdedx2[ntracks_reco][3][1000]/D");
1420 fTree->Branch(
"trkdqdx",trkdqdx,
"trkdqdx[ntracks_reco][3][1000]/D");
1422 fTree->Branch(
"trkpitch",trkpitch,
"trkpitch[ntracks_reco][3]/D");
1425 fTree->Branch(
"trkpitchHit",trkpitchHit,
"trkpitchHit[ntracks_reco][3][1000]/D");
1426 fTree->Branch(
"trkkinE",trkkinE,
"trkkinE[ntracks_reco][3]/D");
1427 fTree->Branch(
"trkrange",trkrange,
"trkrange[ntracks_reco][3]/D");
1430 fTree->Branch(
"trkTPC",trkTPC,
"trkTPC[ntracks_reco][3][1000]/D");
1431 fTree->Branch(
"trkplaneid",trkplaneid,
"trkplaneid[ntracks_reco][3][1000]/D");
1432 fTree->Branch(
"trkresrg",trkresrg,
"trkresrg[ntracks_reco][3][1000]/D");
1433 fTree->Branch(
"trkPosx",trkPosx,
"trkPosx[ntracks_reco][3][1000]/D");
1434 fTree->Branch(
"trkPosy",trkPosy,
"trkPosy[ntracks_reco][3][1000]/D");
1435 fTree->Branch(
"trkPosz",trkPosz,
"trkPosz[ntracks_reco][3][1000]/D");
1438 fTree->Branch(
"trklen",trklen,
"trklen[ntracks_reco]/D");
1439 fTree->Branch(
"trklen_L",trklen_L,
"trklen_L[ntracks_reco]/D");
1440 fTree->Branch(
"trkdQdxSum",trkdQdxSum,
"trkdQdxSum[ntracks_reco]/D");
1441 fTree->Branch(
"trkdQdxAverage",trkdQdxAverage,
"trkdQdxAverage[ntracks_reco]/D");
1442 fTree->Branch(
"trkdEdxSum",trkdEdxSum,
"trkdEdxSum[ntracks_reco]/D");
1443 fTree->Branch(
"trkdEdxAverage",trkdEdxAverage,
"trkdEdxAverage[ntracks_reco]/D");
1445 fTree->Branch(
"trkMCTruthT0",trkMCTruthT0,
"trkMCTruthT0[ntracks_reco]/D");
1447 fTree->Branch(
"nhits",&nhits,
"nhits/I");
1448 fTree->Branch(
"nhits2",&nhits2,
"nhits2/I");
1449 fTree->Branch(
"nclust",&nclust,
"nclust/I");
1450 fTree->Branch(
"hit_plane",hit_plane,
"hit_plane[nhits2]/I");
1451 fTree->Branch(
"hit_tpc",hit_tpc,
"hit_tpc[nhits2]/I");
1452 fTree->Branch(
"hit_wire",hit_wire,
"hit_wire[nhits2]/I");
1453 fTree->Branch(
"hit_channel",hit_channel,
"hit_channel[nhits2]/I");
1454 fTree->Branch(
"hit_peakT",hit_peakT,
"hit_peakT[nhits2]/D");
1455 fTree->Branch(
"hit_charge",hit_charge,
"hit_charge[nhits2]/D");
1456 fTree->Branch(
"hit_ph",hit_ph,
"hit_ph[nhits2]/D");
1457 fTree->Branch(
"hit_trkid",hit_trkid,
"hit_trkid[nhits2]/I");
1471 for (
int i = 0; i<3; ++i){
1475 ntracks_reco = -99999;
1478 trkstartx[i] = -99999;
1479 trkstarty[i] = -99999;
1480 trkstartz[i] = -99999;
1481 trkendx[i] = -99999;
1482 trkendy[i] = -99999;
1483 trkendz[i] = -99999;
1486 trktheta_xz[i] = -99999;
1487 trktheta_yz[i] = -99999;
1488 trketa_xy[i] = -99999;
1489 trketa_zy[i] = -99999;
1490 trktheta[i] = -99999;
1495 for(
int ii=0;ii<3;ii++)
1497 trkkinE[i][ii] = -99999;
1498 trkrange[i][ii] = -99999;
1499 for(
int k=0;
k<1000;
k++)
1501 trkdedx2[i][ii][
k] = -99999;
1502 trkdqdx[i][ii][
k] = -99999;
1503 trkpitchHit[i][ii][
k] = -99999;
1504 trkTPC[i][ii][
k] = -99999;
1505 trkplaneid[i][ii][
k] = -99999;
1506 trkresrg[i][ii][
k] = -99999;
1507 trkPosx[i][ii][
k] = -99999;
1508 trkPosy[i][ii][
k] = -99999;
1509 trkPosz[i][ii][
k] = -99999;
1512 trkstartdcosx[i] = -99999;
1513 trkstartdcosy[i] = -99999;
1514 trkstartdcosz[i] = -99999;
1516 trklen_L[i] = -99999;
1519 trkenddcosx[i] = -99999;
1520 trkenddcosy[i] = -99999;
1521 trkenddcosz[i] = -99999;
1522 ntrkhits[i] = -99999;
1524 trkx[i][j] = -99999;
1525 trky[i][j] = -99999;
1526 trkz[i][j] = -99999;
1528 for (
int j = 0; j<3; ++j){
1529 trkpitch[i][j] = -99999;
1535 hit_plane[i] = -99999;
1536 hit_tpc[i] = -99999;
1537 hit_wire[i] = -99999;
1538 hit_channel[i] = -99999;
1539 hit_peakT[i] = -99999;
1540 hit_charge[i] = -99999;
1542 hit_trkid[i] = -99999;
code to link reconstructed objects back to the MC truth information
double trky[kMaxTrack][kMaxTrackHits]
double tracklengthXZ[kMaxTrack]
constexpr std::uint32_t timeLow() const
double trklen_L[kMaxTrack]
std::string fCalorimetryModuleLabel
Encapsulate the construction of a single cyostat.
double trkdQdxSum[kMaxTrack]
double trketa_zy[kMaxTrack]
double trkPosy[kMaxTrack][3][1000]
double trkenddcosy[kMaxTrack]
double trackmidy[kMaxTrack]
GapWidth(fhicl::ParameterSet const &p)
double trkendx[kMaxTrack]
double trkPosz[kMaxTrack][3][1000]
Declaration of signal hit object.
double trackmidz[kMaxTrack]
constexpr std::uint32_t timeHigh() const
double trkdEdxAverage[kMaxTrack]
std::string fClusterModuleLabel
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::string fSimulationProducerLabel
std::string fTrackModuleLabel
Vector_t VertexDirection() const
std::vector< double > possiblez
Planes which measure Z direction.
WireID_t Wire
Index of the wire within its plane.
double hit_charge[kMaxHits]
double trkTPC[kMaxTrack][3][1000]
EDAnalyzer(fhicl::ParameterSet const &pset)
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
double trktheta_yz[kMaxTrack]
double tracklengthYZ[kMaxTrack]
void CryostatBoundaries(double *boundaries, geo::CryostatID const &cid) const
Returns the boundaries of the specified cryostat.
std::vector< double > possibley
double trkstartx[kMaxTrack]
std::string fHitSpptAssocModuleLabel
double trkdedx2[kMaxTrack][3][1000]
double trkdqdx[kMaxTrack][3][1000]
double trackmidx[kMaxTrack]
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
double dEdx(float dqdx, float Efield)
double trkkinE[kMaxTrack][3]
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void minuitFunctionz(int &nDim, double *gout, double &result, double par[], int flg)
double trkenddcosx[kMaxTrack]
void analyze(art::Event const &e) override
int hit_channel[kMaxHits]
SubRunNumber_t subRun() const
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
double trkMCTruthT0[kMaxTrack]
PlaneID_t Plane
Index of the plane within its TPC.
Declaration of cluster object.
double trackgradientXZ[kMaxTrack]
double trketa_xy[kMaxTrack]
double trkendy[kMaxTrack]
Provides recob::Track data product.
double output[kMaxEvent][5][5]
Encapsulate the geometry of a wire.
double trkstarty[kMaxTrack]
double trkz[kMaxTrack][kMaxTrackHits]
art::ServiceHandle< geo::Geometry > fGeometry
Utility object to perform functions of association.
double trkPosx[kMaxTrack][3][1000]
std::string fMCTruthT0ModuleLabel
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Encapsulate the construction of a single detector plane.
double trkstartdcosy[kMaxTrack]
void minuitFunctionx(int &nDim, double *gout, double &result, double par[], int flg)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
tracking::Point_t Point_t
double trkendz[kMaxTrack]
double TrackPitchInView(recob::Track const &track, geo::View_t view, size_t trajectory_point=0U)
Returns the projected length of track on a wire pitch step [cm].
object containing MC truth information necessary for making RawDigits and doing back tracking ...
double trkpitch[kMaxTrack][3]
double trkstartz[kMaxTrack]
int trigger_offset(DetectorClocksData const &data)
double trktheta[kMaxTrack]
double hit_peakT[kMaxHits]
EventNumber_t event() const
double trktheta_xz[kMaxTrack]
std::string fTrkSpptAssocModuleLabel
double trkdQdxAverage[kMaxTrack]
double trkdEdxSum[kMaxTrack]
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
double trkenddcosz[kMaxTrack]
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
recob::tracking::Plane Plane
Utility functions to extract information from recob::Track
std::string fHitsModuleLabel
double trackgradientYZ[kMaxTrack]
double trkstartdcosz[kMaxTrack]
double trkresrg[kMaxTrack][3][1000]
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double trkx[kMaxTrack][kMaxTrackHits]
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Event finding and building.
Encapsulate the construction of a single detector plane.
std::vector< double > possiblex
double trkstartdcosx[kMaxTrack]
double trkrange[kMaxTrack][3]
double trkplaneid[kMaxTrack][3][1000]
double trkpitchHit[kMaxTrack][3][1000]