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 delta
 
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 25 of file FieldBuilder.cc.

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

26  : theTopVolume(nullptr),thePSet(p)
27 {
28  delta = p.getParameter<double>("delta")*CLHEP::mm;
29  theField = new Field(f, delta);
30  theFieldEquation = new G4Mag_UsualEqRhs(theField);
31 }
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 33 of file FieldBuilder.cc.

34 {}

Member Function Documentation

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

Definition at line 36 of file FieldBuilder.cc.

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

Referenced by RunManagerMT::initG4().

37 {
38  edm::ParameterSet thePSetForGMFM =
39  thePSet.getParameter<edm::ParameterSet>("ConfGlobalMFM");
40 
41  std::string volName = thePSetForGMFM.getParameter< std::string >("Volume");
42 
43  edm::ParameterSet volPSet =
44  thePSetForGMFM.getParameter< edm::ParameterSet >( volName );
45 
46  configureForVolume( volName, volPSet, fM, fP);
47 
48  edm::LogInfo("SimG4CoreApplication")
49  << " FieldBuilder::build: Global magnetic field is used";
50 }
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:52
void FieldBuilder::configureForVolume ( const std::string &  volName,
edm::ParameterSet volPSet,
CMSFieldManager fM,
G4PropagatorInField *  fP 
)

Definition at line 52 of file FieldBuilder.cc.

References delta, edm::ParameterSet::getParameter(), mps_fire::i, CMSFieldManager::InitialiseForVolume(), createfilelist::int, sim::FieldStepper::select(), AlCaHLTBitMon_QueryRunRegistry::string, theField, theFieldEquation, and theTopVolume.

Referenced by build().

56 {
57  G4LogicalVolumeStore* theStore = G4LogicalVolumeStore::GetInstance();
58  for (unsigned int i=0; i<(*theStore).size(); ++i ) {
59  std::string curVolName = ((*theStore)[i])->GetName();
60  if ( curVolName == volName ) {
61  theTopVolume = (*theStore)[i] ;
62  }
63  }
64 
65  std::string fieldType = volPSet.getParameter<std::string>("Type");
66  std::string stepper = volPSet.getParameter<std::string>("Stepper");
67 
68  edm::ParameterSet stpPSet = volPSet.getParameter<edm::ParameterSet>("StepperParam");
69  double minStep = stpPSet.getParameter<double>("MinStep") ;
70  int maxLoopCount =
71  (int)stpPSet.getUntrackedParameter<double>("MaximumLoopCounts",1000);
72  double minEpsilonStep =
73  stpPSet.getUntrackedParameter<double>("MinimumEpsilonStep",0.00001);
74  double maxEpsilonStep =
75  stpPSet.getUntrackedParameter<double>("MaximumEpsilonStep",0.01);
76 
77  FieldStepper * theStepper = new FieldStepper(theFieldEquation, delta);
78  theStepper->select(stepper);
79  G4ChordFinder * cf = new G4ChordFinder(theField,minStep,theStepper);
80 
81  G4MonopoleEquation* monopoleEquation = new G4MonopoleEquation(theField);
82  G4MagIntegratorStepper* theStepperMon = new G4ClassicalRK4(monopoleEquation,8);
83  G4ChordFinder * cfmon = new G4ChordFinder(theField,minStep,theStepperMon);
84 
85  fM->InitialiseForVolume(stpPSet, theField, cf, cfmon, volName,
86  fieldType, stepper, delta, minStep);
87 
88  if(fP) {
89  fP->SetMaxLoopCount(maxLoopCount);
90  fP->SetMinimumEpsilonStep(minEpsilonStep);
91  fP->SetMaximumEpsilonStep(maxEpsilonStep);
92  //fP->SetVerboseLevel(0);
93  }
94 }
T getParameter(std::string const &) const
void InitialiseForVolume(const edm::ParameterSet &, sim::Field *, G4ChordFinder *, G4ChordFinder *, const std::string &vol, const std::string &type, const std::string &stepper, double delta, double minstep)
G4LogicalVolume * theTopVolume
Definition: FieldBuilder.h:34
G4Mag_UsualEqRhs * theFieldEquation
Definition: FieldBuilder.h:33

Member Data Documentation

double sim::FieldBuilder::delta
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().