APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
Branch.h
Go to the documentation of this file.
1 /*
3  *
4  * Branch.h header template automatically generated by a class generator
5  * Creation date : lun. mai 4 2015
6  *
7  * This file is part of APRILContent libraries.
8  *
9  * APRILContent is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  * based upon these libraries are permitted. Any copy of these libraries
14  * must include this copyright notice.
15  *
16  * APRILContent is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with APRILContent. If not, see <http://www.gnu.org/licenses/>.
23  *
24  * @author Remi Ete
25  * @copyright CNRS , IPNL
26  */
27 
28 
29 #ifndef BRANCH_H
30 #define BRANCH_H
31 
32 #include "Pandora/PandoraInternal.h"
33 
35 
36 namespace april_content
37 {
38 
42 class Branch
43 {
44 public:
45  typedef std::vector<const CaloHit *> List;
46  typedef List::value_type value_type;
47  typedef List::iterator iterator;
48  typedef List::const_iterator const_iterator;
49  typedef List::reverse_iterator reverse_iterator;
50  typedef List::const_reverse_iterator const_reverse_iterator;
51 
55  Branch();
56 
63  Branch(const_iterator first, const_iterator last);
64 
68  Branch(const Branch &branch);
69 
73  virtual ~Branch();
74 
81  pandora::StatusCode BuildFromCaloHit(const CaloHit *const pCaloHit);
82 
86  iterator begin();
87 
91  const_iterator begin() const;
92 
96  iterator end();
97 
101  const_iterator end() const;
102 
106  reverse_iterator rbegin();
107 
111  const_reverse_iterator rbegin() const;
112 
116  reverse_iterator rend();
117 
121  const_reverse_iterator rend() const;
122 
126  void clear();
127 
131  size_t size() const;
132 
139  pandora::StatusCode push_back(const CaloHit *const pCaloHit);
140 
147  pandora::StatusCode push_front(const CaloHit *const pCaloHit);
148 
155  pandora::StatusCode Cut(iterator position, bool keepForwardPart = true);
156 
162  bool IsValid() const;
163 
167  Branch &operator =(const Branch &branch);
168 
169 private:
170 
171  std::vector<const CaloHit *> m_caloHitList;
172 };
173 
174 //------------------------------------------------------------------------------------------------------------------------------------------
175 //------------------------------------------------------------------------------------------------------------------------------------------
176 
178 {
179 }
180 
181 //------------------------------------------------------------------------------------------------------------------------------------------
182 
184 {
185  clear();
186 }
187 
188 //------------------------------------------------------------------------------------------------------------------------------------------
189 
190 inline Branch::iterator Branch::begin()
191 {
192  return m_caloHitList.begin();
193 }
194 
195 //------------------------------------------------------------------------------------------------------------------------------------------
196 
197 inline Branch::const_iterator Branch::begin() const
198 {
199  return m_caloHitList.begin();
200 }
201 
202 //------------------------------------------------------------------------------------------------------------------------------------------
203 
204 inline Branch::iterator Branch::end()
205 {
206  return m_caloHitList.end();
207 }
208 
209 //------------------------------------------------------------------------------------------------------------------------------------------
210 
211 inline Branch::const_iterator Branch::end() const
212 {
213  return m_caloHitList.end();
214 }
215 
216 //------------------------------------------------------------------------------------------------------------------------------------------
217 
218 inline Branch::reverse_iterator Branch::rbegin()
219 {
220  return m_caloHitList.rbegin();
221 }
222 
223 //------------------------------------------------------------------------------------------------------------------------------------------
224 
225 inline Branch::const_reverse_iterator Branch::rbegin() const
226 {
227  return m_caloHitList.rbegin();
228 }
229 
230 //------------------------------------------------------------------------------------------------------------------------------------------
231 
232 inline Branch::reverse_iterator Branch::rend()
233 {
234  return m_caloHitList.rend();
235 }
236 
237 //------------------------------------------------------------------------------------------------------------------------------------------
238 
239 inline Branch::const_reverse_iterator Branch::rend() const
240 {
241  return m_caloHitList.rend();
242 }
243 
244 //------------------------------------------------------------------------------------------------------------------------------------------
245 
246 inline void Branch::clear()
247 {
248  return m_caloHitList.clear();
249 }
250 
251 //------------------------------------------------------------------------------------------------------------------------------------------
252 
253 inline size_t Branch::size() const
254 {
255  return m_caloHitList.size();
256 }
257 
258 }
259 
260 #endif // BRANCH_H
Branch & operator=(const Branch &branch)
Assignment operator.
Definition: Branch.cc:184
reverse_iterator rbegin()
Returns a begin reverse iterator on branch.
Definition: Branch.h:218
pandora::StatusCode push_front(const CaloHit *const pCaloHit)
Add a calo hit to the branch (innermost calo hit). A check is performed to test whether the calo hit ...
Definition: Branch.cc:118
size_t size() const
Returns the size of the branch (n calo hits)
Definition: Branch.h:253
Branch()
Default constructor.
Definition: Branch.h:177
pandora::StatusCode push_back(const CaloHit *const pCaloHit)
Add a calo hit to the branch (outermost calo hit). A check is performed to test whether the calo hit ...
Definition: Branch.cc:94
iterator end()
Returns an end iterator on branch.
Definition: Branch.h:204
reverse_iterator rend()
Returns an end reverse iterator on branch.
Definition: Branch.h:232
CaloHit class.
Definition: CaloHit.h:52
iterator begin()
Returns an begin iterator on branch.
Definition: Branch.h:190
virtual ~Branch()
Destructor.
Definition: Branch.h:183
pandora::StatusCode BuildFromCaloHit(const CaloHit *const pCaloHit)
Build-up a branch from the calo hit by looking a UNIQUE backward connection. Stops when no connection...
Definition: Branch.cc:61
void clear()
Clear the branch content.
Definition: Branch.h:246
pandora::StatusCode Cut(iterator position, bool keepForwardPart=true)
Cut the branch and keep only a part of the branch including the calo hit of the iterator.
Definition: Branch.cc:142
bool IsValid() const
Whether the branch is still valid in terms of connected calo hits. Returns true if the structure stil...
Definition: Branch.cc:161
Branch class.
Definition: Branch.h:42