14 #include "art_root_io/TFileService.h" 66 void GetHits(
const std::vector<recob::Hit>& inputHits,
70 const std::vector<recob::Slice>& inputSlices,
73 std::vector<int>& slcIDs);
139 if (pset.has_key(
"SliceModuleLabel"))
142 if (pset.has_key(
"MaxSliceHits"))
fMaxSliceHits = pset.get<
unsigned int>(
"MaxSliceHits");
144 if (pset.has_key(
"SpacePointModuleLabel"))
147 if (pset.has_key(
"SpacePointHitAssnLabel"))
152 if (pset.has_key(
"SaveAll2DVertices")) fSaveAll2DVertices = pset.get<
bool>(
"SaveAll2DVertices");
160 produces<std::vector<recob::Cluster>>();
161 produces<std::vector<recob::Vertex>>();
162 produces<std::vector<recob::EndPoint2D>>();
163 produces<std::vector<recob::Seed>>();
164 produces<std::vector<recob::Shower>>();
165 produces<art::Assns<recob::Cluster, recob::Hit>>();
166 produces<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>();
167 produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
168 produces<art::Assns<recob::Shower, recob::Hit>>();
170 produces<std::vector<recob::PFParticle>>();
171 produces<art::Assns<recob::PFParticle, recob::Cluster>>();
172 produces<art::Assns<recob::PFParticle, recob::Shower>>();
173 produces<art::Assns<recob::PFParticle, recob::Vertex>>();
174 produces<art::Assns<recob::PFParticle, recob::Seed>>();
176 produces<art::Assns<recob::Slice, recob::Cluster>>();
177 produces<art::Assns<recob::Slice, recob::PFParticle>>();
178 produces<art::Assns<recob::Slice, recob::Hit>>();
180 produces<std::vector<anab::CosmicTag>>();
181 produces<art::Assns<recob::PFParticle, anab::CosmicTag>>();
184 produces<art::Assns<recob::SpacePoint, recob::Hit>>();
192 showertree = tfs->make<TTree>(
"showervarstree",
"showerVarsTree");
201 if (fAlgBitNames.size() != fAlgModCount.size())
return;
203 myprt <<
"TrajCluster algorithm counts\n";
204 unsigned short icol = 0;
205 for (
unsigned short ib = 0; ib < fAlgModCount.size(); ++ib) {
208 << fAlgModCount[ib] <<
" ";
230 std::vector<art::Ptr<recob::Slice>>
slices;
231 std::vector<int> slcIDs;
232 unsigned int nInputHits = 0;
239 nInputHits = (*inputHits).size();
257 throw cet::exception(
"TrajClusterModule") <<
"Failed to get a inputSlices";
264 throw cet::exception(
"TrajClusterModule") <<
"Failed to get a handle to SpacePoints\n";
265 tca::evt.
sptHits.resize((*InputSpts).size(), {{UINT_MAX, UINT_MAX, UINT_MAX}});
270 if (!hitsFromSpt.isValid())
272 <<
"Failed to get a handle to SpacePoint -> Hit assns\n";
274 auto& firstHit = hitsFromSpt.at(0)[0];
275 if (firstHit.id() != inputHits.id())
277 <<
"The SpacePoint -> Hit assn doesn't reference the input hit collection\n";
278 tca::evt.
sptHits.resize((*InputSpts).size(), {{UINT_MAX, UINT_MAX, UINT_MAX}});
279 for (
unsigned int isp = 0; isp < (*InputSpts).size(); ++isp) {
280 auto&
hits = hitsFromSpt.at(isp);
281 for (
unsigned short iht = 0; iht <
hits.size(); ++iht) {
282 unsigned short plane =
hits[iht]->WireID().Plane;
288 if (nInputHits > 0) {
289 auto const clockData =
295 if (tpcgeo.DriftDistance() < 25.0)
continue;
298 auto const& tpcid = tpcgeo.ID();
299 std::vector<std::vector<unsigned int>> sltpcHits;
300 if (inputSlices.isValid()) {
303 GetHits(tpcid, *inputSlices, hitFromSlc, sltpcHits, slcIDs);
308 GetHits(*inputHits, tpcid, sltpcHits);
312 if (sltpcHits.empty())
continue;
313 for (
unsigned short isl = 0; isl < sltpcHits.size(); ++isl) {
314 auto& tpcHits = sltpcHits[isl];
315 if (tpcHits.empty())
continue;
319 std::vector<HitLoc> sortVec(tpcHits.size());
320 for (
unsigned int indx = 0; indx < tpcHits.size(); ++indx) {
321 auto&
hit = (*inputHits)[tpcHits[indx]];
322 sortVec[indx].index = indx;
324 sortVec[indx].wire =
hit.WireID().Wire;
325 sortVec[indx].tick =
hit.StartTick();
326 sortVec[indx].localIndex =
hit.LocalIndex();
328 std::sort(sortVec.begin(), sortVec.end(),
SortHits);
330 for (
unsigned int ii = 0; ii < tpcHits.size(); ++ii)
331 tpcHits[ii] = tmp[sortVec[ii].index];
338 for (
unsigned short indx = 0; indx < tpcHits.size(); ++indx) {
339 auto&
hit = (*inputHits)[tpcHits[indx]];
344 std::cout <<
"Debug hit " << tpcHits[indx] <<
" found in slice ID " << slcIDs[isl];
345 std::cout <<
" RMS " <<
hit.RMS();
346 std::cout <<
" Multiplicity " <<
hit.Multiplicity();
347 std::cout <<
" GoodnessOfFit " <<
hit.GoodnessOfFit();
363 std::vector<recob::Hit> hitCol;
364 std::vector<recob::Cluster> clsCol;
365 std::vector<recob::PFParticle> pfpCol;
366 std::vector<recob::Vertex> vx3Col;
367 std::vector<recob::EndPoint2D> vx2Col;
368 std::vector<recob::Seed> sedCol;
369 std::vector<recob::Shower> shwCol;
370 std::vector<anab::CosmicTag> ctCol;
372 std::vector<unsigned int> newIndex(nInputHits, UINT_MAX);
376 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> cls_hit_assn(
379 std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>> cls_vx2_assn(
381 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>> cls_vx3_assn(
384 std::unique_ptr<art::Assns<recob::Shower, recob::Hit>> shwr_hit_assn(
387 std::unique_ptr<art::Assns<recob::PFParticle, recob::Cluster>> pfp_cls_assn(
389 std::unique_ptr<art::Assns<recob::PFParticle, recob::Shower>> pfp_shwr_assn(
391 std::unique_ptr<art::Assns<recob::PFParticle, recob::Vertex>> pfp_vx3_assn(
393 std::unique_ptr<art::Assns<recob::PFParticle, anab::CosmicTag>> pfp_cos_assn(
395 std::unique_ptr<art::Assns<recob::PFParticle, recob::Seed>> pfp_sed_assn(
398 std::unique_ptr<art::Assns<recob::Slice, recob::Cluster>> slc_cls_assn(
400 std::unique_ptr<art::Assns<recob::Slice, recob::PFParticle>> slc_pfp_assn(
402 std::unique_ptr<art::Assns<recob::Slice, recob::Hit>> slc_hit_assn(
405 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> sp_hit_assn(
411 unsigned short slIndx;
413 unsigned short vxColIndx;
415 std::vector<slcVxStruct> vx2StrList;
417 std::vector<slcVxStruct> vx3StrList;
419 if (nInputHits > 0) {
422 unsigned int hitColBeginIndex = 0;
423 for (
unsigned short isl = 0; isl < nSlices; ++isl) {
424 unsigned short slcIndex = 0;
425 if (!slices.empty()) {
426 for (slcIndex = 0; slcIndex < slices.size(); ++slcIndex)
427 if (slices[slcIndex]->ID() == slcIDs[isl])
break;
428 if (slcIndex == slices.size())
continue;
432 if (!slc.isValid)
continue;
434 for (
auto& vx2 : slc.vtxs) {
435 if (vx2.ID <= 0)
continue;
438 unsigned int vtxID = vx2.UID;
439 unsigned int wire = std::nearbyint(vx2.Pos[0]);
454 tmp.vxColIndx = vx2Col.size() - 1;
455 vx2StrList.push_back(tmp);
459 for (
auto& vx3 : slc.vtx3s) {
460 if (vx3.ID <= 0)
continue;
462 if (vx3.Wire >= 0)
continue;
463 unsigned int vtxID = vx3.UID;
468 vx3Col.emplace_back(xyz, vtxID);
473 tmp.vxColIndx = vx3Col.size() - 1;
474 vx3StrList.push_back(tmp);
477 for (
auto& tj : slc.tjs) {
479 hitColBeginIndex = hitCol.size();
480 for (
unsigned short ipt = tj.EndPt[0]; ipt <= tj.EndPt[1]; ++ipt) {
481 auto& tp = tj.Pts[ipt];
482 if (tp.Chg <= 0)
continue;
484 std::vector<unsigned int> tpHits;
485 for (
unsigned short ii = 0; ii < tp.Hits.size(); ++ii) {
486 if (!tp.UseHit[ii])
continue;
487 if (tp.Hits[ii] > slc.slHits.size() - 1) {
break; }
488 unsigned int allHitsIndex = slc.slHits[tp.Hits[ii]].allHitsIndex;
489 if (allHitsIndex > nInputHits - 1) {
break; }
490 tpHits.push_back(allHitsIndex);
491 if (newIndex[allHitsIndex] != UINT_MAX) {
492 std::cout <<
"Bad Slice " << isl <<
" tp.Hits " << tp.Hits[ii] <<
" allHitsIndex " 494 std::cout <<
" old newIndex " << newIndex[allHitsIndex];
495 auto& oldhit = (*inputHits)[allHitsIndex];
496 std::cout <<
" old " << oldhit.WireID().Plane <<
":" << oldhit.WireID().Wire <<
":" 497 << (int)oldhit.PeakTime();
498 auto& newhit = hitCol[newIndex[allHitsIndex]];
499 std::cout <<
" new " << newhit.WireID().Plane <<
":" << newhit.WireID().Wire <<
":" 500 << (int)newhit.PeakTime();
501 std::cout <<
" hitCol size " << hitCol.size();
512 for (
auto iht : tpHits) {
513 hitCol.push_back((*inputHits)[iht]);
514 newIndex[iht] = hitCol.size() - 1;
521 if (hitCol.empty())
continue;
525 for (
unsigned int indx = hitColBeginIndex; indx < hitCol.size(); ++indx) {
526 auto&
hit = hitCol[indx];
527 sumChg +=
hit.Integral();
528 sumADC +=
hit.ROISummedADC();
529 if (!slices.empty() &&
532 <<
"Failed to associate hits with Slice";
535 geo::View_t view = hitCol[hitColBeginIndex].View();
536 auto& firstTP = tj.Pts[tj.EndPt[0]];
537 auto& lastTP = tj.Pts[tj.EndPt[1]];
542 unsigned int nclhits = hitCol.size() - hitColBeginIndex + 1;
543 clsCol.emplace_back(firstTP.Pos[0],
570 evt, clsCol, hitCol, *cls_hit_assn, hitColBeginIndex, hitCol.size())) {
572 <<
"Failed to associate hits with cluster ID " << tj.UID;
575 if (!slices.empty()) {
578 <<
"Failed to associate slice with PFParticle";
582 for (
unsigned short end = 0;
end < 2; ++
end) {
583 if (tj.VtxID[
end] <= 0)
continue;
584 for (
auto& vx2str : vx2StrList) {
585 if (vx2str.slIndx != isl)
continue;
586 if (vx2str.ID != tj.VtxID[
end])
continue;
588 evt, *cls_vx2_assn, clsCol.size() - 1, vx2str.vxColIndx,
end)) {
590 <<
"Failed to associate cluster " << tj.UID <<
" with EndPoint2D";
592 auto& vx2 = slc.vtxs[tj.VtxID[
end] - 1];
594 for (
auto vx3str : vx3StrList) {
595 if (vx3str.slIndx != isl)
continue;
596 if (vx3str.ID != vx2.Vx3ID)
continue;
598 evt, *cls_vx3_assn, clsCol.size() - 1, vx3str.vxColIndx,
end)) {
600 <<
"Failed to associate cluster " << tj.UID <<
" with Vertex";
611 for (
auto& ss3 : slc.showers) {
612 if (ss3.ID <= 0)
continue;
620 TVector3
dir = {ss3.Dir[0], ss3.Dir[1], ss3.Dir[2]};
622 TVector3 dirErr = {ss3.DirErr[0], ss3.DirErr[1], ss3.DirErr[2]};
624 TVector3 pos = {ss3.Start[0], ss3.Start[1], ss3.Start[2]};
626 TVector3 posErr = {ss3.StartErr[0], ss3.StartErr[1], ss3.StartErr[2]};
632 shwCol.push_back(shower);
634 std::vector<unsigned int> shwHits(ss3.Hits.size());
635 for (
unsigned int iht = 0; iht < ss3.Hits.size(); ++iht)
636 shwHits[iht] = newIndex[ss3.Hits[iht]];
638 evt, *shwr_hit_assn, shwCol.size() - 1, shwHits.begin(), shwHits.end())) {
640 <<
"Failed to associate hits with Shower";
646 for (
unsigned short isl = 0; isl < nSlices; ++isl) {
647 unsigned short slcIndex = 0;
648 if (!slices.empty()) {
649 for (slcIndex = 0; slcIndex < slices.size(); ++slcIndex)
650 if (slices[slcIndex]->ID() == slcIDs[isl])
break;
651 if (slcIndex == slices.size())
continue;
655 if (!slc.isValid)
continue;
657 for (
size_t ipfp = 0; ipfp < slc.pfps.size(); ++ipfp) {
658 auto& pfp = slc.
pfps[ipfp];
659 if (pfp.ID <= 0)
continue;
661 size_t self = pfpCol.size();
662 size_t offset =
self - ipfp;
663 size_t parentIndex = UINT_MAX;
664 if (pfp.ParentUID > 0) parentIndex = pfp.ParentUID + offset - 1;
665 std::vector<size_t> dtrIndices(pfp.DtrUIDs.size());
666 for (
unsigned short idtr = 0; idtr < pfp.DtrUIDs.size(); ++idtr)
667 dtrIndices[idtr] = pfp.DtrUIDs[idtr] + offset - 1;
668 pfpCol.emplace_back(pfp.PDGCode,
self, parentIndex, dtrIndices);
671 double sp[] = {pos[0], pos[1], pos[2]};
672 double sd[] = {
dir[0],
dir[1], dir[2]};
673 double spe[] = {0., 0., 0.};
674 double sde[] = {0., 0., 0.};
675 sedCol.emplace_back(sp, sd, spe, sde);
677 std::vector<unsigned int> clsIndices;
678 for (
auto tuid : pfp.TjUIDs) {
679 unsigned int clsIndex = 0;
680 for (clsIndex = 0; clsIndex < clsCol.size(); ++clsIndex)
681 if (
abs(clsCol[clsIndex].ID()) == tuid)
break;
682 if (clsIndex == clsCol.size())
continue;
683 clsIndices.push_back(clsIndex);
686 evt, *pfp_cls_assn, pfpCol.size() - 1, clsIndices.begin(), clsIndices.end())) {
688 <<
"Failed to associate clusters with PFParticle";
691 if (pfp.Vx3ID[0] > 0) {
692 for (
auto vx3str : vx3StrList) {
693 if (vx3str.slIndx != isl)
continue;
694 if (vx3str.ID != pfp.Vx3ID[0])
continue;
695 std::vector<unsigned short> indx(1, vx3str.vxColIndx);
697 evt, *pfp_vx3_assn, pfpCol.size() - 1, indx.begin(), indx.end())) {
699 <<
"Failed to associate PFParticle " << pfp.UID <<
" with Vertex";
705 if (!sedCol.empty()) {
712 pfpCol.size() - 1)) {
714 <<
"Failed to associate seed with PFParticle";
718 if (!slices.empty()) {
721 <<
"Failed to associate slice with PFParticle";
725 if (pfp.PDGCode == 1111) {
726 std::vector<unsigned short> shwIndex(1, 0);
727 for (
auto& ss3 : slc.showers) {
728 if (ss3.ID <= 0)
continue;
729 if (ss3.PFPIndex == ipfp)
break;
732 if (shwIndex[0] < shwCol.size()) {
734 evt, *pfp_shwr_assn, pfpCol.size() - 1, shwIndex.begin(), shwIndex.end())) {
736 <<
"Failed to associate shower with PFParticle";
742 std::vector<float> tempPt1, tempPt2;
743 tempPt1.push_back(-999);
744 tempPt1.push_back(-999);
745 tempPt1.push_back(-999);
746 tempPt2.push_back(-999);
747 tempPt2.push_back(-999);
748 tempPt2.push_back(-999);
751 evt, pfpCol, ctCol, *pfp_cos_assn, ctCol.size() - 1, ctCol.size())) {
753 <<
"Failed to associate CosmicTag with PFParticle";
764 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
765 if (newIndex[allHitsIndex] != UINT_MAX)
continue;
766 std::vector<unsigned int> oneHit(1, allHitsIndex);
770 for (
size_t isl = 0; isl < slices.size(); ++isl) {
771 auto& hit_in_slc = hitFromSlc.at(isl);
772 for (
auto&
hit : hit_in_slc) {
773 if (
hit.key() != allHitsIndex)
continue;
778 <<
"Failed to associate old Hit with Slice";
788 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
789 if (newIndex[allHitsIndex] != UINT_MAX)
continue;
790 std::vector<unsigned int> oneHit(1, allHitsIndex);
797 if (nInputHits > 0) {
802 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
803 if (newIndex[allHitsIndex] == UINT_MAX)
805 auto& sp_from_hit = spFromHit.at(allHitsIndex);
806 for (
auto& sp : sp_from_hit) {
808 if (!
util::CreateAssn(evt, hitCol, sp, *sp_hit_assn, newIndex[allHitsIndex])) {
810 <<
"Failed to associate new Hit with SpacePoint";
821 auto hcol = std::make_unique<std::vector<recob::Hit>>(move(hitCol));
822 auto ccol = std::make_unique<std::vector<recob::Cluster>>(move(clsCol));
823 auto v2col = std::make_unique<std::vector<recob::EndPoint2D>>(move(vx2Col));
824 auto v3col = std::make_unique<std::vector<recob::Vertex>>(move(vx3Col));
825 auto pcol = std::make_unique<std::vector<recob::PFParticle>>(move(pfpCol));
826 auto sdcol = std::make_unique<std::vector<recob::Seed>>(move(sedCol));
827 auto scol = std::make_unique<std::vector<recob::Shower>>(move(shwCol));
828 auto ctgcol = std::make_unique<std::vector<anab::CosmicTag>>(move(ctCol));
841 evt.
put(std::move(ccol));
842 evt.
put(std::move(cls_hit_assn));
843 evt.
put(std::move(v2col));
844 evt.
put(std::move(v3col));
845 evt.
put(std::move(scol));
846 evt.
put(std::move(sdcol));
847 evt.
put(std::move(shwr_hit_assn));
848 evt.
put(std::move(cls_vx2_assn));
849 evt.
put(std::move(cls_vx3_assn));
850 evt.
put(std::move(pcol));
851 evt.
put(std::move(pfp_cls_assn));
852 evt.
put(std::move(pfp_shwr_assn));
853 evt.
put(std::move(pfp_vx3_assn));
854 evt.
put(std::move(pfp_sed_assn));
855 evt.
put(std::move(slc_cls_assn));
856 evt.
put(std::move(slc_pfp_assn));
857 evt.
put(std::move(slc_hit_assn));
858 evt.
put(std::move(ctgcol));
859 evt.
put(std::move(pfp_cos_assn));
860 evt.
put(std::move(sp_hit_assn));
870 unsigned int tpc = tpcid.
TPC;
872 for (
size_t iht = 0; iht < inputHits.size(); ++iht) {
873 auto&
hit = inputHits[iht];
874 if (
hit.WireID().TPC == tpc) tpcHits[0].push_back(iht);
880 const std::vector<recob::Slice>& inputSlices,
883 std::vector<int>& slcIDs)
888 if (!hitFromSlc.isValid())
return;
890 unsigned int tpc = tpcid.
TPC;
892 for (
size_t isl = 0; isl < inputSlices.size(); ++isl) {
893 auto& hit_in_slc = hitFromSlc.at(isl);
894 if (hit_in_slc.size() < 3)
continue;
895 int slcID = inputSlices[isl].ID();
896 for (
auto&
hit : hit_in_slc) {
897 if (
hit->WireID().TPC != tpc)
continue;
898 unsigned short indx = 0;
899 for (indx = 0; indx < slcIDs.size(); ++indx)
900 if (slcID == slcIDs[indx])
break;
901 if (indx == slcIDs.size()) {
902 slcIDs.push_back(slcID);
903 tpcHits.resize(tpcHits.size() + 1);
905 tpcHits[indx].push_back(
hit.key());
void PrintAll(detinfo::DetectorPropertiesData const &detProp, std::string someText)
void ClearResults()
Deletes all the results.
bool CreateAssnD(art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t &&data)
Creates a single one-to-one association with associated data.
void set_start_point_err(const TVector3 &xyz_e)
void set_dedx_err(const std::vector< double > &q)
void set_direction_err(const TVector3 &dir_e)
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Utilities related to art service access.
const geo::WireReadoutGeom * wireReadoutGeom
tca::TrajClusterAlg fTCAlg
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
void set_total_energy(const std::vector< double > &q)
void RunTrajClusterAlg(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< unsigned int > &hitsInSlice, int sliceID)
art::InputTag fSliceModuleLabel
constexpr auto abs(T v)
Returns the absolute value of the argument.
CryostatID_t Cryostat
Index of cryostat.
void set_total_MIPenergy_err(const std::vector< double > &q)
Point3_t PosAtEnd(const PFPStruct &pfp, unsigned short end)
Cluster finding and building.
std::vector< std::string > const & GetAlgBitNames() const
bool SortHits(HitLoc const &h1, HitLoc const &h2)
std::vector< std::array< unsigned int, 3 > > sptHits
SpacePoint -> Hits assns by plane.
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
void set_total_energy_err(const std::vector< double > &q)
static const SentryArgument_t Sentry
An instance of the sentry object.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
void set_id(const int id)
bool SetInputHits(std::vector< recob::Hit > const &inputHits, unsigned int run, unsigned int event)
void DefineShTree(TTree *t)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
unsigned int Hit
set to the hit index in evt.allHits if a Plane:Wire:Tick match is found
Helper functions to create a hit.
View_t View() const
Which coordinate does this plane measure.
art::InputTag fHitModuleLabel
void set_direction(const TVector3 &dir)
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
int Wire
Select hit Wire for debugging.
#define DEFINE_ART_MODULE(klass)
float unitsPerTick
scale factor from Tick to WSE equivalent units
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void put_into(art::Event &)
Moves the data into the event.
unsigned short GetSlicesSize() const
void set_length(const double &l)
void set_open_angle(const double &a)
A class handling a collection of hits and its associations.
EventNumber_t event() const
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
Declaration of cluster object.
void set_total_best_plane(const int q)
Definition of data types for geometry description.
void set_total_MIPenergy(const std::vector< double > &q)
std::vector< TCSlice > slices
Detector simulation of raw signals on wires.
TCSlice const & GetSlice(unsigned short sliceIndex) const
art::InputTag fSpacePointModuleLabel
ProducesCollector & producesCollector() noexcept
void GetHits(const std::vector< recob::Hit > &inputHits, const geo::TPCID &tpcid, std::vector< std::vector< unsigned int >> &tpcHits)
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
int Tick
Select hit PeakTime for debugging (< 0 for vertex finding)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
geo::PlaneID DecodeCTP(CTP_t CTP)
Produces clusters by the TrajCluster algorithm.
void produce(art::Event &evt) override
CTP_t EncodeCTP(unsigned int cryo, unsigned int tpc, unsigned int plane)
unsigned int fMaxSliceHits
void MergeTPHits(std::vector< unsigned int > &tpHits, std::vector< recob::Hit > &newHitCol, std::vector< unsigned int > &newHitAssns) const
void SetSourceHits(std::vector< recob::Hit > const &srcHits)
std::vector< PFPStruct > pfps
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
void set_start_point(const TVector3 &xyz)
TPCID_t TPC
Index of the TPC within its cryostat.
void SetInputSpts(std::vector< recob::SpacePoint > const &sptHandle)
Vector3_t DirAtEnd(const PFPStruct &pfp, unsigned short end)
short recoSlice
only reconstruct the slice with ID (0 = all)
Interface to geometry for wire readouts .
cet::coded_exception< error, detail::translate > exception
art::InputTag fSpacePointHitAssnLabel
void set_dedx(const std::vector< double > &q)
std::vector< unsigned int > const & GetAlgModCount() const
TrajCluster(fhicl::ParameterSet const &pset)