LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
cluster::ClusterCrawler Class Reference
Inheritance diagram for cluster::ClusterCrawler:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 ClusterCrawler (fhicl::ParameterSet const &pset)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Member Functions

void produce (art::Event &evt) override
 

Private Attributes

hit::CCHitFinderAlg fCCHFAlg
 
ClusterCrawlerAlg fCCAlg
 
std::string fCalDataModuleLabel
 label of module producing input wires More...
 

Detailed Description

Definition at line 39 of file ClusterCrawler_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Constructor & Destructor Documentation

cluster::ClusterCrawler::ClusterCrawler ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 54 of file ClusterCrawler_module.cc.

References recob::HitAndAssociationsWriterBase::declare_products(), fCalDataModuleLabel, fCCAlg, fCCHFAlg, and art::ProductRegistryHelper::producesCollector().

55  : EDProducer{pset}
56  , fCCHFAlg(pset.get<fhicl::ParameterSet>("CCHitFinderAlg"))
57  , fCCAlg(pset.get<fhicl::ParameterSet>("ClusterCrawlerAlg"))
58  , fCalDataModuleLabel(pset.get<std::string>("CalDataModuleLabel"))
59  {
60  mf::LogWarning("ClusterCrawler")
61  << "\nClusterCrawler module has been deprecated and will be removed."
62  "\nIt is now replaced by HitFinder and LineCluster modules.";
63 
64  // let HitCollectionAssociator declare that we are going to produce
65  // hits and associations with wires and raw digits
66  // (with no particular product label)
68 
69  produces<std::vector<recob::Cluster>>();
70  produces<std::vector<recob::Vertex>>();
71  produces<art::Assns<recob::Cluster, recob::Hit>>();
72  produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
73  }
hit::CCHitFinderAlg fCCHFAlg
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
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.
Definition: HitCreator.cxx:248
ProducesCollector & producesCollector() noexcept
std::string fCalDataModuleLabel
label of module producing input wires
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

45  {
46  ProcessingFrame const frame{ScheduleID{}};
48  }
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

38  {
39  ProcessingFrame const frame{ScheduleID{}};
41  }
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::Modifier::fillProductDescriptions ( )
inherited

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void cluster::ClusterCrawler::produce ( art::Event evt)
overrideprivatevirtual

Implements art::EDProducer.

Definition at line 75 of file ClusterCrawler_module.cc.

References cluster::ClusterCrawlerAlg::ClusterStore::BeginAng, cluster::ClusterCrawlerAlg::ClusterStore::BeginChg, cluster::ClusterCrawlerAlg::ClusterStore::BeginTim, cluster::ClusterCrawlerAlg::ClusterStore::BeginVtx, cluster::ClusterCrawlerAlg::ClusterStore::BeginWir, cluster::ClusterCrawlerAlg::ClearResults(), util::CreateAssn(), util::CreateAssnD(), cluster::ClusterCrawlerAlg::ClusterStore::CTP, cluster::ClusterCrawlerAlg::DecodeCTP(), DEFINE_ART_MODULE, util::end(), cluster::ClusterCrawlerAlg::ClusterStore::EndAng, cluster::ClusterCrawlerAlg::ClusterStore::EndChg, cluster::ClusterCrawlerAlg::ClusterStore::EndTim, cluster::ClusterCrawlerAlg::ClusterStore::EndVtx, cluster::ClusterCrawlerAlg::ClusterStore::EndWir, fCalDataModuleLabel, fCCAlg, fCCHFAlg, cluster::ClusterCrawlerAlg::GetClusters(), cluster::ClusterCrawlerAlg::GetinClus(), art::ProductRetriever::getValidHandle(), cluster::ClusterCrawlerAlg::GetVertices(), cluster::ClusterCrawlerAlg::ClusterStore::ID, recob::Hit::Integral(), geo::PlaneID::Plane, art::errors::ProductRegistrationFailure, art::Event::put(), recob::HitCollectionAssociator::put_into(), hit::CCHitFinderAlg::RunCCHitFinder(), cluster::ClusterCrawlerAlg::RunCrawler(), recob::Cluster::Sentry, recob::Hit::SummedADC(), cluster::ClusterCrawlerAlg::ClusterStore::tclhits, recob::HitCollectionAssociator::use_hits(), recob::Hit::WireID(), hit::CCHitFinderAlg::YieldHits(), and cluster::ClusterCrawlerAlg::YieldHits().

