CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

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

Definition at line 12 of file LocalFieldManager.h.

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().

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
PID
Definition: data.h:16
const G4FieldManager * LocalFieldManager::CopyValuesAndChordFinder ( G4FieldManager *  fm)
protected

Definition at line 45 of file LocalFieldManager.cc.

Referenced by ConfigureForTrack(), and LocalFieldManager().

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, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ConfigureForTrack().

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 }
Log< level::Info, true > LogVerbatim
G4FieldManager * fCurrentFM
G4FieldManager * fAlternativeFM
const double GeV
Definition: MathUtil.h:16
void sim::LocalFieldManager::SetVerbosity ( bool  flag)
inline

Definition at line 15 of file LocalFieldManager.h.

References fVerbosity.

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

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().