[VMC] Re: composite shapes

From: Andrei Gheata (Andrei.Gheata@cern.ch)
Date: Thu Jun 17 2004 - 14:44:38 MEST


Hi Ivana,

This is probably due to a bug that I have fixed few weeks ago - this was 
altering the matrices of the current tracked geometry branch. It was 
squite severe and I introduced it few moths ago when trying to optimize 
TGeoCache class. This is fixed in 4.00-04 and we forgot to notify the 
VMC list to update TGeo. Please do so.
 I attached the picture for your composite shape made with 4-04 and the 
translation t1 is taken correctly into account.

Best regards,
Andrei

Ivana Hrivnacova wrote:

> Hi Andrei,
>
> I attached a macro, where I don't understand
> if I do something wrong or a if the problem is in Root.
>
> It seems to me that when I define the composite shape
> in this way, the t1 translation is not taken into account:
>  TGeoCompositeShape* cs
>    = new TGeoCompositeShape("cs", "B:t1-T:r2"); 
> The picture is the same as for "B-T:r2."
>
> When applying it to the T volume, it works as expected.
>
> Could you have a look, please, and let me know?
> I did this test with Root 4.00/03.
>
> Thank you,
>
> Ivana
>
>  
>
>------------------------------------------------------------------------
>
>void macrox()
>{
>// Example with displacement applied namely on left solid
>// ---
>
>  gSystem->Load("libGeom");
>  new TGeoManager("Geom", "composite shape example");
>
>  // Define some material
>  TGeoMaterial* material = new TGeoMaterial("Al", 26.98, 13, 2.7);
>  TGeoMedium* medium = new TGeoMedium("Medium", 1, material);
>
>  const Double_t sq2 = TMath::Sqrt(2.);
>  TGeoVolume* top = gGeoManager->MakeBox("TOP", medium, 300., 300., 300.);
>  gGeoManager->SetTopVolume(top);  
>
>  // Add a small box in the middle
>  //
>  TGeoShape* solid
>    = new TGeoBBox("SB", 10., 10, 10);
>  TGeoVolume* volume1
>    = new TGeoVolume("volume1", solid,medium);
>  top->AddNode(volume1, 1, new TGeoTranslation(0., 0., 0.));
>  volume1->SetLineColor(4);  
>
>
>  // Make shape componenets
>  //
>  new TGeoBBox("B", 100., 100, 100);
>  new TGeoTube("T", 0., 20., 100.) ;
> 
>  // Define rotations
>  //
>  TGeoTranslation* t1 = new TGeoTranslation("t1", 0., 50., 0);
>  t1->RegisterYourself();
>  TGeoTranslation* t2 = new TGeoTranslation("t2", 0., -50., 0);
>  t2->RegisterYourself();
>  TGeoTranslation* t3 = new TGeoTranslation("t3", 150., 0., 0);
>  t3->RegisterYourself();
>  
>  TGeoRotation* r1 = new TGeoRotation();
>  r1->RotateZ(45.);
>  r1->SetName("r1");
>  r1->RegisterYourself();
>
>  TGeoRotation* r2 = new TGeoRotation();
>  r2->RotateX(90.);
>  r2->SetName("r2");
>  r2->RegisterYourself();
>  
>  TGeoCombiTrans* tc1 = new TGeoCombiTrans("tc1", -150., 0., 0, r1);
>  tc1->RegisterYourself();
>  TGeoCombiTrans* tc2 = new TGeoCombiTrans("tc2",  0., -50., 0., r1);
>  tc2->RegisterYourself();
> 
>  // Create composite shape
>  //
>  //TGeoCompositeShape* cs
>  //  = new TGeoCompositeShape("cs", "((B:t1-T):tc1+(B:t2-T):t3"); 
>  
>  TGeoCompositeShape* cs
>    = new TGeoCompositeShape("cs", "B:t1-T:r2"); 
>           // t1 shift in y not seen
>
>  //TGeoCompositeShape* cs
>  //  = new TGeoCompositeShape("cs", "B-T:tc2"); 
>  //         // if traslation applied to T ok
>
>  TGeoVolume* comp = new TGeoVolume("COMP", cs, medium);
>  comp->SetLineColor(5);  
>
>  top->AddNode(comp, 1, new TGeoTranslation(0, 0, 150.)); 
>  gGeoManager->CloseGeometry();
>  
>  top->Raytrace();
>  
>  gGeoManager->Export("geometry.root");
>}
>  
>



c1.gif



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 11:25:00 MET