I know how to rotate a particle gun along a circle but when I try to do that with a solid object, I’ll end up with a solid circle. This is because the object won’t move but simply another instance will be positioned and the former ones won’t be deleted. See the code:
double R = 72 + 19.32;
double x, y = 0;
double angle = 0;
for(int i=0; i<360; i++)
angle = i;
angle = 2pi(angle * 0.00277777777);
x = R*cos(angle); y = R*sin(angle); G4VPhysicalVolume *al_ball_hardening3 = new G4PVPlacement(0, G4ThreeVector(x*cm, y*cm, -0.2*m), al_ball, "al_hardening", logicWorld, false, 1, true);
Is there a way to move something?
I’m moving the particle gun in exactly the same manner and I would like to put a shpere around this particle gun which moves with it.
My troubles are, as far as I understand, e.g., when I construct or place objects, they will be created when the application is executed but the particle gun won’t move before running it. So somehow I need to align these and thus, I guess, it doesn’t make sense to try to do any movement within the construction, right? But this would mean, there has to be a kind of .mac or the like where I can let objects move while the application is running?
Thank you very much!