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

 SpacePointSolver (const fhicl::ParameterSet &pset)
 
virtual ~SpacePointSolver ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
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 Types

typedef std::map< const WireHit *, art::Ptr< recob::Hit > > HitMap_t
 

Protected Member Functions

double HitToXPos (const recob::Hit &hit, geo::TPCID tpc) const
 
bool CloseDrift (double xa, double xb) const
 
bool CloseSpace (geo::WireIDIntersection ra, geo::WireIDIntersection rb) const
 
void FastForward (std::vector< InductionWireWithXPos >::iterator &it, double target, const std::vector< InductionWireWithXPos >::const_iterator &end) const
 
bool ISect (int chanA, int chanB, geo::TPCID tpc, geo::WireIDIntersection &pt) const
 
bool ISect (int chanA, int chanB, geo::TPCID tpc) const
 
void AddNeighbours (const std::vector< SpaceCharge * > &spaceCharges) const
 
void BuildSystemXUV (const std::vector< art::Ptr< recob::Hit >> &xhits, const std::vector< art::Ptr< recob::Hit >> &uhits, const std::vector< art::Ptr< recob::Hit >> &vhits, std::vector< CollectionWireHit * > &cwires, std::vector< InductionWireHit * > &iwires, bool incNei, HitMap_t &hitmap) const
 
void BuildSystemXU (const std::vector< art::Ptr< recob::Hit >> &xhits, const std::vector< art::Ptr< recob::Hit >> &uhits, std::vector< CollectionWireHit * > &cwires, std::vector< InductionWireHit * > &iwires, bool incNei, HitMap_t &hitmap) const
 
bool AddSpacePoint (const SpaceCharge &sc, int id, recob::ChargedSpacePointCollectionCreator &points) const
 return whether the point was inserted (only happens when it has charge) More...
 
void FillSystemToSpacePoints (const std::vector< CollectionWireHit * > &cwires, recob::ChargedSpacePointCollectionCreator &pts) const
 
void FillSystemToSpacePointsAndAssns (const std::vector< CollectionWireHit * > &cwires, const HitMap_t &hitmap, recob::ChargedSpacePointCollectionCreator &points, art::Assns< recob::SpacePoint, recob::Hit > &assn) const
 
CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

std::string fHitLabel
 
bool fFit
 
double fAlpha
 
TH1 * fDeltaX
 
const detinfo::DetectorPropertiesdetprop
 
const geo::GeometryCoregeom
 

Detailed Description

Definition at line 60 of file SpacePointSolver_module.cc.

Member Typedef Documentation

typedef std::map<const WireHit*, art::Ptr<recob::Hit> > reco3d::SpacePointSolver::HitMap_t
protected

Definition at line 90 of file SpacePointSolver_module.cc.

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

reco3d::SpacePointSolver::SpacePointSolver ( const fhicl::ParameterSet pset)
explicit

Definition at line 135 of file SpacePointSolver_module.cc.

References recob::ChargedSpacePointCollectionCreator::produces().

136  : fHitLabel(pset.get<std::string>("HitLabel")),
137  fFit(pset.get<bool>("Fit")),
138  fAlpha(pset.get<double>("Alpha"))
139 {
141  if(fFit){
143  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
145  }
146 }
static void produces(art::ProducerBase &producer, std::string const &instanceName={})
Declares the data products being produced.
T get(std::string const &key) const
Definition: ParameterSet.h:231
reco3d::SpacePointSolver::~SpacePointSolver ( )
virtual

Definition at line 149 of file SpacePointSolver_module.cc.

150 {
151 }

Member Function Documentation

void reco3d::SpacePointSolver::AddNeighbours ( const std::vector< SpaceCharge * > &  spaceCharges) const
protected

Definition at line 270 of file SpacePointSolver_module.cc.

References BuildSystemXUV(), Neighbour::fCoupling, SpaceCharge::fPred, Neighbour::fSC, SpaceCharge::fX, SpaceCharge::fY, SpaceCharge::fZ, reco3d::InductionWireWithXPos::operator<(), sqr(), x, y, and z.

Referenced by HitToXPos().

