109 Error(
"ctor",
"volume not specified");
189 static Int_t icall = 0;
192 if (unique_volumes) {
227 Info(
"CheckOverlaps",
"Checking overlaps for %s and daughters within %g",
fVolume->
GetName(),ovlp);
229 Info(
"CheckOverlaps",
"Checking overlaps by sampling <%s> for %s and daughters", option,
fVolume->
GetName());
230 Info(
"CheckOverlaps",
"=== NOTE: Extrusions NOT checked with sampling option ! ===");
242 while ((node=next())) {
257 for (i=0; i<novlps; i++) {
262 Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions : %d\n", novlps);
275 if (!painter)
return dist;
287 if (!painter)
return;
298 if (!painter)
return 0;
316 printf(
"== Inspecting node %s ",
GetName());
321 printf(
" possibly overlaping with : ");
326 printf(
"Transformation matrix:\n");
369 if (!
fNovlp) {printf(
"node %s is ONLY\n",
GetName());
return;}
374 for (i=0; i<nd; i++) {
379 for (i=0; i<
fNovlp; i++) {
395 Int_t istart = ifree;
397 for (
Int_t id=0;
id<nd;
id++) {
399 array[istart+
id] = ifree;
400 array[ifree++] = ++nodeid;
415 while ((daughter=(
TGeoNode*)next())) {
416 if (daughter==node) {
423 while ((daughter=(
TGeoNode*)next())) {
424 new_level = daughter->FindNode(node, level+1);
444 out <<
" vol = gGeoManager->GetVolume("<<quote<<
fVolume->
GetName()<<quote<<
");"<<std::endl;
447 out <<
" vol->SetVisDaughters(kFALSE);"<<std::endl;
458 out <<
" vol->SetVisibility(kFALSE);"<<std::endl;
465 for (
Int_t i=0; i<nd; i++) {
470 out <<
" vol = gGeoManager->GetVolume("<<quote<<
fVolume->
GetName()<<quote<<
");"<<std::endl;
471 out<<
" node = vol->GetNode("<<i<<
");"<<std::endl;
473 out<<
" node->VisibleDaughters(kFALSE);"<<std::endl;
478 out<<
" node->SetVisibility(kFALSE);"<<std::endl;
594 if (!painter)
return;
606 printf(
" Local : %g, %g, %g\n", point[0], point[1], point[2]);
608 printf(
"current point not inside this\n");
614 printf(
"current node divided\n");
617 printf(
"point not inside division element\n");
620 printf(
"inside division element %s\n", node->
GetName());
625 printf(
"volume not voxelized\n");
635 printf(
"no candidates for current point\n");
639 for (
Int_t id=0;
id<ncheck;
id++) {
642 else overlap =
"ONLY";
643 printf(
"%i %s %s\n", check_list[
id], node->
GetName(), overlap.
Data());
655 printf(
"Overlaps for node %s :\n",
GetName());
659 printf(
" %s\n", node->
GetName());
722 TGeoNodeMatrix::TGeoNodeMatrix()
770 Int_t count = 40 + 4;
841 TGeoNodeOffset::TGeoNodeOffset()
1003 fArray =
new Int_t[30];
1005 fTopName = fTop->GetName();
1007 fPluginAutoexec =
kFALSE;
1021 for (
Int_t i=0; i<fLevel+1; i++) fArray[i] = iter.
GetIndex(i);
1033 if (fArray)
delete [] fArray;
1042 if (&iter ==
this)
return *
this;
1048 if (fArray)
delete [] fArray;
1050 for (
Int_t i=0; i<fLevel+1; i++) fArray[i] = iter.
GetIndex(i);
1064 if (fMustStop)
return 0;
1074 fArray[++fLevel] = 0;
1075 next = fTop->GetNode(0);
1076 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1079 next = fTop->GetNode(fArray[1]);
1081 for (i=2; i<fLevel+1; i++) {
1087 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1097 if ((fLevel%30)==0) IncreaseArray();
1099 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1104 next = GetNode(fLevel-1);
1106 nd = fTop->GetNdaughters();
1107 if (fArray[fLevel]<nd-1) {
1109 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1110 return fTop->GetNode(fArray[fLevel]);
1116 if (fArray[fLevel]<nd-1) {
1118 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1127 if (fArray[fLevel]<nd-1) {
1129 if (fPlugin && fPluginAutoexec) fPlugin->ProcessNode();
1130 if (!mother)
return fTop->GetNode(fArray[fLevel]);
1152 if (!fLevel)
return fMatrix;
1153 TGeoNode *node = fTop->GetNode(fArray[1]);
1155 for (
Int_t i=2; i<fLevel+1; i++) {
1167 if (!level || level>fLevel)
return 0;
1168 TGeoNode *node = fTop->GetNode(fArray[1]);
1179 if (!fLevel)
return;
1180 TGeoNode *node = fTop->GetNode(fArray[1]);
1183 for (
Int_t i=2; i<fLevel+1; i++) {
1196 memcpy(array, fArray, fLevel*
sizeof(
Int_t));
1206 if (top) fTop = top;
1226 fMustResume =
kTRUE;
1234 next = GetNode(fLevel-1);
1236 if (fArray[fLevel]<nd-1) {
1248 next = GetNode(fLevel-1);
1250 if (fArray[fLevel]<nd-1) {
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
virtual void ls(Option_t *option="") const
Print the path (A/B/C/...) to this node on stdout.
virtual const char * GetName() const
Returns name of object.
void ModifiedPad() const
Send "Modified" signal to painter.
double dist(Rotation3D const &r1, Rotation3D const &r2)
TGeoPatternFinder * fFinder
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
Convert a vector from local reference system to mother reference.
void Print(Option_t *option="") const
print the matrix in 4x4 format
void GetPath(TString &path) const
Returns the path for the current node.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Bool_t TestAttBit(UInt_t f) const
void DrawOnly(Option_t *option="")
draw only this node independently of its vis options
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
TGeoNode()
Default constructor.
void SetUserPlugin(TGeoIteratorPlugin *plugin)
Set a plugin.
virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py)=0
Bool_t IsOverlapping() const
virtual TGeoNode * FindNode(Double_t *, const Double_t *=0)
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
TGeoStateInfo * GetInfo()
Get next state info pointer.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
void CdUp()
Go one level up in geometry.
TVirtualGeoPainter * GetPainter() const
virtual ~TGeoIterator()
Destructor.
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
virtual void SetName(const char *name)
Change (i.e.
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
Convert a vector from mother reference to local reference system.
void Skip()
Stop iterating the current branch.
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual void Print(Option_t *option="") const
Print volume info.
Int_t FindNode(const TGeoNode *node, Int_t level)
Search for a node within the branch of this one.
TGeoNode * Next()
Returns next node.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get node info for the browser.
TGeoNode * operator()()
Returns next node.
void MasterToLocal(const Double_t *master, Double_t *local) const
virtual void DrawOnly(Option_t *option="")
draw only this volume
void ToLower()
Change string to lower-case.
TGeoNodeCache * GetCache() const
TGeoNode * GetNode(Int_t level) const
Returns current node at a given level.
virtual void Paint(Option_t *option="")
Paint this node and its content according to visualization settings.
void Reset(TGeoVolume *top=0)
Resets the iterator for volume TOP.
TObject * At(Int_t idx) const
void IncreaseArray()
Increase by 30 the size of the array.
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void VisibleDaughters(Bool_t vis=kTRUE)
Set visibility of the daughters (obsolete).
virtual TGeoPatternFinder * GetFinder() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void PaintNode(TGeoNode *node, Option_t *option="", TGeoMatrix *global=0)=0
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute mouse actions on this volume.
Int_t GetNdaughters() const
virtual void Clear(Option_t *option="")
Set name and title to empty strings ("").
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the node.
TGeoExtension * fUserExtension
TGeoPatternFinder * GetFinder() const
void PrintVoxelLimits(const Double_t *point) const
print the voxel containing point
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void PrintOverlaps() const
print possible overlapping nodes if (!IsOverlapping()) {printf("node %s is ONLY\n", GetName()); return;}
virtual Int_t GetOptimalVoxels() const
— Returns type of optimal voxelization for this node.
void SetCurrentPoint(Double_t *point)
TObjArray * GetListOfNodes()
The TNamed class is the base class for all named ROOT classes.
virtual TGeoNode * MakeCopyNode() const
Make a copy of this node.
void SetVisStreamed(Bool_t vis=kTRUE)
Mark attributes as "streamed to file".
void InspectNode() const
Inspect this node.
void SortOverlaps()
Sort overlaps by decreasing overlap distance. Extrusions comes first.
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the node.
Bool_t IsOnScreen() const
check if this node is drawn. Assumes that this node is current
const TGeoMatrix * GetCurrentMatrix() const
Returns global matrix for current node.
void SetTopName(const char *name)
Set the top name for path.
virtual Bool_t IsVisible() const
virtual TGeoMatrix * GetMatrix() const =0
virtual ~TGeoNodeOffset()
Destructor.
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
TGeoIteratorPlugin * fPlugin
virtual Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
void Browse(TBrowser *b)
How-to-browse for a node.
virtual Int_t GetIndex() const
Get the index of this offset.
void ReleaseInfo()
Release last used state info pointer.
Using a TBrowser one can browse all ROOT objects.
virtual void Release() const =0
Int_t GetIndex(Int_t i) const
void DrawOverlaps()
Method drawing the overlap candidates with this node.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check overlaps bigger than OVLP hierarchically, starting with this node.
void SetMotherVolume(TGeoVolume *mother)
TGeoNode * GetDaughter(Int_t ind) const
void SaveAttributes(std::ostream &out)
save attributes for this node
Bool_t IsVisStreamed() const
void Draw(Option_t *option="")
draw current node according to option
void PrintCandidates() const
print daughters candidates for containing current point cd();
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
TGeoVolume * GetCurrentVolume() const
virtual Int_t GetByteCount() const
return the total size in bytes of this node
Int_t GetEntriesFast() const
Bool_t IsVisDaughters() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGeoNodeMatrix()
Default constructor.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
void SetIterator(const TGeoIterator *iter)
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Int_t CountDaughters(Bool_t unique_volumes=kFALSE)
Returns the number of daughters.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
Bool_t Contains(const Double_t *point) const
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
void SetFinder(TGeoPatternFinder *finder)
void SetCloned(Bool_t flag=kTRUE)
void SetOverlapping(Bool_t flag=kTRUE)
R__EXTERN TGeoManager * gGeoManager
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
TGeoNodeMatrix & operator=(const TGeoNodeMatrix &gnm)
Assignment.
virtual const char * GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const =0
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
Fill array with node id. Recursive on node branch.
void SetCheckingOverlaps(Bool_t flag=kTRUE)
Binding & operator=(OUT(*fun)(void))
Bool_t IsSelected() const
TGeoNode & operator=(const TGeoNode &)
assignment operator
virtual ~TGeoNode()
Destructor.
Bool_t MayOverlap(Int_t iother) const
Check the overlab between the bounding box of the node overlaps with the one the brother with index I...
void ClearOverlaps()
Clear the list of overlaps.
void CheckShapes()
check for wrong parameters in shapes
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute the closest distance of approach from point px,py to this node
virtual TGeoExtension * Grab()=0
TGeoNodeOffset()
Default constructor.
R__EXTERN TGeoIdentity * gGeoIdentity
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
Bool_t IsVisDaughters() const
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
Bool_t IsVisTouched() const
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
Convert the point coordinates from local reference system to mother reference.
const Double_t * GetCurrentPoint() const
Int_t GetNdaughters() const
virtual TGeoNode * MakeCopyNode() const
make a copy of this node
TGeoManager * GetGeoManager() const
virtual ~TGeoNodeMatrix()
Destructor.
void SetVisibility(Bool_t vis=kTRUE)
Set visibility of the node (obsolete).
TObjArray * GetListOfOverlaps()
TGeoShape * GetShape() const
virtual void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=0, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="")=0
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
void CheckShapes()
check for negative parameters in shapes.
TGeoNodeOffset & operator=(const TGeoNodeOffset &)
assignment operator
virtual const Double_t * GetTranslation() const =0
virtual Bool_t IsCylType() const =0
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
TGeoVolume * GetVolume() const
Bool_t IsRotAboutZ() const
Returns true if no rotation or the rotation is about Z axis.
TGeoIterator & operator=(const TGeoIterator &iter)
Assignment.
void SetOverlaps(Int_t *ovlp, Int_t novlp)
set the list of overlaps for this node (ovlp must be created with operator new)
void SetNumber(Int_t number)
TGeoVolume * GetTopVolume() const
const char * Data() const