Message: Of course /testem/det/setField 3 tesla Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Of course /testem/det/setField 3 tesla 

Forum: Fields: Magnetic and Otherwise
Re: None Magnetic field in TestEm3 (Paul)
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/setField 3 tesla. Here I get information /testem/det/setField 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
> 

On Thu, 21 Feb 2013 10:27:11 GMT, Paul wrote:

> 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
> 

 Add Message Add Message
to: "Of course /testem/det/setField 3 tesla"

 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 ]