Message: Magnetic field in TestEm3 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Magnetic field in TestEm3 

Forum: Fields: Magnetic and Otherwise
Date: 21 Feb, 2013
From: Paul <Paul>

Dear Users, I have problem with magnetic field in TestEm3. This example works with magn f. only in the case of particle beam. I changed mainly PrimaryGenerationAction.cc file in the aim of obtaining positrons emitted for betha source. Unfornately after this change I cannot to add magnetic field both in the file DC.cc and also using command /testem/det/setFile 3 tesla Here I get information /testem/det/setFile 3 tesla not found This command works in this same example but for the beam. I have the system cosist with 1 layer which includes 3 absorbers. From the middle absorber positrons in all directions with differeds enegies are emitted. Help me please. I attached these two files Regards Pawel

#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"

void DetectorConstruction::SetMagField(G4double fieldValue)
{
  //apply a global uniform magnetic field along Z axis
  //

	G4FieldManager* fieldMgr
   = G4TransportationManager::GetTransportationManager()->GetFieldManager();

  if(magField) delete magField;		//delete the existing magn field

  if(fieldValue!=0.)			// create a new one if non nul
  { magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
    fieldMgr->SetDetectorField(magField);
    fieldMgr->CreateChordFinder(magField);
  } else {
    magField = 0;
    fieldMgr->SetDetectorField(magField);
  }

}

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2013/02/21/02.13-22356-DetectorConstruction.txt
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2013/02/21/02.15-85235-rimaryGeneratorAction.txt

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

1 None: Of course /testem/det/setField 3 tesla   (Paul - 21 Feb, 2013)
2 Feedback: Re: Magnetic field in TestEm3   (Gumplinger Peter - 21 Feb, 2013)
 Add Message Add Message
to: "Magnetic field in TestEm3"

 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 ]