PandaRoot
TrackCandHit.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30  */
35 #ifndef genfit_TrackCandHit_h
36 #define genfit_TrackCandHit_h
37 
38 #include <TObject.h>
39 
40 namespace genfit {
41 
45 class TrackCandHit : public TObject {
46  public:
47  // Constructors/Destructors ---------
48  TrackCandHit(int detId = -1, int hitId = -1, int planeId = -1, double sortingParameter = 0.);
49 
50  virtual ~TrackCandHit() { ; }
51 
52  virtual TrackCandHit *clone() const { return new TrackCandHit(*this); }
53 
54  // Accessors
55  int getDetId() const { return detId_; }
56  int getHitId() const { return hitId_; }
57  int getPlaneId() const { return planeId_; }
58  double getSortingParameter() const { return sortingParameter_; }
59 
60  // Modifiers
61  void setSortingParameter(double sortingParameter) { sortingParameter_ = sortingParameter; }
62 
63  virtual void Print(Option_t *option = "") const;
64 
67  friend bool operator==(const TrackCandHit &lhs, const TrackCandHit &rhs);
68  friend bool operator!=(const TrackCandHit &lhs, const TrackCandHit &rhs) { return !(lhs == rhs); }
69 
72  friend bool operator<(const TrackCandHit &lhs, const TrackCandHit &rhs) { return (lhs.sortingParameter_ < rhs.sortingParameter_); }
73 
74  protected:
76  TrackCandHit(const TrackCandHit &other) : TObject(other), detId_(other.detId_), hitId_(other.hitId_), planeId_(other.planeId_), sortingParameter_(other.sortingParameter_) { ; }
79 
80  // Data Members ------------
81  int detId_; // detId id is -1 per default
82  int hitId_; // hitId id is -1 per default
83  int planeId_; // planeId id is -1 per default
84  double sortingParameter_; // sorting parameter
85 
86  public:
87  ClassDef(TrackCandHit, 1)
88 };
89 
90 } /* End of namespace genfit */
93 #endif // genfit_TrackCandHit_h
double getSortingParameter() const
Definition: TrackCandHit.h:58
int getPlaneId() const
Definition: TrackCandHit.h:57
virtual ~TrackCandHit()
Definition: TrackCandHit.h:50
virtual TrackCandHit * clone() const
Definition: TrackCandHit.h:52
TrackCandHit(int detId=-1, int hitId=-1, int planeId=-1, double sortingParameter=0.)
int getDetId() const
Definition: TrackCandHit.h:55
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:76
friend bool operator!=(const TrackCandHit &lhs, const TrackCandHit &rhs)
Definition: TrackCandHit.h:68
Hit object for use in TrackCand. Provides IDs and sorting parameters.
Definition: TrackCandHit.h:45
virtual void Print(Option_t *option="") const
friend bool operator<(const TrackCandHit &lhs, const TrackCandHit &rhs)
Compare sortingParameter, needed for sorting.
Definition: TrackCandHit.h:72
int getHitId() const
Definition: TrackCandHit.h:56
void setSortingParameter(double sortingParameter)
Definition: TrackCandHit.h:61
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:40