CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
sim::LocalFieldManager Class Reference

#include <LocalFieldManager.h>

Inheritance diagram for sim::LocalFieldManager:

Public Member Functions

void ConfigureForTrack (const G4Track *trk) override
 
 LocalFieldManager ()
 
 LocalFieldManager (G4Field *commonField, G4FieldManager *priFM, G4FieldManager *altFM)
 
void SetVerbosity (bool flag)
 
 ~LocalFieldManager () override
 

Protected Member Functions

const G4FieldManager * CopyValuesAndChordFinder (G4FieldManager *fm)
 
void print (const G4Track *trk)
 

Private Attributes

G4FieldManager * fAlternativeFM
 
G4FieldManager * fCurrentFM
 
G4FieldManager * fPrimaryFM
 
bool fVerbosity
 

Detailed Description

Definition at line 8 of file LocalFieldManager.h.

Constructor & Destructor Documentation

sim::LocalFieldManager::LocalFieldManager ( )
inline

Definition at line 12 of file LocalFieldManager.h.

Referenced by ~LocalFieldManager().

12 : G4FieldManager() {}
sim::LocalFieldManager::~LocalFieldManager ( )
inlineoverride

Definition at line 13 of file LocalFieldManager.h.

References ConfigureForTrack(), and LocalFieldManager().

13 {}
LocalFieldManager::LocalFieldManager ( G4Field *  commonField,
G4FieldManager *  priFM,
G4FieldManager *  altFM 
)

Definition at line 14 of file LocalFieldManager.cc.

References CopyValuesAndChordFinder(), and fCurrentFM.

17  : G4FieldManager(commonField,nullptr,false),
18  fPrimaryFM(priFM), fAlternativeFM(altFM),
19  fCurrentFM(nullptr),
20  fVerbosity(false)
21 {
22  this->CopyValuesAndChordFinder(priFM);
23  fCurrentFM = priFM ;
24 }
G4FieldManager * fCurrentFM
G4FieldManager * fAlternativeFM
const G4FieldManager * CopyValuesAndChordFinder(G4FieldManager *fm)
G4FieldManager * fPrimaryFM

Member Function Documentation

void LocalFieldManager::ConfigureForTrack ( const G4Track *  trk)
override

Definition at line 26 of file LocalFieldManager.cc.

References funct::abs(), CopyValuesAndChordFinder(), fAlternativeFM, fCurrentFM, fPrimaryFM, fVerbosity, and print().

Referenced by ~LocalFieldManager().

27 {
28 
29  int PID = trk->GetDynamicParticle()->GetDefinition()->GetPDGEncoding();
30 
31  if ( std::abs(PID)!=13 ) // maybe also high energy pions ?... what else ?
32  {
33  if ( fCurrentFM != fAlternativeFM )
34  {
37  if ( fVerbosity) print(trk);
38  }
39  }
40  else
41  {
42  if ( fCurrentFM != fPrimaryFM )
43  {
46  if ( fVerbosity) print(trk);
47  }
48  }
49 }
G4FieldManager * fCurrentFM
G4FieldManager * fAlternativeFM
const G4FieldManager * CopyValuesAndChordFinder(G4FieldManager *fm)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void print(const G4Track *trk)
G4FieldManager * fPrimaryFM
const G4FieldManager * LocalFieldManager::CopyValuesAndChordFinder ( G4FieldManager *  fm)
protected

Definition at line 51 of file LocalFieldManager.cc.

Referenced by ConfigureForTrack(), LocalFieldManager(), and SetVerbosity().

52 {
53 
54  SetDeltaIntersection(fm->GetDeltaIntersection());
55  SetDeltaOneStep(fm->GetDeltaOneStep());
56  G4ChordFinder* cf = fm->GetChordFinder();
57  cf->SetDeltaChord(cf->GetDeltaChord());
58  SetChordFinder(cf);
59 
60  return fm;
61 
62 }
void LocalFieldManager::print ( const G4Track *  trk)
protected

Definition at line 64 of file LocalFieldManager.cc.

References fAlternativeFM, fCurrentFM, GeV, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ConfigureForTrack(), and SetVerbosity().

65 {
67  ? "Alternative field manager with"
68  : "Global field manager with";
69 
70  edm::LogVerbatim("SimG4CoreMagneticField")
71  << ss << " DeltaIntersection= " << G4FieldManager::GetDeltaIntersection()
72  << ", DeltaOneStep= " << G4FieldManager::GetDeltaOneStep()
73  << ", DeltaChord= " << G4FieldManager::GetChordFinder()->GetDeltaChord()
74  << " for " << trk->GetDynamicParticle()->GetDefinition()->GetPDGEncoding()
75  << " with " << trk->GetKineticEnergy()/CLHEP::GeV << " GeV in "
76  << trk->GetVolume()->GetName();
77 }
G4FieldManager * fCurrentFM
G4FieldManager * fAlternativeFM
const double GeV
Definition: MathUtil.h:16
void sim::LocalFieldManager::SetVerbosity ( bool  flag)
inline

Member Data Documentation

G4FieldManager* sim::LocalFieldManager::fAlternativeFM
private

Definition at line 25 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and print().

G4FieldManager* sim::LocalFieldManager::fCurrentFM
private

Definition at line 26 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), LocalFieldManager(), and print().

G4FieldManager* sim::LocalFieldManager::fPrimaryFM
private

Definition at line 24 of file LocalFieldManager.h.

Referenced by ConfigureForTrack().

bool sim::LocalFieldManager::fVerbosity
private

Definition at line 27 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and SetVerbosity().