FairRoot/PandaRoot
PndTrackCand.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 // File and Version Information:
3 // $Id$
4 //
5 // Description:
6 // Implementation of class PndTrackCand
7 // see PndTrackCand.hh for details
8 //
9 // Environment:
10 // Software developed for the PANDA Detector at FAIR.
11 //
12 // Author List:
13 // Tobias Stockmanns (IKP - Juelich) during the Panda Meeting 03/09
14 //
15 //
16 //-----------------------------------------------------------
17 
18 #ifndef PNDTRACKCAND_HH
19 #define PNDTRACKCAND_HH
20 
21 // Root Class Headers ----------------
22 #include "PndTrackCandHit.h"
23 #include "FairTimeStamp.h"
24 
25 #include "TObject.h"
26 #include "TVector3.h"
27 #include "TString.h"
28 
29 #include <iostream>
30 #include <vector>
31 #include <map>
32 
33 #ifndef __CINT__
34 #include <boost/serialization/access.hpp>
35 #include <boost/serialization/base_object.hpp>
36 #include <boost/serialization/vector.hpp>
37 #endif //__CINT__
38 
39 
40 
41 typedef std::multimap<Double_t, std::pair<Int_t, Int_t> >::const_iterator mapIter;
42 
43 class PndTrackCand : public FairTimeStamp {
44 public:
45 
46  // Constructors/Destructors ---------
47  PndTrackCand();
48  ~PndTrackCand();
49 
50  // operators
51  bool operator== (const PndTrackCand& rhs);
52 
53  // Accessors -----------------------
55  if (sorted == false)
56  Sort();
57  return fHitId.at(i);
58  }
59  UInt_t GetNHits() const {return fHitId.size();}
60  int getMcTrackId() const {return fMcTrackId;}
61 
62  UInt_t GetNHitsDet(Int_t detId);
63  std::vector<PndTrackCandHit>GetSortedHits();
64  void Sort();
65 
66  // Modifiers -----------------------
67  void AddHit(UInt_t detId, UInt_t hitId, Double_t rho);
68  void AddHit(TString branchName, UInt_t hitId, Double_t rho);
69  void AddHit(FairLink link, Double_t rho);
70  void DeleteHit(UInt_t detId, UInt_t hitId);
71  Int_t HitInTrack(UInt_t detId, UInt_t hitId) const;
72  void setMcTrackId(int i){fMcTrackId=i;}
73 
74  void CalcTimeStamp();
75 
76  void ResetLinks();
77 
78  void Print() const;
79 
80 #ifndef __CINT__ // for BOOST serialization
81  template<class Archive>
82  void serialize(Archive & ar, const unsigned int version)
83  {
84  ar & boost::serialization::base_object<FairTimeStamp>(*this);
85  ar & fHitId;
86  ar & sorted;
87  ar & fMcTrackId;
88  }
89 #endif // for BOOST serialization
90 
91 private:
92  // Private Data Members ------------
93  std::vector<PndTrackCandHit> fHitId;
94  bool sorted;
95  int fMcTrackId; //track id for MC simulation
96  Int_t fVerbose;
97 public:
99 };
100 
101 #endif
102 
103 //--------------------------------------------------------------
104 // $Log$
105 //--------------------------------------------------------------
UInt_t GetNHitsDet(Int_t detId)
int getMcTrackId() const
Definition: PndTrackCand.h:60
void Print() const
Int_t i
Definition: run_full.C:25
std::multimap< Double_t, std::pair< Int_t, Int_t > >::const_iterator mapIter
Definition: PndTrackCand.h:41
std::vector< PndTrackCandHit > GetSortedHits()
PndTrackCandHit GetSortedHit(UInt_t i)
Definition: PndTrackCand.h:54
void setMcTrackId(int i)
Definition: PndTrackCand.h:72
ClassDef(PndTrackCand, 3)
std::vector< PndTrackCandHit > fHitId
first index is detId, second index is hit Id
Definition: PndTrackCand.h:93
bool operator==(const PndTrackCand &rhs)
Int_t fVerbose
Definition: PndTrackCand.h:96
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
Double_t
void DeleteHit(UInt_t detId, UInt_t hitId)
void serialize(Archive &ar, const unsigned int version)
Definition: PndTrackCand.h:82
void CalcTimeStamp()
void ResetLinks()
UInt_t GetNHits() const
Definition: PndTrackCand.h:59
Int_t HitInTrack(UInt_t detId, UInt_t hitId) const