LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
cluster::LineCluster Class Reference

Produces clusters by ClusterCrawler algorithm. More...

Inheritance diagram for cluster::LineCluster:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 LineCluster (fhicl::ParameterSet const &pset)
 
virtual ~LineCluster ()=default
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void produce (art::Event &evt) override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::unique_ptr< ClusterCrawlerAlgfCCAlg
 
art::InputTag fHitFinderLabel
 label of module producing input hits More...
 
bool fDoWireAssns
 
bool fDoRawDigitAssns
 

Detailed Description

Produces clusters by ClusterCrawler algorithm.

Configuration parameters

  • HitFinderModuleLabel (InputTag, mandatory): label of the hits to be used as input (usually the label of the producing module is enough)
  • ClusterCrawlerAlg (parameter set, mandatory): full configuration for ClusterCrawlerAlg algorithm

Definition at line 41 of file LineCluster_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 90 of file LineCluster_module.cc.

References recob::HitAndAssociationsWriterBase::declare_products(), fDoRawDigitAssns, fDoWireAssns, and reconfigure().

90  {
91  reconfigure(pset);
92 
93  // let HitCollectionAssociator declare that we are going to produce
94  // hits and associations with wires and raw digits
95  // (with no particular product label)
97 
98  produces< std::vector<recob::Cluster> >();
99  produces< std::vector<recob::Vertex> >();
100  produces< std::vector<recob::EndPoint2D> >();
101  produces< art::Assns<recob::Cluster, recob::Hit> >();
102  produces< art::Assns<recob::Cluster, recob::Vertex, unsigned short> >();
103  produces< art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short> >();
104  } // LineCluster::LineCluster()
void reconfigure(fhicl::ParameterSet const &pset)
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.h:1117
virtual cluster::LineCluster::~LineCluster ( )
virtualdefault

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDProducer::currentContext ( ) const
protectedinherited

Definition at line 120 of file EDProducer.cc.

References art::EDProducer::current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void cluster::LineCluster::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 124 of file LineCluster_module.cc.

References cluster::ClusterCrawlerAlg::ClusterStore::BeginAng, cluster::ClusterCrawlerAlg::ClusterStore::BeginChg, cluster::ClusterCrawlerAlg::ClusterStore::BeginTim, cluster::ClusterCrawlerAlg::ClusterStore::BeginVtx, cluster::ClusterCrawlerAlg::ClusterStore::BeginWir, util::CreateAssn(), util::CreateAssnD(), geo::CryostatID::Cryostat, cluster::ClusterCrawlerAlg::ClusterStore::CTP, cluster::ClusterCrawlerAlg::DecodeCTP(), DEFINE_ART_MODULE, evd::details::end(), cluster::ClusterCrawlerAlg::ClusterStore::EndAng, cluster::ClusterCrawlerAlg::ClusterStore::EndChg, cluster::ClusterCrawlerAlg::ClusterStore::EndTim, cluster::ClusterCrawlerAlg::ClusterStore::EndVtx, cluster::ClusterCrawlerAlg::ClusterStore::EndWir, fCCAlg, fDoRawDigitAssns, fDoWireAssns, fHitFinderLabel, art::DataViewImpl::getValidHandle(), cluster::ClusterCrawlerAlg::ClusterStore::ID, recob::Hit::Integral(), geo::PlaneID::Plane, art::errors::ProductRegistrationFailure, art::Event::put(), recob::Cluster::Sentry, recob::Hit::SummedADC(), cluster::ClusterCrawlerAlg::ClusterStore::tclhits, and geo::TPCID::TPC.

