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

◆ LocalFieldManager() [1/2]

sim::LocalFieldManager::LocalFieldManager ( )
inline

Definition at line 11 of file LocalFieldManager.h.

11 : G4FieldManager() {}

◆ ~LocalFieldManager()

sim::LocalFieldManager::~LocalFieldManager ( )
inlineoverride

Definition at line 12 of file LocalFieldManager.h.

12 {}

◆ LocalFieldManager() [2/2]

LocalFieldManager::LocalFieldManager ( G4Field *  commonField,
G4FieldManager *  priFM,
G4FieldManager *  altFM 
)

Definition at line 14 of file LocalFieldManager.cc.

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 }

References CopyValuesAndChordFinder(), and fCurrentFM.

Member Function Documentation

◆ ConfigureForTrack()

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

Definition at line 24 of file LocalFieldManager.cc.

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 }

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

◆ CopyValuesAndChordFinder()

const G4FieldManager * LocalFieldManager::CopyValuesAndChordFinder ( G4FieldManager *  fm)
protected

Definition at line 45 of file LocalFieldManager.cc.

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 }

Referenced by ConfigureForTrack(), and LocalFieldManager().

◆ print()

void LocalFieldManager::print ( const G4Track *  trk)
protected

Definition at line 55 of file LocalFieldManager.cc.

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 }

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

Referenced by ConfigureForTrack().

◆ SetVerbosity()

void sim::LocalFieldManager::SetVerbosity ( bool  flag)
inline

Definition at line 15 of file LocalFieldManager.h.

15  {
16  fVerbosity = flag;
17  return;
18  }

References RemoveAddSevLevel::flag, and fVerbosity.

Member Data Documentation

◆ fAlternativeFM

G4FieldManager* sim::LocalFieldManager::fAlternativeFM
private

Definition at line 27 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and print().

◆ fCurrentFM

G4FieldManager* sim::LocalFieldManager::fCurrentFM
private

Definition at line 28 of file LocalFieldManager.h.

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

◆ fPrimaryFM

G4FieldManager* sim::LocalFieldManager::fPrimaryFM
private

Definition at line 26 of file LocalFieldManager.h.

Referenced by ConfigureForTrack().

◆ fVerbosity

bool sim::LocalFieldManager::fVerbosity
private

Definition at line 29 of file LocalFieldManager.h.

Referenced by ConfigureForTrack(), and SetVerbosity().

sim::LocalFieldManager::fAlternativeFM
G4FieldManager * fAlternativeFM
Definition: LocalFieldManager.h:27
sim::LocalFieldManager::CopyValuesAndChordFinder
const G4FieldManager * CopyValuesAndChordFinder(G4FieldManager *fm)
Definition: LocalFieldManager.cc:45
sim::LocalFieldManager::fVerbosity
bool fVerbosity
Definition: LocalFieldManager.h:29
sim::LocalFieldManager::fPrimaryFM
G4FieldManager * fPrimaryFM
Definition: LocalFieldManager.h:26
sim::LocalFieldManager::print
void print(const G4Track *trk)
Definition: LocalFieldManager.cc:55
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
PID
PID
Definition: data.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeV
const double GeV
Definition: MathUtil.h:16
sim::LocalFieldManager::fCurrentFM
G4FieldManager * fCurrentFM
Definition: LocalFieldManager.h:28
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116