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 typedef std::multimap<Double_t, std::pair<Int_t, Int_t>>::const_iterator mapIter;
40 
41 class PndTrackCand : public FairTimeStamp {
42  public:
43  // Constructors/Destructors ---------
44  PndTrackCand();
45  ~PndTrackCand();
46 
47  // operators
48  bool operator==(const PndTrackCand &rhs);
49 
50  // Accessors -----------------------
52  {
53  if (sorted == false)
54  Sort();
55  return fHitId.at(i);
56  }
57  UInt_t GetNHits() const { return fHitId.size(); }
58  int getMcTrackId() const { return fMcTrackId; }
59 
60  UInt_t GetNHitsDet(Int_t detId);
61  std::vector<PndTrackCandHit> GetSortedHits();
62  void Sort();
63 
64  // Modifiers -----------------------
65  void AddHit(UInt_t detId, UInt_t hitId, Double_t rho);
66  void AddHit(TString branchName, UInt_t hitId, Double_t rho);
67  void AddHit(FairLink link, Double_t rho);
68  void DeleteHit(UInt_t detId, UInt_t hitId);
69  Int_t HitInTrack(UInt_t detId, UInt_t hitId) const;
70  void setMcTrackId(int i) { fMcTrackId = i; }
71 
72  void CalcTimeStamp();
73 
74  void ResetLinks();
75 
76  void Print() const;
77 
78 #ifndef __CINT__ // for BOOST serialization
79  template <class Archive>
80  void serialize(Archive &ar, const unsigned int version)
81  {
82  ar &boost::serialization::base_object<FairTimeStamp>(*this);
83  ar &fHitId;
84  ar &sorted;
85  ar &fMcTrackId;
86  }
87 #endif // for BOOST serialization
88 
89  private:
90  // Private Data Members ------------
91  std::vector<PndTrackCandHit> fHitId;
92  bool sorted;
93  int fMcTrackId; // track id for MC simulation
94  Int_t fVerbose;
95 
96  public:
98 };
99 
100 #endif
101 
102 //--------------------------------------------------------------
103 // $Log$
104 //--------------------------------------------------------------
UInt_t GetNHitsDet(Int_t detId)
std::multimap< Double_t, std::pair< Int_t, Int_t > >::const_iterator mapIter
Definition: PndTrackCand.h:39
Int_t HitInTrack(UInt_t detId, UInt_t hitId) const
PndTrackCandHit GetSortedHit(UInt_t i)
Definition: PndTrackCand.h:51
void setMcTrackId(int i)
Definition: PndTrackCand.h:70
ClassDef(PndTrackCand, 3)
UInt_t GetNHits() const
Definition: PndTrackCand.h:57
unsigned int i
Definition: P4_F32vec4.h:21
bool operator==(const PndTrackCand &rhs)
void Print() const
void AddHit(UInt_t detId, UInt_t hitId, Double_t rho)
int getMcTrackId() const
Definition: PndTrackCand.h:58
void DeleteHit(UInt_t detId, UInt_t hitId)
void serialize(Archive &ar, const unsigned int version)
Definition: PndTrackCand.h:80
void CalcTimeStamp()
void ResetLinks()
std::vector< PndTrackCandHit > GetSortedHits()