125  {
126  // fetch the wires needed by CCHitFinder
127 
128  // make this accessible to ClusterCrawler_module
130  = evt.getValidHandle<std::vector<recob::Hit>>(fHitFinderLabel);
131 
132  // look for clusters in all planes
133  fCCAlg->RunCrawler(*hitVecHandle);
134 
135  std::unique_ptr<std::vector<recob::Hit>> FinalHits
136  (new std::vector<recob::Hit>(std::move(fCCAlg->YieldHits())));
137 
138  // shcol contains the hit collection
139  // and its associations to wires and raw digits;
140  // we get the association to raw digits through wire associations
142  std::vector<recob::Cluster> sccol;
143  std::vector<recob::Vertex> sv3col;
144  std::vector<recob::EndPoint2D> sv2col;
145 
146  std::unique_ptr<art::Assns<recob::Cluster, recob::Hit> >
148  std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>
150  std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>
152 
153  std::vector<ClusterCrawlerAlg::ClusterStore> const& Clusters = fCCAlg->GetClusters();
154 
155 
156 // Consistency check
157 /*
158  std::vector<short> const& inClus = fCCAlg->GetinClus();
159  for(unsigned int icl = 0; icl < Clusters.size(); ++icl) {
160  ClusterCrawlerAlg::ClusterStore const& clstr = Clusters[icl];
161  if(clstr.ID < 0) continue;
162  geo::PlaneID planeID = ClusterCrawlerAlg::DecodeCTP(clstr.CTP);
163  unsigned short plane = planeID.Plane;
164  for(unsigned short ii = 0; ii < clstr.tclhits.size(); ++ii) {
165  unsigned int iht = clstr.tclhits[ii];
166  recob::Hit const& theHit = FinalHits->at(iht);
167  if(theHit.WireID().Plane != plane) {
168  mf::LogError("LineCluster")<<"Cluster-hit plane mis-match "<<theHit.WireID().Plane<<" "<<plane
169  <<" in cluster "<<clstr.ID<<" WT "<<clstr.BeginWir<<":"<<(int)clstr.BeginTim<<" cluster CTP "<<clstr.CTP;
170  return;
171  }
172  if(inClus[iht] != clstr.ID) {
173  mf::LogError("LineCluster") << "InClus mis-match " << inClus[iht]
174  << " ID " << clstr.ID << " in cluster ID " << clstr.ID<<" cluster ProcCode "<<clstr.ProcCode;;
175  return;
176  }
177  } // ii
178  } // icl
179 */
180  // make EndPoints (aka 2D vertices)
181  std::vector<ClusterCrawlerAlg::VtxStore> const& EndPts = fCCAlg->GetEndPoints();
182  std::vector<unsigned int> indxToIndx(EndPts.size());
184  unsigned short vtxID = 0, end, wire, ivx;
185  for(ivx = 0; ivx < EndPts.size(); ++ivx) {
186  if(EndPts[ivx].NClusters == 0) continue;
187  indxToIndx[ivx] = vtxID;
188  ++vtxID;
189 // std::cout<<"EndPt "<<ivx<<" vtxID "<<vtxID<<"\n";
190  wire = (0.5 + EndPts[ivx].Wire);
191  geo::PlaneID plID = ClusterCrawlerAlg::DecodeCTP(EndPts[ivx].CTP);
192  geo::WireID wID = geo::WireID(plID.Cryostat, plID.TPC, plID.Plane, wire);
193  geo::View_t view = geom->View(wID);
194  sv2col.emplace_back((double)EndPts[ivx].Time, // Time
195  wID, // WireID
196  0, // strength - not relevant
197  vtxID, // ID
198  view, // View
199  0); // total charge - not relevant
200  } // iv
201  // convert 2D Vertex vector to unique_ptrs
202  std::unique_ptr<std::vector<recob::EndPoint2D> > v2col(new std::vector<recob::EndPoint2D>(std::move(sv2col)));
203 
204  // make 3D vertices
205  std::vector<ClusterCrawlerAlg::Vtx3Store> const& Vertices = fCCAlg->GetVertices();
206  double xyz[3] = {0, 0, 0};
207  vtxID = 0;
208  for(ClusterCrawlerAlg::Vtx3Store const& vtx3: Vertices) {
209  // ignore incomplete vertices
210  if(vtx3.Ptr2D[0] < 0) continue;
211  if(vtx3.Ptr2D[1] < 0) continue;
212  if(vtx3.Ptr2D[2] < 0) continue;
213  ++vtxID;
214  xyz[0] = vtx3.X;
215  xyz[1] = vtx3.Y;
216  xyz[2] = vtx3.Z;
217  sv3col.emplace_back(xyz, vtxID);
218  } // 3D vertices
219  // convert Vertex vector to unique_ptrs
220  std::unique_ptr<std::vector<recob::Vertex> > v3col(new std::vector<recob::Vertex>(std::move(sv3col)));
221 
222  // make the clusters and associations
223  float sumChg, sumADC;
224  unsigned int clsID = 0, nclhits;
225  for(unsigned int icl = 0; icl < Clusters.size(); ++icl) {
226  ClusterCrawlerAlg::ClusterStore const& clstr = Clusters[icl];
227  if(clstr.ID < 0) continue;
228  ++clsID;
229  sumChg = 0;
230  sumADC = 0;
231  geo::PlaneID planeID = ClusterCrawlerAlg::DecodeCTP(clstr.CTP);
232  unsigned short plane = planeID.Plane;
233  nclhits = clstr.tclhits.size();
234  std::vector<unsigned int> clsHitIndices;
235  // correct the hit indices to refer to the valid hits that were just added
236  for(unsigned int itt = 0; itt < nclhits; ++itt) {
237  unsigned int iht = clstr.tclhits[itt];
238  recob::Hit const& hit = FinalHits->at(iht);
239  sumChg += hit.Integral();
240  sumADC += hit.SummedADC();
241  } // itt
242  // get the wire, plane from a hit
243  unsigned int iht = clstr.tclhits[0];
244 
245  geo::View_t view = FinalHits->at(iht).View();
246  sccol.emplace_back(
247  (float)clstr.BeginWir, // Start wire
248  0, // sigma start wire
249  clstr.BeginTim, // start tick
250  0, // sigma start tick
251  clstr.BeginChg, // start charge
252  clstr.BeginAng, // start angle
253  0, // start opening angle (0 for line-like clusters)
254  (float)clstr.EndWir, // end wire
255  0, // sigma end wire
256  clstr.EndTim, // end tick
257  0, // sigma end tick
258  clstr.EndChg, // end charge
259  clstr.EndAng, // end angle
260  0, // end opening angle (0 for line-like clusters)
261  sumChg, // integral
262  0, // sigma integral
263  sumADC, // summed ADC
264  0, // sigma summed ADC
265  nclhits, // n hits
266  0, // wires over hits
267  0, // width (0 for line-like clusters)
268  clsID, // ID
269  view, // view
270  planeID, // plane
271  recob::Cluster::Sentry // sentry
272  );
273  // make the cluster - hit association
274  if(!util::CreateAssn(
275  *this, evt, *hc_assn, sccol.size()-1, clstr.tclhits.begin(), clstr.tclhits.end())
276  )
277  {
279  <<"Failed to associate hit "<<iht<<" with cluster "<<icl;
280  } // exception
281  // make the cluster - EndPoint2D and Vertex associations
282  if(clstr.BeginVtx >= 0) {
283  end = 0;
284 // std::cout<<clstr.ID<<" clsID "<<clsID<<" Begin vtx "<<clstr.BeginVtx<<" vtxID "<<indxToIndx[clstr.BeginVtx]<<"\n";
285  if(!util::CreateAssnD(*this, evt, *cep_assn, clsID - 1, indxToIndx[clstr.BeginVtx], end))
286  {
287  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate cluster "<<clsID<<" with EndPoint2D "<<clstr.BeginVtx;
288  } // exception
289  // See if this endpoint is associated with a 3D vertex
290  unsigned short vtxIndex = 0;
291  for(ClusterCrawlerAlg::Vtx3Store const& vtx3: Vertices) {
292  // ignore incomplete vertices
293  if(vtx3.Ptr2D[0] < 0) continue;
294  if(vtx3.Ptr2D[1] < 0) continue;
295  if(vtx3.Ptr2D[2] < 0) continue;
296  if(vtx3.Ptr2D[plane] == clstr.BeginVtx) {
297  if(!util::CreateAssnD(*this, evt, *cv_assn, clsID - 1, vtxIndex, end))
298  {
300  <<"Failed to associate cluster "<<icl<<" with vertex";
301  } // exception
302  break;
303  } // vertex match
304  ++vtxIndex;
305  } // 3D vertices
306  } // clstr.BeginVtx >= 0
307  if(clstr.EndVtx >= 0) {
308  end = 1;
309 // std::cout<<clstr.ID<<" clsID "<<clsID<<" End vtx "<<clstr.EndVtx<<" vtxID "<<indxToIndx[clstr.EndVtx]<<"\n";
310  if(!util::CreateAssnD(*this, evt, *cep_assn, clsID - 1, indxToIndx[clstr.EndVtx], end))
311  {
312  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate cluster "<<clsID<<" with EndPoint2D "<<clstr.BeginVtx;
313  } // exception
314  // See if this endpoint is associated with a 3D vertex
315  unsigned short vtxIndex = 0;
316  for(ClusterCrawlerAlg::Vtx3Store const& vtx3: Vertices) {
317  // ignore incomplete vertices
318  if(vtx3.Ptr2D[0] < 0) continue;
319  if(vtx3.Ptr2D[1] < 0) continue;
320  if(vtx3.Ptr2D[2] < 0) continue;
321  if(vtx3.Ptr2D[plane] == clstr.EndVtx) {
322  if(!util::CreateAssnD(*this, evt, *cv_assn, clsID - 1, vtxIndex, end))
323  {
325  <<"Failed to associate cluster "<<icl<<" with endpoint";
326  } // exception
327  break;
328  } // vertex match
329  ++vtxIndex;
330  } // 3D vertices
331  } // clstr.BeginVtx >= 0
332  } // icl
333 
334  // convert cluster vector to unique_ptrs
335  std::unique_ptr<std::vector<recob::Cluster> > ccol(new std::vector<recob::Cluster>(std::move(sccol)));
336 
337  shcol.use_hits(std::move(FinalHits));
338 
339  // clean up
340  fCCAlg->ClearResults();
341 
342  // move the hit collection and the associations into the event:
343  shcol.put_into(evt);
344  evt.put(std::move(ccol));
345  evt.put(std::move(hc_assn));
346  evt.put(std::move(v2col));
347  evt.put(std::move(v3col));
348  evt.put(std::move(cv_assn));
349  evt.put(std::move(cep_assn));
350 
351  } // LineCluster::produce()
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
static const SentryArgument_t Sentry
An instance of the sentry object.
Definition: Cluster.h:182
static geo::PlaneID DecodeCTP(CTP_t CTP)
std::unique_ptr< ClusterCrawlerAlg > fCCAlg
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool CreateAssnD(PRODUCER const &prod, 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.
art::InputTag fHitFinderLabel
label of module producing input hits
A class handling a collection of hits and its associations.
Definition: HitCreator.h:865
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
Detector simulation of raw signals on wires.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:224
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
void cluster::LineCluster::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 108 of file LineCluster_module.cc.

References fCCAlg, fDoRawDigitAssns, fDoWireAssns, fHitFinderLabel, and fhicl::ParameterSet::get().

Referenced by LineCluster().

109  {
110  fHitFinderLabel = pset.get<art::InputTag>("HitFinderModuleLabel");
111  fDoWireAssns = pset.get<bool>("DoWireAssns",true);
112  fDoRawDigitAssns = pset.get<bool>("DoRawDigitAssns",false);
113 
114  // this trick avoids double configuration on construction
115  if (fCCAlg)
116  fCCAlg->reconfigure(pset.get< fhicl::ParameterSet >("ClusterCrawlerAlg"));
117  else {
118  fCCAlg.reset(new ClusterCrawlerAlg
119  (pset.get< fhicl::ParameterSet >("ClusterCrawlerAlg")));
120  }
121  } // LineCluster::reconfigure()
std::unique_ptr< ClusterCrawlerAlg > fCCAlg
art::InputTag fHitFinderLabel
label of module producing input hits
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139

Member Data Documentation

std::unique_ptr<ClusterCrawlerAlg> cluster::LineCluster::fCCAlg
private

Definition at line 51 of file LineCluster_module.cc.

Referenced by produce(), and reconfigure().

bool cluster::LineCluster::fDoRawDigitAssns
private

Definition at line 56 of file LineCluster_module.cc.

Referenced by LineCluster(), produce(), and reconfigure().

bool cluster::LineCluster::fDoWireAssns
private

Definition at line 55 of file LineCluster_module.cc.

Referenced by LineCluster(), produce(), and reconfigure().

art::InputTag cluster::LineCluster::fHitFinderLabel
private

label of module producing input hits

Definition at line 53 of file LineCluster_module.cc.

Referenced by produce(), and reconfigure().


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