Message: Re: Rotating a field & obtaining the EM field in a certain point Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Rotating a field & obtaining the EM field in a certain point 

Forum: Fields: Magnetic and Otherwise
Re: None Rotating a field & obtaining the EM field in a certain point (Giovanni Marchiori)
Re: Feedback Re: Rotating a field & obtaining the EM field in a certain point (John Apostolakis)
Date: 27 Sep, 2006
From: Giovanni Marchiori <giovanni.marchiori@pi.infn.it>

Dear John,
thanks for answering my questions and clarifying my doubts.

>> 2) What is the easiest way to know, once I have setup the
>> geometry of the fields, what is the total electromagnetic field - in 
>> global coordinates - in a generic point in space? Does Geant4 
>> provide such a functionality?
>
>This is a very good question - and likely should be in our FAQ.
>
>First I note that only a single field exists for any point of space in 
>Geant4 currently. It can be either a global field (the one chosen for 
>all the setup) or a local field (that is set for a logical volume and
>can be propagated to ones below, and which overrides any global field.) 
>[ Extensions which allow different field descriptions have been created, 
>including BeamTools from D. Elvira at Fermilab. ]

Thanks for emphasizing the "override" issue: at first glance I had the 
wrong idea that the local field aws added to the global one (which would
have made my life easier...). So is there a way to add two fields in Geant4?

>A single method to get the global field value is not currently available.
>You will need to call several objects to do this currently and tailor it
>to your current field needs (eg B field only, EM field, custom field.) 
>I will communicate privately a trial version of this, and once it is
>ironed out post it.

Yesterday I was trying with the following code

  G4StepPoint* pt = new G4StepPoint;
  x[0]=0.;
  x[1]=1.45*m;
  x[2]=0.;
  x[3]=0.;
  pt->SetPosition(G4ThreeVector(x[0],x[1],x[2]));
  G4FieldManager* fMgr = pt->GetPhysicalVolume()->GetLogicalVolume()->GetFieldManager();
  if (fMgr) {
    const G4Field* field = fMgr->GetDetectorField();
    if (field)
      field->GetFieldValue(x,B);
    else
      B[0]=B[1]=B[2]=0.0;
  }

but the application crashed. I will now try your recipe and let you know.

Best regards,

   Giovanni

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

 Add Message Add Message
to: "Re: Rotating a field & obtaining the EM field in a certain point"

 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 ]