PandaRoot
TrackCandHit.h
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18  */
23 #ifndef genfit_TrackCandHit_h
24 #define genfit_TrackCandHit_h
25 
26 #include <TObject.h>
27 
28 namespace genfit {
29 
33 class TrackCandHit : public TObject {
34  public:
35  // Constructors/Destructors ---------
36  TrackCandHit(int detId = -1, int hitId = -1, int planeId = -1, double sortingParameter = 0.);
37 
38  virtual ~TrackCandHit() { ; }
39 
40  virtual TrackCandHit *clone() const { return new TrackCandHit(*this); }
41 
42  // Accessors
43  int getDetId() const { return detId_; }
44  int getHitId() const { return hitId_; }
45  int getPlaneId() const { return planeId_; }
46  double getSortingParameter() const { return sortingParameter_; }
47 
48  // Modifiers
49  void setSortingParameter(double sortingParameter) { sortingParameter_ = sortingParameter; }
50 
51  virtual void Print(Option_t *option = "") const;
52 
55  friend bool operator==(const TrackCandHit &lhs, const TrackCandHit &rhs);
56  friend bool operator!=(const TrackCandHit &lhs, const TrackCandHit &rhs) { return !(lhs == rhs); }
57 
60  friend bool operator<(const TrackCandHit &lhs, const TrackCandHit &rhs) { return (lhs.sortingParameter_ < rhs.sortingParameter_); }
61 
62  protected:
64  TrackCandHit(const TrackCandHit &other) : TObject(other), detId_(other.detId_), hitId_(other.hitId_), planeId_(other.planeId_), sortingParameter_(other.sortingParameter_) { ; }
67 
68  // Data Members ------------
69  int detId_; // detId id is -1 per default
70  int hitId_; // hitId id is -1 per default
71  int planeId_; // planeId id is -1 per default
72  double sortingParameter_; // sorting parameter
73 
74  public:
75  ClassDef(TrackCandHit, 1)
76 };
77 
78 } /* End of namespace genfit */
81 #endif // genfit_TrackCandHit_h
double getSortingParameter() const
Definition: TrackCandHit.h:46
int getPlaneId() const
Definition: TrackCandHit.h:45
virtual ~TrackCandHit()
Definition: TrackCandHit.h:38
virtual TrackCandHit * clone() const
Definition: TrackCandHit.h:40
TrackCandHit(int detId=-1, int hitId=-1, int planeId=-1, double sortingParameter=0.)
int getDetId() const
Definition: TrackCandHit.h:43
TrackCandHit(const TrackCandHit &other)
protect from calling copy c&#39;tor from outside the class. Use clone() if you want a copy! ...
Definition: TrackCandHit.h:64
friend bool operator!=(const TrackCandHit &lhs, const TrackCandHit &rhs)
Definition: TrackCandHit.h:56
Hit object for use in TrackCand. Provides IDs and sorting parameters.
Definition: TrackCandHit.h:33
virtual void Print(Option_t *option="") const
friend bool operator<(const TrackCandHit &lhs, const TrackCandHit &rhs)
Compare sortingParameter, needed for sorting.
Definition: TrackCandHit.h:60
int getHitId() const
Definition: TrackCandHit.h:44
void setSortingParameter(double sortingParameter)
Definition: TrackCandHit.h:49
TrackCandHit & operator=(const TrackCandHit &)
protect from calling assignment operator from outside the class. Use clone() instead! ...
friend bool operator==(const TrackCandHit &lhs, const TrackCandHit &rhs)
Equality operator. Does not check sortingParameter.
Matrix inversion tools.
Definition: AbsBField.h:28