271 {
272  static const double kCritDist = 5;
273 
274  // Could use a QuadTree or VPTree etc, but seems like overkill
275  class IntCoord
276  {
277  public:
278  IntCoord(const SpaceCharge& sc)
279  : fX(sc.fX/kCritDist),
280  fY(sc.fY/kCritDist),
281  fZ(sc.fZ/kCritDist)
282  {
283  }
284 
285  bool operator<(const IntCoord& i) const
286  {
287  return std::make_tuple(fX, fY, fZ) < std::make_tuple(i.fX, i.fY, i.fZ);
288  }
289 
290  std::vector<IntCoord> Neighbours() const
291  {
292  std::vector<IntCoord> ret;
293  for(int dx = -1; dx <= +1; ++dx){
294  for(int dy = -1; dy <= +1; ++dy){
295  for(int dz = -1; dz <= +1; ++dz){
296  ret.push_back(IntCoord(fX+dx, fY+dy, fZ+dz));
297  }
298  }
299  }
300  return ret;
301  }
302  protected:
303  IntCoord(int x, int y, int z) : fX(x), fY(y), fZ(z) {}
304 
305  int fX, fY, fZ;
306  };
307 
308  std::map<IntCoord, std::vector<SpaceCharge*>> scMap;
309  for(SpaceCharge* sc: spaceCharges){
310  scMap[IntCoord(*sc)].push_back(sc);
311  }
312 
313  std::cout << "Neighbour search..." << std::endl;
314  std::cout << spaceCharges.size() << std::endl;
315  // Now that we know all the space charges, can go through and assign neighbours
316 
317  int Ntests = 0;
318  int Nnei = 0;
319  for(SpaceCharge* sc1: spaceCharges){
320  IntCoord ic(*sc1);
321  for(IntCoord icn: ic.Neighbours()){
322  for(SpaceCharge* sc2: scMap[icn]){
323 
324  ++Ntests;
325 
326  if(sc1 == sc2) continue;
327  /*const*/ double dist2 = sqr(sc1->fX-sc2->fX) + sqr(sc1->fY-sc2->fY) + sqr(sc1->fZ-sc2->fZ);
328 
329  if(dist2 > sqr(kCritDist)) continue;
330 
331  if(dist2 == 0){
332  std::cout << "ZERO DISTANCE SOMEHOW?" << std::endl;
333  std::cout << sc1->fCWire << " " << sc1->fWire1 << " " << sc1->fWire2 << std::endl;
334  std::cout << sc2->fCWire << " " << sc2->fWire1 << " " << sc2->fWire2 << std::endl;
335  std::cout << dist2 << " " << sc1->fX << " " << sc2->fX << " " << sc1->fY << " " << sc2->fY << " " << sc1->fZ << " " << sc2->fZ << std::endl;
336  continue;
337  dist2 = sqr(kCritDist);
338  }
339 
340  ++Nnei;
341 
342  // This is a pretty random guess
343  const double coupling = exp(-sqrt(dist2)/2);
344  sc1->fNeighbours.emplace_back(sc2, coupling);
345 
346  if(isnan(1/sqrt(dist2)) || isinf(1/sqrt(dist2))){
347  std::cout << dist2 << " " << sc1->fX << " " << sc2->fX << " " << sc1->fY << " " << sc2->fY << " " << sc1->fZ << " " << sc2->fZ << std::endl;
348  abort();
349  }
350  } // end for sc2
351  } // end for icn
352 
353  // The neighbours lists use the most memory, so be careful to trim
354  sc1->fNeighbours.shrink_to_fit();
355  } // end for sc1
356 
357  for(SpaceCharge* sc: spaceCharges){
358  for(Neighbour& nei: sc->fNeighbours){
359  sc->fNeiPotential += nei.fCoupling * nei.fSC->fPred;
360  }
361  }
362 
363  std::cout << Ntests << " tests to find " << Nnei << std::endl;
364 }
Float_t x
Definition: compare.C:6
bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
Definition: geo_types.h:413
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double fCoupling
Definition: Solver.h:37
T sqr(T x)
double fPred
Definition: Solver.h:58
SpaceCharge * fSC
Definition: Solver.h:36
bool reco3d::SpacePointSolver::AddSpacePoint ( const SpaceCharge sc,
int  id,
recob::ChargedSpacePointCollectionCreator points 
) const
protected

return whether the point was inserted (only happens when it has charge)

Definition at line 640 of file SpacePointSolver_module.cc.

References recob::ChargedSpacePointCollectionCreator::add(), FillSystemToSpacePoints(), SpaceCharge::fPred, SpaceCharge::fX, SpaceCharge::fY, and SpaceCharge::fZ.

Referenced by BuildSystemXU().

643 {
644  static const double err[6] = {0,};
645 
646  const float charge = sc.fPred;
647  if(charge == 0) return false;
648 
649  const double xyz[3] = {sc.fX, sc.fY, sc.fZ};
650  points.add({ xyz, err, 0.0, id }, charge);
651 
652  return true;
653 }
double fZ
Definition: Solver.h:52
double fY
Definition: Solver.h:52
double fX
Definition: Solver.h:52
double fPred
Definition: Solver.h:58
void add(recob::SpacePoint const &spacePoint, recob::PointCharge const &charge)
Inserts the specified space point and associated data into the collection.
void reco3d::SpacePointSolver::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 154 of file SpacePointSolver_module.cc.

References art::TFileDirectory::make().

155 {
157  geom = art::ServiceHandle<geo::Geometry>()->provider();
158 
160  fDeltaX = tfs->make<TH1F>("deltax", ";#Deltax (cm)", 100, -2, +2);
161 }
const geo::GeometryCore * geom
const detinfo::DetectorProperties * detprop
T * make(ARGS...args) const
void reco3d::SpacePointSolver::BuildSystemXU ( const std::vector< art::Ptr< recob::Hit >> &  xhits,
const std::vector< art::Ptr< recob::Hit >> &  uhits,
std::vector< CollectionWireHit * > &  cwires,
std::vector< InductionWireHit * > &  iwires,
bool  incNei,
HitMap_t hitmap 
) const
protected

