104 Error(
"Compare",
"other object is not TGeoOverlap");
123 return fVolume1->GetGeoManager()->GetGeomPainter()->DistanceToPrimitiveVol(
fVolume1, px,
py);
132 fVolume1->GetGeoManager()->GetGeomPainter()->DrawOverlap(
this,
option);
141 fVolume1->GetGeoManager()->GetGeomPainter()->ExecuteVolumeEvent(
fVolume1, event, px,
py);
149 fVolume1->GetGeoManager()->GetGeomPainter()->PaintOverlap(
this,
option);
158 printf(
" - first volume: %s at position:\n",
fVolume1->GetName());
161 printf(
" - second volume: %s at position:\n",
fVolume2->GetName());
200 while (
ipoint < npoints) {
202 pt[0] = orig[0] - dx + 2. * dx *
gRandom->Rndm();
203 pt[1] = orig[1] - dy + 2. * dy *
gRandom->Rndm();
204 pt[2] = orig[2] - dz + 2. * dz *
gRandom->Rndm();
207 if (itry > 10000 && !
ipoint) {
208 Error(
"SampleOverlap",
"No point inside volume!!! - aborting");
232 marker->
Draw(
"SAME");
238 Info(
"SampleOverlap",
"#Overlap %s has %g +/- %g [cm3]",
GetName(), capacity, err * capacity);
259 for (
Int_t i = 0;
i < npoints;
i++) {
260 fMarker->GetPoint(
i, point[0], point[1], point[2]);
262 fMatrix1->MasterToLocal(point, local);
264 printf(
"point %d: safe1=%f\n",
i, safe1);
266 fMatrix1->MasterToLocal(point, local);
268 fMatrix2->MasterToLocal(point, local);
270 printf(
"point %d: safe1=%f safe2=%f\n",
i, safe1, safe2);
R__EXTERN TRandom * gRandom
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Using a TBrowser one can browse all ROOT objects.
Matrix class used for computing global transformations Should NOT be used for node definition.
Geometrical transformation package.
Base class describing geometry overlaps.
void SetIsOverlap(Bool_t flag=kTRUE)
void Paint(Option_t *option="") override
Paint the overlap.
void Validate() const
Validate this overlap.
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
void SampleOverlap(Int_t npoints=1000000)
Draw overlap and sample with random points the overlapping region.
Int_t Compare(const TObject *obj) const override
Method to compare this overlap with another.
void Draw(Option_t *option="") override
Draw the overlap.
void Print(Option_t *option="") const override
Print detailed info.
TGeoOverlap(const TGeoOverlap &)=delete
~TGeoOverlap() override
Destructor.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Distance to primitive for an overlap.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Event interception.
void Browse(TBrowser *b) override
Define double-click action.
virtual void PrintInfo() const
Print some info.
Bool_t IsExtrusion() const
Double_t GetOverlap() const
void Sizeof3D() const override
Get 3D size of this.
TGeoOverlap()
Default ctor.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
void Draw(Option_t *option="") override
Draws 3-D polymarker with its current attributes.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t Sqrt(Double_t x)
Returns the square root of x.