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

 DBCluster3D (fhicl::ParameterSet const &p)
 
 DBCluster3D (DBCluster3D const &)=delete
 
 DBCluster3D (DBCluster3D &&)=delete
 
DBCluster3Doperator= (DBCluster3D const &)=delete
 
DBCluster3Doperator= (DBCluster3D &&)=delete
 
void produce (art::Event &e) 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 Types

using Point_t = recob::tracking::Point_t
 
using Vector_t = recob::tracking::Vector_t
 

Private Attributes

const art::InputTag fHitModuleLabel
 
const art::InputTag fSpacePointModuleLabel
 
const art::InputTag fSPHitAssnLabel
 
DBScan3DAlg fDBScan
 
geo::GeometryCore const * fGeom
 
detinfo::DetectorProperties const * fDetProp
 
double tickToDist
 
double fMinHitDis
 

Detailed Description

Definition at line 37 of file DBCluster3D_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::DBCluster3D::DBCluster3D ( fhicl::ParameterSet const &  p)
explicit

Definition at line 73 of file DBCluster3D_module.cc.

References detinfo::DetectorProperties::DriftVelocity(), detinfo::DetectorProperties::Efield(), fDetProp, fGeom, fMinHitDis, detinfo::DetectorProperties::SamplingRate(), detinfo::DetectorProperties::Temperature(), and tickToDist.

74  : fHitModuleLabel(p.get< art::InputTag >("HitModuleLabel"))
75  , fSpacePointModuleLabel(p.get< art::InputTag >("SpacePointModuleLabel"))
76  , fSPHitAssnLabel(p.get< art::InputTag >("SPHitAssnLabel"))
77  , fDBScan(p.get< fhicl::ParameterSet >("DBScan3DAlg"))
78  , fMinHitDis(p.get< double >("MinHitDis"))
79 {
80  produces< std::vector<recob::Slice> >();
81  produces< art::Assns<recob::Slice, recob::Hit> >();
82  produces< art::Assns<recob::Slice, recob::SpacePoint> >();
83 
85  fDetProp = lar::providerFrom<detinfo::DetectorPropertiesService>();
86 
88  tickToDist *= 1.e-3 * fDetProp->SamplingRate(); // 1e-3 is conversion of 1/us to 1/ns
90 }
geo::GeometryCore const * fGeom
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
const art::InputTag fSpacePointModuleLabel
const art::InputTag fHitModuleLabel
const art::InputTag fSPHitAssnLabel
virtual double Temperature() const =0
detinfo::DetectorProperties const * fDetProp
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
cluster::DBCluster3D::DBCluster3D ( DBCluster3D const &  )
delete
cluster::DBCluster3D::DBCluster3D ( DBCluster3D &&  )
delete

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  }
DBCluster3D& cluster::DBCluster3D::operator= ( DBCluster3D const &  )
delete
DBCluster3D& cluster::DBCluster3D::operator= ( DBCluster3D &&  )
delete
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::DBCluster3D::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 92 of file DBCluster3D_module.cc.

References evd::details::begin(), util::CreateAssn(), cluster::DBScan3DAlg::dbscan(), DEFINE_ART_MODULE, dir, evd::details::end(), fDBScan, fGeom, fHitModuleLabel, art::fill_ptr_vector(), fMinHitDis, fSpacePointModuleLabel, fSPHitAssnLabel, art::DataViewImpl::getValidHandle(), hits(), cluster::DBScan3DAlg::init(), norm, cluster::DBScan3DAlg::points, art::Event::put(), tickToDist, geo::GeometryCore::WirePitch(), xx, and zz.

