Re: [ROOT] TGeoIntersection

From: Andrei Gheata (Andrei.Gheata@cern.ch)
Date: Thu Mar 04 2004 - 09:48:08 MET


Hi Karl,

It is easy, but what you will have to intersect are not volumes as you 
are trying - but shapes. You can do this in the following way:

  TGeoTube *s1 = new TGeoTube("S1", 0.0, tubeOuterRGe,tubeGeHalfT);
  TGeoPgon *s2 = new TGeoPgon("S2", 0,360,6,2);
  s2->DefineSection(0,-tubeGeHalfT, 0, rOuterBase);
  s2->DefineSection(1, tubeGeHalfT, 0, rOuterTop);
  TGeoShape *cs = new TGeoCompositeShape("SU", "S1*S2");
  TGeoVolume *solidGe = new TGeoVolume("solidInt", cs, med);
  // here med is a pointer to a medium made from the material you want
  // for the intersection.

Have also a look at the users guide at the chapter "Composite Shapes".

Regards,
Andrei

karl hauschild wrote:
> 
> Hi,
> 
> I would like to perform a intersection of 2 solids in the TGeomerty
> package.
> 
> 
> I have defined :
> 
>    TGeoVolume *ge_tub =
> 	gGeoManager->MakeTube("geTube",Ge,0.0,tubeOuterRGe,tubeGeHalfT);
> 
> 
>    TGeoVolume *ge_pgon =
> 	 gGeoManager->MakePgon("gePolygon", Al, 0,360,6,2);
>    TGeoPgon   *pgon    = (TGeoPgon*)(ge_pgon->GetShape());
>    
>    pgon->DefineSection(0,-tubeGeHalfT, 0, rOuterBase);
>    pgon->DefineSection(1, tubeGeHalfT, 0, rOuterTop);
> 
> 	
>    The question is : how do I use TGeoIntersection to obtain the same
>    result as I have in Geant4 when using 
> 
>   G4IntersectionSolid* solidGe = 
>     new G4IntersectionSolid("germanium",ge_tub,ge_pgon);
> 
> 
> 
> Many thanks,
> 
> Karl
> 
> [v4.00/02, fedora]
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET