LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
cluster::SimpleClusterMerger Class Reference
Inheritance diagram for cluster::SimpleClusterMerger:
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

 SimpleClusterMerger (fhicl::ParameterSet const &p)
 
virtual ~SimpleClusterMerger ()
 
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

::cmtool::CMergeHelper fCMerge
 ClusterMergeHelper. More...
 
std::string fClusterModuleLabel
 Input cluster data product producer name label. More...
 
::util::GeometryUtilities fGeoU
 GeometryUtilities instance. More...
 
::cmtool::CBAlgoArray fMergeAlg
 Example merging algorithm: algorithm array container. More...
 
::cmtool::CBAlgoShortestDist fDistAlg
 Merging algorithm 1. More...
 
::cmtool::CBAlgoAngleCompat fAngleAlg
 Merging algorithm 2. More...
 
::cmtool::CBAlgoTrackSeparate fProhibitAlg
 Example prohibit algorithm. More...
 

Detailed Description

Definition at line 36 of file SimpleClusterMerger_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::SimpleClusterMerger::SimpleClusterMerger ( fhicl::ParameterSet const &  p)
explicit

Definition at line 83 of file SimpleClusterMerger_module.cc.

References cmtool::CBAlgoArray::AddAlgo(), cmtool::CMergeManager::AddMergeAlgo(), cmtool::CMergeManager::AddSeparateAlgo(), cmtool::CMManagerBase::DebugMode(), fAngleAlg, fClusterModuleLabel, fCMerge, fDistAlg, fMergeAlg, fProhibitAlg, fhicl::ParameterSet::get(), cmtool::CMergeHelper::GetManager(), cmtool::CMManagerBase::kPerIteration, cmtool::CMManagerBase::MergeTillConverge(), cmtool::CBAlgoAngleCompat::SetAllow180Ambig(), cmtool::CBAlgoAngleCompat::SetAngleCut(), cmtool::CBAlgoTrackSeparate::SetDebug(), cmtool::CBAlgoTrackSeparate::SetMaxOpeningAngle(), cmtool::CBAlgoTrackSeparate::SetMinAngleDiff(), cmtool::CBAlgoShortestDist::SetMinHits(), cmtool::CBAlgoAngleCompat::SetMinHits(), cmtool::CBAlgoTrackSeparate::SetMinLength(), cmtool::CBAlgoTrackSeparate::SetMinNumHits(), cmtool::CBAlgoShortestDist::SetSquaredDistanceCut(), cmtool::CBAlgoTrackSeparate::SetVerbose(), and cmtool::CMAlgoBase::SetVerbose().

