Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:21

0001 /* Copyright 2008-2010, Technische Universitaet Muenchen,
0002    Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
0003 
0004    This file is part of GENFIT.
0005 
0006    GENFIT is free software: you can redistribute it and/or modify
0007    it under the terms of the GNU Lesser General Public License as published
0008    by the Free Software Foundation, either version 3 of the License, or
0009    (at your option) any later version.
0010 
0011    GENFIT is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014    GNU Lesser General Public License for more details.
0015 
0016    You should have received a copy of the GNU Lesser General Public License
0017    along with GENFIT.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 /** @addtogroup genfit
0020  * @{
0021  */
0022 
0023 #ifndef genfit_TrackCandHit_h
0024 #define genfit_TrackCandHit_h
0025 
0026 #include <TObject.h>
0027 
0028 
0029 namespace genfit {
0030 
0031 /**
0032  * @brief Hit object for use in TrackCand. Provides IDs and sorting parameters.
0033  */
0034 class TrackCandHit : public TObject {
0035  public:
0036 
0037   // Constructors/Destructors ---------
0038   TrackCandHit(int detId   = -1,
0039                int hitId   = -1,
0040                int planeId = -1,
0041                double sortingParameter  =  0.);
0042 
0043   virtual ~TrackCandHit() {;}
0044 
0045   virtual TrackCandHit* clone() const {return new TrackCandHit(*this);}
0046 
0047   // Accessors
0048   int    getDetId() const {return detId_;}
0049   int    getHitId() const {return hitId_;}
0050   int    getPlaneId() const {return planeId_;}
0051   double getSortingParameter() const {return sortingParameter_;}
0052 
0053   // Modifiers
0054   void setSortingParameter(double sortingParameter) {sortingParameter_ = sortingParameter;}
0055 
0056   virtual void Print(Option_t* option = "") const;
0057 
0058 
0059   /** @brief Equality operator. Does not check sortingParameter.
0060    */
0061   friend bool operator== (const TrackCandHit& lhs, const TrackCandHit& rhs);
0062   friend bool operator!= (const TrackCandHit& lhs, const TrackCandHit& rhs) {
0063     return !(lhs == rhs);
0064   }
0065 
0066   /** @brief Compare sortingParameter, needed for sorting
0067    */
0068   friend bool operator< (const TrackCandHit& lhs, const TrackCandHit& rhs) {
0069     return (lhs.sortingParameter_ < rhs.sortingParameter_);
0070   }
0071 
0072  protected:
0073 
0074   //! protect from calling copy c'tor from outside the class. Use #clone() if you want a copy!
0075   TrackCandHit(const TrackCandHit& other) :
0076     TObject(other), detId_(other.detId_), hitId_(other.hitId_), planeId_(other.planeId_), sortingParameter_(other.sortingParameter_) {;}
0077   //! protect from calling assignment operator from outside the class. Use #clone() instead!
0078   TrackCandHit& operator=(const TrackCandHit&);
0079 
0080 
0081   // Data Members ------------
0082   int    detId_; // detId id is -1 per default
0083   int    hitId_; // hitId id is -1 per default
0084   int    planeId_; // planeId id is -1 per default
0085   double sortingParameter_; // sorting parameter
0086 
0087 
0088  public:
0089 
0090   ClassDef(TrackCandHit,1)
0091 
0092 };
0093 
0094 } /* End of namespace genfit */
0095 /** @} */
0096 
0097 #endif // genfit_TrackCandHit_h