42 fArray(&fRealArray[0])
44 memset(fRealArray, 0, fMaxLevel*
sizeof(
TGeoNode*));
55 size_t needed =
SizeOf(maxlevel);
56 char *ptr =
new char[ needed ];
86 char *ptr =
new char[ needed ];
144 char *where =
reinterpret_cast<char*
>(
this);
145 for (
size_t i=0; i<nobj; ++i, where += needed) {
156 fLevel(other.fLevel),
157 fMaxLevel(other.fMaxLevel),
172 if (&other ==
this)
return *
this;
189 Error(
"AddLevel",
"You must initialize from navigator or copy from another branch array first.");
214 if (value==0)
return kTRUE;
224 if (value!=0)
return kTRUE;
234 if (value>0)
return kTRUE;
244 if (value<0)
return kTRUE;
254 if (value>=0)
return kTRUE;
264 if (value<=0)
return kTRUE;
278 while(nabove-nbelow > 1) {
279 middle = (nabove+nbelow)/2;
280 pind = array[middle-1];
281 if (*value == *pind)
return middle-1;
282 if (*value < *pind) nabove = middle;
283 else nbelow = middle;
300 for (i=0; i<maxLevel+1; i++) {
301 if (
fArray[i]==otherArray[i])
continue;
305 if (
fLevel==otherLevel)
return 0;
306 if (
fLevel<otherLevel)
return -1;
325 Fatal(
"Init",
"Requested level %d exceeds maximum level %d", level+1,
fMaxLevel);
342 Fatal(
"InitFromNavigator",
"Requested level %d exceeds maximum level %d", level+1,
fMaxLevel);
378 for (
Int_t i=0; i<
n; i++) index[i] = i;
396 for (i=1; i<maxlev+1; ++i) {
401 for (i=0; i<navlev-matchlev; i++) nav->
CdUp();
Bool_t operator<=(const TGeoBranchArray &other) const
Is equal operator.
Bool_t operator==(const TGeoBranchArray &other) const
Is equal operator.
virtual Int_t Compare(const TObject *obj) const
Compare with other object of same type.
TGeoVolume * GetVolume() const
TGeoHMatrix * GetCurrentMatrix() const
void SetOutside(Bool_t flag=kTRUE)
static void ReleaseInstance(TGeoBranchArray *obj)
Releases the space allocated for the object.
Short_t Min(Short_t a, Short_t b)
Bool_t operator<(const TGeoBranchArray &other) const
Is equal operator.
void InitFromNavigator(TGeoNavigator *nav)
Init the branch array from current navigator state.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * Data() const
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
static TGeoBranchArray * MakeCopy(const TGeoBranchArray &other)
Make a copy of a branch array at the location (if indicated)
void CopyFrom(const TGeoMatrix *other)
Fast copy method.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Bool_t operator>(const TGeoBranchArray &other) const
Is equal operator.
Bool_t operator!=(const TGeoBranchArray &other) const
Not equal operator.
void UpdateArray(size_t nobj)
Updates the internal addresses for n contiguous objects which have the same fMaxLevel Updates the int...
virtual ~TGeoBranchArray()
void CleanMatrix()
Garbage collect the stored matrix.
static TGeoBranchArray * MakeCopyAt(const TGeoBranchArray &other, void *addr)
Make a copy of a branch array at the location (if indicated)
Bool_t TestBit(UInt_t f) const
void CdDown(Int_t index)
Make a daughter of current node current.
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.
virtual const char * GetName() const
Returns name of object.
TGeoNodeCache * GetCache() const
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Bool_t operator>=(const TGeoBranchArray &other) const
Is equal operator.
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 CdUp()
Go one level up in geometry.
static TGeoBranchArray * MakeInstance(size_t maxlevel)
Make an instance of the class which allocates the node array.
TGeoNode * GetMother(Int_t up=1) const
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
void UpdateNavigator(TGeoNavigator *nav) const
Update the navigator to reflect the branch.
void AddLevel(Int_t dindex)
Add and extra daughter to the current path array. No validity check performed !
TGeoBranchArray & operator=(const TGeoBranchArray &)
Assignment. Not valid anymore. Use TGeoBranchArray::MakeCopy instead.
TGeoNode ** GetArray() const
Mother of all ROOT objects.
virtual void Print(Option_t *option="") const
Print branch information.
#define dest(otri, vertexptr)
static TGeoBranchArray * MakeInstanceAt(size_t maxlevel, void *addr)
Make an instance of the class which allocates the node array.
void CopyTo(TGeoBranchArray *dest)
Raw memcpy of the branch array content to an existing destination.
TGeoBranchArray(Int_t level)
static void Sort(Int_t n, TGeoBranchArray **array, Int_t *index, Bool_t down=kTRUE)
Sorting of an array of branch array pointers.
void GetPath(TString &path) const
Fill path pointed by the array.
ClassImp(TGeoBranchArray) TGeoBranchArray
Constructor. Alocates the array with a size given by level.
TGeoNode * fRealArray[1]
[fMaxLevel+1] Array of nodes