54 size_t needed =
SizeOf(maxlevel);
55 char *ptr =
new char[needed];
85 char *ptr =
new char[needed];
120 dest->fArray = &(
dest->fRealArray[0]);
130 delete[](
char *) obj;
146 char *where =
reinterpret_cast<char *
>(
this);
147 for (
size_t i = 0; i < nobj; ++i, where += needed) {
157 :
TObject(other), fLevel(other.fLevel), fMaxLevel(other.fMaxLevel), fMatrix(other.fMatrix), fArray(nullptr)
186 Error(
"AddLevel",
"You must initialize from navigator or copy from another branch array first.");
281 while (nabove - nbelow > 1) {
282 middle = (nabove + nbelow) / 2;
283 pind = array[middle - 1];
306 for (i = 0; i < maxLevel + 1; i++) {
307 if (
fArray[i] == otherArray[i])
333 Fatal(
"Init",
"Requested level %d exceeds maximum level %d", level + 1,
fMaxLevel);
350 Fatal(
"InitFromNavigator",
"Requested level %d exceeds maximum level %d", level + 1,
fMaxLevel);
380 printf(
"branch: %s\n", path.
Data());
388 for (
Int_t i = 0; i <
n; i++)
410 for (i = 1; i < maxlev + 1; ++i) {
416 for (i = 0; i < navlev - matchlev; i++)
418 for (i = matchlev + 1; i <
fLevel + 1; i++)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
An array of daughter indices making a geometry path.
static void ReleaseInstance(TGeoBranchArray *obj)
Releases the space allocated for the object.
TGeoNode ** GetArray() const
TGeoBranchArray & operator=(const TGeoBranchArray &)
Assignment. Not valid anymore. Use TGeoBranchArray::MakeCopy instead.
static TGeoBranchArray * MakeCopyAt(const TGeoBranchArray &other, void *addr)
Make a copy of a branch array at the location (if indicated)
static TGeoBranchArray * MakeCopy(const TGeoBranchArray &other)
Make a copy of a branch array at the location (if indicated)
void Init(TGeoNode **branch, TGeoMatrix *global, Int_t level)
Init the branch array from an array of nodes, the global matrix for the path and the level.
void GetPath(TString &path) const
Fill path pointed by the array.
~TGeoBranchArray() override
void CleanMatrix()
Garbage collect the stored matrix.
Bool_t operator!=(const TGeoBranchArray &other) const
Not equal operator.
static TGeoBranchArray * MakeInstanceAt(size_t maxlevel, void *addr)
Make an instance of the class which allocates the node array.
Bool_t operator<(const TGeoBranchArray &other) const
Is equal operator.
TGeoBranchArray(Int_t level)
Constructor. Allocates the array with a size given by level.
void CopyTo(TGeoBranchArray *dest)
Raw memcpy of the branch array content to an existing destination.
TGeoNode * fRealArray[1]
[fMaxLevel+1] Array of nodes
Bool_t operator>(const TGeoBranchArray &other) const
Is equal operator.
void UpdateArray(size_t nobj)
Updates the internal addresses for n contiguous objects which have the same fMaxLevel Updates the int...
void UpdateNavigator(TGeoNavigator *nav) const
Update the navigator to reflect the branch.
Bool_t operator>=(const TGeoBranchArray &other) const
Is equal operator.
static TGeoBranchArray * MakeInstance(size_t maxlevel)
Make an instance of the class which allocates the node array.
Bool_t operator<=(const TGeoBranchArray &other) const
Is equal operator.
static void Sort(Int_t n, TGeoBranchArray **array, Int_t *index, Bool_t down=kTRUE)
Sorting of an array of branch array pointers.
void AddLevel(Int_t dindex)
Add and extra daughter to the current path array. No validity check performed !
void InitFromNavigator(TGeoNavigator *nav)
Init the branch array from current navigator state.
Bool_t operator==(const TGeoBranchArray &other) const
Is equal operator.
static Long64_t BinarySearch(Long64_t n, const TGeoBranchArray **array, TGeoBranchArray *value)
Binary search in an array of n pointers to branch arrays, to locate value.
Int_t Compare(const TObject *obj) const override
Compare with other object of same type.
void Print(Option_t *option="") const override
Print branch information.
void CopyFrom(const TGeoMatrix *other)
Fast copy method.
Geometrical transformation package.
Class providing navigation API for TGeo geometries.
void CdUp()
Go one level up in geometry.
TGeoNode * GetMother(Int_t up=1) const
void SetOutside(Bool_t flag=kTRUE)
TGeoNodeCache * GetCache() const
void CdDown(Int_t index)
Make a daughter of current node current.
Special pool of reusable nodes.
TGeoHMatrix * GetCurrentMatrix() const
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoVolume * GetVolume() const
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * Data() const
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.