Definition at line 547 of file SpacePointSolver_module.cc.

References AddSpacePoint(), evd::details::end(), InductionWireHit::fChannel, reco3d::InductionWireWithXPos::iwire, reco3d::InductionWireWithXPos::xpos, geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

Referenced by BuildSystemXUV().

553 {
554  std::map<geo::TPCID, std::vector<art::Ptr<recob::Hit>>> xhits_by_tpc;
555  for(auto& xhit: xhits){
556  const std::vector<geo::TPCID> tpcs = geom->ROPtoTPCs(geom->ChannelToROP(xhit->Channel()));
557  assert(tpcs.size() == 1);
558  const geo::TPCID tpc = tpcs[0];
559  xhits_by_tpc[tpc].push_back(xhit);
560  }
561 
562  // Maps from TPC to the induction wires. Normally want to access them this
563  // way.
564  std::map<geo::TPCID, std::vector<InductionWireWithXPos>> uwires;
565 
566  for(auto& hit: uhits){
567  const std::vector<geo::TPCID> tpcs = geom->ROPtoTPCs(geom->ChannelToROP(hit->Channel()));
568 
569  InductionWireHit* iwire = new InductionWireHit(hit->Channel(), hit->Integral());
570  iwires.emplace_back(iwire);
571  hitmap[iwire] = hit;
572 
573  for(geo::TPCID tpc: tpcs){
574  if(xhits_by_tpc.count(tpc) == 0) continue;
575 
576  const double xpos = HitToXPos(*hit, tpc);
577 
578  uwires[tpc].emplace_back(iwire, xpos);
579  } // end for tpc
580  } // end for hit
581 
582  for(auto it = uwires.begin(); it != uwires.end(); ++it){
583  std::sort(it->second.begin(), it->second.end());
584  }
585 
586  for(auto it = xhits_by_tpc.begin(); it != xhits_by_tpc.end(); ++it){
587  const geo::TPCID tpc = it->first;
588  std::sort(it->second.begin(), it->second.end(),
589  [this, tpc](art::Ptr<recob::Hit>& a, art::Ptr<recob::Hit>& b)
590  {
591  return HitToXPos(*a, tpc) < HitToXPos(*b, tpc);
592  });
593  }
594 
595 
596  std::cout << "Finding UV coincidences..." << std::endl;
597  std::vector<SpaceCharge*> spaceCharges;
598 
599  for(auto it: xhits_by_tpc){
600  const geo::TPCID tpc = it.first;
601 
602  auto uwires_begin = uwires[tpc].begin();
603 
604  for(auto& hit: it.second){
605  const double xpos = HitToXPos(*hit, tpc);
606 
607  std::vector<SpaceCharge*> crossers;
608 
609  FastForward(uwires_begin, xpos, uwires[tpc].end());
610 
611  // Figure out which uwires intersect this xwire here.
612  for(auto uit = uwires_begin; uit != uwires[tpc].end(); ++uit){
613  InductionWireWithXPos uwire = *uit;
614 
615  if(uwire.xpos > xpos && !CloseDrift(uwire.xpos, xpos)) break;
616 
618  if(ISect(hit->Channel(), uwire.iwire->fChannel, tpc, ptXU)){
619 
620  // Don't have a cwire object yet, set it later
621  SpaceCharge* sc = new SpaceCharge((xpos+uwire.xpos)/2, ptXU.y, ptXU.z,
622  0, 0, uwire.iwire);
623  spaceCharges.push_back(sc);
624  crossers.push_back(sc);
625  } // end for uwire
626  } // end for uit
627 
628  CollectionWireHit* cwire = new CollectionWireHit(hit->Channel(), hit->Integral(), crossers);
629  hitmap[cwire] = hit;
630  cwires.push_back(cwire);
631  for(SpaceCharge* sc: crossers) sc->fCWire = cwire;
632  } // end for hit
633  } // end for it (tpc)
634 
635  if(incNei) AddNeighbours(spaceCharges);
636 }
std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const
Returns a list of ID of TPCs the specified ROP spans.
double z
z position of intersection
Definition: geo_types.h:494
const geo::GeometryCore * geom
void AddNeighbours(const std::vector< SpaceCharge * > &spaceCharges) const
bool CloseDrift(double xa, double xb) const
bool ISect(int chanA, int chanB, geo::TPCID tpc, geo::WireIDIntersection &pt) const
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
Detector simulation of raw signals on wires.
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
CollectionWireHit * fCWire
Definition: Solver.h:53
double y
y position of intersection
Definition: geo_types.h:493
void FastForward(std::vector< InductionWireWithXPos >::iterator &it, double target, const std::vector< InductionWireWithXPos >::const_iterator &end) const
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
double HitToXPos(const recob::Hit &hit, geo::TPCID tpc) const
void reco3d::SpacePointSolver::BuildSystemXUV ( const std::vector< art::Ptr< recob::Hit >> &  xhits,
const std::vector< art::Ptr< recob::Hit >> &  uhits,
const std::vector< art::Ptr< recob::Hit >> &  vhits,
std::vector< CollectionWireHit * > &  cwires,
std::vector< InductionWireHit * > &  iwires,
bool  incNei,
HitMap_t hitmap 
) const
protected

