CMS 3D CMS Logo

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

#include <FieldBuilder.h>

Public Member Functions

void build (CMSFieldManager *fM, G4PropagatorInField *fP)
 
void configureForVolume (const std::string &volName, edm::ParameterSet &volPSet, CMSFieldManager *fM, G4PropagatorInField *fP)
 
 FieldBuilder (const MagneticField *, const edm::ParameterSet &)
 
 ~FieldBuilder ()
 

Private Attributes

double theDelta
 
FieldtheField
 
G4Mag_UsualEqRhs * theFieldEquation
 
edm::ParameterSet thePSet
 
G4LogicalVolume * theTopVolume
 

Detailed Description

Definition at line 15 of file FieldBuilder.h.

Constructor & Destructor Documentation

◆ FieldBuilder()

FieldBuilder::FieldBuilder ( const MagneticField f,
const edm::ParameterSet p 
)

Definition at line 24 of file FieldBuilder.cc.

24  : theTopVolume(nullptr), thePSet(p) {
25  theDelta = p.getParameter<double>("delta") * CLHEP::mm;
26  theField = new Field(f, theDelta);
27  theFieldEquation = nullptr;
28 }

References f, AlCaHLTBitMon_ParallelJobs::p, theDelta, theField, and theFieldEquation.

◆ ~FieldBuilder()

FieldBuilder::~FieldBuilder ( )

Definition at line 30 of file FieldBuilder.cc.

30 {}

Member Function Documentation

◆ build()

void FieldBuilder::build ( CMSFieldManager fM,
G4PropagatorInField *  fP 
)

Definition at line 32 of file FieldBuilder.cc.

32  {
33  edm::ParameterSet thePSetForGMFM = thePSet.getParameter<edm::ParameterSet>("ConfGlobalMFM");
34  std::string volName = thePSetForGMFM.getParameter<std::string>("Volume");
35  edm::ParameterSet volPSet = thePSetForGMFM.getParameter<edm::ParameterSet>(volName);
36 
37  configureForVolume(volName, volPSet, fM, fP);
38 
39  edm::LogVerbatim("SimG4CoreMagneticField") << " FieldBuilder::build: Global magnetic field is used";
40 }

References configureForVolume(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and thePSet.

Referenced by RunManagerMTWorker::initializeG4().

◆ configureForVolume()

void FieldBuilder::configureForVolume ( const std::string &  volName,
edm::ParameterSet volPSet,
CMSFieldManager fM,
G4PropagatorInField *  fP 
)

Definition at line 42 of file FieldBuilder.cc.

45  {
46  G4LogicalVolumeStore *theStore = G4LogicalVolumeStore::GetInstance();
47  for (auto vol : *theStore) {
48  if ((std::string)vol->GetName() == volName) {
49  theTopVolume = vol;
50  break;
51  }
52  }
53 
54  std::string fieldType = volPSet.getParameter<std::string>("Type");
55  std::string stepper = volPSet.getParameter<std::string>("Stepper");
56 
57  edm::ParameterSet stpPSet = volPSet.getParameter<edm::ParameterSet>("StepperParam");
58  double minStep = stpPSet.getParameter<double>("MinStep") * CLHEP::mm;
59 
60  if (stepper == "G4TDormandPrince45") {
61  theFieldEquation = new G4TMagFieldEquation<Field>(theField);
62  } else {
63  theFieldEquation = new G4Mag_UsualEqRhs(theField);
64  }
65 
66  FieldStepper *dStepper = new FieldStepper(theFieldEquation, theDelta, stepper);
67  G4ChordFinder *cf = new G4ChordFinder(theField, minStep, dStepper);
68 
69  MonopoleEquation *monopoleEquation = new MonopoleEquation(theField);
70  G4MagIntegratorStepper *mStepper = new G4ClassicalRK4(monopoleEquation, 8);
71  G4ChordFinder *cfmon = new G4ChordFinder(theField, minStep, mStepper);
72 
73  fM->InitialiseForVolume(stpPSet, theField, cf, cfmon, volName, fieldType, stepper, theDelta, fP);
74 }

References edm::ParameterSet::getParameter(), CMSFieldManager::InitialiseForVolume(), AlCaHLTBitMon_QueryRunRegistry::string, theDelta, theField, theFieldEquation, and theTopVolume.

Referenced by build().

Member Data Documentation

◆ theDelta

double sim::FieldBuilder::theDelta
private

Definition at line 33 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

◆ theField

Field* sim::FieldBuilder::theField
private

Definition at line 29 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

◆ theFieldEquation

G4Mag_UsualEqRhs* sim::FieldBuilder::theFieldEquation
private

Definition at line 30 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

◆ thePSet

edm::ParameterSet sim::FieldBuilder::thePSet
private

Definition at line 32 of file FieldBuilder.h.

Referenced by build().

◆ theTopVolume

G4LogicalVolume* sim::FieldBuilder::theTopVolume
private

Definition at line 31 of file FieldBuilder.h.

Referenced by configureForVolume().

sim::FieldBuilder::theField
Field * theField
Definition: FieldBuilder.h:29
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
CMSFieldManager::InitialiseForVolume
void InitialiseForVolume(const edm::ParameterSet &, sim::Field *, G4ChordFinder *cfDefault, G4ChordFinder *cfMonopole, const std::string &vol, const std::string &fieldType, const std::string &stepperName, double delta, G4PropagatorInField *)
Definition: CMSFieldManager.cc:46
sim::FieldBuilder::theTopVolume
G4LogicalVolume * theTopVolume
Definition: FieldBuilder.h:31
FieldStepper
Definition: FieldStepper.h:8
sim::FieldBuilder::theFieldEquation
G4Mag_UsualEqRhs * theFieldEquation
Definition: FieldBuilder.h:30
sim::FieldBuilder::thePSet
edm::ParameterSet thePSet
Definition: FieldBuilder.h:32
sim::FieldBuilder::configureForVolume
void configureForVolume(const std::string &volName, edm::ParameterSet &volPSet, CMSFieldManager *fM, G4PropagatorInField *fP)
Definition: FieldBuilder.cc:42
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sim::FieldBuilder::theDelta
double theDelta
Definition: FieldBuilder.h:33
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonopoleEquation
Definition: MonopoleEquation.h:28