101 Error(
"Compare",
"other object is not TGeoOverlap");
120 return fVolume1->GetGeoManager()->GetGeomPainter()->DistanceToPrimitiveVol(
fVolume1, px, py);
129 fVolume1->GetGeoManager()->GetGeomPainter()->DrawOverlap(
this, option);
138 fVolume1->GetGeoManager()->GetGeomPainter()->ExecuteVolumeEvent(
fVolume1, event, px, py);
146 fVolume1->GetGeoManager()->GetGeomPainter()->PaintOverlap(
this, option);
155 printf(
" - first volume: %s at position:\n",
fVolume1->GetName());
158 printf(
" - second volume: %s at position:\n",
fVolume2->GetName());
167 printf(
" - first %d points in the overlapping region :\n", nshow);
169 for (
auto i = 0; i < nshow; ++i) {
171 printf(
" {%g, %g, %g}\n",
x,
y, z);
211 while (ipoint < npoints) {
213 pt[0] = orig[0] - dx + 2. * dx *
gRandom->Rndm();
214 pt[1] = orig[1] - dy + 2. * dy *
gRandom->Rndm();
215 pt[2] = orig[2] - dz + 2. * dz *
gRandom->Rndm();
218 if (itry > 10000 && !ipoint) {
219 Error(
"SampleOverlap",
"No point inside volume!!! - aborting");
243 marker->
Draw(
"SAME");
249 Info(
"SampleOverlap",
"#Overlap %s has %g +/- %g [cm3]",
GetName(), capacity,
err * capacity);
270 for (
Int_t i = 0; i < npoints; i++) {
271 fMarker->GetPoint(i, point[0], point[1], point[2]);
273 fMatrix1->MasterToLocal(point, local);
275 printf(
"point %d: safe1=%f\n", i, safe1);
277 fMatrix1->MasterToLocal(point, local);
279 fMatrix2->MasterToLocal(point, local);
281 printf(
"point %d: safe1=%f safe2=%f\n", i, safe1, safe2);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
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.
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 ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
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.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.