84  {
85  // Declare output data products
86  produces< std::vector<recob::Cluster> >();
87  produces< art::Assns<recob::Cluster, recob::Hit> >();
88 
89  // Fill fcl parameter
90  fClusterModuleLabel = p.get<std::string>("InputClusterLabel");
91 
92  //--- Configure Merging Algorithm ---//
93  /*
94  This is where we should pass fcl parameters to configure various algorithms
95  we defined as class member. Here, for simplicity, I don't pass any configuration
96  parameters but you should in your custom merging module.
97  */
98 
99  // Configure angle algorithm
100  fAngleAlg.SetVerbose(false); // no verbous mode... annoying
101  fAngleAlg.SetMinHits(10); // Set minimum # hits to be 10
102  fAngleAlg.SetAngleCut(180); // Set angle-diff cut < 180 degree (i.e. anything :))
103  fAngleAlg.SetAllow180Ambig(true); // Allow 180-degree ambiguity (direction mis-reco)
104 
105  // Configure distance algorithm
106  fDistAlg.SetVerbose(false); // No verbous mode ... annoying
107  fDistAlg.SetMinHits(10); // Set minimum # hits to be 10
108  fDistAlg.SetSquaredDistanceCut(9); // Set distance-squared cut to be 9 cm^2
109 
110  // Attach them to CBAlgoArray to make it into one merging algorithm
111  fMergeAlg.AddAlgo(&fAngleAlg,true); // attach to CBAlgoArray in AND condition
112  fMergeAlg.AddAlgo(&fDistAlg,true); // attach to CBAlgoArray in AND condition
113 
114  //--- Configure Prohibit Algorithm ---//
115 
116  // I configure this using totally arbitrary numbers + I do not configure all parameters...
117  // This is just for example.
118  fProhibitAlg.SetVerbose(false);
119  fProhibitAlg.SetDebug(false);
124 
125 
126  //--- Configure Merger ---//
127 
128  fCMerge.GetManager(0).AddMergeAlgo(&fMergeAlg); // Attach merging algorithm
129  fCMerge.GetManager(0).AddSeparateAlgo(&fProhibitAlg); // Attach prohibit algorithm
130  fCMerge.GetManager(0).DebugMode(::cmtool::CMergeManager::kPerIteration); // Set verbosity level to be per-merging-iteration report
131  fCMerge.GetManager(0).MergeTillConverge(true); // Set to iterate over till it finds no more newly merged clusters
132 
133  //
134  // FYI there's an algorithm to just-merge-everything if you want to do a simple test (line commented out below)
135  //
136  //fCMerge.GetManager(0).AddMergeAlgo( new CBAlgoMergeAll );
137 
138 
139  }
Somewhat verbose (cout per merging iteration)
Definition: CMManagerBase.h:38
void SetSquaredDistanceCut(double d)
Method to set cut value in cm^2 for distance compatibility test.
::cmtool::CBAlgoTrackSeparate fProhibitAlg
Example prohibit algorithm.
void SetAllow180Ambig(bool on)
Method to set whether you allow angles to match with +/- 180 deg difference.
std::string fClusterModuleLabel
Input cluster data product producer name label.
void SetAngleCut(double angle)
Method to set cut value in degrees for angle compatibility test.
::cmtool::CBAlgoArray fMergeAlg
Example merging algorithm: algorithm array container.
void AddMergeAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for merging.
Definition: CMergeManager.h:44
::cmtool::CMergeHelper fCMerge
ClusterMergeHelper.
void SetMinHits(size_t n)
Set Minimum Number of Hits to consider Cluster.
void SetVerbose(bool on)
Setter function for verbosity.
::cmtool::CBAlgoAngleCompat fAngleAlg
Merging algorithm 2.
void SetMaxOpeningAngle(float maxangle)
void SetMinLength(float minlength)
void DebugMode(CMMSGLevel_t level)
Method to enable debug mode (lots of couts)
Definition: CMManagerBase.h:54
CMergeManager & GetManager(size_t mgr_id)
Definition: CMergeHelper.cxx:8
virtual void SetVerbose(bool doit=true)
Setter function for verbosity.
Definition: CMAlgoBase.h:80
void SetMinHits(size_t n)
Set Minimum Number of Hits to consider Cluster.
void MergeTillConverge(bool doit=true)
Switch to continue merging till converges.
Definition: CMManagerBase.h:66
::cmtool::CBAlgoShortestDist fDistAlg
Merging algorithm 1.
void AddAlgo(CBoolAlgoBase *algo, bool ask_and=true)
A simple method to add a one merging step.
Definition: CBAlgoArray.h:37
void SetMinAngleDiff(float anglesep)
void AddSeparateAlgo(CBoolAlgoBase *algo)
A simple method to add an algorithm for separation.
Definition: CMergeManager.h:47
cluster::SimpleClusterMerger::~SimpleClusterMerger ( )
virtual

Definition at line 141 of file SimpleClusterMerger_module.cc.

142  {
143  // Clean up dynamic memory and other resources here.
144  }

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::SimpleClusterMerger::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 146 of file SimpleClusterMerger_module.cc.

