DUNEAnaHitUtils.h
Go to the documentation of this file.
1 /**
2  *
3  * @file dunereco/AnaUtils/DUNEAnaHitUtils.h
4  *
5  * @brief Utility containing helpful functions for end users to access information about Hits
6 */
7 
8 #ifndef DUNE_ANA_HIT_UTILS_H
9 #define DUNE_ANA_HIT_UTILS_H
10 
11 //STL
12 #include <cmath>
13 #include <string>
14 #include <vector>
15 //ROOT
16 //ART
18 //LARSOFT
20 //DUNE
22 
23 namespace dune_ana
24 {
25 /**
26  *
27  * @brief DUNEAnaHitUtils class
28  *
29 */
31 {
32 public:
33  /**
34  * @brief Get the space points associated with the hit.
35  *
36  * @param pHit is the spacepoint for which we want the hits
37  * @param evt is the underlying art event
38  * @param hitLabel is the label for the hit producer
39  * @param hitToSpacePointLabel is the label for the association between hit and space point
40  *
41  * @return vector of art::Ptrs to the hits
42  */
43  static std::vector<art::Ptr<recob::SpacePoint>> GetSpacePoints(const art::Ptr<recob::Hit> &pHit,
44  const art::Event &evt, const std::string &hitLabel, const std::string &hitToSpacePointLabel);
45 
46  /**
47  * @brief Get all hits on a specific plane
48  *
49  * @param hits the hit vector to be searched for hits on a specific plane
50  * @param planeID the requested plane number
51  *
52  * @return the hit vector containing hits on a specific plane
53  */
54  static std::vector<art::Ptr<recob::Hit>> GetHitsOnPlane(const std::vector<art::Ptr<recob::Hit>> &hits,
55  const geo::PlaneID::PlaneID_t planeID);
56 
57  /**
58  * @brief get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0
59  *
60  * @param phit is the hit
61  *
62  * @return the charge normalisation correction
63  */
64  static double LifetimeCorrection(detinfo::DetectorClocksData const& clockData,
65  detinfo::DetectorPropertiesData const& detProp,
66  const art::Ptr<recob::Hit> &pHit);
67 
68  /**
69  * @brief get the lifetime correction for a particular time
70  *
71  * @param timeinTicks the time in ticks
72  * @param t0InMicroS the t0 time in micro seconds
73  *
74  * @return the charge normalisation correction
75  */
76  static double LifetimeCorrection(detinfo::DetectorClocksData const& clockData,
77  detinfo::DetectorPropertiesData const& detProp,
78  const double timeInTicks, const double t0InMicroS);
79 
80  /**
81  * @brief get the total hit charge, corrected for lifetime
82  *
83  * @param hits the vector of hits to be summed over
84  *
85  * @return the lifetime corrected total hit charge
86  */
87  static double LifetimeCorrectedTotalHitCharge(detinfo::DetectorClocksData const& clockData,
88  detinfo::DetectorPropertiesData const& detProp,
89  const std::vector<art::Ptr<recob::Hit> > &hits);
90 };
91 
92 } // namespace dune_ana
93 
94 
95 #endif // DUNE_ANA_HIT_UTILS_H
DUNEAnaUtilsBase class containing some template functions.
std::string string
Definition: nybbler.cc:12
static std::vector< art::Ptr< recob::SpacePoint > > GetSpacePoints(const art::Ptr< recob::Hit > &pHit, const art::Event &evt, const std::string &hitLabel, const std::string &hitToSpacePointLabel)
Get the space points associated with the hit.
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:473
struct vector vector
Base class containing functionality to extract products from the event.
static double LifetimeCorrection(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Ptr< recob::Hit > &pHit)
get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0 ...
static double LifetimeCorrectedTotalHitCharge(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &hits)
get the total hit charge, corrected for lifetime
DUNEAnaHitUtils class.
Declaration of signal hit object.
Contains all timing reference information for the detector.
TCEvent evt
Definition: DataStructs.cxx:7
static std::vector< art::Ptr< recob::Hit > > GetHitsOnPlane(const std::vector< art::Ptr< recob::Hit >> &hits, const geo::PlaneID::PlaneID_t planeID)
Get all hits on a specific plane.