Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 09/02/03
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TGeoOverlap
13#define ROOT_TGeoOverlap
15#include "TNamed.h"
17#include "TAttLine.h"
19#include "TAttFill.h"
21#include "TAtt3D.h"
23#include "TGeoMatrix.h"
26// //
27// TGeoOverlap - base class describing geometry overlaps. Overlaps apply //
28// to the nodes contained inside a volume. These should not overlap to //
29// each other nor extrude the shape of their mother volume. //
30// //
33class TGeoVolume;
34class TPolyMarker3D;
35class TBrowser;
37class TGeoOverlap : public TNamed, public TAttLine, public TAttFill, public TAtt3D {
42 TGeoOverlap(const TGeoOverlap &) = delete;
43 TGeoOverlap &operator=(const TGeoOverlap &) = delete;
46 Double_t fOverlap; // overlap distance
47 TGeoVolume *fVolume1; // first volume
48 TGeoVolume *fVolume2; // second volume
49 TGeoHMatrix *fMatrix1; // positioning matrix for first volume
50 TGeoHMatrix *fMatrix2; // positioning matrix for second volume
51 TPolyMarker3D *fMarker; // points in the overlapping region
55 TGeoOverlap(const char *name, TGeoVolume *vol1, TGeoVolume *vol2, const TGeoMatrix *matrix1,
56 const TGeoMatrix *matrix2, Bool_t isovlp = kTRUE, Double_t ovlp = 0.01);
57 ~TGeoOverlap() override;
59 void Browse(TBrowser *b) override;
60 Int_t Compare(const TObject *obj) const override;
61 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
62 void Draw(Option_t *option = "") override; // *MENU*
63 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
64 TPolyMarker3D *GetPolyMarker() const { return fMarker; }
65 TGeoVolume *GetFirstVolume() const { return fVolume1; }
66 TGeoVolume *GetSecondVolume() const { return fVolume2; }
67 TGeoHMatrix *GetFirstMatrix() const { return fMatrix1; }
69 Double_t GetOverlap() const { return fOverlap; }
72 Bool_t IsFolder() const override { return kFALSE; }
73 Bool_t IsSortable() const override { return kTRUE; }
74 void Paint(Option_t *option = "") override;
75 void Print(Option_t *option = "") const override; // *MENU*
76 virtual void PrintInfo() const;
77 void Sizeof3D() const override;
78 void SampleOverlap(Int_t npoints = 1000000); // *MENU*
80 {
83 }
85 {
88 }
90 void SetFirstVolume(TGeoVolume *vol) { fVolume1 = vol; }
91 void SetSecondVolume(TGeoVolume *vol) { fVolume2 = vol; }
92 void SetFirstMatrix(TGeoMatrix *matrix) { *fMatrix1 = matrix; }
93 void SetSecondMatrix(TGeoMatrix *matrix) { *fMatrix2 = matrix; }
94 void SetOverlap(Double_t ovlp) { fOverlap = ovlp; }
95 void Validate() const; // *MENU*
97 ClassDefOverride(TGeoOverlap, 2) // base class for geometical overlaps
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
Geometrical transformation package.
Definition TGeoMatrix.h:38
Base class describing geometry overlaps.
Definition TGeoOverlap.h:37
TGeoVolume * GetSecondVolume() const
Definition TGeoOverlap.h:66
TGeoHMatrix * fMatrix1
Definition TGeoOverlap.h:49
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TGeoOverlap.h:72
void SetIsOverlap(Bool_t flag=kTRUE)
Definition TGeoOverlap.h:84
void Paint(Option_t *option="") override
Paint the overlap.
void Validate() const
Validate this overlap.
TPolyMarker3D * GetPolyMarker() const
Definition TGeoOverlap.h:64
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
TGeoVolume * fVolume1
Definition TGeoOverlap.h:47
Bool_t IsOverlap() const
Definition TGeoOverlap.h:71
void SetFirstMatrix(TGeoMatrix *matrix)
Definition TGeoOverlap.h:92
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 SetOverlap(Double_t ovlp)
Definition TGeoOverlap.h:94
TPolyMarker3D * fMarker
Definition TGeoOverlap.h:51
void SetSecondMatrix(TGeoMatrix *matrix)
Definition TGeoOverlap.h:93
void Print(Option_t *option="") const override
Print detailed info.
TGeoOverlap(const TGeoOverlap &)=delete
~TGeoOverlap() override
TGeoHMatrix * GetFirstMatrix() const
Definition TGeoOverlap.h:67
Double_t fOverlap
Definition TGeoOverlap.h:46
void SetSecondVolume(TGeoVolume *vol)
Definition TGeoOverlap.h:91
TGeoHMatrix * fMatrix2
Definition TGeoOverlap.h:50
TGeoOverlap & operator=(const TGeoOverlap &)=delete
void SetFirstVolume(TGeoVolume *vol)
Definition TGeoOverlap.h:90
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Distance to primitive for an overlap.
TGeoVolume * fVolume2
Definition TGeoOverlap.h:48
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 IsSortable() const override
Definition TGeoOverlap.h:73
Bool_t IsExtrusion() const
Definition TGeoOverlap.h:70
void SetIsExtrusion(Bool_t flag=kTRUE)
Definition TGeoOverlap.h:79
Double_t GetOverlap() const
Definition TGeoOverlap.h:69
void Sizeof3D() const override
Get 3D size of this.
TGeoHMatrix * GetSecondMatrix() const
Definition TGeoOverlap.h:68
Default ctor.
TGeoVolume * GetFirstVolume() const
Definition TGeoOverlap.h:65
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:780
A 3D polymarker.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
th1 Draw()