Message: Re: Adding quadrupole Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: Adding quadrupole 

Forum: Fields: Magnetic and Otherwise
Re: Question Adding quadrupole (Lukasz Fulek)
Re: Feedback Re: Adding quadrupole (Gumplinger Peter)
Date: 19 Dec, 2011
From: Lukasz Fulek <Lukasz Fulek>

Hi. I've done my quadrupole in this way:

  G4double piradius = 13.0*m;
  G4double phlengthz = 9.8/2*cm;
  G4Material* vacuum = G4Material::GetMaterial("Vacuum");

  G4RotationMatrix *rotm  = new G4RotationMatrix;
  rotm->rotateY(45*deg);

  G4double fGradient = -223.*tesla/m;
  G4QuadrupoleMagField* pipeField = new G4QuadrupoleMagField(fGradient);
  G4Mag_UsualEqRhs* myEquationq = new G4Mag_UsualEqRhs(pipeField);
  G4MagIntegratorStepper* myStepperq = new G4ClassicalRK4(myEquationq);
  G4ChordFinder* myChordFinderq = new G4ChordFinder(pipeField,0.1e-3*mm,myStepperq);

  G4FieldManager* fieldMgrq = new G4FieldManager(pipeField,myChordFinderq,true);

  G4VSolid* beamPipeSolid = new G4Tubs("BeamPipe_Solid", 0*cm, piradius*cm, phlengthz*m,
				       0.*deg, 360.*deg);

  G4LogicalVolume* beamPipeLogical = 
  new G4LogicalVolume(beamPipeSolid, vacuum, "BeamPipe_Logical",fieldMgrq);

  new G4PVPlacement(rotm, G4ThreeVector(0.,0.,0),
		    beamPipeLogical, "BeamPipe_Physical",
                    fpWorldLogical, false, 0);

 A beam is also turned by 45 deg. And now I have a question. I have noticed that my Gradient variable, called by me as fGradient, is defined in the global coordinate system. So in my case it doesn't work as it should. The Beam, which I'm generating, is not going in the center of the beamPipe, it turns right. So here is my question, what can I do to fix it? Maybe there is some kind of method to rotate the gradient or define it in local coordinates?

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

1 Feedback: Re: Adding quadrupole   (Gumplinger Peter - 12 Jan, 2012)
(_ None: Re: Adding quadrupole   (Lukasz Fulek - 13 Jan, 2012)
 Add Message Add Message
to: "Re: Adding quadrupole"

 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 ]