93 {
94 
95  std::vector<recob::Slice> slcCol;
96 
97  std::unique_ptr<art::Assns<recob::Slice, recob::Hit>>
98  slc_hit_assn(new art::Assns<recob::Slice, recob::Hit>);
99 
100  std::unique_ptr<art::Assns<recob::Slice, recob::SpacePoint>>
102 
103  auto hitsHandle = evt.getValidHandle< std::vector<recob::Hit> >(fHitModuleLabel);
104  auto spsHandle = evt.getValidHandle< std::vector<recob::SpacePoint> >(fSpacePointModuleLabel);
105 
106  // all hits in the collection
107  std::vector< art::Ptr<recob::Hit> > hits;
108  art::fill_ptr_vector(hits, hitsHandle);
109 
110  // all space points in the collection
111  std::vector< art::Ptr<recob::SpacePoint> > sps;
112  art::fill_ptr_vector(sps, spsHandle);
113 
115  if(!spFromHit.isValid()) {
116  std::cout<<"spFromHit is invalid\n";
117  return;
118  }
119  // Find the first Hit - SpacePoint assn and check consistency on the first event
120  static bool first = true;
121  if(first) {
122  bool success = false;
123  for(auto &hit : hits) {
124  auto &sps = spFromHit.at(hit.key());
125  if(sps.empty()) continue;
126  success = (sps[0].id() == spsHandle.id());
127  break;
128  } // hit
129  if(!success) throw cet::exception("DBCluster3D")<<"HitModuleLabel, SpacePointModuleLabel and SPHitAssnLabel are inconsistent\n";
130  first = false;
131  } // first
132 
133  art::FindManyP< recob::Hit > hitFromSp(spsHandle, evt, fSPHitAssnLabel);
134  if(!hitFromSp.isValid()) {
135  std::cout<<"hitFromSp is invalid\n";
136  return;
137  }
138  fDBScan.init(sps, hitFromSp);
139  fDBScan.dbscan();
140 
141  //Find number of slices
142  int maxid = INT_MIN;
143  for (size_t i = 0; i<fDBScan.points.size(); ++i){
144 // std::cout<<"Space point index "<<i<<" "<<fDBScan.points[i].sp.key()<<" "<<fDBScan.points[i].cluster_id<<std::endl;
145  if (fDBScan.points[i].cluster_id > maxid) maxid = fDBScan.points[i].cluster_id;
146  }
147  size_t nslc = 0;
148  if (maxid>=0) nslc = maxid + 1;
149 
150  //Save hits associated with each slice
151  std::vector<std::vector<art::Ptr<recob::Hit>>> slcHits(nslc);
152  //Save hits on each PlaneID with pfparticle index
153  std::map<geo::PlaneID, std::vector<std::pair<art::Ptr<recob::Hit>, unsigned int>>> hitmap;
154  for (auto &hit : hits){
155  auto &sps = spFromHit.at(hit.key());
156  if (sps.size()){//found associated space point
157  if (fDBScan.points[sps[0].key()].cluster_id>=0){
158  slcHits[fDBScan.points[sps[0].key()].cluster_id].push_back(hit);
159  hitmap[geo::PlaneID(hit->WireID())].push_back(std::make_pair(hit, fDBScan.points[sps[0].key()].cluster_id));
160  }
161  } // sps.size()
162  } // hit
163 
164  //Save hits not associated with any spacepoints
165  for (auto &hit : hits){
166  bool found = false;
167  for (size_t i = 0; i<slcHits.size(); ++i){
168  if (std::find(slcHits[i].begin(), slcHits[i].end(), hit) != slcHits[i].end()){
169  found = true;
170  break;
171  }
172  }
173  if (!found){
174  double wirePitch = fGeom->WirePitch(hit->WireID());
175  double UnitsPerTick = tickToDist / wirePitch;
176  double x0 = hit->WireID().Wire;
177  double y0 = hit->PeakTime() * UnitsPerTick;
178  double mindis = DBL_MAX;
179  unsigned slcIndex = UINT_MAX;
180  for (auto &hit2 : hitmap[geo::PlaneID(hit->WireID())]) {
181  double dx = hit2.first->WireID().Wire - x0;
182  double dy = hit2.first->PeakTime() * UnitsPerTick - y0;
183  double dis = dx*dx + dy*dy;
184  if (dis<mindis){
185  mindis = dis;
186  slcIndex = hit2.second;
187  }
188  }
189  if (slcIndex != UINT_MAX && mindis < fMinHitDis){
190  slcHits[slcIndex].push_back(hit);
191  }
192  }
193  }
194 
195  //Save spacepoints for each slice
196  std::vector<std::vector<art::Ptr<recob::SpacePoint>>> sps_in_slc(nslc);
197  for (size_t i = 0; i<fDBScan.points.size(); ++i){
198  if (fDBScan.points[i].cluster_id>=0){
199  sps_in_slc[fDBScan.points[i].cluster_id].push_back(sps[i]);
200  }
201  } // i
202 
203  // calculate the properties of the slice
204  for(size_t isl = 0; isl < nslc; ++isl) {
205  double sum = sps_in_slc[isl].size();
206  // find the center
207  double center[3] = {0.};
208  // TODO: calculate the charge using recob::PointCharge instead of just counting hits
209  float charge = slcHits[isl].size();
210  for(auto& spt : sps_in_slc[isl]) {
211  for(unsigned short xyz = 0; xyz < 3; ++xyz) center[xyz] += spt->XYZ()[xyz];
212  } // spt
213  for(unsigned short xyz = 0; xyz < 3; ++xyz) center[xyz] /= sum;
214  // do a linear fit
215  double sumx = 0, sumy = 0., sumz = 0., sumx2 = 0, sumy2 = 0, sumz2 = 0;
216  double sumxy = 0, sumxz = 0;
217  for(auto& spt : sps_in_slc[isl]) {
218  double xx = spt->XYZ()[0] - center[0];
219  double yy = spt->XYZ()[1] - center[1];
220  double zz = spt->XYZ()[2] - center[2];
221  sumx += xx;
222  sumy += yy;
223  sumz += zz;
224  sumx2 += xx * xx;
225  sumy2 += yy * yy;
226  sumz2 += zz * zz;
227  sumxy += xx * yy;
228  sumxz += xx * zz;
229  } // spt
230  double delta = sum * sumx2 - sumx * sumx;
231  if(delta <= 0) continue;
232  // calculate the slopes
233  double dydx = (sumxy * sum - sumx * sumy) / delta;
234  double dzdx = (sumxz * sum - sumx * sumz) / delta;
235  // and convert to direction vector
236  double direction[3];
237  double norm = std::sqrt(1 + dydx * dydx + dzdx * dzdx);
238  direction[0] = 1 / norm;
239  direction[1] = dydx / norm;
240  direction[2] = dzdx / norm;
241  // Find the points that are farthest away from the center along the slice axis
242  unsigned int imax = 0, imin = 0;
243  float minAlong = 1E6, maxAlong = -1E6;
244  double tmpVec[3];
245  for(unsigned int ipt = 0; ipt < sps_in_slc[isl].size(); ++ipt) {
246  auto& spt = sps_in_slc[isl][ipt];
247  for(unsigned short xyz = 0; xyz < 3; ++xyz) tmpVec[xyz] = spt->XYZ()[xyz] - center[xyz];
248  double dotp = 0;
249  for(unsigned short xyz = 0; xyz < 3; ++xyz) dotp += tmpVec[xyz] * direction[xyz];
250  if(dotp < minAlong) { minAlong = dotp; imin = ipt; }
251  if(dotp > maxAlong) { maxAlong = dotp; imax = ipt; }
252  } // spt
253  // Find the aspect ratio
254  float cnt = 0.;
255  float aspectRatio = 0;
256  double arg = sum * sumy2 - sumy * sumy;
257  if(arg > 0) {
258  aspectRatio += std::abs(sum * sumxy - sumx * sumy) / sqrt(delta * arg);
259  ++cnt;
260  }
261  arg = sum * sumz2 - sumz * sumz;
262  if(arg > 0) {
263  aspectRatio += std::abs(sum * sumxz - sumx * sumz) / sqrt(delta * arg);
264  ++cnt;
265  }
266  if(cnt > 1) aspectRatio /= cnt;
267  int id = isl + 1;
268  Point_t ctr(center[0], center[1], center[2]);
269  Vector_t dir(direction[0], direction[1], direction[2]);
270  auto pos0 = sps_in_slc[isl][imin]->XYZ();
271  Point_t ep0(pos0[0], pos0[1], pos0[2]);
272  auto pos1 = sps_in_slc[isl][imax]->XYZ();
273  Point_t ep1(pos1[0], pos1[1], pos1[2]);
274  slcCol.emplace_back(id, ctr, dir, ep0, ep1, aspectRatio, charge);
275  util::CreateAssn(*this, evt, slcCol, slcHits[isl], *slc_hit_assn);
276  util::CreateAssn(*this, evt, slcCol, sps_in_slc[isl], *slc_sps_assn);
277  } // isl
278 
279  std::unique_ptr<std::vector<recob::Slice> > scol(new std::vector<recob::Slice>(std::move(slcCol)));
280  evt.put(std::move(scol));
281  evt.put(std::move(slc_hit_assn));
282  evt.put(std::move(slc_sps_assn));
283 }
geo::GeometryCore const * fGeom
Double_t xx
Definition: macro.C:12
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
Double_t zz
Definition: plot.C:279
const art::InputTag fSpacePointModuleLabel
const art::InputTag fHitModuleLabel
const art::InputTag fSPHitAssnLabel
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
recob::tracking::Point_t Point_t
void hits()
Definition: readHits.C:15
void init(const std::vector< art::Ptr< recob::SpacePoint >> &sps, art::FindManyP< recob::Hit > &hitFromSp)
Definition: DBScan3DAlg.cxx:29
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
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.
Detector simulation of raw signals on wires.
Float_t norm
TDirectory * dir
Definition: macro.C:5
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::vector< point_t > points
Definition: DBScan3DAlg.h:82
TCEvent evt
Definition: DataStructs.cxx:5
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
recob::tracking::Vector_t Vector_t
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

