PandaRoot
PndTrackCandHit.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 //-----------------------------------------------------------
14 // File and Version Information:
15 // $Id$
16 //
17 // Description:
18 // Implementation of class PndTrackCand
19 // see PndTrackCand.hh for details
20 //
21 // Environment:
22 // Software developed for the PANDA Detector at FAIR.
23 //
24 // Author List:
25 // Tobias Stockmanns (IKP - Juelich) during the Panda Meeting 03/09
26 //
27 //
28 //-----------------------------------------------------------
29 
30 #ifndef PNDTRACKCANDHIT_HH
31 #define PNDTRACKCANDHIT_HH
32 
33 // Root Class Headers ----------------
34 #include "TObject.h"
35 
36 #include "FairLink.h"
37 
38 #include <iostream>
39 #include <vector>
40 #include <map>
41 
42 #ifndef __CINT__
43 #include <boost/serialization/access.hpp>
44 #include <boost/serialization/base_object.hpp>
45 #endif //__CINT__
46 
47 class PndTrackCandHit : public FairLink {
48  public:
49  PndTrackCandHit() : FairLink(), fRho(0) {}
50  PndTrackCandHit(Int_t detId, Int_t hitId, Double_t rho) : FairLink(detId, hitId), fRho(rho) {}
51  PndTrackCandHit(FairLink &link, Double_t &rho) : FairLink(link), fRho(rho){};
52  virtual ~PndTrackCandHit() {}
53  bool operator<(const PndTrackCandHit &rhs) const { return fRho < rhs.fRho; };
54  bool operator>(const PndTrackCandHit &rhs) const { return fRho > rhs.fRho; };
55  bool operator<=(const PndTrackCandHit &rhs) const { return fRho <= rhs.fRho; };
56  bool operator>=(const PndTrackCandHit &rhs) const { return fRho >= rhs.fRho; };
57  bool operator==(const PndTrackCandHit &hit) const { return (FairLink::operator==((FairLink)hit) && fRho == hit.fRho); }
58  bool operator!=(const PndTrackCandHit &hit) const { return (!(FairLink::operator==(hit))); }
59  Int_t GetHitId() const { return GetIndex(); }
60  Int_t GetDetId() const { return GetType(); }
61  Double_t GetRho() const { return fRho; }
62 
63  void Print() const;
64 
65 #ifndef __CINT__ // for BOOST serialization
66  template <class Archive>
67  void serialize(Archive &ar, const unsigned int version)
68  {
69  ar &boost::serialization::base_object<FairLink>(*this);
70  ar &fRho;
71  }
72 #endif // for BOOST serialization
73 
74  private:
75  Double_t fRho;
76 
77  ClassDef(PndTrackCandHit, 2);
78 };
79 
80 #endif
81 
82 //--------------------------------------------------------------
83 // $Log$
84 //--------------------------------------------------------------
void serialize(Archive &ar, const unsigned int version)
PndTrackCandHit(Int_t detId, Int_t hitId, Double_t rho)
bool operator<=(const PndTrackCandHit &rhs) const
Int_t GetHitId() const
bool operator<(const PndTrackCandHit &rhs) const
Double_t GetRho() const
virtual ~PndTrackCandHit()
bool operator>=(const PndTrackCandHit &rhs) const
void Print() const
bool operator>(const PndTrackCandHit &rhs) const
bool operator!=(const PndTrackCandHit &hit) const
Int_t GetDetId() const
PndTrackCandHit(FairLink &link, Double_t &rho)
bool operator==(const PndTrackCandHit &hit) const