LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
108 // LArSoft libraries
109 #include "lardata/RecoBaseProxy/ProxyBase.h" // proxy namespace
112 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect namespace
113 
114 // framework libraries
115 
116 
117 namespace proxy {
118 
119  //----------------------------------------------------------------------------
120 
223 
225  using SpacePointDataProduct_t = std::vector<recob::SpacePoint>;
226 
229 
230  }; // struct ChargedSpacePoints
231 
232 
233 
234  //--------------------------------------------------------------------------
243  template <typename CollProxy>
244  struct SpacePointWithCharge: public CollectionProxyElement<CollProxy> {
245 
247  using base_t::base_t; // inherit constructors
248 
249  public:
250 
251  // --- BEGIN data object access --------------------------------------------
254 
256  recob::SpacePoint const& point() const { return base_t::operator*(); }
257 
259  // --- END data object access ----------------------------------------------
260 
264  { return base_t::template get<ChargedSpacePoints::ChargeTag>(); }
265 
266  // --- BEGIN space point access --------------------------------------------
269 
271  auto ID() const { return point().ID(); }
272 
275  { return geo::vect::makePointFromCoords(point().XYZ()); }
276 
278  // --- END space point access ----------------------------------------------
279 
280 
281  // --- BEGIN charge access -------------------------------------------------
284 
288  { return chargeInfo().charge(); }
289 
292  bool hasCharge() const { return chargeInfo().hasCharge(); }
293 
295  // --- END charge access ---------------------------------------------------
296 
297 
298  }; // SpacePointWithCharge<>
299 
300 
301  //----------------------------------------------------------------------------
322  template <typename MainColl, typename... AuxColl>
324  : public CollectionProxyBase<SpacePointWithCharge, MainColl, AuxColl...>
325  {
326  using base_t
327  = CollectionProxyBase<SpacePointWithCharge, MainColl, AuxColl...>;
328  using base_t::base_t;
329 
330  public:
331 
333  auto const& spacePoints() const
334  { return base_t::main(); }
335 
337  auto const& charges() const
338  {
339  return base_t::template get<ChargedSpacePoints::ChargeTag>().dataRef();
340  }
341 
342  }; // ChargedSpacePointsCollectionProxy
343 
344 
345  //----------------------------------------------------------------------------
363  template <typename Tag = proxy::ChargedSpacePoints::ChargeTag>
364  auto withCharge(art::InputTag inputTag)
365  { return proxy::withParallelDataAs<recob::PointCharge, Tag>(inputTag); }
366 
367 
393  template <typename Event, typename... Args>
395  (Event const& event, art::InputTag inputTag, Args&&... withArgs)
396  {
397  return proxy::getCollection<ChargedSpacePoints>(
398  event, inputTag, withCharge(inputTag), std::forward<Args>(withArgs)...
399  );
400  } // getChargedSpacePoints()
401 
402 
403  //----------------------------------------------------------------------------
422  template <>
424  : public
425  CollectionProxyMakerTraits<ChargedSpacePoints::SpacePointDataProduct_t>
426  {
427  template <typename... Args>
429  };
430 
431  //----------------------------------------------------------------------------
432 
433 
434 } // namespace proxy
435 
436 
437 #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(int argc, char **argv)
Definition: main.cpp:72
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:35
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.
Proxy tag for a recob::SpacePoint collection with charge.
recob::PointCharge::Charge_t charge() const
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:187
QuadExpr operator*(double v, const QuadExpr &e)
Definition: QuadExpr.h:39
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:31