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 ( const MagneticField f,
const edm::ParameterSet p 
)

Definition at line 23 of file FieldBuilder.cc.

References edm::ParameterSet::getParameter(), theDelta, theField, and theFieldEquation.

24  : theTopVolume(nullptr),thePSet(p)
25 {
26  theDelta = p.getParameter<double>("delta")*CLHEP::mm;
27  theField = new Field(f, theDelta);
28  theFieldEquation = new G4Mag_UsualEqRhs(theField);
29 }
T getParameter(std::string const &) const
G4LogicalVolume * theTopVolume
Definition: FieldBuilder.h:34
G4Mag_UsualEqRhs * theFieldEquation
Definition: FieldBuilder.h:33
edm::ParameterSet thePSet
Definition: FieldBuilder.h:35
FieldBuilder::~FieldBuilder ( )

Definition at line 31 of file FieldBuilder.cc.

32 {}

Member Function Documentation

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

Definition at line 34 of file FieldBuilder.cc.

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

Referenced by RunManagerMT::initG4().

35 {
36  edm::ParameterSet thePSetForGMFM =
37  thePSet.getParameter<edm::ParameterSet>("ConfGlobalMFM");
38  std::string volName = thePSetForGMFM.getParameter< std::string >("Volume");
39  edm::ParameterSet volPSet =
40  thePSetForGMFM.getParameter< edm::ParameterSet >( volName );
41 
42  configureForVolume( volName, volPSet, fM, fP);
43 
44  edm::LogVerbatim("SimG4CoreMagneticField")
45  << " FieldBuilder::build: Global magnetic field is used";
46 }
T getParameter(std::string const &) const
edm::ParameterSet thePSet
Definition: FieldBuilder.h:35
void configureForVolume(const std::string &volName, edm::ParameterSet &volPSet, CMSFieldManager *fM, G4PropagatorInField *fP)
Definition: FieldBuilder.cc:48
void FieldBuilder::configureForVolume ( const std::string &  volName,
edm::ParameterSet volPSet,
CMSFieldManager fM,
G4PropagatorInField *  fP 
)

Definition at line 48 of file FieldBuilder.cc.

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

Referenced by build().

52 {
53  G4LogicalVolumeStore* theStore = G4LogicalVolumeStore::GetInstance();
54  for (auto vol : *theStore) {
55  if ( (std::string)vol->GetName() == volName ) {
56  theTopVolume = vol;
57  break;
58  }
59  }
60 
61  std::string fieldType = volPSet.getParameter<std::string>("Type");
62  std::string stepper = volPSet.getParameter<std::string>("Stepper");
63 
64  edm::ParameterSet stpPSet = volPSet.getParameter<edm::ParameterSet>("StepperParam");
65  double minStep = stpPSet.getParameter<double>("MinStep")*CLHEP::mm;
66 
67  FieldStepper* dStepper = new FieldStepper(theFieldEquation, theDelta, stepper);
68  G4ChordFinder* cf = new G4ChordFinder(theField,minStep,dStepper);
69 
70  MonopoleEquation* monopoleEquation = new MonopoleEquation(theField);
71  G4MagIntegratorStepper* mStepper = new G4ClassicalRK4(monopoleEquation,8);
72  G4ChordFinder* cfmon = new G4ChordFinder(theField, minStep, mStepper);
73 
74  fM->InitialiseForVolume(stpPSet, theField, cf, cfmon, volName,
75  fieldType, stepper, theDelta, fP);
76 }
T getParameter(std::string const &) const
G4LogicalVolume * theTopVolume
Definition: FieldBuilder.h:34
G4Mag_UsualEqRhs * theFieldEquation
Definition: FieldBuilder.h:33
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 *)

Member Data Documentation

double sim::FieldBuilder::theDelta
private

Definition at line 36 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

Field* sim::FieldBuilder::theField
private

Definition at line 32 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

G4Mag_UsualEqRhs* sim::FieldBuilder::theFieldEquation
private

Definition at line 33 of file FieldBuilder.h.

Referenced by configureForVolume(), and FieldBuilder().

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

Definition at line 35 of file FieldBuilder.h.

Referenced by build().

G4LogicalVolume* sim::FieldBuilder::theTopVolume
private

Definition at line 34 of file FieldBuilder.h.

Referenced by configureForVolume().