FairRoot/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 "PndTrkHit.h"
11 #include "FairHit.h"
12 
13 #include <iostream>
14 #include <cmath>
15 #include <vector>
16 #include <iterator>
17 #include <algorithm>
18 
19 #define MAXNOFHITS 1000 // CHECK consistency
20 
21 class PndTrkHitList : public TObject
22 {
23 
24  public:
25 
26  PndTrkHitList();
27  ~PndTrkHitList();
28 
29  // CHECK private?
30  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, TVector3& pos);
31  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t tubeID, TVector3& pos, Double_t isochrone);
32  void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, Int_t sensorID, TVector3& pos);
33  void AddHit(PndTrkHit *hit);
34 
35  void AddTCA(Int_t detID, TClonesArray *array);
36 
37  virtual void AddHit(Int_t hitid, Int_t detid, FairHit *hit);
38 
39  PndTrkHit *GetHit(int index);
40  std::vector<PndTrkHit> GetHitList();
41  PndTrkHit *GetHitByID(int id);
42 
43  inline Int_t GetNofHits() { return hitlist.size(); }
44 
45  void RemoveHit(PndTrkHit *hit) {
46  std::vector<PndTrkHit>::iterator it = find(hitlist.begin(), hitlist.end(), *hit);
47  if(it != hitlist.end()) hitlist.erase(it);
48  }
49 
50  void Print();
51  void Draw(Color_t color = kBlack);
52  void ClearList() {
53  hitlist.clear();
54  }
55 
56 
57  protected:
58 
59  std::vector<PndTrkHit> hitlist;
60 
62 };
63 
64 
65 #endif
TVector3 pos
void AddTCA(Int_t detID, TClonesArray *array)
PndTrkHit * GetHitByID(int id)
std::vector< PndTrkHit > hitlist
Definition: PndTrkHitList.h:59
PndTrkHit * GetHit(int index)
void ClearList()
Definition: PndTrkHitList.h:52
ClassDef(PndTrkHitList, 1)
void RemoveHit(PndTrkHit *hit)
Definition: PndTrkHitList.h:45
Double_t
std::vector< PndTrkHit > GetHitList()
void Draw(Color_t color=kBlack)
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
void AddHit(Int_t hitID, Int_t detID, Bool_t used, Int_t iregion, TVector3 &pos)
Int_t GetNofHits()
Definition: PndTrkHitList.h:43