92 <<
"Start position not set, returning " <<
std::endl;
98 <<
"Direction not set, returning " <<
std::endl;
102 TVector3 ShowerStartPosition = {-999, -999, -999};
105 TVector3 ShowerDirection = {-999, -999, -999};
114 const art::FindManyP<recob::Cluster>& fmc =
116 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
118 if (clusters.size() < 2) {
121 <<
"Not enough clusters: " << clusters.size() <<
std::endl;
126 const art::FindManyP<recob::Hit>& fmhc =
128 std::map<geo::PlaneID, std::vector<art::Ptr<recob::Hit>>> plane_clusters;
130 for (
auto const&
cluster : clusters) {
133 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(
cluster.key());
135 for (
auto hit : hits) {
138 plane_clusters[plane].push_back(
hit);
146 auto const clockData =
151 std::vector<art::Ptr<recob::Hit>> InitialTrackHits;
153 for (
auto const&
cluster : plane_clusters) {
156 std::vector<art::Ptr<recob::Hit>> hits =
cluster.second;
160 detProp, hits, ShowerStartPosition, ShowerDirection);
165 InitialTrackHits.insert(InitialTrackHits.end(), trackhits.begin(), trackhits.end());
173 auto const hitHandle = Event.getValidHandle<std::vector<recob::Hit>>(
fHitLabel);
176 const art::FindManyP<recob::SpacePoint>& fmsp =
180 std::vector<art::Ptr<recob::SpacePoint>> intitaltrack_sp;
181 for (
auto const&
hit : InitialTrackHits) {
182 std::vector<art::Ptr<recob::SpacePoint>> sps = fmsp.at(
hit.key());
183 for (
auto const sp : sps) {
184 intitaltrack_sp.push_back(sp);
The data type to uniquely identify a Plane.
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
Set of hits with a 2D structure.
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 > > &handle, const art::Event &evt, const art::InputTag &moduleTag)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Cluster finding and building.
key_type key() const noexcept
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool CheckElement(const std::string &Name) const
constexpr PlaneID const & asPlaneID() const
Conversion to PlaneID (for convenience of notation).
int GetElement(const std::string &Name, T &Element) const
Detector simulation of raw signals on wires.
2D representation of charge deposited in the TDC/wire plane
QTextStream & endl(QTextStream &s)
void OrderShowerHits(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> &hits, TVector3 const &ShowerDirection, TVector3 const &ShowerPosition) const