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