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 11 of file LocalFieldManager.h.

Referenced by ~LocalFieldManager().

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

Definition at line 12 of file LocalFieldManager.h.

References ConfigureForTrack(), and LocalFieldManager().

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

Definition at line 14 of file LocalFieldManager.cc.

References CopyValuesAndChordFinder(), and fCurrentFM.

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

Member Function Documentation

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

Definition at line 24 of file LocalFieldManager.cc.

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

Referenced by ~LocalFieldManager().

24  {
25  int PID = trk->GetDynamicParticle()->GetDefinition()->GetPDGEncoding();
26 
27  if (std::abs(PID) != 13) // maybe also high energy pions ?... what else ?
28  {
29  if (fCurrentFM != fAlternativeFM) {
32  if (fVerbosity)
33  print(trk);
34  }
35  } else {
36  if (fCurrentFM != fPrimaryFM) {
39  if (fVerbosity)
40  print(trk);
41  }
42  }
43 }
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 45 of file LocalFieldManager.cc.

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

45  {
46  SetDeltaIntersection(fm->GetDeltaIntersection());
47  SetDeltaOneStep(fm->GetDeltaOneStep());
48  G4ChordFinder *cf = fm->GetChordFinder();
49  cf->SetDeltaChord(cf->GetDeltaChord());
50  SetChordFinder(cf);
51 
52  return fm;
53 }
void LocalFieldManager::print ( const G4Track *  trk)
protected

Definition at line 55 of file LocalFieldManager.cc.

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

Referenced by ConfigureForTrack(), and SetVerbosity().

55  {
56  std::string ss = (fCurrentFM == fAlternativeFM) ? "Alternative field manager with" : "Global field manager with";
57 
58  edm::LogVerbatim("SimG4CoreMagneticField")
59  << ss << " DeltaIntersection= " << G4FieldManager::GetDeltaIntersection()
60  << ", DeltaOneStep= " << G4FieldManager::GetDeltaOneStep()
61  << ", DeltaChord= " << G4FieldManager::GetChordFinder()->GetDeltaChord() << " for "
62  << trk->GetDynamicParticle()->GetDefinition()->GetPDGEncoding() << " with "
63  << trk->GetKineticEnergy() / CLHEP::GeV << " GeV in " << trk->GetVolume()->GetName();
64 }
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 27 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and print().

G4FieldManager* sim::LocalFieldManager::fCurrentFM
private

Definition at line 28 of file LocalFieldManager.h.

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

G4FieldManager* sim::LocalFieldManager::fPrimaryFM
private

Definition at line 26 of file LocalFieldManager.h.

Referenced by ConfigureForTrack().

bool sim::LocalFieldManager::fVerbosity
private

Definition at line 29 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and SetVerbosity().