Message: Rotation Bug? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Rotation Bug? 

Forum: Geometry
Date: 10 Nov, 2008
From: Antony Luk <Antony Luk>

I would like to assemble several volumes and place it in a bigger volume with a rotation, however from the HepRapp visualization, I found those volumes doesn't rotate in the same way so that the optical path of photons is wrong. I am wondering if it is a bug or I used a wrong way to do that. I use GEANT4.8.3.p01. Here is part of the code.

  // Cylinder to contain the corner cube
  G4Tubs* retroouterbox = new G4Tubs("retroouterbox", 0., 2.55*cm, 22.4*mm, 0.*deg, 360*deg);
  G4LogicalVolume* retroouterbox1b_log = new G4LogicalVolume(retroouterbox, RetroMat, "retroouterbox1b_log",0,0,0);
  G4Tubs* retroinnerbox = new G4Tubs("retroinnerbox", 0., 2.54*cm, 22.35*mm, 0.*deg, 360*deg);
  G4LogicalVolume* retroinnerbox1b_log = new G4LogicalVolume(retroinnerbox, Air, "retroinnerbox1b_log",0,0,0);

  //Corner Cube
  G4Box* basicbox = new G4Box("basicbox", 5.*cm, 5.*cm, 5.*cm);
  G4Tubs* basictube = new G4Tubs("basictube", 0., 2.54*cm, 4.8*cm, 0.*deg, 360.*deg);
  G4RotationMatrix* rotate = new G4RotationMatrix();
  G4IntersectionSolid* cornercube = new G4IntersectionSolid("cornercube", basictube, basicbox, rotate, G4ThreeVector(0.*cm, 0.*cm, 9*cm));

  G4LogicalVolume* cornercube1b_log = new G4LogicalVolume(cornercube,BK7,"cornercube1b_log",0,0,0);

  G4VPhysicalVolume* cornercube1b_phys;
  G4VPhysicalVolume* retroinnerbox1b_phys;
  G4VPhysicalVolume* retroouterbox1b_phys;

  G4RotationMatrix* rotate1 = new G4RotationMatrix();


  retroouterbox1b_phys = new G4PVPlacement(rotate1,G4ThreeVector(2125*mm*cos(217.5*degree),2125*mm*sin(217.5*degree),-2032.6*mm),retroouterbox1b_log,"retroouterbox1b",MineralOil_log,false,0);

  retroinnerbox1b_phys = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.05*mm),"retroinnerbox1b",retroinnerbox1b_log,retroouterbox1b_phys,false,0);

  cornercube1b_phys = new G4PVPlacement(0,G4ThreeVector(0.,0.,-25.65*mm),"cornercube1b",cornercube1b_log,retroinnerbox1b_phys,false,0);

where MineralOil_log is the biggest volume I want put in the whole thing.

My Observation is that only rotating x or z axis (I mean rotate1) will not cause problem. But rotating Y alone will cause problem unless it is at some "good" angle like 90, 180 degrees. Rotating around more than one axes will usually cause the problem.

Thank you very much!

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Rotation Bug?   (Joseph Perl - 10 Nov, 2008)
(_ More: Re: Rotation Bug?   (Antony Luk - 11 Nov, 2008)
 Add Message Add Message
to: "Rotation Bug?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]