190 art::ServiceHandle<geo::Geometry const> geom;
192 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
evt);
198 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
199 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
200 if (geom->Cryostat(cstat).TPC(tpc).Nplanes() > 2) {
GT2PlaneDetector =
true; }
208 auto vcol = std::make_unique<std::vector<recob::Vertex>>();
209 auto epcol = std::make_unique<std::vector<recob::EndPoint2D>>();
210 auto assnep = std::make_unique<art::Assns<recob::EndPoint2D, recob::Hit>>();
211 auto assnsh = std::make_unique<art::Assns<recob::Vertex, recob::Shower>>();
212 auto assntr = std::make_unique<art::Assns<recob::Vertex, recob::Track>>();
213 auto assnh = std::make_unique<art::Assns<recob::Vertex, recob::Hit>>();
220 art::Handle<std::vector<recob::EndPoint2D>> ccrawlerFinderHandle;
222 std::vector<art::Ptr<recob::EndPoint2D>> ccrawlerEndPoints;
223 art::fill_ptr_vector(ccrawlerEndPoints, ccrawlerFinderHandle);
229 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get EndPoint2d's from Cluster Crawler";
236 art::Handle<std::vector<recob::EndPoint2D>> CornerFinderHandle;
238 std::vector<art::Ptr<recob::EndPoint2D>> cornerEndPoints;
239 art::fill_ptr_vector(cornerEndPoints, CornerFinderHandle);
245 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get EndPoint2d's from Corner Finder";
252 art::Handle<std::vector<recob::Cluster>> clusterListHandle;
259 art::PtrVector<recob::Cluster> clusters;
260 for (
unsigned int ii = 0; ii < clusterListHandle->size(); ++ii) {
261 art::Ptr<recob::Cluster> clusterHolder(clusterListHandle, ii);
262 clusters.push_back(clusterHolder);
272 mf::LogWarning(
"FeatureVertexFinder") <<
"Failed to get Cluster from default cluster module";
294 double tempxyz[3] = {
299 if (tempxyz[0] == 0 && tempxyz[1] == 0 && tempxyz[2] == 0) {
continue; }
301 vcol->push_back(the3Dvertex);
307 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
308 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
309 for (
size_t plane = 0; plane < geom->Cryostat(cstat).TPC(tpc).Nplanes(); ++plane) {
310 double temp2dXYZ[3] = {
316 if (temp2dXYZ[0] == 0 && temp2dXYZ[1] == 0 && temp2dXYZ[2] == 0) {
continue; }
321 double EndPoint2d_TimeTick =
detProp.ConvertXToTicks(temp2dXYZ[0], plane, tpc, cstat);
322 int EndPoint2d_Wire = 0;
323 int EndPoint2d_Channel = 0;
326 EndPoint2d_Wire = geom->NearestWire(temp2dXYZ, plane, tpc, cstat);
329 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
334 EndPoint2d_Channel = geom->NearestChannel(temp2dXYZ, plane, tpc, cstat);
337 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
343 geo::WireID wireID(cstat, tpc, plane, EndPoint2d_Wire);
373 double tempxyz[3] = {
378 if (bail > 0) {
continue; }
379 if (tempxyz[0] == 0 && tempxyz[1] == 0 && tempxyz[2] == 0) {
continue; }
383 vcol->push_back(the3Dvertex);
392 for (
size_t cstat = 0; cstat < geom->Ncryostats(); ++cstat) {
394 for (
size_t tpc = 0; tpc < geom->Cryostat(cstat).NTPC(); ++tpc) {
396 for (
size_t plane = 0; plane < geom->Cryostat(cstat).TPC(tpc).Nplanes(); ++plane) {
405 double EndPoint2d_TimeTick =
detProp.ConvertXToTicks(temp2dXYZ[0], plane, tpc, cstat);
406 int EndPoint2d_Wire = 0;
407 int EndPoint2d_Channel = 0;
410 EndPoint2d_Wire = geom->NearestWire(temp2dXYZ, plane, tpc, cstat);
413 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
418 EndPoint2d_Channel = geom->NearestChannel(temp2dXYZ, plane, tpc, cstat);
421 mf::LogWarning(
"FeatureVertexFinder") <<
"2dWire failed";
427 geo::WireID wireID(cstat, tpc, plane, EndPoint2d_Wire);
443 mf::LogVerbatim(
"Summary") << std::setfill(
'-') << std::setw(175) <<
"-" << std::setfill(
' ');
444 mf::LogVerbatim(
"Summary") <<
"FeatureVertexFinder Summary:";
445 for (
size_t i = 0; i < epcol->size(); ++i)
446 mf::LogVerbatim(
"Summary") << epcol->at(i);
447 for (
size_t i = 0; i < vcol->size(); ++i)
448 mf::LogVerbatim(
"Summary") << vcol->at(i);
450 evt.put(std::move(epcol));
451 evt.put(std::move(vcol));
452 evt.put(std::move(assnep));
453 evt.put(std::move(assntr));
454 evt.put(std::move(assnsh));
455 evt.put(std::move(assnh));
std::vector< double > Clu_Plane
void MergeAndSort3dVtxCandidate(std::vector< double > merge_vtxX, std::vector< double > merge_vtxY, std::vector< double > merge_vtxZ, std::vector< double > merge_vtxStgth)
std::vector< double > TwoDvtx_wire
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::vector< double > TwoDvtx_time
std::vector< double > Clu_EndPos_Wire
std::vector< double > candidate_y
std::vector< double > candidate_strength
std::vector< double > Clu_Length
std::vector< double > Clu_Yintercept
std::vector< double > Clu_EndPos_TimeTick
std::vector< double > MergeSort3dVtx_strength
std::vector< double > candidate_z
Definition of vertex object for LArSoft.
std::vector< double > Clu_StartPos_TimeTick
void Find3dVtxFrom2dClusterVtxCand(detinfo::DetectorPropertiesData const &detProp, std::vector< double > const &Wire_2dvtx, std::vector< double > const &Time_2dvtx, std::vector< double > const &Plane_2dvtx)
void Get3dVertexCandidates(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::EndPoint2D >> EndPoints, bool PlaneDet)
std::vector< double > Clu_StartPos_Wire
std::vector< double > MergeSort3dVtx_zpos
std::string fClusterModuleLabel
void Find2dClusterVertexCandidates(detinfo::DetectorPropertiesData const &detProp, art::PtrVector< recob::Cluster > RawClusters, art::FindManyP< recob::Hit > fmhit)
std::string fCornerFinderModuleLabel
std::vector< double > dtdwstart
std::vector< double > MergeSort3dVtx_ypos
std::vector< double > MergeSort3dVtx_xpos
std::vector< double > Clu_Slope
std::vector< double > TwoDvtx_plane
std::vector< double > dtdwstartError
std::vector< double > candidate_x
std::string fCCrawlerEndPoint2dModuleLabel
BEGIN_PROLOG could also be cout
std::vector< double > Clu_Yintercept2