Definition at line 368 of file SpacePointSolver_module.cc.

References BuildSystemXU(), evd::details::end(), InductionWireHit::fChannel, reco3d::InductionWireWithXPos::iwire, geo::kU, geo::kV, reco3d::InductionWireWithXPos::operator<(), x, reco3d::InductionWireWithXPos::xpos, geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

Referenced by AddNeighbours().

375 {
376  std::map<geo::TPCID, std::vector<art::Ptr<recob::Hit>>> xhits_by_tpc;
377  for(auto& xhit: xhits){
378  const std::vector<geo::TPCID> tpcs = geom->ROPtoTPCs(geom->ChannelToROP(xhit->Channel()));
379  assert(tpcs.size() == 1);
380  const geo::TPCID tpc = tpcs[0];
381  xhits_by_tpc[tpc].push_back(xhit);
382  }
383 
384  // Maps from TPC to the induction wires. Normally want to access them this
385  // way.
386  std::map<geo::TPCID, std::vector<InductionWireWithXPos>> uwires, vwires;
387 
388  for(auto& ihits: {uhits, vhits}){
389  for(auto& hit: ihits){
390  const std::vector<geo::TPCID> tpcs = geom->ROPtoTPCs(geom->ChannelToROP(hit->Channel()));
391 
392  // TODO: Empirically, total collection charge is about 5% high of total
393  // induction charge, which might cause "spare" charge to go where it's
394  // not wanted.
395  InductionWireHit* iwire = new InductionWireHit(hit->Channel(), hit->Integral() * .95);
396  iwires.emplace_back(iwire);
397  hitmap[iwire] = hit;
398 
399  for(geo::TPCID tpc: tpcs){
400  if(xhits_by_tpc.count(tpc) == 0) continue;
401 
402  const double xpos = HitToXPos(*hit, tpc);
403 
404  if(hit->View() == geo::kU) uwires[tpc].emplace_back(iwire, xpos);
405  if(hit->View() == geo::kV) vwires[tpc].emplace_back(iwire, xpos);
406  } // end for tpc
407  } // end for hit
408  } // end for U/V
409 
410  for(auto it = uwires.begin(); it != uwires.end(); ++it){
411  std::sort(it->second.begin(), it->second.end());
412  }
413  for(auto it = vwires.begin(); it != vwires.end(); ++it){
414  std::sort(it->second.begin(), it->second.end());
415  }
416 
417  for(auto it = xhits_by_tpc.begin(); it != xhits_by_tpc.end(); ++it){
418  const geo::TPCID tpc = it->first;
419  std::sort(it->second.begin(), it->second.end(),
420  [this, tpc](art::Ptr<recob::Hit>& a, art::Ptr<recob::Hit>& b)
421  {
422  return HitToXPos(*a, tpc) < HitToXPos(*b, tpc);
423  });
424  }
425 
426 
427  struct UVCrossing
428  {
429  geo::TPCID tpc;
430  InductionWireHit *u, *v;
431 
432  bool operator<(const UVCrossing& x) const
433  {
434  return std::make_tuple(tpc, u, v) < std::make_tuple(x.tpc, x.u, x.v);
435  }
436  };
437 
438  // Build a table of UV crossers up front
439  std::cout << "Building UV table..." << std::endl;
440  std::map<UVCrossing, bool> isectUV;
441  std::map<UVCrossing, geo::WireIDIntersection> ptsUV;
442 
443  for(auto it: uwires){
444  const geo::TPCID tpc = it.first;
445 
446  auto vwires_begin = vwires[tpc].begin();
447 
448  for(InductionWireWithXPos uwire: uwires[tpc]){
449 
450  // Fast-forward up to the first vwire that could be relevant
451  FastForward(vwires_begin, uwire.xpos, vwires[tpc].end());
452 
453  for(auto vit = vwires_begin; vit != vwires[tpc].end(); ++vit){
454  const InductionWireWithXPos vwire = *vit;
455 
456  // No more vwires can be relevant, bail out
457  if(vwire.xpos > uwire.xpos &&
458  !CloseDrift(uwire.xpos, vwire.xpos)) break;
459 
460  const UVCrossing key = {tpc, uwire.iwire, vwire.iwire};
461 
462  isectUV[key] = ISect(uwire.iwire->fChannel, vwire.iwire->fChannel, tpc,
463  ptsUV[key]);
464  } // end for vwire
465  } // end for uwire
466  } // end for tpc
467 
468  std::cout << "Finding XUV coincidences..." << std::endl;
469  std::vector<SpaceCharge*> spaceCharges;
470 
471  for(auto it: xhits_by_tpc){
472  const geo::TPCID tpc = it.first;
473 
474  auto uwires_begin = uwires[tpc].begin();
475  auto vwires_begin = vwires[tpc].begin();
476 
477  for(auto& hit: it.second){
478  const double xpos = HitToXPos(*hit, tpc);
479 
480  FastForward(uwires_begin, xpos, uwires[tpc].end());
481  FastForward(vwires_begin, xpos, vwires[tpc].end());
482 
483  // Figure out which vwires intersect this xwire here so we don't do N^2
484  // nesting inside the uwire loop below.
485  std::vector<InductionWireWithXPos> vwires_cross;
486  std::unordered_map<InductionWireHit*, geo::WireIDIntersection> ptsXV;
487  vwires_cross.reserve(vwires[tpc].size()); // avoid reallocations
488  for(auto vit = vwires_begin; vit != vwires[tpc].end(); ++vit){
489  InductionWireWithXPos vwire = *vit;
490 
491  if(vwire.xpos > xpos && !CloseDrift(vwire.xpos, xpos)) break;
492 
493  if(ISect(hit->Channel(), vwire.iwire->fChannel, tpc, ptsXV[vwire.iwire]))
494  vwires_cross.push_back(vwire);
495  } // end for vwire
496 
497  std::vector<SpaceCharge*> crossers;
498  for(auto uit = uwires_begin; uit != uwires[tpc].end(); ++uit){
499  const InductionWireWithXPos uwire = *uit;
500 
501  if(uwire.xpos > xpos && !CloseDrift(uwire.xpos, xpos)) break;
502 
504  if(!ISect(hit->Channel(), uwire.iwire->fChannel, tpc, ptXU)) continue;
505 
506  for(const InductionWireWithXPos& vwire: vwires_cross){
507 
508  const geo::WireIDIntersection ptXV = ptsXV[vwire.iwire];
509  if(!CloseSpace(ptXU, ptXV)) continue;
510 
511  if(!isectUV[{tpc, uwire.iwire, vwire.iwire}]) continue;
512 
513  const geo::WireIDIntersection ptUV = ptsUV[{tpc, uwire.iwire, vwire.iwire}];
514 
515  if(!CloseSpace(ptXU, ptUV) ||
516  !CloseSpace(ptXV, ptUV)) continue;
517 
518  fDeltaX->Fill(xpos-uwire.xpos);
519  fDeltaX->Fill(xpos-vwire.xpos);
520  fDeltaX->Fill(uwire.xpos-vwire.xpos);
521 
522  // TODO exactly which 3D position to set for this point? This average
523  // aleviates the problem with a single collection wire matching
524  // multiple hits on an induction wire at different times.
525 
526  // Don't have a cwire object yet, set it later
527  SpaceCharge* sc = new SpaceCharge((xpos+uwire.xpos+vwire.xpos)/3,
528  ptXU.y, ptXU.z,
529  0, uwire.iwire, vwire.iwire);
530  spaceCharges.push_back(sc);
531  crossers.push_back(sc);
532  } // end for vwire
533  } // end for uwire
534 
535  CollectionWireHit* cwire = new CollectionWireHit(hit->Channel(), hit->Integral(), crossers);
536  hitmap[cwire] = hit;
537  cwires.push_back(cwire);
538  for(SpaceCharge* sc: crossers) sc->fCWire = cwire;
539  } // end for hit
540  } // end for it (tpc)
541 
542  if(incNei) AddNeighbours(spaceCharges);
543 }
Float_t x
Definition: compare.C:6
std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const
Returns a list of ID of TPCs the specified ROP spans.
double z
z position of intersection
Definition: geo_types.h:494
const geo::GeometryCore * geom
bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
Definition: geo_types.h:413
Planes which measure V.
Definition: geo_types.h:77
void AddNeighbours(const std::vector< SpaceCharge * > &spaceCharges) const
Planes which measure U.
Definition: geo_types.h:76
bool CloseDrift(double xa, double xb) const
bool ISect(int chanA, int chanB, geo::TPCID tpc, geo::WireIDIntersection &pt) const
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
Detector simulation of raw signals on wires.
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
bool CloseSpace(geo::WireIDIntersection ra, geo::WireIDIntersection rb) const
CollectionWireHit * fCWire
Definition: Solver.h:53
double y
y position of intersection
Definition: geo_types.h:493
void FastForward(std::vector< InductionWireWithXPos >::iterator &it, double target, const std::vector< InductionWireWithXPos >::const_iterator &end) const
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
double HitToXPos(const recob::Hit &hit, geo::TPCID tpc) const
bool reco3d::SpacePointSolver::CloseDrift ( double  xa,
double  xb 
) const
protected

