1 #ifndef SBN_ANALYSIS_CALORIMETRYANALYSIS_CXX
2 #define SBN_ANALYSIS_CALORIMETRYANALYSIS_CXX
7 #include "TDatabasePDG.h"
8 #include "TParticlePDG.h"
9 #include "art/Framework/Core/EDAnalyzer.h"
10 #include "canvas/Utilities/InputTag.h"
11 #include "fhiclcpp/ParameterSet.h"
12 #include "art/Framework/Core/FileBlock.h"
13 #include "art/Framework/Core/ModuleMacros.h"
14 #include "art/Framework/Principal/Event.h"
15 #include "art/Framework/Principal/Handle.h"
16 #include "art/Framework/Principal/SubRun.h"
17 #include "art/Framework/Services/Registry/ServiceHandle.h"
19 #include "art_root_io/TFileService.h"
21 #include "canvas/Persistency/Common/FindMany.h"
22 #include "canvas/Persistency/Common/FindManyP.h"
23 #include "canvas/Persistency/Common/FindOne.h"
24 #include "canvas/Persistency/Common/FindOneP.h"
25 #include "canvas/Persistency/Common/Ptr.h"
26 #include "canvas/Persistency/Common/PtrVector.h"
46 #include "nusimdata/SimulationBase/MCParticle.h"
47 #include "nusimdata/SimulationBase/MCTruth.h"
84 float distance3d(
const float& x1,
const float& y1,
const float& z1,
85 const float& x2,
const float& y2,
const float& z2);
87 const std::vector<geoalgo::AABox> &boxes);
90 std::vector<float> &charge_u,
91 std::vector<float> &charge_v,
92 std::vector<float> &charge_y,
93 std::vector<unsigned> &wire_u,
94 std::vector<unsigned> &wire_v,
95 std::vector<unsigned> &wire_y,
96 std::vector<unsigned> &channel_u,
97 std::vector<unsigned> &channel_v,
98 std::vector<unsigned> &channel_y,
99 std::vector<int> &multiplicity_u,
100 std::vector<int> &multiplicity_v,
101 std::vector<int> &multiplicity_y,
102 std::vector<float> &width_u,
103 std::vector<float> &width_v,
104 std::vector<float> &width_y,
105 std::vector<float> &time_u,
106 std::vector<float> &time_v,
107 std::vector<float> &time_y,
108 std::vector<unsigned> &nhit_u,
109 std::vector<unsigned> &nhit_v,
110 std::vector<unsigned> &nhit_y,
111 bool use_integral=
true);
132 void analyze(art::Event
const &
e)
override;
158 const std::vector<art::Ptr<recob::Wire>> &allWires,
160 const art::Ptr<recob::PFParticle> &pfp,
161 const art::Ptr<recob::Track> &trk,
162 const std::vector<art::Ptr<recob::SpacePoint>> &spacepoints,
163 const std::vector<art::Ptr<anab::Calorimetry>> &calos,
164 const std::vector<art::Ptr<anab::ParticleID>> &pid,
172 const std::vector<std::pair<int, float>> &particleMatches,
173 const art::Ptr<simb::MCParticle> &trueParticle,
174 const std::array<std::map<
unsigned, std::vector<const sim::IDE*>>, 3> particle_ide_map,
175 const std::array<std::vector<const sim::IDE*>,3> &allIDEs,
176 const std::vector<geo::BoxBoundedGeo> &activeVolumes);
179 TParticlePDG *
proton = TDatabasePDG::Instance()->GetParticle(2212);
180 TParticlePDG *
muon = TDatabasePDG::Instance()->GetParticle(13);
560 fPFPproducer =
p.get< art::InputTag > (
"PFPproducer",
"pandoraTrackGausCryo0");
561 fCALOproducer =
p.get< art::InputTag > (
"CALOproducer");
562 fPIDproducer =
p.get< art::InputTag > (
"PIDproducer" );
563 fTRKproducer =
p.get< art::InputTag > (
"TRKproducer" );
564 fMCSproducer =
p.get<std::string>(
"MCSproducer",
"pandoraTrackMCS");
565 fRangeproducer =
p.get<std::string>(
"Rangeproducer",
"pandoraTrackRange");
566 fT0producer =
p.get< art::InputTag > (
"T0producer",
"" );
567 fAreaHitproducer =
p.get<art::InputTag> (
"AreaHitproducer",
"areahit");
568 fAllTrueEnergyDeposits =
p.get<
bool>(
"AllTrueEnergyDeposits",
true);
569 fHitFilterproducer =
p.get<art::InputTag>(
"HitFilterproducer",
"filtgoodhit");
570 fHitProducers =
p.get<std::vector<art::InputTag>>(
"HitProducers");
571 fWireProducer =
p.get<art::InputTag>(
"WireProducer",
"decon1DroiTPC0");
573 art::ServiceHandle<art::TFileService>
tfs;
575 _calo_tree = tfs->make<TTree>(
"CalorimetryAnalyzer",
"Calo Tree");
580 for (
auto const &cryo: geometry->IterateCryostats()) {
582 tend = geometry->end_TPC(cryo.ID());
583 std::vector<geo::BoxBoundedGeo> this_tpc_volumes;
584 while (iTPC != tend) {
589 fTPCVolumes.push_back(std::move(this_tpc_volumes));
593 for (
const std::vector<geo::BoxBoundedGeo> &tpcs: fTPCVolumes) {
594 double XMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinX() < rhs.MinX(); })->MinX();
595 double YMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinY() < rhs.MinY(); })->MinY();
596 double ZMin = std::min_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MinZ() < rhs.MinZ(); })->MinZ();
598 double XMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxX() < rhs.MaxX(); })->MaxX();
599 double YMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxY() < rhs.MaxY(); })->MaxY();
600 double ZMax = std::max_element(tpcs.begin(), tpcs.end(), [](
auto &lhs,
auto &rhs) {
return lhs.MaxZ() < rhs.MaxZ(); })->MaxZ();
602 fActiveVolumes.emplace_back(XMin, XMax, YMin, YMax, ZMin, ZMax);
612 bool fData = e.isRealData();
620 std::cout <<
"[CalorimetryAnalysis::analyzeEvent] Run: " <<
_run <<
", SubRun: " <<
_sub <<
", Event: "<< _evt << std::endl;
630 std::vector<art::Ptr<recob::Hit>> hitList;
631 for (
const art::InputTag &t: fHitProducers) {
632 art::ValidHandle<std::vector<recob::Hit>> hitHandle = e.getValidHandle<std::vector<recob::Hit>>(t);
633 art::fill_ptr_vector(hitList, hitHandle);
637 art::Handle<std::vector<recob::Wire>> wireHandle;
638 e.getByLabel(fWireProducer, wireHandle);
640 std::vector<art::Ptr<recob::Wire>> wireList;
641 if (wireHandle.isValid()) {
642 art::fill_ptr_vector(wireList, wireHandle);
646 art::ValidHandle<std::vector<simb::MCParticle>> particleHandle = e.getValidHandle<std::vector<simb::MCParticle>>(
"largeant");
647 std::vector<art::Ptr<simb::MCParticle>> particleList;
648 art::fill_ptr_vector(particleList, particleHandle);
650 art::ValidHandle<std::vector<sim::SimChannel>> simchannelHandle = e.getValidHandle<std::vector<sim::SimChannel>>(
"largeant");
651 std::vector<art::Ptr<sim::SimChannel>> simchannelList;
652 art::fill_ptr_vector(simchannelList, simchannelHandle);
654 art::ValidHandle<std::vector<recob::PFParticle>> pfparticles = e.getValidHandle<std::vector<recob::PFParticle>>(
fPFPproducer);
655 std::vector<art::Ptr<recob::PFParticle>> PFParticleList;
656 art::fill_ptr_vector(PFParticleList, pfparticles);
657 _n_pfp = pfparticles->size();
659 art::ValidHandle<std::vector<recob::Track>>
tracks = e.getValidHandle<std::vector<recob::Track>>(
fTRKproducer);
661 art::FindManyP<recob::SpacePoint> fmSpacePoint(PFParticleList, e,
fPFPproducer);
663 art::FindManyP<recob::Track> fmTracks(pfparticles, e, fTRKproducer);
666 art::FindManyP<recob::Hit> fmtrkHits(tracks, e, fTRKproducer);
667 art::FindManyP<recob::Hit> fmareaHits(tracks, e, fAreaHitproducer);
668 art::FindManyP<recob::Hit> fmcaloHits(tracks, e, fHitFilterproducer);
670 art::FindManyP<anab::Calorimetry> fmCalo(tracks, e, fCALOproducer);
671 art::FindManyP<anab::ParticleID> fmPID(tracks, e, fPIDproducer);
677 art::FindManyP<recob::MCSFitResult> fmMuonMCS(tracks, e, mcs_muon);
678 art::FindManyP<sbn::RangeP> fmMuonRange(tracks, e, range_muon);
679 art::FindManyP<sbn::RangeP> fmProtonRange(tracks, e, range_proton);
682 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(e);
684 for (art::Ptr<recob::PFParticle> p_pfp: PFParticleList) {
690 const std::vector<art::Ptr<recob::Track>> thisTrack = fmTracks.at(p_pfp.key());
691 if (thisTrack.size() != 1)
694 size_t parent_ind = pfp.
Parent();
695 std::cout <<
"Parent ind: " << parent_ind << std::endl;
702 for (
unsigned i_p = 0; i_p < PFParticleList.size(); i_p++) {
703 if (PFParticleList[i_p]->Self() == pfp.
Parent()) {
704 p_parent = &*PFParticleList[i_p];
709 if (p_parent == NULL || !p_parent->
IsPrimary()) {
714 art::Ptr<recob::Track> trkPtr = thisTrack.at(0);
720 std::vector<art::Ptr<recob::SpacePoint>> emptySPVector;
721 const std::vector<art::Ptr<recob::SpacePoint>> &spacepoints = fmSpacePoint.isValid() ? fmSpacePoint.at(p_pfp.key()) : emptySPVector;
723 std::vector<art::Ptr<anab::Calorimetry>> emptyCaloVector;
724 const std::vector<art::Ptr<anab::Calorimetry>> &
calo = fmCalo.isValid() ? fmCalo.at(trkPtr.key()) : emptyCaloVector;
726 std::vector<art::Ptr<anab::ParticleID>> emptyPIDVector;
727 const std::vector<art::Ptr<anab::ParticleID>> &pid = fmPID.isValid() ? fmPID.at(trkPtr.key()) : emptyPIDVector;
730 if (fmMuonMCS.isValid() && fmMuonMCS.at(trkPtr.key()).
size()) muon_mcs = *fmMuonMCS.at(trkPtr.key()).at(0);
733 if (fmMuonRange.isValid() && fmMuonRange.at(trkPtr.key()).
size()) muon_range = *fmMuonRange.at(trkPtr.key()).at(0);
736 if (fmProtonRange.isValid() && fmProtonRange.at(trkPtr.key()).
size()) proton_range = *fmProtonRange.at(trkPtr.key()).at(0);
738 std::vector<art::Ptr<recob::Hit>> emptyHitVector;
739 const std::vector<art::Ptr<recob::Hit>> &trkHits = fmtrkHits.isValid() ? fmtrkHits.at(trkPtr.key()) : emptyHitVector;
740 const std::vector<art::Ptr<recob::Hit>> &areaHits = fmareaHits.isValid() ? fmareaHits.at(trkPtr.key()) : emptyHitVector;
741 const std::vector<art::Ptr<recob::Hit>> &caloHits = fmcaloHits.isValid() ? fmcaloHits.at(trkPtr.key()) : emptyHitVector;
746 int match_id = matches.size() ? std::max_element(matches.begin(), matches.end(),
747 [](
const auto &
a,
const auto &b) {
return a.second < b.second; })->
first : -1;
748 float matchE = matches.size() ? std::max_element(matches.begin(), matches.end(),
749 [](
const auto &
a,
const auto &b) {
return a.second < b.second; })->
second : -1;
750 art::Ptr<simb::MCParticle> true_particle;
751 for (art::Ptr<simb::MCParticle>
p: particleList) {
752 if (
p->TrackId() == match_id) {
757 float trueTrackE = 0.;
758 for (
auto pair: matches) trueTrackE += pair.second;
763 if (!true_particle)
continue;
765 if (true_particle->Process() !=
"primary")
continue;
768 std::cout <<
"Track: " << track.
ID() <<
" len: " << track.
Length() <<
" matched to particle: " << true_particle->TrackId() <<
" frac: " << (matchE/trueTrackE) << std::endl;
770 art::ServiceHandle<cheat::BackTrackerService> bt_serv;
772 std::array<std::map<unsigned, std::vector<const sim::IDE*>>, 3> particle_ide_map;
773 for (
const art::Ptr<sim::SimChannel> sc: simchannelList) {
774 for (
const auto &pair: sc->TDCIDEMap()) {
775 for (
const sim::IDE &ide: pair.second) {
777 unsigned plane_id = geometry->
ChannelToWire(sc->Channel()).at(0).Plane;
778 particle_ide_map[plane_id][sc->Channel()].push_back(&ide);
784 std::array<std::vector<const sim::IDE*>, 3> allIDEs;
785 for (
unsigned i = 0; i < particleList.size(); i++) {
786 int G4ID = particleList[i]->TrackId();
787 for (
unsigned plane = 0; plane < 3; plane++) {
790 std::vector<const sim::IDE*> this_ides = bt_serv->TrackIdToSimIDEs_Ps(G4ID, geometry->
View(plane_id));
791 allIDEs[plane].insert(allIDEs[plane].
end(), this_ides.begin(), this_ides.end());
923 _daughters = std::numeric_limits<uint>::lowest();
926 _trk_score = std::numeric_limits<float>::lowest();
928 _trk_theta = std::numeric_limits<float>::lowest();
929 _trk_phi = std::numeric_limits<float>::lowest();
930 _trk_len = std::numeric_limits<float>::lowest();
936 _trk_dir_x = std::numeric_limits<float>::lowest();
937 _trk_dir_y = std::numeric_limits<float>::lowest();
938 _trk_dir_z = std::numeric_limits<float>::lowest();
948 _trk_end_x = std::numeric_limits<float>::lowest();
949 _trk_end_y = std::numeric_limits<float>::lowest();
950 _trk_end_z = std::numeric_limits<float>::lowest();
963 _trk_pida_y = std::numeric_limits<float>::lowest();
972 _trk_pida_u = std::numeric_limits<float>::lowest();
981 _trk_pida_v = std::numeric_limits<float>::lowest();
985 _longest = std::numeric_limits<int>::lowest();
1523 std::vector<unsigned> ret;
1529 for (
const art::Ptr<recob::Hit> &
hit: hits) {
1530 if (
hit.key() == ind) {
1531 ret.push_back(
hit->Channel());
1537 throw cet::exception(
"dEdx w/out Hit!");
1549 geo::Vector_t offset_v = SCEService->GetPosOffsets(location_p);
1550 TVector3
offset = TVector3(offset_v.X(), offset_v.Y(), offset_v.Z());
1552 if (location.X() < 0.) offset.SetX(-offset.X());
1555 TVector3 location_dx = location + geo->
WirePitch(plane) * direction;
1559 geo::Vector_t offset_dx_v = SCEService->GetPosOffsets(location_dx_p);
1560 TVector3 offset_dx(offset_dx_v.X(), offset_dx_v.Y(), offset_dx_v.Z());
1562 if (location_dx.X() < 0.) offset_dx.SetX(-offset_dx.X());
1565 direction = (offset_dx + location_dx - offset - location).Unit();
1569 float cosgamma =
abs(cos(angletovert) * direction.Z() + sin(angletovert) * direction.Y());
1570 float pitch = geo->
WirePitch(plane) / cosgamma;
1575 geo::Vector_t offset_v = SCEService->GetPosOffsets(location_p);
1576 TVector3
offset(offset_v.X(), offset_v.Y(), offset_v.Z());
1580 TVector3 location_sce = location +
offset;
1582 TVector3 location_sce_dx = location_sce + direction * pitch;
1586 geo::Vector_t back_v = SCEService->GetCalPosOffsets(location_sce_dx_p, plane.
TPC);
1587 TVector3 back(back_v.X(), back_v.Y(), back_v.Z());
1588 TVector3 location_dx = location_sce_dx + back;
1590 pitch = (location - location_dx).Mag();
1598 const std::vector<art::Ptr<recob::Wire>> &allWires,
1600 const art::Ptr<recob::PFParticle> &pfp,
1601 const art::Ptr<recob::Track> &trk,
1602 const std::vector<art::Ptr<recob::SpacePoint>> &spacepoints,
1603 const std::vector<art::Ptr<anab::Calorimetry>> &calos,
1604 const std::vector<art::Ptr<anab::ParticleID>> &pids,
1605 const std::vector<art::Ptr<recob::Hit>> &areaHits,
1607 const std::vector<art::Ptr<recob::Hit>> &caloHits,
1612 const std::vector<std::pair<int, float>> &particleMatches,
1613 const art::Ptr<simb::MCParticle> &trueParticle,
1614 const std::array<std::map<
unsigned, std::vector<const sim::IDE*>>, 3> particle_ide_map,
1615 const std::array<std::vector<const sim::IDE*>,3> &allIDEs,
1616 const std::vector<geo::BoxBoundedGeo> &activeVolumes)
1621 art::ServiceHandle<cheat::BackTrackerService> bt_serv;
1624 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(e);
1625 auto const dprop = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e, clock_data);
1638 for (
unsigned sp_i = 0; sp_i < spacepoints.size(); sp_i++) {
1639 _sx.push_back(spacepoints[sp_i]->XYZ()[0]);
1640 _sy.push_back(spacepoints[sp_i]->XYZ()[1]);
1641 _sz.push_back(spacepoints[sp_i]->XYZ()[2]);
1644 for (
const auto &wire: allWires) {
1645 unsigned plane_id = geometry->
ChannelToWire(wire->Channel()).at(0).Plane;
1647 if (plane_id == 0) {
1649 for (
auto const &range: wire->SignalROI().get_ranges()) {
1653 else if (plane_id == 1) {
1655 for (
auto const &range: wire->SignalROI().get_ranges()) {
1659 else if (plane_id == 2) {
1661 for (
auto const &range: wire->SignalROI().get_ranges()) {
1792 float trueTrackE = 0.;
1794 for (
auto pair: particleMatches) {
1795 trueTrackE += pair.second;
1796 if (pair.first == trueParticle->TrackId()) matchE = pair.second;
1798 assert(matchE > 0.);
1801 float trueParticleE = 0.;
1812 for (
auto const &ide_pair: particle_ide_map[0]) {
1816 for (
const sim::IDE *ide: ide_pair.second) {
1817 trueParticleE += ide->
energy;
1825 for (
auto const &ide_pair: particle_ide_map[1]) {
1829 for (
const sim::IDE *ide: ide_pair.second) {
1830 trueParticleE += ide->
energy;
1838 for (
auto const &ide_pair: particle_ide_map[2]) {
1842 for (
const sim::IDE *ide: ide_pair.second) {
1843 trueParticleE += ide->
energy;
1851 for (
auto ide: allIDEs[0]) {
1854 for (
auto ide: allIDEs[1]) {
1857 for (
auto ide: allIDEs[2]) {
1886 for (
unsigned i_traj = 0; i_traj < trueParticle->NumberTrajectoryPoints(); i_traj++) {
1891 _backtracked_dirx.push_back(trueParticle->Px(i_traj) / trueParticle->P(i_traj));
1892 _backtracked_diry.push_back(trueParticle->Py(i_traj) / trueParticle->P(i_traj));
1893 _backtracked_dirz.push_back(trueParticle->Pz(i_traj) / trueParticle->P(i_traj));
1934 auto const &plane = planeID.Plane;
1935 if (plane > 2)
continue;
1937 int lastWire = -1000000;
1939 for (
unsigned i_traj = 0; i_traj < trueParticle->NumberTrajectoryPoints()-1; i_traj++) {
1940 TVector3 thispoint = trueParticle->Position(i_traj).Vect();
1941 TVector3 nextpoint = trueParticle->Position(i_traj+1).Vect();
1943 geo::Point_t thispoint_p(thispoint.X(), thispoint.Y(), thispoint.Z());
1944 geo::Point_t nextpoint_p(nextpoint.X(), nextpoint.Y(), nextpoint.Z());
1946 double thiswirecoord = geometry->
WireCoordinate(thispoint_p, planeID);
1947 double nextwirecoord = geometry->
WireCoordinate(nextpoint_p, planeID);
1948 int wireStart = std::nearbyint((thiswirecoord >= nextwirecoord) ? std::floor(thiswirecoord) : std::ceil(thiswirecoord));
1949 int wireEnd = std::nearbyint((thiswirecoord >= nextwirecoord) ? std::floor(nextwirecoord) : std::ceil(nextwirecoord));
1951 if (wireStart == wireEnd)
continue;
1954 if (!(wireStart >= 0 && wireStart < (
int)geometry->
Plane(planeID).
Nwires()))
continue;
1955 if (!(wireEnd >= 0 && wireEnd <= (
int)geometry->
Plane(planeID).
Nwires()))
continue;
1958 if (wireStart == lastWire) {
1959 if (wireStart < wireEnd) wireStart ++;
1963 if (wireStart == wireEnd)
continue;
1966 double locX = trueParticle->Position(i_traj).X();
1967 double locY = trueParticle->Position(i_traj).Y();
1968 double locZ = trueParticle->Position(i_traj).Z();
1969 double dirX = trueParticle->Momentum(i_traj).Vect().Unit().X();
1970 double dirY = trueParticle->Momentum(i_traj).Vect().Unit().Y();
1971 double dirZ = trueParticle->Momentum(i_traj).Vect().Unit().Z();
1972 double deltaE = (trueParticle->Momentum(last_traj).E() - trueParticle->Momentum(i_traj+1).E()) /
abs(wireEnd - wireStart);
1974 double pitch =
calcPitch(geometry, planeID, trueParticle->Position(i_traj).Vect(), trueParticle->Momentum(i_traj).Vect().Unit());
1975 double pitchSCE =
calcPitch(geometry, planeID, trueParticle->Position(i_traj).Vect(), trueParticle->Momentum(i_traj).Vect().Unit(), spacecharge);
1978 int incl = wireStart < wireEnd ? 1: -1;
1979 for (
int wire = wireStart; wire != wireEnd; wire += incl) {
1981 unsigned channel = geometry->
PlaneWireToChannel(planeID.Plane, wire, planeID.TPC, planeID.Cryostat);
1991 if (index < 0)
continue;
2004 else if (plane == 1) {
2012 if (index < 0)
continue;
2025 else if (plane == 2) {
2033 if (index < 0)
continue;
2070 trueParticle->EndProcess() ==
"CoupledTransportation" ||
2071 trueParticle->EndProcess() ==
"FastScintillation" ||
2072 trueParticle->EndProcess() ==
"muMinusCaptureAtRest" ||
2073 trueParticle->EndProcess() ==
"LArVoxelReadoutScoringProcess");
2077 std::vector<geoalgo::AABox> aa_volumes;
2080 if (AV.ContainsPosition(trueParticle->Position().Vect()) && AV.ContainsPosition(trueParticle->EndPosition().Vect())) {
2082 aa_volumes.emplace_back(AV.MinX(), AV.MinY(), AV.MinZ(), AV.MaxX(), AV.MaxY(), AV.MaxZ());
2089 for (
unsigned i = 1; i < trueParticle->NumberTrajectoryPoints(); i++) {
2095 float mcs_momentum_muon = muon_range.
range_p;
2096 float momentum_proton = proton_range.
range_p;
2097 float energy_proton = std::sqrt(std::pow(momentum_proton, 2) + std::pow(
proton->Mass(), 2)) -
proton->Mass();
2098 float energy_muon = std::sqrt(std::pow(mcs_momentum_muon, 2) + std::pow(
muon->Mass(), 2)) -
muon->Mass();
2122 float _trk_start_sce[3];
2123 (
void) _trk_start_sce;
2128 float _trk_end_sce[3];
2129 (
void) _trk_end_sce;
2135 for (
const art::Ptr<anab::ParticleID> pid: pids) {
2139 double chi2_muon = 0.;
2140 double chi2_pion = 0.;
2141 double chi2_kaon = 0.;
2142 double chi2_proton = 0.;
2144 auto plane = pid->PlaneID().Plane;
2149 std::vector<anab::sParticleIDAlgScores> AlgScoresVec = pid->ParticleIDAlgScores();
2150 for (
size_t i_algscore=0; i_algscore<AlgScoresVec.size(); i_algscore++){
2154 chi2_muon = AlgScore.
fValue;
2161 else if (TMath::Abs(AlgScore.
fAssumedPdg) == 211) {
2162 chi2_pion = AlgScore.
fValue;
2169 else if (TMath::Abs(AlgScore.
fAssumedPdg) == 321) {
2170 chi2_kaon = AlgScore.
fValue;
2177 else if (TMath::Abs(AlgScore.
fAssumedPdg) == 2212) {
2178 chi2_proton = AlgScore.
fValue;
2195 if (plane > 2)
continue;
2209 else if (plane == 1) {
2221 else if (plane == 2) {
2236 for (
const art::Ptr<anab::Calorimetry>
calo : calos)
2239 auto const& plane =
calo->PlaneID().Plane;
2244 auto const& xyz_v =
calo->XYZ();
2252 for (
auto xyz : xyz_v)
2255 _t_u.push_back(dprop.ConvertXToTicks(xyz.X(),
calo->PlaneID()));
2256 _x_u.push_back(xyz.X());
2257 _y_u.push_back(xyz.Y());
2258 _z_u.push_back(xyz.Z());
2271 else if (plane == 1)
2278 for (
auto xyz : xyz_v)
2281 _t_v.push_back(dprop.ConvertXToTicks(xyz.X(),
calo->PlaneID()));
2282 _x_v.push_back(xyz.X());
2283 _y_v.push_back(xyz.Y());
2284 _z_v.push_back(xyz.Z());
2296 else if (plane == 2)
2303 for (
auto xyz : xyz_v)
2306 _t_y.push_back(dprop.ConvertXToTicks(xyz.X(),
calo->PlaneID()));
2307 _x_y.push_back(xyz.X());
2308 _y_y.push_back(xyz.Y());
2309 _z_y.push_back(xyz.Z());
2329 float min_dist = 1000;
2336 float distance =
distance3d((
double)point_i.X(), (double)point_i.Y(), (double)point_i.Z(),
2338 if (distance < min_dist)
2346 if (i_min == (
size_t)-1)
return;
2349 out[0] = (float)direction.X();
2350 out[1] = (float)direction.Y();
2351 out[2] = (float)direction.Z();
2354 norm = out[0]*out[0] + out[1]*out[1] + out[2]*out[2];
2355 if (fabs(norm -1) > 0.001)
2357 std::cout <<
"i_min = " << i_min << std::endl;
2358 std::cout <<
"minimum distance = " << min_dist << std::endl;
2359 std::cout <<
"out[0], out[1], out[2] = " << out[0] <<
" , " << out[1] <<
" , " << out[2] << std::endl;
2360 std::cout <<
"norm = " << norm << std::endl;
2366 std::vector<float> &charge_u,
2367 std::vector<float> &charge_v,
2368 std::vector<float> &charge_y,
2369 std::vector<unsigned> &wire_u,
2370 std::vector<unsigned> &wire_v,
2371 std::vector<unsigned> &wire_y,
2372 std::vector<unsigned> &channel_u,
2373 std::vector<unsigned> &channel_v,
2374 std::vector<unsigned> &channel_y,
2375 std::vector<int> &multiplicity_u,
2376 std::vector<int> &multiplicity_v,
2377 std::vector<int> &multiplicity_y,
2378 std::vector<float> &width_u,
2379 std::vector<float> &width_v,
2380 std::vector<float> &width_y,
2381 std::vector<float> &time_u,
2382 std::vector<float> &time_v,
2383 std::vector<float> &time_y,
2384 std::vector<unsigned> &nhit_u,
2385 std::vector<unsigned> &nhit_v,
2386 std::vector<unsigned> &nhit_y,
2387 bool use_integral) {
2398 HitInfo(): charge(0), multiplicity(0), width(0), start(0),
end(0), time(0.), nhit(0) {}
2401 std::map<unsigned, HitInfo> hit_map_u;
2402 std::map<unsigned, HitInfo> hit_map_v;
2403 std::map<unsigned, HitInfo> hit_map_y;
2405 for (
const art::Ptr<recob::Hit>
hit: hits) {
2406 if (
hit->WireID().Plane == 0) {
2408 if (!use_integral && hit_map_u[
hit->Channel()].start ==
hit->StartTick() && hit_map_u[
hit->Channel()].end ==
hit->EndTick()) {
2411 hit_map_u[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2412 hit_map_u[
hit->Channel()].multiplicity = std::max(hit_map_u[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2413 hit_map_u[
hit->Channel()].start = hit_map_u[
hit->Channel()].nhit ? std::min(hit_map_u[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2414 hit_map_u[
hit->Channel()].end = hit_map_u[
hit->Channel()].nhit ? std::max(hit_map_u[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2415 hit_map_u[
hit->Channel()].width = (hit_map_u[
hit->Channel()].end - hit_map_u[
hit->Channel()].start);
2416 hit_map_u[
hit->Channel()].time = (
hit->PeakTime() + hit_map_u[
hit->Channel()].time * hit_map_u[
hit->Channel()].nhit) / (hit_map_u[
hit->Channel()].nhit + 1);
2417 hit_map_u[
hit->Channel()].nhit ++;
2418 hit_map_u[
hit->Channel()].wire =
hit->WireID().Wire;
2420 else if (
hit->WireID().Plane == 1) {
2422 if (!use_integral && hit_map_v[
hit->Channel()].start ==
hit->StartTick() && hit_map_v[
hit->Channel()].end ==
hit->EndTick()) {
2425 hit_map_v[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2426 hit_map_v[
hit->Channel()].multiplicity = std::max(hit_map_v[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2427 hit_map_v[
hit->Channel()].start = hit_map_v[
hit->Channel()].nhit ? std::min(hit_map_v[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2428 hit_map_v[
hit->Channel()].end = hit_map_v[
hit->Channel()].nhit ? std::max(hit_map_v[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2429 hit_map_v[
hit->Channel()].width = (hit_map_v[
hit->Channel()].end - hit_map_v[
hit->Channel()].start);
2430 hit_map_v[
hit->Channel()].time = (
hit->PeakTime() + hit_map_v[
hit->Channel()].time * hit_map_v[
hit->Channel()].nhit) / (hit_map_v[
hit->Channel()].nhit + 1);
2431 hit_map_v[
hit->Channel()].nhit ++;
2432 hit_map_v[
hit->Channel()].wire =
hit->WireID().Wire;
2436 if (!use_integral && hit_map_y[
hit->Channel()].start ==
hit->StartTick() && hit_map_y[
hit->Channel()].end ==
hit->EndTick()) {
2439 hit_map_y[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2440 hit_map_y[
hit->Channel()].multiplicity = std::max(hit_map_y[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2441 hit_map_y[
hit->Channel()].start = hit_map_y[
hit->Channel()].nhit ? std::min(hit_map_y[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2442 hit_map_y[
hit->Channel()].end = hit_map_y[
hit->Channel()].nhit ? std::max(hit_map_y[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2443 hit_map_y[
hit->Channel()].width = (hit_map_y[
hit->Channel()].end - hit_map_y[
hit->Channel()].start);
2444 hit_map_y[
hit->Channel()].time = (
hit->PeakTime() + hit_map_y[
hit->Channel()].time * hit_map_y[
hit->Channel()].nhit) / (hit_map_y[
hit->Channel()].nhit + 1);
2445 hit_map_y[
hit->Channel()].nhit ++;
2446 hit_map_y[
hit->Channel()].wire =
hit->WireID().Wire;
2450 for (
auto const &pair: hit_map_u) {
2451 channel_u.push_back(pair.first);
2452 charge_u.push_back(pair.second.charge);
2453 multiplicity_u.push_back(pair.second.multiplicity);
2454 width_u.push_back(pair.second.width);
2455 time_u.push_back(pair.second.time);
2456 nhit_u.push_back(pair.second.nhit);
2457 wire_u.push_back(pair.second.wire);
2459 for (
auto const &pair: hit_map_v) {
2460 channel_v.push_back(pair.first);
2461 charge_v.push_back(pair.second.charge);
2462 multiplicity_v.push_back(pair.second.multiplicity);
2463 width_v.push_back(pair.second.width);
2464 time_v.push_back(pair.second.time);
2465 nhit_v.push_back(pair.second.nhit);
2466 wire_v.push_back(pair.second.wire);
2468 for (
auto const &pair: hit_map_y) {
2469 channel_y.push_back(pair.first);
2470 charge_y.push_back(pair.second.charge);
2471 multiplicity_y.push_back(pair.second.multiplicity);
2472 width_y.push_back(pair.second.width);
2473 time_y.push_back(pair.second.time);
2474 nhit_y.push_back(pair.second.nhit);
2475 wire_y.push_back(pair.second.wire);
2490 auto const* geom = ::lar::providerFrom<geo::Geometry>();
2493 if (!tpc)
return -1e6;
2495 double _wire2cm = geom->WirePitch(planeID);
2497 return geom->WireCoordinate(p, planeID) * _wire2cm;
2500 float distance3d(
const float& x1,
const float& y1,
const float& z1,
2501 const float& x2,
const float& y2,
const float& z2)
2503 return sqrt((x1-x2)*(x1-x2) +
2510 const std::vector<geoalgo::AABox> &boxes) {
2514 if ((v0 - v1).Mag() < 1
e-6)
return 0;
2527 for (
auto const &box: boxes) {
2528 int n_contained = box.Contain(p0) + box.Contain(p1);
2530 if (n_contained == 2) {
2531 length = (v1 - v0).Mag();
2535 if (n_contained == 1) {
2540 if (intersections.size() == 0) {
2543 bool p0_edge = algo.
SqDist(p0, box) <
tol;
2544 bool p1_edge = algo.
SqDist(p1, box) <
tol;
2545 assert(p0_edge || p1_edge);
2549 if ((p0_edge && box.Contain(p0)) || (box.Contain(p1) && p1_edge))
2552 else if ((p0_edge && box.Contain(p1)) || (box.Contain(p0) && p1_edge)) {
2553 length = (v1 - v0).Mag();
2565 else if (intersections.size() == 2) {
2566 length += (intersections.at(0).ToTLorentzVector().Vect() - intersections.at(1).ToTLorentzVector().Vect()).Mag();
2570 else if (intersections.size() == 1) {
2572 TVector3 int_tv(intersections.at(0).ToTLorentzVector().Vect());
2573 length += ( box.Contain(p0) ? (v0 - int_tv).Mag() : (v1 - int_tv).Mag() );
2578 if (n_contained == 0) {
2580 if (!(intersections.size() == 0 || intersections.size() == 2)) {
2585 bool p0_edge = algo.
SqDist(p0, box) <
tol;
2586 bool p1_edge = algo.
SqDist(p1, box) <
tol;
2588 TVector3 vint = intersections.at(0).ToTLorentzVector().Vect();
2590 bool p0_int = (v0 - vint).Mag() <
tol;
2591 bool p1_int = (v1 - vint).Mag() <
tol;
2593 assert((p0_int && p0_edge) != (p1_int && p1_edge));
2598 if (p0_edge && p1_edge) {
2599 length += (v0 - v1).Mag();
2605 else if (intersections.size() == 2) {
2606 TVector3 start(intersections.at(0).ToTLorentzVector().Vect());
2607 TVector3
end(intersections.at(1).ToTLorentzVector().Vect());
2608 length += (start -
end).Mag();
std::vector< unsigned > _sumhit_channel_v
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
TrackID_t trackID
Geant4 supplied track ID.
std::vector< unsigned > _areahit_nhit_v
std::vector< unsigned > _calohit_channel_v
void resetTTree(TTree *_tree)
reset ttree branches
process_name opflash particleana ie ie ie z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
std::vector< float > _dir_x_u
std::vector< float > _backtracked_diry_c_y
float _backtracked_deposited_e_u
std::vector< unsigned > _calohit_nhit_u
std::vector< float > _backtracked_pc_q_v
bool fAllTrueEnergyDeposits
std::vector< unsigned > _areahit_channel_y
Algorithm to compute various geometrical relation among geometrical objects. In particular functions ...
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
std::vector< std::vector< geo::BoxBoundedGeo > > fTPCVolumes
std::vector< unsigned > _areahit_nhit_y
float _trk_bragg_p_three_planes
std::vector< int > _sumhit_multiplicity_u
~CalorimetryAnalysis()
Destructor.
std::vector< float > _backtracked_diry
Utilities related to art service access.
std::vector< unsigned > _allhit_nhit_v
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
std::vector< float > _areahit_width_u
std::vector< float > _pitch_y
std::vector< float > _backtracked_pc_q_y
ClusterModuleLabel join with tracks
std::vector< float > _backtracked_pitch_c_y
std::vector< unsigned > _sumhit_wire_u
std::vector< int > _trkhit_multiplicity_v
float _backtracked_length
std::vector< float > _dir_z_u
const geo::GeometryCore * geometry
process_name opflash particleana ie x
std::vector< float > _dir_z_y
std::vector< unsigned > _allhit_wire_v
std::vector< float > _sumhit_charge_u
static constexpr size_t kPFParticlePrimary
Define index to signify primary particle.
std::vector< float > _calohit_width_y
void FillCalorimetry(art::Event const &e, const std::vector< art::Ptr< recob::Wire >> &allWires, const std::vector< art::Ptr< recob::Hit >> &allHits, const art::Ptr< recob::PFParticle > &pfp, const art::Ptr< recob::Track > &trk, const std::vector< art::Ptr< recob::SpacePoint >> &spacepoints, const std::vector< art::Ptr< anab::Calorimetry >> &calos, const std::vector< art::Ptr< anab::ParticleID >> &pid, const std::vector< art::Ptr< recob::Hit >> &areaHits, const std::vector< art::Ptr< recob::Hit >> &trkHits, const std::vector< art::Ptr< recob::Hit >> &caloHits, const recob::MCSFitResult &muon_mcs, const sbn::RangeP &muon_range, const sbn::RangeP &proton_range, const bool fData, const std::vector< std::pair< int, float >> &particleMatches, const art::Ptr< simb::MCParticle > &trueParticle, const std::array< std::map< unsigned, std::vector< const sim::IDE * >>, 3 > particle_ide_map, const std::array< std::vector< const sim::IDE * >, 3 > &allIDEs, const std::vector< geo::BoxBoundedGeo > &activeVolumes)
std::vector< float > _areahit_time_u
std::vector< float > _backtracked_pc_e_v
std::vector< unsigned > _allhit_wire_y
std::vector< float > _trkhit_width_y
std::vector< float > _backtracked_dirx_c_u
std::vector< float > _w_v
double SqDist(const Line_t &line, const Point_t &pt) const
Declaration of signal hit object.
std::vector< float > _backtracked_z
std::vector< int > _trkhit_multiplicity_y
std::vector< float > _allhit_time_y
Point_t const & LocationAtPoint(size_t i) const
std::vector< unsigned > _allhit_nhit_u
The data type to uniquely identify a Plane.
Representation of a simple 3D line segment Defines a finite 3D straight line by having the start and ...
Geometry information for a single TPC.
std::vector< float > _backtracked_pitch_c_u
std::vector< float > _backtracked_locy_c_v
std::vector< float > _backtracked_diry_c_u
float _backtracked_sce_start_x
art::InputTag fHitFilterproducer
void TrkDirectionAtXYZ(const recob::Track trk, const double x, const double y, const double z, float out[3])
std::vector< float > _backtracked_pitch_c_v
bool HasValidPoint(size_t i) const
std::vector< float > _calohit_time_v
std::vector< float > _x_v
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
float _backtracked_deposited_e_y
geo::BoxBoundedGeo const & ActiveBoundingBox() const
Returns the box of the active volume of this TPC.
std::vector< float > _allhit_time_u
std::vector< float > _sumhit_charge_v
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
std::vector< float > _sumhit_width_v
float _backtracked_start_x
std::size_t size(FixedBins< T, C > const &) noexcept
std::vector< unsigned > _areahit_channel_u
std::vector< float > _rr_u
std::vector< float > _calohit_time_y
std::vector< unsigned > _allhit_nhit_y
std::vector< float > _backtracked_dirx_c_v
art::InputTag fPFPproducer
process_name use argoneut_mc_hitfinder track
float fValue
Result of Particle ID algorithm/test.
std::vector< float > _pitch_u
std::vector< float > _areahit_width_v
std::vector< float > _sumhit_width_y
std::vector< int > _areahit_multiplicity_y
std::vector< unsigned > _calohit_nhit_v
void fillDefault()
Fill Default info for event associated to neutrino.
std::vector< unsigned > _allhit_wire_u
std::vector< float > _backtracked_dirz
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
std::vector< float > _allhit_width_v
std::vector< unsigned > _calohit_wire_y
IteratorBox< TPC_id_iterator,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id > IterateTPCIDs() const
Enables ranged-for loops on all TPC IDs of the detector.
float calcPitch(const geo::GeometryCore *geo, const geo::PlaneID &plane, TVector3 location, TVector3 direction, const spacecharge::SpaceCharge *SCEService=NULL)
std::vector< float > _trkhit_width_v
std::vector< float > _sumhit_time_v
std::vector< float > _allhit_charge_y
std::vector< float > _integrated_charge_u
std::vector< float > _backtracked_dirz_c_v
std::bitset< 8 > fPlaneMask
Bitset for PlaneID used by algorithm, allowing for multiple planes and up to 8 total planes...
float distance3d(const float &x1, const float &y1, const float &z1, const float &x2, const float &y2, const float &z2)
std::vector< float > _backtracked_pc_e_u
std::vector< int > _trkhit_multiplicity_u
std::vector< unsigned > _calohit_channel_y
std::vector< unsigned > _backtracked_c_v
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
std::string fAlgName
< determined particle ID
std::vector< float > _calohit_width_u
process_name can override from command line with o or output calo
std::vector< std::pair< int, float > > AllTrueParticleIDEnergyMatches(const detinfo::DetectorClocksData &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< float > _z_v
std::vector< float > _backtracked_locz_c_v
std::vector< int > _sumhit_multiplicity_v
float _backtracked_deposited_e_v
float _backtracked_sce_start_U
kVariableType fVariableType
Variable type enum: defined in ParticleID_VariableTypeEnums.h. Set to kNotSet by default.
void True2RecoMappingXYZ(float t, float x, float y, float z, float out[3])
float _backtracked_purity
art::InputTag fWireProducer
std::vector< unsigned > _dedx_channel_v
art::InputTag fAreaHitproducer
std::vector< float > _rr_y
float _backtracked_sce_start_z
std::vector< int > _backtracked_nloc_c_u
double Length(size_t p=0) const
Access to various track properties.
std::vector< float > _sumhit_width_u
std::vector< float > _backtracked_scepitch_c_v
then echo ***************************************echo array
process_name opflash particleana ie ie y
std::vector< float > _dqdx_v
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
void FillHits(const detinfo::DetectorClocksData &clockData, const std::vector< art::Ptr< recob::Hit >> &hits, std::vector< float > &charge_u, std::vector< float > &charge_v, std::vector< float > &charge_y, std::vector< unsigned > &wire_u, std::vector< unsigned > &wire_v, std::vector< unsigned > &wire_y, std::vector< unsigned > &channel_u, std::vector< unsigned > &channel_v, std::vector< unsigned > &channel_y, std::vector< int > &multiplicity_u, std::vector< int > &multiplicity_v, std::vector< int > &multiplicity_y, std::vector< float > &width_u, std::vector< float > &width_v, std::vector< float > &width_y, std::vector< float > &time_u, std::vector< float > &time_v, std::vector< float > &time_y, std::vector< unsigned > &nhit_u, std::vector< unsigned > &nhit_v, std::vector< unsigned > &nhit_y, bool use_integral=true)
std::vector< float > _dedx_v
std::vector< float > _trkhit_width_u
Ionization at a point of the TPC sensitive volume.
std::vector< float > _backtracked_locy_c_u
std::vector< float > _integrated_charge_v
std::vector< float > _calohit_charge_v
std::vector< float > _allhit_charge_u
float _backtracked_start_z
bool _backtracked_process_is_stopping
std::vector< float > _x_y
std::vector< int > _allhit_multiplicity_v
std::vector< float > _t_v
std::vector< float > _trkhit_charge_u
float energy
energy deposited by ionization by this track ID and time [MeV]
float _backtracked_sce_start_y
std::vector< unsigned > _trkhit_nhit_v
std::vector< unsigned > FinddEdxHits(const anab::Calorimetry &calo, const std::vector< art::Ptr< recob::Hit >> &hits)
CalorimetryAnalysis(const fhicl::ParameterSet &pset)
Constructor.
std::string fRangeproducer
std::vector< int > _calohit_multiplicity_v
std::vector< float > _w_y
std::vector< unsigned > _trkhit_channel_u
auto end(FixedBins< T, C > const &) noexcept
std::vector< int > _calohit_multiplicity_y
std::vector< unsigned > _sumhit_wire_y
std::vector< int > _calohit_multiplicity_u
std::vector< unsigned > _trkhit_channel_v
std::vector< float > _sumhit_charge_y
bool IsPrimary() const
Returns whether the particle is the root of the flow.
std::vector< float > _areahit_charge_y
std::vector< geo::BoxBoundedGeo > fActiveVolumes
std::vector< unsigned > _sumhit_wire_v
std::vector< unsigned > _backtracked_c_y
std::vector< int > _backtracked_nloc_c_y
std::vector< float > _areahit_time_y
std::vector< float > _backtracked_diry_c_v
std::vector< unsigned > _sumhit_channel_y
std::vector< unsigned > _allhit_channel_v
The data type to uniquely identify a TPC.
std::vector< float > _z_y
Description of geometry of one entire detector.
Declaration of cluster object.
std::vector< float > _areahit_charge_v
std::vector< float > _sumhit_time_u
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
std::vector< unsigned > _areahit_wire_y
Provides recob::Track data product.
std::vector< float > _backtracked_scepitch_c_u
auto norm(Vector const &v)
Return norm of the specified vector.
std::vector< float > _trkhit_time_v
std::vector< unsigned > _areahit_nhit_u
std::vector< float > _y_v
float _backtracked_sce_start_Y
std::vector< int > _sumhit_multiplicity_y
std::vector< int > _allhit_multiplicity_u
std::vector< float > _backtracked_scepitch_c_y
std::vector< float > _pitch_v
std::vector< int > _areahit_multiplicity_v
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
std::vector< float > _areahit_width_y
std::vector< float > _areahit_time_v
std::vector< unsigned > _sumhit_nhit_u
std::vector< unsigned > _trkhit_nhit_u
std::vector< unsigned > _sumhit_nhit_v
std::vector< float > _dir_z_v
std::vector< float > _calohit_time_u
std::vector< unsigned > _trkhit_wire_y
std::vector< float > _backtracked_dirx_c_y
std::vector< unsigned > _sumhit_channel_u
std::vector< float > _w_u
std::vector< float > _dedx_u
std::vector< float > _dqdx_u
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
const std::vector< size_t > & TpIndices() const
std::vector< float > _rr_v
float _backtracked_start_t
std::vector< unsigned > _areahit_wire_v
Hierarchical representation of particle flow.
std::vector< unsigned > _allhit_channel_u
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
std::vector< float > _backtracked_locx_c_v
std::vector< float > _dir_y_u
std::vector< float > _backtracked_dirz_c_y
Contains all timing reference information for the detector.
std::vector< float > _t_u
art::InputTag fPIDproducer
std::vector< float > _dir_x_v
std::vector< float > _backtracked_pc_q_u
std::vector< float > _backtracked_locy_c_y
std::vector< float > _backtracked_pc_e_y
std::vector< float > _calohit_charge_y
std::vector< unsigned > _calohit_wire_v
std::vector< float > _backtracked_y
std::vector< unsigned > _trkhit_nhit_y
std::vector< float > _trkhit_time_u
std::vector< float > _backtracked_locx_c_y
std::vector< unsigned > _calohit_wire_u
float XYZtoPlanecoordinate(const float x, const float y, const float z, const int plane)
std::vector< float > _areahit_charge_u
std::vector< unsigned > _areahit_channel_v
unsigned int Nwires() const
Number of wires in this plane.
std::vector< float > _backtracked_de_c_y
float _backtracked_overlay_purity
float _backtracked_start_y
std::vector< unsigned > _calohit_channel_u
std::vector< float > _dqdx_y
std::vector< float > _z_u
std::vector< float > _dir_y_v
std::vector< float > _trkhit_charge_v
std::vector< float > _allhit_width_u
Declaration of basic channel signal object.
std::vector< float > _dir_y_y
std::vector< float > _trkhit_charge_y
std::vector< float > _calohit_charge_u
std::vector< float > _y_y
float _backtracked_qtotal_y
Vector_t DirectionAtPoint(size_t i) const
float _backtracked_qtotal_u
std::vector< float > _allhit_width_y
std::vector< unsigned > _trkhit_channel_y
std::vector< unsigned > _sumhit_nhit_y
std::vector< float > _dedx_y
std::vector< unsigned > _dedx_channel_u
void setBranches(TTree *_tree)
set branches for TTree
std::vector< float > _sumhit_time_y
bool _backtracked_end_in_tpc
art::ServiceHandle< art::TFileService > tfs
std::vector< unsigned > _allhit_channel_y
std::vector< float > _y_u
void analyze(art::Event const &e) override
Analysis function.
std::vector< int > _areahit_multiplicity_u
std::vector< art::InputTag > fHitProducers
std::vector< float > _dir_x_y
float _backtracked_length_start_to_end
art::InputTag fCALOproducer
float _backtracked_start_V
TPCID_t TPC
Index of the TPC within its cryostat.
std::vector< int > _allhit_multiplicity_y
std::vector< unsigned > _backtracked_c_u
std::vector< unsigned > _dedx_channel_y
std::vector< float > _t_y
std::vector< Point_t > Intersection(const AABox_t &box, const HalfLine_t &line, bool back=false) const
Intersection between a HalfLine and an AABox.
Forward iterator browsing all geometry elements in the detector.
std::vector< float > _backtracked_de_c_u
std::vector< unsigned > _trkhit_wire_v
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
std::vector< float > _allhit_charge_v
std::vector< float > _backtracked_de_c_v
std::vector< float > _backtracked_dirz_c_u
std::vector< unsigned > _areahit_wire_u
float _backtracked_qtotal_v
void respondToOpenInputFile(const art::FileBlock &fb) override
float ContainedLength(const TVector3 &v0, const TVector3 &v1, const std::vector< geoalgo::AABox > &boxes)
float _backtracked_completeness
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
std::vector< int > _backtracked_nloc_c_v
std::vector< float > _calohit_width_v
physics associatedGroupsWithLeft p1
std::vector< float > _backtracked_dirx
std::vector< unsigned > _trkhit_wire_u
BEGIN_PROLOG could also be cout
std::vector< float > _backtracked_locz_c_y
std::vector< float > _trkhit_time_y
float _backtracked_sce_start_V
std::vector< float > _integrated_charge_y
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
std::vector< unsigned > _calohit_nhit_y
std::vector< float > _backtracked_locz_c_u
float numElectrons
number of electrons at the readout for this track ID and time
int fAssumedPdg
PDG of particle hypothesis assumed by algorithm, if applicable. Set to 0 by default.
art::InputTag fTRKproducer
std::vector< float > _x_u
std::vector< float > _backtracked_x
float _backtracked_start_U
std::vector< float > _backtracked_locx_c_u
std::vector< float > _allhit_time_v
art::InputTag fT0producer
float _backtracked_start_Y