PandaRoot
PndTrkHitList.h
Go to the documentation of this file.
1 
6 #ifndef PNDTRKHITLIST_H
7 #define PNDTRKHITLIST_H 1
8 
9 #include "TVector3.h"
10 #include <TClonesArray.h>
11 #include "PndTrkHit.h"
12 #include "FairHit.h"
13 
14 #include <iostream>
15 #include <cmath>
16 #include <vector>
17 #include <iterator>
18 #include <algorithm>
19 
20 #define MAXNOFHITS 1000 // CHECK consistency
21 
22 class PndTrkHitList : public TObject {
23 
24  public:
25  PndTrkHitList();
27 
28  // CHECK private?
29  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, TVector3 &pos);
30  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t tubeID, TVector3 &pos, Double_t isochrone);
31  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t sensorID, TVector3 &pos);
32  void AddHit(PndTrkHit *hit);
33 
34  void AddTCA(Int_t detID, TClonesArray *array);
35 
36  virtual void AddHit(Int_t hitid, Int_t detid, FairHit *hit);
37 
38  PndTrkHit *GetHit(int index);
39  std::vector<PndTrkHit> GetHitList();
40  PndTrkHit *GetHitByID(int id);
41 
42  inline Int_t GetNofHits() { return hitlist.size(); }
43 
44  void RemoveHit(PndTrkHit *hit)
45  {
46  std::vector<PndTrkHit>::iterator it = find(hitlist.begin(), hitlist.end(), *hit);
47  if (it != hitlist.end())
48  hitlist.erase(it);
49  }
50 
51  void Print();
52  void Draw(Color_t color = kBlack);
53  void ClearList() { hitlist.clear(); }
54 
55  protected:
56  std::vector<PndTrkHit> hitlist;
57 
59 };
60 
61 #endif
void AddTCA(Int_t detID, TClonesArray *array)
PndTrkHit * GetHitByID(int id)
std::vector< PndTrkHit > hitlist
Definition: PndTrkHitList.h:56
void ClearList()
Definition: PndTrkHitList.h:53
ClassDef(PndTrkHitList, 1)
void RemoveHit(PndTrkHit *hit)
Definition: PndTrkHitList.h:44
std::vector< PndTrkHit > GetHitList()
void Draw(Color_t color=kBlack)
void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, TVector3 &pos)
Int_t GetNofHits()
Definition: PndTrkHitList.h:42
PndTrkHit * GetHit(int index)