DBScan3DAlg cluster::DBCluster3D::fDBScan
private

Definition at line 62 of file DBCluster3D_module.cc.

Referenced by produce().

detinfo::DetectorProperties const* cluster::DBCluster3D::fDetProp
private

Definition at line 65 of file DBCluster3D_module.cc.

Referenced by DBCluster3D().

geo::GeometryCore const* cluster::DBCluster3D::fGeom
private

Definition at line 64 of file DBCluster3D_module.cc.

Referenced by DBCluster3D(), and produce().

const art::InputTag cluster::DBCluster3D::fHitModuleLabel
private

Definition at line 58 of file DBCluster3D_module.cc.

Referenced by produce().

double cluster::DBCluster3D::fMinHitDis
private

Definition at line 68 of file DBCluster3D_module.cc.

Referenced by DBCluster3D(), and produce().

const art::InputTag cluster::DBCluster3D::fSpacePointModuleLabel
private

Definition at line 59 of file DBCluster3D_module.cc.

Referenced by produce().

const art::InputTag cluster::DBCluster3D::fSPHitAssnLabel
private

Definition at line 60 of file DBCluster3D_module.cc.

Referenced by produce().

double cluster::DBCluster3D::tickToDist
private

Definition at line 67 of file DBCluster3D_module.cc.

Referenced by DBCluster3D(), and produce().


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