749 art::ServiceHandle<geo::Geometry const> geom;
751 art::ServiceHandle<cheat::BackTrackerService const> btserv;
752 art::ServiceHandle<cheat::ParticleInventoryService const> piserv;
753 std::map<int, double> trkID_E;
758 TH1F* ttemp_1 =
new TH1F(
"ttemp_1",
"ttemp_1",
TBINS,
TMIN,
TMAX);
759 TH1F* ttemp_2 =
new TH1F(
"ttemp_2",
"ttemp_2",
TBINS,
TMIN,
TMAX);
760 TH1F* ttemp_3 =
new TH1F(
"ttemp_3",
"ttemp_3",
TBINS,
TMIN,
TMAX);
761 TH1F* ttemp_4 =
new TH1F(
"ttemp_4",
"ttemp_4",
TBINS,
TMIN,
TMAX);
762 TH1F* ttemp_5 =
new TH1F(
"ttemp_5",
"ttemp_5",
TBINS,
TMIN,
TMAX);
770 double shwvtxT = -999;
771 double shwvtxW = -999;
772 double shwtwoT = -999;
773 double shwtwoW = -999;
775 double shwvtxx = -999;
776 double shwvtxy = -999;
777 double shwtwox = -999;
778 double shwtwoy = -999;
779 double xtwoorth = -999;
780 double ytwoorth = -999;
782 double wirePitch = -999;
783 double tickToDist = -999;
785 bool foundParent =
false;
787 for (
auto const&
hit : allhits) {
788 if (
hit->WireID().Plane != collectionPlane.Plane)
continue;
791 std::vector<sim::TrackIDE> trackIDs = btserv->HitToEveTrackIDEs(clockData,
hit);
793 for (
size_t j = 0; j < trackIDs.size(); ++j) {
795 if (
std::abs((piserv->TrackIdToParticle_P(trackIDs[j].trackID))->PdgCode()) != 11)
continue;
796 if (
std::abs((piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Mother()) != 0)
continue;
799 xvtx = (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Vx();
800 yvtx = (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Vy();
801 zvtx = (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Vz();
803 xtwo = xvtx + (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Px();
804 ytwo = yvtx + (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Py();
805 ztwo = zvtx + (piserv->TrackIdToParticle_P(trackIDs[j].trackID))->Pz();
807 shwvtxT =
detProp.ConvertXToTicks(xvtx, collectionPlane);
808 shwvtxW = geom->WireCoordinate(yvtx, zvtx, collectionPlane);
810 shwtwoT =
detProp.ConvertXToTicks(xtwo, collectionPlane);
811 shwtwoW = geom->WireCoordinate(ytwo, ztwo, collectionPlane);
813 wirePitch = geom->WirePitch(
hit->WireID());
817 shwvtxx = shwvtxT * tickToDist;
818 shwvtxy = shwvtxW * wirePitch;
820 shwtwox = shwtwoT * tickToDist;
821 shwtwoy = shwtwoW * wirePitch;
823 xtwoorth = (shwtwoy - shwvtxy) + shwvtxx;
824 ytwoorth = -(shwtwox - shwvtxx) + shwvtxy;
828 double xhit =
hit->PeakTime() * tickToDist;
829 double yhit =
hit->WireID().Wire * wirePitch;
831 double ldist =
abs((ytwoorth - shwvtxy) * xhit - (xtwoorth - shwvtxx) * yhit +
832 xtwoorth * shwvtxy - ytwoorth * shwvtxx) /
833 std::hypot(ytwoorth - shwvtxy, xtwoorth - shwvtxx);
834 double tdist = ((shwtwoy - shwvtxy) * xhit - (shwtwox - shwvtxx) * yhit + shwtwox * shwvtxy -
836 std::hypot(shwtwoy - shwvtxy, shwtwox - shwvtxx);
838 double to3D = std::hypot(xvtx - xtwo, yvtx - ytwo, zvtx - ztwo) /
839 std::hypot(shwvtxx - shwtwox,
843 double t = ldist /
X0;
845 double energy = trackIDs[j].energy;
847 ltemp->Fill(t, energy);
848 ttemp->Fill(tdist, energy);
851 ttemp_1->Fill(tdist, energy);
853 ttemp_2->Fill(tdist, energy);
855 ttemp_3->Fill(tdist, energy);
857 ttemp_4->Fill(tdist, energy);
859 ttemp_5->Fill(tdist, energy);
865 for (
int i = 0; i <
LBINS; ++i) {
866 if (ltemp->GetBinContent(i + 1) == 0)
continue;
871 for (
int i = 0; i <
TBINS; ++i) {
872 if (ttemp->GetBinContent(i + 1) == 0)
continue;
877 ttemp_1->GetBinCenter(i + 1), elep, ttemp_1->GetBinContent(i + 1));
879 ttemp_2->GetBinCenter(i + 1), elep, ttemp_2->GetBinContent(i + 1));
881 ttemp_3->GetBinCenter(i + 1), elep, ttemp_3->GetBinContent(i + 1));
883 ttemp_4->GetBinCenter(i + 1), elep, ttemp_4->GetBinContent(i + 1));
885 ttemp_5->GetBinCenter(i + 1), elep, ttemp_5->GetBinContent(i + 1));
TProfile2D * fShowerProfileHitTrans2D_2
TProfile2D * fShowerProfileHitTrans2D_4
TProfile2D * fShowerProfileHitTrans2D_1
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
TProfile2D * fShowerProfileHitTrans2D_3
TProfile * fShowerProfileHitTrans
TProfile * fShowerProfileHitLong
TProfile2D * fShowerProfileHitTrans2D
TProfile2D * fShowerProfileHitLong2D
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
TProfile2D * fShowerProfileHitTrans2D_5