KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVGeoStrucElement.h
1
3
4#ifndef __KVGEOSTRUCELEMENT_H
5#define __KVGEOSTRUCELEMENT_H
6
7#include "KVBase.h"
8#include "KVUniqueNameList.h"
9class KVDetector;
10
18class KVGeoStrucElement : public KVBase {
19 void init();
20
21protected:
25
28
29public:
31 KVGeoStrucElement(const Char_t* name, const Char_t* type = "");
32 virtual ~KVGeoStrucElement();
33
34 void SetOwnsDaughters(Bool_t yes = kTRUE)
35 {
39 }
40
41 void SetOwnsDetectors(Bool_t yes = kTRUE)
42 {
46 }
47
48 bool OwnsDaughters() const
49 {
52 return fStructures.IsOwner();
53 }
54
55 bool OwnsDetectors() const
56 {
59 return fDetectors.IsOwner();
60 }
61
62 void Sort(Bool_t order = kSortAscending)
63 {
64 SortStructures(order);
65 SortDetectors(order);
66 }
67 void SortStructures(Bool_t order = kSortAscending)
68 {
69 fStructures.Sort(order);
70 }
71 void SortDetectors(Bool_t order = kSortAscending)
72 {
73 fDetectors.Sort(order);
74 }
75 void ClearDetectors(const Char_t* type = "");
76 void ClearStructures(const Char_t* type = "");
77
78 virtual void Add(KVBase*);
79 virtual void Remove(KVBase*);
80
81 void Clear(Option_t* opt = "");
82
83 virtual Bool_t Contains(KVBase* name) const
84 {
87
89 if (det != nullptr) return kTRUE;
90 return (GetStructures()->FindObject(name) != nullptr);
91 }
92
98 KVGeoStrucElement* GetStructure(const Char_t* type, Int_t num) const;
99 KVGeoStrucElement* GetStructure(const Char_t* type, const Char_t* name) const;
100 KVSeqCollection* GetStructureTypeList(const Char_t* type) const;
101 KVDetector* GetDetector(const Char_t* name) const;
102
103 KVDetector* GetDetectorByType(const Char_t* type) const;
104
105 KVSeqCollection* GetDetectorTypeList(const Char_t* type) const;
106 KVSeqCollection* GetDetectorNameList(const Char_t* name) const;
107 KVDetector* GetDetectorAny(const Char_t* name);
108
110 {
111 return &fDetectors;
112 }
114 {
115 return &fDetectors;
116 }
118 {
119 return &fStructures;
120 }
122 {
123 return &fParentStrucList;
124 }
125 virtual Bool_t Fired(Option_t* opt = "any") const;
126 KVGeoStrucElement* GetParentStructure(const Char_t* type, const Char_t* name = "") const;
127
128 void Print(Option_t* option = "") const;
129
130 ClassDef(KVGeoStrucElement, 1) //A multidetector array geometry structural element
131};
132
133#endif
int Int_t
bool Bool_t
char Char_t
constexpr Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
char name[80]
Base class for KaliVeda framework.
Definition KVBase.h:142
Base class for detector geometry description.
Definition KVDetector.h:160
Base class describing elements of array geometry.
virtual Bool_t Fired(Option_t *opt="any") const
const KVSeqCollection * GetStructures() const
void SortStructures(Bool_t order=kSortAscending)
void SetOwnsDetectors(Bool_t yes=kTRUE)
void RemoveParentStructure(KVGeoStrucElement *)
KVUniqueNameList fDetectors
detectors in this structure element
virtual Bool_t Contains(KVBase *name) const
void Sort(Bool_t order=kSortAscending)
void Print(Option_t *option="") const
void SortDetectors(Bool_t order=kSortAscending)
void AddParentStructure(KVGeoStrucElement *)
KVGeoStrucElement * GetStructure(const Char_t *name) const
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
KVUniqueNameList fStructures
daughter structures
bool OwnsDetectors() const
KVSeqCollection * GetDetectors()
virtual void Remove(KVBase *)
KVSeqCollection * GetDetectorTypeList(const Char_t *type) const
KVUniqueNameList fParentStrucList
parent structures
KVDetector * GetDetectorAny(const Char_t *name)
void SetOwnsDaughters(Bool_t yes=kTRUE)
KVGeoStrucElement()
Default constructor.
virtual ~KVGeoStrucElement()
Destructor.
KVSeqCollection * GetStructureTypeList(const Char_t *type) const
void Clear(Option_t *opt="")
Empty lists of detectors, daughter structures, and parent structures.
void ClearStructures(const Char_t *type="")
const KVSeqCollection * GetParents() const
void init()
Default initialisations.
KVSeqCollection * GetDetectorNameList(const Char_t *name) const
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
bool OwnsDaughters() const
void ClearDetectors(const Char_t *type="")
const KVSeqCollection * GetDetectors() const
KVDetector * GetDetectorByType(const Char_t *type) const
Return detector in this structure with given type.
void Sort(Bool_t order=kSortAscending)
Definition KVHashList.h:44
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
Optimised list in which named objects can only be placed once.
Bool_t IsOwner() const
virtual TObject * FindObject(const char *name) const