LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ChargedSpacePoints.h
Go to the documentation of this file.
1 
104 #ifndef LARDATA_RECOBASEPROXY_CHARGEDSPACEPOINTS_H
105 #define LARDATA_RECOBASEPROXY_CHARGEDSPACEPOINTS_H
106 
107 // LArSoft libraries
108 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect namespace
109 #include "lardata/RecoBaseProxy/ProxyBase.h" // proxy namespace
112 
113 // framework libraries
114 
115 namespace proxy {
116 
117  //----------------------------------------------------------------------------
118 
221 
223  using SpacePointDataProduct_t = std::vector<recob::SpacePoint>;
224 
227 
228  }; // struct ChargedSpacePoints
229 
230  //--------------------------------------------------------------------------
239  template <typename CollProxy>
240  struct SpacePointWithCharge : public CollectionProxyElement<CollProxy> {
241 
243  using base_t::base_t; // inherit constructors
244 
245  public:
246  // --- BEGIN data object access --------------------------------------------
249 
251  recob::SpacePoint const& point() const { return base_t::operator*(); }
252 
254  // --- END data object access ----------------------------------------------
255 
259  {
260  return base_t::template get<ChargedSpacePoints::ChargeTag>();
261  }
262 
263  // --- BEGIN space point access --------------------------------------------
266 
268  auto ID() const { return point().ID(); }
269 
271  geo::Point_t position() const { return geo::vect::makePointFromCoords(point().XYZ()); }
272 
274  // --- END space point access ----------------------------------------------
275 
276  // --- BEGIN charge access -------------------------------------------------
279 
282  recob::PointCharge::Charge_t charge() const { return chargeInfo().charge(); }
283 
286  bool hasCharge() const { return chargeInfo().hasCharge(); }
287 
289  // --- END charge access ---------------------------------------------------
290 
291  }; // SpacePointWithCharge<>
292 
293  //----------------------------------------------------------------------------
314  template <typename MainColl, typename... AuxColl>
316  : public CollectionProxyBase<SpacePointWithCharge, MainColl, AuxColl...> {
317  using base_t = CollectionProxyBase<SpacePointWithCharge, MainColl, AuxColl...>;
318  using base_t::base_t;
319 
320  public:
322  auto const& spacePoints() const { return base_t::main(); }
323 
325  auto const& charges() const
326  {
327  return base_t::template get<ChargedSpacePoints::ChargeTag>().dataRef();
328  }
329 
330  }; // ChargedSpacePointsCollectionProxy
331 
332  //----------------------------------------------------------------------------
350  template <typename Tag = proxy::ChargedSpacePoints::ChargeTag>
351  auto withCharge(art::InputTag inputTag)
352  {
353  return proxy::withParallelDataAs<recob::PointCharge, Tag>(inputTag);
354  }
355 
381  template <typename Event, typename... Args>
382  auto getChargedSpacePoints(Event const& event, art::InputTag inputTag, Args&&... withArgs)
383  {
384  return proxy::getCollection<ChargedSpacePoints>(
385  event, inputTag, withCharge(inputTag), std::forward<Args>(withArgs)...);
386  } // getChargedSpacePoints()
387 
388  //----------------------------------------------------------------------------
407  template <>
409  : public CollectionProxyMakerTraits<ChargedSpacePoints::SpacePointDataProduct_t> {
410  template <typename... Args>
412  };
413 
414  //----------------------------------------------------------------------------
415 
416 } // namespace proxy
417 
418 #endif // LARDATA_RECOBASEPROXY_CHARGEDSPACEPOINTS_H
Collection of data type definitions for collection proxies.
auto getChargedSpacePoints(Event const &event, art::InputTag inputTag, Args &&...withArgs)
Creates and returns a proxy to space points with associated charge.
auto withCharge(art::InputTag inputTag)
Adds additional recob::PointCharge information to the proxy.
int main()
Definition: example_main.cc:17
Information about charge reconstructed in the active volume.
Base utilities for the implementation of data product facades.
Base representation of a collection of proxied objects.
Proxy class for charged space point proxy elements.
std::vector< recob::SpacePoint > SpacePointDataProduct_t
Type of the main collection.
auto const & spacePoints() const
Returns the original collection of space points.
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
recob::SpacePoint const & point() const
Returns the original space point.
Utilities to extend the interface of geometry vectors.
float Charge_t
Type for the amount of reconstructed charge.
Definition: PointCharge.h:33
auto ID() const
Returns the ID of the space point.
Proxy collection class for space points associated to charge.
geo::Point_t position() const
Returns the position of the space point.
An element of a collection proxy.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
Proxy tag for a recob::SpacePoint collection with charge.
recob::PointCharge::Charge_t charge() const
QuadExpr operator*(double v, const QuadExpr &e)
Definition: QuadExpr.h:44
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
recob::PointCharge const & chargeInfo() const
auto const & charges() const
Returns the original collection of charge information.
Event finding and building.
Charge reconstructed in the active volume.
Definition: PointCharge.h:30