Definition at line 220 of file SpacePointSolver_module.cc.

221 {
222  // Used to cut at 10 ticks (for basically empirical reasons). Reproduce that
223  // in x.
224  // Sampling rate is in ns/ticks
225  // Drift velocity is in cm/us
226  // static const double k = 10*detprop->SamplingRate()*1e-3*detprop->DriftVelocity();
227  const double k = 0.2;//0.4; // 1 sigma on deltax plot
228 
229  // TODO - figure out cut value
230  return fabs(xa-xb) < k;
231 }
bool reco3d::SpacePointSolver::CloseSpace ( geo::WireIDIntersection  ra,
geo::WireIDIntersection  rb 
) const
protected

Definition at line 234 of file SpacePointSolver_module.cc.

References FastForward(), geo::WireIDIntersection::y, and geo::WireIDIntersection::z.

236 {
237  TVector3 pa(ra.y, ra.z, 0);
238  TVector3 pb(rb.y, rb.z, 0);
239 
240  // TODO - figure out cut value. Empirically .25 is a bit small
241  // return (pa-pb).Mag() < .5;
242 
243  return (pa-pb).Mag() < .35;
244 }
double z
z position of intersection
Definition: geo_types.h:494
double y
y position of intersection
Definition: geo_types.h:493
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
void reco3d::SpacePointSolver::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 164 of file SpacePointSolver_module.cc.

