DUNEAnaEventUtils.h
Go to the documentation of this file.
1 /**
2  *
3  * @file dunereco/AnaUtils/DUNEAnaEventUtils.h
4  *
5  * @brief Utility containing helpful functions for end users to access products from events
6 */
7 
8 #ifndef DUNE_ANA_EVENT_UTILS_H
9 #define DUNE_ANA_EVENT_UTILS_H
10 
12 
16 
26 
29 
30 #include <string>
31 #include <vector>
32 
33 namespace dune_ana
34 {
35 /**
36  *
37  * @brief DUNEAnaEventUtils class
38  *
39 */
41 {
42 public:
43  /**
44  * @brief Get the particles from the event
45  *
46  * @param evt is the underlying art event
47  * @param label is the label for the particle producer
48  *
49  * @return vector of art::Ptrs to particles
50  */
51  static std::vector<art::Ptr<recob::PFParticle>> GetPFParticles(const art::Event &evt, const std::string &label);
52 
53  /**
54  * @brief Get the tracks from the event. This function shouldn't be used as the basis of an analysis.
55  *
56  * @param evt is the underlying art event
57  * @param label is the label for the track producer
58  *
59  * @return vector of art::Ptrs to tracks
60  */
61  static std::vector<art::Ptr<recob::Track>> GetTracks(const art::Event &evt, const std::string &label);
62 
63  /**
64  * @brief Get the showers from the event. This function shouldn't be used as the basis of an analysis.
65  *
66  * @param evt is the underlying art event
67  * @param label is the label for the shower producer
68  *
69  * @return vector of art::Ptrs to showers
70  */
71  static std::vector<art::Ptr<recob::Shower>> GetShowers(const art::Event &evt, const std::string &label);
72 
73  /**
74  * @brief Get the vertices from the event
75  *
76  * @param evt is the underlying art event
77  * @param label is the label for the vertex producer
78  *
79  * @return vector of art::Ptrs to vertices
80  */
81  static std::vector<art::Ptr<recob::Vertex>> GetVertices(const art::Event &evt, const std::string &label);
82 
83  /**
84  * @brief Get the hits from the event
85  *
86  * @param evt is the underlying art event
87  * @param label is the label for the hit producer
88  *
89  * @return vector of art::Ptrs to spacepoints
90  */
91  static std::vector<art::Ptr<recob::Hit>> GetHits(const art::Event &evt, const std::string &label);
92 
93  /**
94  * @brief Get the wires from the event
95  *
96  * @param evt is the underlying art event
97  * @param label is the label for the wire producer
98  *
99  * @return vector of art::Ptrs to wires
100  */
101  static std::vector<art::Ptr<recob::Wire>> GetWires(const art::Event &evt, const std::string &label);
102 
103  /**
104  * @brief Get the spacepoints from the event
105  *
106  * @param evt is the underlying art event
107  * @param label is the label for the spacepoint producer
108  *
109  * @return vector of art::Ptrs to spacepoints
110  */
111  static std::vector<art::Ptr<recob::SpacePoint>> GetSpacePoints(const art::Event &evt, const std::string &label);
112 
113  /**
114  * @brief Get the slices from the event
115  *
116  * @param evt is the underlying art event
117  * @param label is the label for the slice producer
118  *
119  * @return vector of art::Ptrs to slices
120  */
121  static std::vector<art::Ptr<recob::Slice>> GetSlices(const art::Event &evt, const std::string &label);
122 
123  /**
124  * @brief Get the MC truths from the event
125  *
126  * @param evt is the underlying art event
127  * @param label is the label for the MC truth producer
128  *
129  * @return vector of art::Ptrs to MC truths
130  */
131  static std::vector<art::Ptr<simb::MCTruth>> GetMCTruths(const art::Event &evt, const std::string &label);
132 
133  /**
134  * @brief Get the MC particles from the event
135  *
136  * @param evt is the underlying art event
137  * @param label is the label for the MC particle producer
138  *
139  * @return vector of art::Ptrs to MC particles
140  */
141  static std::vector<art::Ptr<simb::MCParticle>> GetMCParticles(const art::Event &evt, const std::string &label);
142 
143  /**
144  * @brief Get the clear cosmic ray primaries from the event
145  *
146  * @param evt is the underlying art event
147  * @param label is the label for the particle producer
148  *
149  * @return vector of art::Ptrs to cosmic particles
150  */
151  static std::vector<art::Ptr<recob::PFParticle>> GetClearCosmics(const art::Event &evt, const std::string &label);
152 
153  /**
154  * @brief Get the neutrino from the event
155  *
156  * @param evt is the underlying art event
157  * @param label is the label for the particle producer
158  *
159  * @return atr::Ptr to the neutrino
160  */
161  static art::Ptr<recob::PFParticle> GetNeutrino(const art::Event &evt, const std::string &label);
162 
163  /**
164  * @brief Check to see if the event has a reconstructed neutrino
165  *
166  * @param evt is the underlying art event
167  * @param label is the label for the particle producer
168  *
169  * @return true if the event has a reconstructed neutrino
170  */
171  static bool HasNeutrino(const art::Event &evt, const std::string &label);
172 
173  /**
174  * @brief Get the CVN result objects from the event
175  *
176  * @param evt is the underlying art event
177  * @param label is the label for the cvn evaluator
178  *
179  * @return vector of art::Ptrs to CVN result objects
180  */
181  static std::vector<art::Ptr<cvn::Result>> GetCVNResults(const art::Event &evt, const std::string &label);
182 
183  /**
184  * @brief Get the SquID track PID result objects from the event
185  *
186  * @param evt is the underlying art event
187  * @param label is the label for the SquID evaluator
188  *
189  * @return vector of art::Ptrs to SquID result objects
190  */
191  static std::vector<art::Ptr<ctp::CTPResult>> GetSquIDResults(const art::Event &evt, const std::string &label);
192 
193 
194 };
195 
196 } // namespace dune_ana
197 
198 #endif // DUNE_ANA_EVENT_UTILS_H
199 
DUNEAnaUtilsBase class containing some template functions.
Class storing the result from the convolutional track PID.
std::string string
Definition: nybbler.cc:12
static art::Ptr< recob::PFParticle > GetNeutrino(const art::Event &evt, const std::string &label)
Get the neutrino from the event.
static std::vector< art::Ptr< recob::Hit > > GetHits(const art::Event &evt, const std::string &label)
Get the hits from the event.
static bool HasNeutrino(const art::Event &evt, const std::string &label)
Check to see if the event has a reconstructed neutrino.
static std::vector< art::Ptr< recob::Wire > > GetWires(const art::Event &evt, const std::string &label)
Get the wires from the event.
Particle class.
static std::vector< art::Ptr< ctp::CTPResult > > GetSquIDResults(const art::Event &evt, const std::string &label)
Get the SquID track PID result objects from the event.
static std::vector< art::Ptr< simb::MCParticle > > GetMCParticles(const art::Event &evt, const std::string &label)
Get the MC particles from the event.
static std::vector< art::Ptr< recob::PFParticle > > GetClearCosmics(const art::Event &evt, const std::string &label)
Get the clear cosmic ray primaries from the event.
static std::vector< art::Ptr< recob::Track > > GetTracks(const art::Event &evt, const std::string &label)
Get the tracks from the event. This function shouldn&#39;t be used as the basis of an analysis...
Result for CVN.
static std::vector< art::Ptr< recob::Vertex > > GetVertices(const art::Event &evt, const std::string &label)
Get the vertices from the event.
Base class containing functionality to extract products from the event.
static std::vector< art::Ptr< recob::SpacePoint > > GetSpacePoints(const art::Event &evt, const std::string &label)
Get the spacepoints from the event.
Declaration of signal hit object.
static std::vector< art::Ptr< simb::MCTruth > > GetMCTruths(const art::Event &evt, const std::string &label)
Get the MC truths from the event.
Provides recob::Track data product.
Declaration of basic channel signal object.
static std::vector< art::Ptr< recob::Shower > > GetShowers(const art::Event &evt, const std::string &label)
Get the showers from the event. This function shouldn&#39;t be used as the basis of an analysis...
TCEvent evt
Definition: DataStructs.cxx:7
DUNEAnaEventUtils class.
static std::vector< art::Ptr< cvn::Result > > GetCVNResults(const art::Event &evt, const std::string &label)
Get the CVN result objects from the event.
static std::vector< art::Ptr< recob::PFParticle > > GetPFParticles(const art::Event &evt, const std::string &label)
Get the particles from the event.
static std::vector< art::Ptr< recob::Slice > > GetSlices(const art::Event &evt, const std::string &label)
Get the slices from the event.