References util::CreateAssn(), DEFINE_ART_MODULE, cluster::cluster_params::end_point, cluster::LazyClusterParamsAlg::EndAngle(), cluster::LazyClusterParamsAlg::EndCharge(), cluster::LazyClusterParamsAlg::EndOpeningAngle(), fClusterModuleLabel, fCMerge, fGeoU, util::PxHitConverter::GeneratePxHit(), art::DataViewImpl::getByLabel(), cmtool::CMergeHelper::GetClusters(), cmtool::CMergeHelper::GetResult(), cmtool::CMergeBookKeeper::GetResult(), hits(), cluster::LazyClusterParamsAlg::Integral(), cluster::LazyClusterParamsAlg::IntegralStdDev(), art::Handle< T >::isValid(), cluster::LazyClusterParamsAlg::MultipleHitDensity(), cluster::LazyClusterParamsAlg::NHits(), geo::GeometryCore::Plane(), cmtool::CMergeHelper::Process(), art::Event::put(), recob::Cluster::Sentry, cluster::cluster_params::start_point, cluster::LazyClusterParamsAlg::StartAngle(), cluster::LazyClusterParamsAlg::StartCharge(), cluster::LazyClusterParamsAlg::StartOpeningAngle(), cluster::LazyClusterParamsAlg::SummedADC(), cluster::LazyClusterParamsAlg::SummedADCStdDev(), util::PxPoint::t, util::GeometryUtilities::TimeToCm(), cluster::details::Measure_t< T >::value(), geo::PlaneGeo::View(), util::PxPoint::w, cluster::LazyClusterParamsAlg::Width(), and util::GeometryUtilities::WireToCm().

147  {
148  std::unique_ptr<std::vector<recob::Cluster> > out_clusters(new std::vector<recob::Cluster>);
149  std::unique_ptr<art::Assns<recob::Cluster, recob::Hit> > out_assn(new art::Assns<recob::Cluster, recob::Hit>);
150 
152 
153  //
154  // Preparation
155  //
156 
157  // Retrieve input clusters
159  evt.getByLabel(fClusterModuleLabel,cHandle);
160 
161  if(!cHandle.isValid())
162  throw cet::exception(__FUNCTION__) << "Invalid input cluster label!" << std::endl;
163 
164  // Cluster type conversion: recob::Hit => util::PxHit
165  std::vector<std::vector< ::util::PxHit> > local_clusters;
166  art::FindManyP<recob::Hit> hit_m(cHandle, evt, fClusterModuleLabel);
168  for(size_t i=0; i<cHandle->size(); ++i) {
169 
170  local_clusters.push_back(std::vector< ::util::PxHit>());
171 
172  const std::vector<art::Ptr<recob::Hit> >& hits = hit_m.at(i);
173 
174  conv.GeneratePxHit(hits, local_clusters.back());
175  }
176 
177  //--- Process merging ---//
178  fCMerge.Process(local_clusters);
179 
180  // Store output
181  auto merged_clusters = fCMerge.GetResult().GetResult();
182 
183  auto const& cpan_v = fCMerge.GetClusters();
184  if(merged_clusters.size()!=cpan_v.size())
185 
186  throw cet::exception(__FUNCTION__) << "LOGIC ERROR: merged cluster id length != output cluster counts..." << std::endl;
187 
188  for(size_t out_index=0; out_index < merged_clusters.size(); ++out_index) {
189 
190  // To save typing let's just retrieve const cluster_params instance
191  const cluster_params &res = cpan_v[out_index].GetParams();
192 
193  // this "algo" is actually parroting its cluster_params
194  LazyClusterParamsAlg algo(res);
195 
196  std::vector<art::Ptr<recob::Hit> > merged_hits;
197  for(auto const& c_index : merged_clusters[out_index]) {
198  const std::vector<art::Ptr<recob::Hit> >& hits = hit_m.at(c_index);
199  merged_hits.reserve(merged_hits.size() + hits.size());
200  for(auto const& ptr : hits) merged_hits.push_back(ptr);
201  }
202 
203  // the full plane needed but not a part of cluster_params...
204  // get the one from the first hit
205  geo::PlaneID plane; // invalid by default
206  if (!merged_hits.empty()) plane = merged_hits.front()->WireID().planeID();
207 
208  // View_t needed but not a part of cluster_params, so retrieve it here
209  geo::View_t view_id = geo->Plane(plane).View();
210 
211  // Push back a new cluster data product with parameters copied from cluster_params
212  out_clusters->emplace_back(
213  res.start_point.w / fGeoU.WireToCm(), // start_wire
214  0., // sigma_start_wire
215  res.start_point.t / fGeoU.TimeToCm(), // start_tick
216  0., // sigma_start_tick
217  algo.StartCharge().value(), // start_charge
218  algo.StartAngle().value(), // start_angle
219  algo.StartOpeningAngle().value(), // start_opening
220  res.end_point.w / fGeoU.WireToCm(), // end_wire
221  0., // sigma_end_wire
222  res.end_point.t / fGeoU.TimeToCm(), // end_tick
223  0., // sigma_end_tick
224  algo.EndCharge().value(), // end_charge
225  algo.EndAngle().value(), // end_angle
226  algo.EndOpeningAngle().value(), // end_opening
227  algo.Integral().value(), // integral
228  algo.IntegralStdDev().value(), // integral_stddev
229  algo.SummedADC().value(), // summedADC
230  algo.SummedADCStdDev().value(), // summedADC_stddev
231  algo.NHits(), // n_hits
232  algo.MultipleHitDensity(), // multiple_hit_density
233  algo.Width(), // width
234  out_clusters->size(), // ID
235  view_id, // view
236  plane, // plane
237  recob::Cluster::Sentry // sentry
238  );
239 
240  util::CreateAssn(*this,
241  evt,
242  *(out_clusters.get()),
243  merged_hits,
244  *(out_assn.get())
245  );
246 
247  }
248 
249  evt.put(std::move(out_clusters));
250  evt.put(std::move(out_assn));
251  }
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
::util::GeometryUtilities fGeoU
GeometryUtilities instance.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
std::vector< std::vector< unsigned short > > GetResult() const
Double_t TimeToCm() const
Double_t WireToCm() const
static const SentryArgument_t Sentry
An instance of the sentry object.
Definition: Cluster.h:182
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool isValid() const
Definition: Handle.h:190
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:171
void hits()
Definition: readHits.C:15
std::string fClusterModuleLabel
Input cluster data product producer name label.
void GeneratePxHit(const std::vector< unsigned int > &hit_index, const std::vector< art::Ptr< recob::Hit >> hits, std::vector< util::PxHit > &pxhits) const
Generate: from 1 set of hits => 1 set of PxHits using indexes (association)
const std::vector< ::cluster::ClusterParamsAlg > & GetClusters() const
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.
::cmtool::CMergeHelper fCMerge
ClusterMergeHelper.
const CMergeBookKeeper & GetResult() const
Definition: CMergeHelper.h:44
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void Process(const std::vector< std::vector< ::util::PxHit > > &clusters)
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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

