16 #include "art_root_io/TFileService.h" 67 void GetHits(
const std::vector<recob::Hit>& inputHits,
71 const std::vector<recob::Slice>& inputSlices,
74 std::vector<int>& slcIDs);
140 if (pset.has_key(
"SliceModuleLabel"))
143 if (pset.has_key(
"MaxSliceHits"))
fMaxSliceHits = pset.get<
unsigned int>(
"MaxSliceHits");
145 if (pset.has_key(
"SpacePointModuleLabel"))
148 if (pset.has_key(
"SpacePointHitAssnLabel"))
153 if (pset.has_key(
"SaveAll2DVertices")) fSaveAll2DVertices = pset.get<
bool>(
"SaveAll2DVertices");
161 produces<std::vector<recob::Cluster>>();
162 produces<std::vector<recob::Vertex>>();
163 produces<std::vector<recob::EndPoint2D>>();
164 produces<std::vector<recob::Seed>>();
165 produces<std::vector<recob::Shower>>();
166 produces<art::Assns<recob::Cluster, recob::Hit>>();
167 produces<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>();
168 produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
169 produces<art::Assns<recob::Shower, recob::Hit>>();
171 produces<std::vector<recob::PFParticle>>();
172 produces<art::Assns<recob::PFParticle, recob::Cluster>>();
173 produces<art::Assns<recob::PFParticle, recob::Shower>>();
174 produces<art::Assns<recob::PFParticle, recob::Vertex>>();
175 produces<art::Assns<recob::PFParticle, recob::Seed>>();
177 produces<art::Assns<recob::Slice, recob::Cluster>>();
178 produces<art::Assns<recob::Slice, recob::PFParticle>>();
179 produces<art::Assns<recob::Slice, recob::Hit>>();
181 produces<std::vector<anab::CosmicTag>>();
182 produces<art::Assns<recob::PFParticle, anab::CosmicTag>>();
185 produces<art::Assns<recob::SpacePoint, recob::Hit>>();
193 showertree = tfs->make<TTree>(
"showervarstree",
"showerVarsTree");
202 if (fAlgBitNames.size() != fAlgModCount.size())
return;
204 myprt <<
"TrajCluster algorithm counts\n";
205 unsigned short icol = 0;
206 for (
unsigned short ib = 0; ib < fAlgModCount.size(); ++ib) {
209 << fAlgModCount[ib] <<
" ";
231 std::vector<art::Ptr<recob::Slice>>
slices;
232 std::vector<int> slcIDs;
233 unsigned int nInputHits = 0;
240 nInputHits = (*inputHits).size();
258 throw cet::exception(
"TrajClusterModule") <<
"Failed to get a inputSlices";
265 throw cet::exception(
"TrajClusterModule") <<
"Failed to get a handle to SpacePoints\n";
266 tca::evt.
sptHits.resize((*InputSpts).size(), {{UINT_MAX, UINT_MAX, UINT_MAX}});
271 if (!hitsFromSpt.isValid())
273 <<
"Failed to get a handle to SpacePoint -> Hit assns\n";
275 auto& firstHit = hitsFromSpt.at(0)[0];
276 if (firstHit.id() != inputHits.id())
278 <<
"The SpacePoint -> Hit assn doesn't reference the input hit collection\n";
279 tca::evt.
sptHits.resize((*InputSpts).size(), {{UINT_MAX, UINT_MAX, UINT_MAX}});
280 for (
unsigned int isp = 0; isp < (*InputSpts).size(); ++isp) {
281 auto&
hits = hitsFromSpt.at(isp);
282 for (
unsigned short iht = 0; iht <
hits.size(); ++iht) {
283 unsigned short plane =
hits[iht]->WireID().Plane;
289 if (nInputHits > 0) {
290 auto const clockData =
294 auto const* geom = lar::providerFrom<geo::Geometry>();
295 for (
const auto& tpcid : geom->Iterate<
geo::TPCID>()) {
297 if (geom->TPC(tpcid).DriftDistance() < 25.0)
continue;
300 std::vector<std::vector<unsigned int>> sltpcHits;
301 if (inputSlices.isValid()) {
304 GetHits(tpcid, *inputSlices, hitFromSlc, sltpcHits, slcIDs);
309 GetHits(*inputHits, tpcid, sltpcHits);
313 if (sltpcHits.empty())
continue;
314 for (
unsigned short isl = 0; isl < sltpcHits.size(); ++isl) {
315 auto& tpcHits = sltpcHits[isl];
316 if (tpcHits.empty())
continue;
320 std::vector<HitLoc> sortVec(tpcHits.size());
321 for (
unsigned int indx = 0; indx < tpcHits.size(); ++indx) {
322 auto&
hit = (*inputHits)[tpcHits[indx]];
323 sortVec[indx].index = indx;
325 sortVec[indx].wire =
hit.WireID().Wire;
326 sortVec[indx].tick =
hit.StartTick();
327 sortVec[indx].localIndex =
hit.LocalIndex();
329 std::sort(sortVec.begin(), sortVec.end(),
SortHits);
331 for (
unsigned int ii = 0; ii < tpcHits.size(); ++ii)
332 tpcHits[ii] = tmp[sortVec[ii].index];
339 for (
unsigned short indx = 0; indx < tpcHits.size(); ++indx) {
340 auto&
hit = (*inputHits)[tpcHits[indx]];
345 std::cout <<
"Debug hit " << tpcHits[indx] <<
" found in slice ID " << slcIDs[isl];
346 std::cout <<
" RMS " <<
hit.RMS();
347 std::cout <<
" Multiplicity " <<
hit.Multiplicity();
348 std::cout <<
" GoodnessOfFit " <<
hit.GoodnessOfFit();
364 std::vector<recob::Hit> hitCol;
365 std::vector<recob::Cluster> clsCol;
366 std::vector<recob::PFParticle> pfpCol;
367 std::vector<recob::Vertex> vx3Col;
368 std::vector<recob::EndPoint2D> vx2Col;
369 std::vector<recob::Seed> sedCol;
370 std::vector<recob::Shower> shwCol;
371 std::vector<anab::CosmicTag> ctCol;
373 std::vector<unsigned int> newIndex(nInputHits, UINT_MAX);
377 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> cls_hit_assn(
380 std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>> cls_vx2_assn(
382 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>> cls_vx3_assn(
385 std::unique_ptr<art::Assns<recob::Shower, recob::Hit>> shwr_hit_assn(
388 std::unique_ptr<art::Assns<recob::PFParticle, recob::Cluster>> pfp_cls_assn(
390 std::unique_ptr<art::Assns<recob::PFParticle, recob::Shower>> pfp_shwr_assn(
392 std::unique_ptr<art::Assns<recob::PFParticle, recob::Vertex>> pfp_vx3_assn(
394 std::unique_ptr<art::Assns<recob::PFParticle, anab::CosmicTag>> pfp_cos_assn(
396 std::unique_ptr<art::Assns<recob::PFParticle, recob::Seed>> pfp_sed_assn(
399 std::unique_ptr<art::Assns<recob::Slice, recob::Cluster>> slc_cls_assn(
401 std::unique_ptr<art::Assns<recob::Slice, recob::PFParticle>> slc_pfp_assn(
403 std::unique_ptr<art::Assns<recob::Slice, recob::Hit>> slc_hit_assn(
406 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> sp_hit_assn(
412 unsigned short slIndx;
414 unsigned short vxColIndx;
416 std::vector<slcVxStruct> vx2StrList;
418 std::vector<slcVxStruct> vx3StrList;
420 if (nInputHits > 0) {
423 unsigned int hitColBeginIndex = 0;
424 for (
unsigned short isl = 0; isl < nSlices; ++isl) {
425 unsigned short slcIndex = 0;
426 if (!slices.empty()) {
427 for (slcIndex = 0; slcIndex < slices.size(); ++slcIndex)
428 if (slices[slcIndex]->ID() == slcIDs[isl])
break;
429 if (slcIndex == slices.size())
continue;
433 if (!slc.isValid)
continue;
435 for (
auto& vx2 : slc.vtxs) {
436 if (vx2.ID <= 0)
continue;
439 unsigned int vtxID = vx2.UID;
440 unsigned int wire = std::nearbyint(vx2.Pos[0]);
455 tmp.vxColIndx = vx2Col.size() - 1;
456 vx2StrList.push_back(tmp);
460 for (
auto& vx3 : slc.vtx3s) {
461 if (vx3.ID <= 0)
continue;
463 if (vx3.Wire >= 0)
continue;
464 unsigned int vtxID = vx3.UID;
469 vx3Col.emplace_back(xyz, vtxID);
474 tmp.vxColIndx = vx3Col.size() - 1;
475 vx3StrList.push_back(tmp);
478 for (
auto& tj : slc.tjs) {
480 hitColBeginIndex = hitCol.size();
481 for (
unsigned short ipt = tj.EndPt[0]; ipt <= tj.EndPt[1]; ++ipt) {
482 auto& tp = tj.Pts[ipt];
483 if (tp.Chg <= 0)
continue;
485 std::vector<unsigned int> tpHits;
486 for (
unsigned short ii = 0; ii < tp.Hits.size(); ++ii) {
487 if (!tp.UseHit[ii])
continue;
488 if (tp.Hits[ii] > slc.slHits.size() - 1) {
break; }
489 unsigned int allHitsIndex = slc.slHits[tp.Hits[ii]].allHitsIndex;
490 if (allHitsIndex > nInputHits - 1) {
break; }
491 tpHits.push_back(allHitsIndex);
492 if (newIndex[allHitsIndex] != UINT_MAX) {
493 std::cout <<
"Bad Slice " << isl <<
" tp.Hits " << tp.Hits[ii] <<
" allHitsIndex " 495 std::cout <<
" old newIndex " << newIndex[allHitsIndex];
496 auto& oldhit = (*inputHits)[allHitsIndex];
497 std::cout <<
" old " << oldhit.WireID().Plane <<
":" << oldhit.WireID().Wire <<
":" 498 << (int)oldhit.PeakTime();
499 auto& newhit = hitCol[newIndex[allHitsIndex]];
500 std::cout <<
" new " << newhit.WireID().Plane <<
":" << newhit.WireID().Wire <<
":" 501 << (int)newhit.PeakTime();
502 std::cout <<
" hitCol size " << hitCol.size();
513 for (
auto iht : tpHits) {
514 hitCol.push_back((*inputHits)[iht]);
515 newIndex[iht] = hitCol.size() - 1;
522 if (hitCol.empty())
continue;
526 for (
unsigned int indx = hitColBeginIndex; indx < hitCol.size(); ++indx) {
527 auto&
hit = hitCol[indx];
528 sumChg +=
hit.Integral();
529 sumADC +=
hit.SummedADC();
530 if (!slices.empty() &&
533 <<
"Failed to associate hits with Slice";
536 geo::View_t view = hitCol[hitColBeginIndex].View();
537 auto& firstTP = tj.Pts[tj.EndPt[0]];
538 auto& lastTP = tj.Pts[tj.EndPt[1]];
543 unsigned int nclhits = hitCol.size() - hitColBeginIndex + 1;
544 clsCol.emplace_back(firstTP.Pos[0],
571 evt, clsCol, hitCol, *cls_hit_assn, hitColBeginIndex, hitCol.size())) {
573 <<
"Failed to associate hits with cluster ID " << tj.UID;
576 if (!slices.empty()) {
579 <<
"Failed to associate slice with PFParticle";
583 for (
unsigned short end = 0;
end < 2; ++
end) {
584 if (tj.VtxID[
end] <= 0)
continue;
585 for (
auto& vx2str : vx2StrList) {
586 if (vx2str.slIndx != isl)
continue;
587 if (vx2str.ID != tj.VtxID[
end])
continue;
589 evt, *cls_vx2_assn, clsCol.size() - 1, vx2str.vxColIndx,
end)) {
591 <<
"Failed to associate cluster " << tj.UID <<
" with EndPoint2D";
593 auto& vx2 = slc.vtxs[tj.VtxID[
end] - 1];
595 for (
auto vx3str : vx3StrList) {
596 if (vx3str.slIndx != isl)
continue;
597 if (vx3str.ID != vx2.Vx3ID)
continue;
599 evt, *cls_vx3_assn, clsCol.size() - 1, vx3str.vxColIndx,
end)) {
601 <<
"Failed to associate cluster " << tj.UID <<
" with Vertex";
612 for (
auto& ss3 : slc.showers) {
613 if (ss3.ID <= 0)
continue;
621 TVector3
dir = {ss3.Dir[0], ss3.Dir[1], ss3.Dir[2]};
623 TVector3 dirErr = {ss3.DirErr[0], ss3.DirErr[1], ss3.DirErr[2]};
625 TVector3 pos = {ss3.Start[0], ss3.Start[1], ss3.Start[2]};
627 TVector3 posErr = {ss3.StartErr[0], ss3.StartErr[1], ss3.StartErr[2]};
633 shwCol.push_back(shower);
635 std::vector<unsigned int> shwHits(ss3.Hits.size());
636 for (
unsigned int iht = 0; iht < ss3.Hits.size(); ++iht)
637 shwHits[iht] = newIndex[ss3.Hits[iht]];
639 evt, *shwr_hit_assn, shwCol.size() - 1, shwHits.begin(), shwHits.end())) {
641 <<
"Failed to associate hits with Shower";
647 for (
unsigned short isl = 0; isl < nSlices; ++isl) {
648 unsigned short slcIndex = 0;
649 if (!slices.empty()) {
650 for (slcIndex = 0; slcIndex < slices.size(); ++slcIndex)
651 if (slices[slcIndex]->ID() == slcIDs[isl])
break;
652 if (slcIndex == slices.size())
continue;
656 if (!slc.isValid)
continue;
658 for (
size_t ipfp = 0; ipfp < slc.pfps.size(); ++ipfp) {
659 auto& pfp = slc.
pfps[ipfp];
660 if (pfp.ID <= 0)
continue;
662 size_t self = pfpCol.size();
663 size_t offset =
self - ipfp;
664 size_t parentIndex = UINT_MAX;
665 if (pfp.ParentUID > 0) parentIndex = pfp.ParentUID + offset - 1;
666 std::vector<size_t> dtrIndices(pfp.DtrUIDs.size());
667 for (
unsigned short idtr = 0; idtr < pfp.DtrUIDs.size(); ++idtr)
668 dtrIndices[idtr] = pfp.DtrUIDs[idtr] + offset - 1;
669 pfpCol.emplace_back(pfp.PDGCode,
self, parentIndex, dtrIndices);
672 double sp[] = {pos[0], pos[1], pos[2]};
673 double sd[] = {
dir[0],
dir[1], dir[2]};
674 double spe[] = {0., 0., 0.};
675 double sde[] = {0., 0., 0.};
676 sedCol.emplace_back(sp, sd, spe, sde);
678 std::vector<unsigned int> clsIndices;
679 for (
auto tuid : pfp.TjUIDs) {
680 unsigned int clsIndex = 0;
681 for (clsIndex = 0; clsIndex < clsCol.size(); ++clsIndex)
682 if (
abs(clsCol[clsIndex].ID()) == tuid)
break;
683 if (clsIndex == clsCol.size())
continue;
684 clsIndices.push_back(clsIndex);
687 evt, *pfp_cls_assn, pfpCol.size() - 1, clsIndices.begin(), clsIndices.end())) {
689 <<
"Failed to associate clusters with PFParticle";
692 if (pfp.Vx3ID[0] > 0) {
693 for (
auto vx3str : vx3StrList) {
694 if (vx3str.slIndx != isl)
continue;
695 if (vx3str.ID != pfp.Vx3ID[0])
continue;
696 std::vector<unsigned short> indx(1, vx3str.vxColIndx);
698 evt, *pfp_vx3_assn, pfpCol.size() - 1, indx.begin(), indx.end())) {
700 <<
"Failed to associate PFParticle " << pfp.UID <<
" with Vertex";
706 if (!sedCol.empty()) {
713 pfpCol.size() - 1)) {
715 <<
"Failed to associate seed with PFParticle";
719 if (!slices.empty()) {
722 <<
"Failed to associate slice with PFParticle";
726 if (pfp.PDGCode == 1111) {
727 std::vector<unsigned short> shwIndex(1, 0);
728 for (
auto& ss3 : slc.showers) {
729 if (ss3.ID <= 0)
continue;
730 if (ss3.PFPIndex == ipfp)
break;
733 if (shwIndex[0] < shwCol.size()) {
735 evt, *pfp_shwr_assn, pfpCol.size() - 1, shwIndex.begin(), shwIndex.end())) {
737 <<
"Failed to associate shower with PFParticle";
743 std::vector<float> tempPt1, tempPt2;
744 tempPt1.push_back(-999);
745 tempPt1.push_back(-999);
746 tempPt1.push_back(-999);
747 tempPt2.push_back(-999);
748 tempPt2.push_back(-999);
749 tempPt2.push_back(-999);
752 evt, pfpCol, ctCol, *pfp_cos_assn, ctCol.size() - 1, ctCol.size())) {
754 <<
"Failed to associate CosmicTag with PFParticle";
765 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
766 if (newIndex[allHitsIndex] != UINT_MAX)
continue;
767 std::vector<unsigned int> oneHit(1, allHitsIndex);
771 for (
size_t isl = 0; isl < slices.size(); ++isl) {
772 auto& hit_in_slc = hitFromSlc.at(isl);
773 for (
auto&
hit : hit_in_slc) {
774 if (
hit.key() != allHitsIndex)
continue;
779 <<
"Failed to associate old Hit with Slice";
789 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
790 if (newIndex[allHitsIndex] != UINT_MAX)
continue;
791 std::vector<unsigned int> oneHit(1, allHitsIndex);
798 if (nInputHits > 0) {
803 for (
unsigned int allHitsIndex = 0; allHitsIndex < nInputHits; ++allHitsIndex) {
804 if (newIndex[allHitsIndex] == UINT_MAX)
806 auto& sp_from_hit = spFromHit.at(allHitsIndex);
807 for (
auto& sp : sp_from_hit) {
809 if (!
util::CreateAssn(evt, hitCol, sp, *sp_hit_assn, newIndex[allHitsIndex])) {
811 <<
"Failed to associate new Hit with SpacePoint";
822 std::unique_ptr<std::vector<recob::Hit>> hcol(
new std::vector<recob::Hit>(std::move(hitCol)));
823 std::unique_ptr<std::vector<recob::Cluster>> ccol(
824 new std::vector<recob::Cluster>(std::move(clsCol)));
825 std::unique_ptr<std::vector<recob::EndPoint2D>> v2col(
826 new std::vector<recob::EndPoint2D>(std::move(vx2Col)));
827 std::unique_ptr<std::vector<recob::Vertex>> v3col(
828 new std::vector<recob::Vertex>(std::move(vx3Col)));
829 std::unique_ptr<std::vector<recob::PFParticle>> pcol(
830 new std::vector<recob::PFParticle>(std::move(pfpCol)));
831 std::unique_ptr<std::vector<recob::Seed>> sdcol(
832 new std::vector<recob::Seed>(std::move(sedCol)));
833 std::unique_ptr<std::vector<recob::Shower>> scol(
834 new std::vector<recob::Shower>(std::move(shwCol)));
835 std::unique_ptr<std::vector<anab::CosmicTag>> ctgcol(
836 new std::vector<anab::CosmicTag>(std::move(ctCol)));
849 evt.
put(std::move(ccol));
850 evt.
put(std::move(cls_hit_assn));
851 evt.
put(std::move(v2col));
852 evt.
put(std::move(v3col));
853 evt.
put(std::move(scol));
854 evt.
put(std::move(sdcol));
855 evt.
put(std::move(shwr_hit_assn));
856 evt.
put(std::move(cls_vx2_assn));
857 evt.
put(std::move(cls_vx3_assn));
858 evt.
put(std::move(pcol));
859 evt.
put(std::move(pfp_cls_assn));
860 evt.
put(std::move(pfp_shwr_assn));
861 evt.
put(std::move(pfp_vx3_assn));
862 evt.
put(std::move(pfp_sed_assn));
863 evt.
put(std::move(slc_cls_assn));
864 evt.
put(std::move(slc_pfp_assn));
865 evt.
put(std::move(slc_hit_assn));
866 evt.
put(std::move(ctgcol));
867 evt.
put(std::move(pfp_cos_assn));
868 evt.
put(std::move(sp_hit_assn));
878 unsigned int tpc = tpcid.
TPC;
880 for (
size_t iht = 0; iht < inputHits.size(); ++iht) {
881 auto&
hit = inputHits[iht];
882 if (
hit.WireID().TPC == tpc) tpcHits[0].push_back(iht);
888 const std::vector<recob::Slice>& inputSlices,
891 std::vector<int>& slcIDs)
896 if (!hitFromSlc.isValid())
return;
898 unsigned int tpc = tpcid.
TPC;
900 for (
size_t isl = 0; isl < inputSlices.size(); ++isl) {
901 auto& hit_in_slc = hitFromSlc.at(isl);
902 if (hit_in_slc.size() < 3)
continue;
903 int slcID = inputSlices[isl].ID();
904 for (
auto&
hit : hit_in_slc) {
905 if (
hit->WireID().TPC != tpc)
continue;
906 unsigned short indx = 0;
907 for (indx = 0; indx < slcIDs.size(); ++indx)
908 if (slcID == slcIDs[indx])
break;
909 if (indx == slcIDs.size()) {
910 slcIDs.push_back(slcID);
911 tpcHits.resize(tpcHits.size() + 1);
913 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.
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.
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.
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
const geo::GeometryCore * geom
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)
View_t View(PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
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
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)
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)