76  {
77  // fetch the wires needed by CCHitFinder
78 
79  // make this accessible to ClusterCrawler_module
81  evt.getValidHandle<std::vector<recob::Wire>>(fCalDataModuleLabel);
82 
83  // find hits in all planes
84  fCCHFAlg.RunCCHitFinder(*wireVecHandle);
85 
86  // extract the result of the algorithm (it's moved)
87  std::vector<recob::Hit> FirstHits = fCCHFAlg.YieldHits();
88 
89  auto const clock_data =
91  auto const det_prop =
93 
94  // look for clusters in all planes
95  fCCAlg.RunCrawler(clock_data, det_prop, FirstHits);
96 
97  auto FinalHits = std::make_unique<std::vector<recob::Hit>>(fCCAlg.YieldHits());
98 
100 
101  // shcol contains the hit collection
102  // and its associations to wires and raw digits;
103  // we get the association to raw digits through wire associations
105  std::vector<recob::Cluster> sccol;
106  std::vector<recob::Vertex> sv3col;
107 
108  auto hc_assn = std::make_unique<art::Assns<recob::Cluster, recob::Hit>>();
109  auto cv_assn = std::make_unique<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
110 
111  std::vector<ClusterCrawlerAlg::ClusterStore> const& tcl = fCCAlg.GetClusters();
112 
113  std::vector<short> const& inClus = fCCAlg.GetinClus();
114 
115  // Consistency check
116  for (unsigned int icl = 0; icl < tcl.size(); ++icl) {
117  ClusterCrawlerAlg::ClusterStore const& clstr = tcl[icl];
118  if (clstr.ID < 0) continue;
119  geo::PlaneID planeID = ClusterCrawlerAlg::DecodeCTP(clstr.CTP);
120  unsigned short plane = planeID.Plane;
121  for (unsigned short ii = 0; ii < clstr.tclhits.size(); ++ii) {
122  unsigned int iht = clstr.tclhits[ii];
123  recob::Hit const& theHit = FinalHits->at(iht);
124  if (theHit.WireID().Plane != plane) {
125  std::cout << "CC: cluster-hit plane mis-match " << theHit.WireID().Plane << " " << plane
126  << " in cluster " << clstr.ID << " WT " << clstr.BeginWir << ":"
127  << (int)clstr.BeginTim << "\n";
128  return;
129  }
130  if (inClus[iht] != clstr.ID) {
131  std::cout << "CC: InClus mis-match " << inClus[iht] << " ID " << clstr.ID
132  << " in cluster " << icl << "\n";
133  return;
134  }
135  } // ii
136  } // icl
137 
138  // make 3D vertices
139  std::vector<ClusterCrawlerAlg::Vtx3Store> const& Vertices = fCCAlg.GetVertices();
140 
141  double xyz[3] = {0, 0, 0};
142  unsigned int vtxID = 0, end;
143  for (ClusterCrawlerAlg::Vtx3Store const& vtx3 : Vertices) {
144  // ignore incomplete vertices
145  if (vtx3.Ptr2D[0] < 0) continue;
146  if (vtx3.Ptr2D[1] < 0) continue;
147  if (vtx3.Ptr2D[2] < 0) continue;
148  ++vtxID;
149  xyz[0] = vtx3.X;
150  xyz[1] = vtx3.Y;
151  xyz[2] = vtx3.Z;
152  sv3col.emplace_back(xyz, vtxID);
153  } // 3D vertices
154  // convert Vertex vector to unique_ptrs
155  std::unique_ptr<std::vector<recob::Vertex>> v3col(
156  new std::vector<recob::Vertex>(std::move(sv3col)));
157 
158  // make the clusters and associations
159  float sumChg, sumADC;
160  unsigned int clsID = 0, nclhits;
161  for (unsigned int icl = 0; icl < tcl.size(); ++icl) {
162  ClusterCrawlerAlg::ClusterStore const& clstr = tcl[icl];
163  if (clstr.ID < 0) continue;
164  ++clsID;
165  sumChg = 0;
166  sumADC = 0;
167  geo::PlaneID planeID = ClusterCrawlerAlg::DecodeCTP(clstr.CTP);
168  unsigned short plane = planeID.Plane;
169  nclhits = clstr.tclhits.size();
170  std::vector<unsigned int> clsHitIndices;
171  // correct the hit indices to refer to the valid hits that were just added
172  for (unsigned int itt = 0; itt < nclhits; ++itt) {
173  unsigned int iht = clstr.tclhits[itt];
174  recob::Hit const& hit = FinalHits->at(iht);
175  sumChg += hit.Integral();
176  sumADC += hit.SummedADC();
177  } // itt
178  // get the wire, plane from a hit
179  unsigned int iht = clstr.tclhits[0];
180 
181  geo::View_t view = FinalHits->at(iht).View();
182  sccol.emplace_back((float)clstr.BeginWir, // Start wire
183  0, // sigma start wire
184  clstr.BeginTim, // start tick
185  0, // sigma start tick
186  clstr.BeginChg, // start charge
187  clstr.BeginAng, // start angle
188  0, // start opening angle (0 for line-like clusters)
189  (float)clstr.EndWir, // end wire
190  0, // sigma end wire
191  clstr.EndTim, // end tick
192  0, // sigma end tick
193  clstr.EndChg, // end charge
194  clstr.EndAng, // end angle
195  0, // end opening angle (0 for line-like clusters)
196  sumChg, // integral
197  0, // sigma integral
198  sumADC, // summed ADC
199  0, // sigma summed ADC
200  nclhits, // n hits
201  0, // wires over hits
202  0, // width (0 for line-like clusters)
203  clsID, // ID
204  view, // view
205  planeID, // plane
206  recob::Cluster::Sentry // sentry
207  );
208  // make the cluster - hit association
209  if (!util::CreateAssn(
210  evt, *hc_assn, sccol.size() - 1, clstr.tclhits.begin(), clstr.tclhits.end())) {
212  << "Failed to associate hit " << iht << " with cluster " << icl;
213  } // exception
214  // make the cluster - endpoint associations
215  if (clstr.BeginVtx >= 0) {
216  end = 0;
217  // See if this endpoint is associated with a 3D vertex
218  unsigned short vtxIndex = 0;
219  for (ClusterCrawlerAlg::Vtx3Store const& vtx3 : Vertices) {
220  // ignore incomplete vertices
221  if (vtx3.Ptr2D[0] < 0) continue;
222  if (vtx3.Ptr2D[1] < 0) continue;
223  if (vtx3.Ptr2D[2] < 0) continue;
224  if (vtx3.Ptr2D[plane] == clstr.BeginVtx) {
225  if (!util::CreateAssnD(evt, *cv_assn, clsID - 1, vtxIndex, end)) {
227  << "Failed to associate cluster " << icl << " with vertex";
228  } // exception
229  break;
230  } // vertex match
231  ++vtxIndex;
232  } // 3D vertices
233  } // clstr.BeginVtx >= 0
234  if (clstr.EndVtx >= 0) {
235  end = 1;
236  // See if this endpoint is associated with a 3D vertex
237  unsigned short vtxIndex = 0;
238  for (ClusterCrawlerAlg::Vtx3Store const& vtx3 : Vertices) {
239  // ignore incomplete vertices
240  if (vtx3.Ptr2D[0] < 0) continue;
241  if (vtx3.Ptr2D[1] < 0) continue;
242  if (vtx3.Ptr2D[2] < 0) continue;
243  if (vtx3.Ptr2D[plane] == clstr.EndVtx) {
244  if (!util::CreateAssnD(evt, *cv_assn, clsID - 1, vtxIndex, end)) {
246  << "Failed to associate cluster " << icl << " with endpoint";
247  } // exception
248  break;
249  } // vertex match
250  ++vtxIndex;
251  } // 3D vertices
252  } // clstr.BeginVtx >= 0
253  } // icl
254 
255  // convert cluster vector to unique_ptrs
256  std::unique_ptr<std::vector<recob::Cluster>> ccol(
257  new std::vector<recob::Cluster>(std::move(sccol)));
258 
259  shcol.use_hits(std::move(FinalHits));
260 
261  // clean up
263 
264  // move the hit collection and the associations into the event:
265  shcol.put_into(evt);
266  evt.put(std::move(ccol));
267  evt.put(std::move(hc_assn));
268  evt.put(std::move(v3col));
269  evt.put(std::move(cv_assn));
270 
271  } // produce
void RunCCHitFinder(std::vector< recob::Wire > const &Wires)
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.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
hit::CCHitFinderAlg fCCHFAlg
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
std::vector< ClusterStore > const & GetClusters() const
Returns a constant reference to the clusters found.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:244
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:280
static const SentryArgument_t Sentry
An instance of the sentry object.
Definition: Cluster.h:174
static geo::PlaneID DecodeCTP(CTP_t CTP)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
A class handling a collection of hits and its associations.
Definition: HitCreator.h:650
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:481
Detector simulation of raw signals on wires.
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
Definition: Exception.h:66
std::string fCalDataModuleLabel
label of module producing input wires
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::vector< Vtx3Store > const & GetVertices() const
Returns a constant reference to the 3D vertices found.
void RunCrawler(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, std::vector< recob::Hit > const &srchits)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:240
std::vector< short > const & GetinClus() const
Returns (and loses) the collection of reconstructed hits.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
Namespace collecting geometry-related classes utilities.
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)

Member Data Documentation

std::string cluster::ClusterCrawler::fCalDataModuleLabel
private

label of module producing input wires

Definition at line 49 of file ClusterCrawler_module.cc.

Referenced by ClusterCrawler(), and produce().

ClusterCrawlerAlg cluster::ClusterCrawler::fCCAlg
private

Definition at line 48 of file ClusterCrawler_module.cc.

Referenced by ClusterCrawler(), and produce().

hit::CCHitFinderAlg cluster::ClusterCrawler::fCCHFAlg
private

Definition at line 47 of file ClusterCrawler_module.cc.

Referenced by ClusterCrawler(), and produce().


The documentation for this class was generated from the following file: