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