165 {
166 }
void reco3d::SpacePointSolver::FastForward ( std::vector< InductionWireWithXPos >::iterator it,
double  target,
const std::vector< InductionWireWithXPos >::const_iterator end 
) const
protected

Definition at line 248 of file SpacePointSolver_module.cc.

Referenced by CloseSpace().

251 {
252  while(it != end && it->xpos < target && !CloseDrift(it->xpos, target)) ++it;
253 }
cout<< "-> Edep in the target
Definition: analysis.C:54
bool CloseDrift(double xa, double xb) const
void reco3d::SpacePointSolver::FillSystemToSpacePoints ( const std::vector< CollectionWireHit * > &  cwires,
recob::ChargedSpacePointCollectionCreator pts 
) const
protected

Definition at line 657 of file SpacePointSolver_module.cc.

References FillSystemToSpacePointsAndAssns().

Referenced by AddSpacePoint().

659 {
660  int iPoint = 0;
661  for(const CollectionWireHit* cwire: cwires){
662  for(const SpaceCharge* sc: cwire->fCrossings){
663  AddSpacePoint(*sc, iPoint++, points);
664  } // for sc
665  } // for cwire
666 }
bool AddSpacePoint(const SpaceCharge &sc, int id, recob::ChargedSpacePointCollectionCreator &points) const
return whether the point was inserted (only happens when it has charge)
void reco3d::SpacePointSolver::FillSystemToSpacePointsAndAssns ( const std::vector< CollectionWireHit * > &  cwires,
const HitMap_t hitmap,
recob::ChargedSpacePointCollectionCreator points,
art::Assns< recob::SpacePoint, recob::Hit > &  assn 
) const
protected

Definition at line 671 of file SpacePointSolver_module.cc.

References art::Assns< L, R, D >::addSingle(), SpaceCharge::fWire1, SpaceCharge::fWire2, and recob::ChargedSpacePointCollectionCreator::lastSpacePointPtr().

Referenced by FillSystemToSpacePoints().

675 {
676  int iPoint = 0;
677  for(const CollectionWireHit* cwire: cwires){
678  for(const SpaceCharge* sc: cwire->fCrossings){
679  // fill the space point and reconstructed charge information;
680  // if the point is filtered out, it's not inserted (no association either)
681  if(!AddSpacePoint(*sc, iPoint++, points)) continue;
682 
683  // now fill the associations to the last added space point
684  const auto& spsPtr = points.lastSpacePointPtr();
685 
686  const auto& hit = hitmap.at(cwire);
687  assn.addSingle(spsPtr, hit);
688 
689  if(sc->fWire1){
690  assn.addSingle(spsPtr, hitmap.at(sc->fWire1));
691  }
692  if(sc->fWire2){
693  assn.addSingle(spsPtr, hitmap.at(sc->fWire2));
694  }
695  } // for sc
696  } // for cwire
697 }
art::Ptr< recob::SpacePoint > lastSpacePointPtr() const
Returns an art pointer to the last inserted space point (no check!).
InductionWireHit * fWire2
Definition: Solver.h:54
bool AddSpacePoint(const SpaceCharge &sc, int id, recob::ChargedSpacePointCollectionCreator &points) const
return whether the point was inserted (only happens when it has charge)
InductionWireHit * fWire1
Definition: Solver.h:54
Detector simulation of raw signals on wires.
void addSingle(Ptr< left_t > const &left, Ptr< right_t > const &right, data_t const &data)
Definition: Assns.h:489
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
double reco3d::SpacePointSolver::HitToXPos ( const recob::Hit hit,
geo::TPCID  tpc 
) const
protected

