PandaRoot
PndGeoHitList.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 #ifndef PNDGEOHITLIST_H
14 #define PNDGEOHITLIST_H
15 
16 #include "FairHit.h"
17 
18 #include "TGeoManager.h"
19 #include "TGeoNode.h"
20 #include "TGeoMatrix.h"
21 #include "TGeoVolume.h"
22 #include "TString.h"
23 #include "TClonesArray.h"
24 
25 #include <vector>
26 #include <iostream>
27 
29  public:
30  PndGeoHitList();
31  PndGeoHitList(TString groupName, TString topNodeName, TGeoVolume *baseVolume);
32  virtual ~PndGeoHitList();
33  PndGeoHitList(const PndGeoHitList &) = delete;
34  PndGeoHitList &operator=(const PndGeoHitList &) = delete;
35 
36  void CreateNewGroup(TString groupName, TString topNodeName, TGeoVolume *baseVolume);
37  void AddHit(FairHit *hit, Bool_t vis = kTRUE);
38  void AddHit(Double_t x, Double_t y, Double_t z, Bool_t vis = kTRUE);
39  void AddHit(TGeoMatrix *mat, Bool_t vis = kTRUE);
40  void AddHits(TClonesArray *hitList, Bool_t vis = kTRUE);
41  void SetHits(TClonesArray *hitList, Bool_t vis = kTRUE);
42  void RemoveGeoHits(Int_t from);
43  void CreateGeoHit(TGeoMatrix *mat);
44 
45  TString GetName() const { return fGroupName; };
46  const std::vector<TGeoNode *> GetNodes() const { return fNodeList; };
47  void SetVisibility(TString NodeName, bool value);
48  void SetVisibility(TGeoHMatrix pos, bool value);
49  void SetVisibility(Int_t id, bool value);
50  void SetAllInvisible();
51  Int_t GetNodeId(TString NodeName);
52  Int_t GetNodeId(TGeoHMatrix pos);
53 
54  private:
55  TString fGroupName;
56  TString fVolName;
57  std::vector<TGeoNode *> fNodeList;
58  TGeoVolume *fGroupVolume;
59  TGeoVolume *fTopVolume;
60  TGeoVolume *fBaseVolume;
61 
62  void CreateGeoHits(Int_t number);
63  void SetGeoHitsInvisible(Int_t from);
64 
65  ClassDef(PndGeoHitList, 1);
66 };
67 
68 #endif /*PNDGEOHITLIST_H*/
void SetVisibility(TString NodeName, bool value)
virtual ~PndGeoHitList()
void SetAllInvisible()
void AddHit(FairHit *hit, Bool_t vis=kTRUE)
void AddHits(TClonesArray *hitList, Bool_t vis=kTRUE)
void CreateGeoHit(TGeoMatrix *mat)
const std::vector< TGeoNode * > GetNodes() const
Definition: PndGeoHitList.h:46
void RemoveGeoHits(Int_t from)
TString GetName() const
Definition: PndGeoHitList.h:45
Int_t GetNodeId(TString NodeName)
void SetHits(TClonesArray *hitList, Bool_t vis=kTRUE)
PndGeoHitList & operator=(const PndGeoHitList &)=delete
void CreateNewGroup(TString groupName, TString topNodeName, TGeoVolume *baseVolume)