HitUtils.h
Go to the documentation of this file.
1 /**
2  * @file HitUtils.h
3  * @brief Functions and objects interfacing with recob::Hit
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date December 16th, 2014
6  * @see HitUtils.cxx
7  *
8  * The utilities hereby provided should supply the functionality that was
9  * removed in the simplification of recob::Hit (removal of wire and digit
10  * pointers, etc).
11  */
12 
13 #ifndef HITUTILS_H
14 #define HITUTILS_H
15 
16 // LArSoft libraries
20 
21 
22 /// LArSoft-specific namespace
23 namespace lar {
24 
25  /// LArSoft utility namespace
26  namespace util {
27 
28 
29  /** ************************************************************************
30  * @brief Query object connecting a hit to a wire
31  *
32  * Once upon a time, recob::Hit had a art::Ptr<recob::Wire> in it, and life
33  * was easy.
34  * When it was discovered that art pointers in data products were evil, they
35  * were banned from recob::Hit.
36  * As always, evil turns out to be convenient.
37  * This query object tries to provide in an efficient way a connection
38  * between a hit and the wire that has generated it.
39  *
40  * This object expects
41  *
42  * Example of usage: let hit_ptr be a valid art::Ptr<recob::Hit>. Then
43  *
44  * HitToWire HtoW(evt);
45  * art::Ptr<recob::Wire> wire_ptr = HtoW[hit_ptr];
46  *
47  * If the association label is known, it can be used to selectively load
48  * that association:
49  *
50  * HitToWire HtoW(evt, AssociationInputTag);
51  * art::Ptr<recob::Wire> wire_ptr = HtoW[hit_ptr];
52  *
53  * that has little advantage (in fact, it is possibly slower) respect to
54  * using art::FindOneP.
55  */
57 
58 
59  } // namespace util
60 
61 } // namespace lar
62 
63 
64 
65 
66 #endif // HITUTILS_H
Namespace for general, non-LArSoft-specific utilities.
Query object reading all the associations between two classes.
Definition: FindAllP.h:117
More association queries.
Declaration of signal hit object.
LArSoft-specific namespace.
Declaration of basic channel signal object.