Definition at line 256 of file SpacePointSolver_module.cc.

References AddNeighbours(), recob::Hit::Channel(), recob::Hit::PeakTime(), and w.

257 {
258  const std::vector<geo::WireID> ws = geom->ChannelToWire(hit.Channel());
259  for(geo::WireID w: ws){
260  if(geo::TPCID(w) == tpc)
261  return detprop->ConvertTicksToX(hit.PeakTime(), w);
262  }
263 
264  std::cout << "Wire does not exist on given TPC!" << std::endl;
265  abort();
266 }
const geo::GeometryCore * geom
const detinfo::DetectorProperties * detprop
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
Float_t w
Definition: plot.C:23
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:231
bool reco3d::SpacePointSolver::ISect ( int  chanA,
int  chanB,
geo::TPCID  tpc,
geo::WireIDIntersection pt 
) const
protected

Definition at line 170 of file SpacePointSolver_module.cc.

References pt.

172 {
173  // string has a default implementation for hash. Perhaps TPCID should
174  // implement a hash function directly.
175  typedef std::tuple<int, int, std::string/*geo::TPCID*/> Key_t;
176  static std::unordered_map<Key_t, bool> bCache;
177  static std::unordered_map<Key_t, geo::WireIDIntersection> pCache;
178 
179  // Prevent cache from growing without bound
180  if(bCache.size() > 1e8){
181  std::cout << "Clearing Intersection caches" << std::endl;
182  bCache.clear();
183  pCache.clear();
184  }
185 
186  const Key_t key = std::make_tuple(chanA, chanB, std::string(tpc));
187  if(bCache.count(key)){
188  if(bCache[key]) pt = pCache[key];
189  return bCache[key];
190  }
191 
192  const std::vector<geo::WireID> awires = geom->ChannelToWire(chanA);
193  const std::vector<geo::WireID> bwires = geom->ChannelToWire(chanB);
194 
195  for(geo::WireID awire: awires){
196  if(geo::TPCID(awire) != tpc) continue;
197  for(geo::WireID bwire: bwires){
198  if(geo::TPCID(bwire) != tpc) continue;
199 
200  if(geom->WireIDsIntersect(awire, bwire, pt)){
201  bCache[key] = true;
202  pCache[key] = pt;
203  return true;
204  }
205  }
206  }
207 
208  bCache[key] = false;
209  return false;
210 }
const geo::GeometryCore * geom
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
TMarker * pt
Definition: egs.C:25
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
bool reco3d::SpacePointSolver::ISect ( int  chanA,
int  chanB,
geo::TPCID  tpc 
) const
protected

Definition at line 213 of file SpacePointSolver_module.cc.

214 {
216  return ISect(chanA, chanB, tpc, junk);
217 }
bool ISect(int chanA, int chanB, geo::TPCID tpc, geo::WireIDIntersection &pt) const
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 reco3d::SpacePointSolver::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 701 of file SpacePointSolver_module.cc.

References e, art::fill_ptr_vector(), art::DataViewImpl::getByLabel(), hits(), Iterate(), geo::kCollection, geo::kU, geo::kV, geo::kY, geo::kZ, Metric(), art::Event::put(), and recob::ChargedSpacePointCollectionCreator::put().