::cmtool::CBAlgoAngleCompat cluster::SimpleClusterMerger::fAngleAlg
private

Merging algorithm 2.

Definition at line 73 of file SimpleClusterMerger_module.cc.

Referenced by SimpleClusterMerger().

std::string cluster::SimpleClusterMerger::fClusterModuleLabel
private

Input cluster data product producer name label.

Definition at line 52 of file SimpleClusterMerger_module.cc.

Referenced by produce(), and SimpleClusterMerger().

::cmtool::CMergeHelper cluster::SimpleClusterMerger::fCMerge
private

ClusterMergeHelper.

Definition at line 49 of file SimpleClusterMerger_module.cc.

Referenced by produce(), and SimpleClusterMerger().

::cmtool::CBAlgoShortestDist cluster::SimpleClusterMerger::fDistAlg
private

Merging algorithm 1.

Definition at line 70 of file SimpleClusterMerger_module.cc.

Referenced by SimpleClusterMerger().

::util::GeometryUtilities cluster::SimpleClusterMerger::fGeoU
private

GeometryUtilities instance.

Definition at line 55 of file SimpleClusterMerger_module.cc.

Referenced by produce().

::cmtool::CBAlgoArray cluster::SimpleClusterMerger::fMergeAlg
private

Example merging algorithm: algorithm array container.

Definition at line 67 of file SimpleClusterMerger_module.cc.

Referenced by SimpleClusterMerger().

::cmtool::CBAlgoTrackSeparate cluster::SimpleClusterMerger::fProhibitAlg
private

Example prohibit algorithm.

Definition at line 76 of file SimpleClusterMerger_module.cc.

Referenced by SimpleClusterMerger().


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