702 {
704  std::vector<art::Ptr<recob::Hit> > hitlist;
705  if(evt.getByLabel(fHitLabel, hits))
706  art::fill_ptr_vector(hitlist, hits);
707 
708  recob::ChargedSpacePointCollectionCreator spcol_pre(evt, *this, "pre");
709  recob::ChargedSpacePointCollectionCreator spcol_noreg(evt, *this, "noreg");
711  auto assns = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
712 
713  // Skip very small events
714  if(hits->size() < 20){
715  spcol_pre.put();
716  if(fFit){
717  spcol.put();
718  evt.put(std::move(assns));
719  spcol_noreg.put();
720  }
721  return;
722  }
723 
725 
726  bool is2view = false;
727  std::vector<art::Ptr<recob::Hit>> xhits, uhits, vhits;
728  for(auto& hit: hitlist){
729  if(isnan(hit->Integral()) || isinf(hit->Integral())){
730  std::cout << "WARNING: bad recob::Hit::Integral() = "
731  << hit->Integral()
732  << ". Skipping." << std::endl;
733  continue;
734  }
735 
736  if(hit->SignalType() == geo::kCollection){
737  // For DualPhase, both view are collection. Arbitrarily map V to the main
738  // "X" view. For Argoneut and Lariat, collection=V is also the right
739  // convention.
740  if(hit->View() == geo::kZ){
741  xhits.push_back(hit);
742  }
743  if(hit->View() == geo::kV){
744  xhits.push_back(hit);
745  is2view = true;
746  }
747  if(hit->View() == geo::kU || hit->View() == geo::kY){
748  uhits.push_back(hit);
749  is2view = true;
750  }
751  }
752  else{
753  if(hit->View() == geo::kU) uhits.push_back(hit);
754  if(hit->View() == geo::kV) vhits.push_back(hit);
755  }
756  } // end for hit
757 
758  std::vector<CollectionWireHit*> cwires;
759  // So we can find them all to free the memory
760  std::vector<InductionWireHit*> iwires;
761 
762  HitMap_t hitmap;
763  if(is2view)
764  BuildSystemXU(xhits, uhits, cwires, iwires, fAlpha != 0, hitmap);
765  else
766  BuildSystemXUV(xhits, uhits, vhits, cwires, iwires, fAlpha != 0, hitmap);
767 
768  FillSystemToSpacePoints(cwires, spcol_pre);
769  spcol_pre.put();
770 
771  if(fFit){
772  std::cout << "Iterating..." << std::endl;
773  double prevMetric = Metric(cwires, 0);//fAlpha);
774  std::cout << "Begin: " << prevMetric << std::endl;
775  for(int i = 0;; ++i){
776  Iterate(cwires, 0);//fAlpha);
777  const double metric = Metric(cwires, 0);//fAlpha);
778  std::cout << i << " " << metric << std::endl;
779  if(fabs(metric-prevMetric) < 1e-3*fabs(prevMetric)) break;
780  if(i > 100) break;
781  // if(metric/prevMetric > .9999) break;
782  prevMetric = metric;
783  }
784 
785  FillSystemToSpacePoints(cwires, spcol_noreg);
786  spcol_noreg.put();
787 
788  prevMetric = Metric(cwires, fAlpha);
789  std::cout << "Begin: " << prevMetric << std::endl;
790  for(int i = 0;; ++i){
791  Iterate(cwires, fAlpha);
792  const double metric = Metric(cwires, fAlpha);
793  std::cout << i << " " << metric << std::endl;
794  if(fabs(metric-prevMetric) < 1e-3*fabs(prevMetric)) break;
795  if(i > 100) break;
796  // if(metric/prevMetric > .9999) break;
797  prevMetric = metric;
798  }
799 
800  FillSystemToSpacePointsAndAssns(cwires, hitmap, spcol, *assns);
801  spcol.put();
802  evt.put(std::move(assns));
803  } // end if fFit
804 
805  for(InductionWireHit* i: iwires) delete i;
806  for(CollectionWireHit* c: cwires) delete c;
807 }
const geo::GeometryCore * geom
Planes which measure V.
Definition: geo_types.h:77
std::map< const WireHit *, art::Ptr< recob::Hit > > HitMap_t
Planes which measure Z direction.
Definition: geo_types.h:79
Planes which measure Y direction.
Definition: geo_types.h:80
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void FillSystemToSpacePointsAndAssns(const std::vector< CollectionWireHit * > &cwires, const HitMap_t &hitmap, recob::ChargedSpacePointCollectionCreator &points, art::Assns< recob::SpacePoint, recob::Hit > &assn) const
Planes which measure U.
Definition: geo_types.h:76
void hits()
Definition: readHits.C:15
void Iterate(CollectionWireHit *cwire, double alpha)
Definition: Solver.cxx:235
double Metric(double q, double p)
Definition: Solver.cxx:70
void BuildSystemXU(const std::vector< art::Ptr< recob::Hit >> &xhits, const std::vector< art::Ptr< recob::Hit >> &uhits, std::vector< CollectionWireHit * > &cwires, std::vector< InductionWireHit * > &iwires, bool incNei, HitMap_t &hitmap) const
void BuildSystemXUV(const std::vector< art::Ptr< recob::Hit >> &xhits, const std::vector< art::Ptr< recob::Hit >> &uhits, const std::vector< art::Ptr< recob::Hit >> &vhits, std::vector< CollectionWireHit * > &cwires, std::vector< InductionWireHit * > &iwires, bool incNei, HitMap_t &hitmap) const
Detector simulation of raw signals on wires.
Creates a collection of space points with associated charge.
void FillSystemToSpacePoints(const std::vector< CollectionWireHit * > &cwires, recob::ChargedSpacePointCollectionCreator &pts) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Float_t e
Definition: plot.C:34
Signal from collection planes.
Definition: geo_types.h:93
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

const detinfo::DetectorProperties* reco3d::SpacePointSolver::detprop
protected

Definition at line 128 of file SpacePointSolver_module.cc.

double reco3d::SpacePointSolver::fAlpha
protected

Definition at line 124 of file SpacePointSolver_module.cc.

TH1* reco3d::SpacePointSolver::fDeltaX
protected

Definition at line 126 of file SpacePointSolver_module.cc.

bool reco3d::SpacePointSolver::fFit
protected

Definition at line 122 of file SpacePointSolver_module.cc.

std::string reco3d::SpacePointSolver::fHitLabel
protected

Definition at line 120 of file SpacePointSolver_module.cc.

const geo::GeometryCore* reco3d::SpacePointSolver::geom
protected

Definition at line 129 of file SpacePointSolver_module.cc.


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