Skip to content
Snippets Groups Projects
Commit df3d9a80 authored by nnitika's avatar nnitika
Browse files

modified for DeltaChord and StepMax

parent 059532de
Branches
No related tags found
1 merge request!200Draft: Mag field opt
Pipeline #6376746 failed
......@@ -17,7 +17,8 @@
#include "G4UIcommand.hh"
#include "G4UIcontrolMessenger.hh"
#include "G4UIbatch.hh"
#include "G4StepLimiter.hh"
#include "G4UserLimits.hh"
#include "G4RunManager.hh"
FSLDetectorMessenger::FSLDetectorMessenger(FSLDetectorConstruction* FSLDet)
......@@ -75,6 +76,15 @@ FSLDetectorMessenger::FSLDetectorMessenger(FSLDetectorConstruction* FSLDet)
theDeltaChordCommand->SetGuidance(" -> in unit of [millimeter]");
theDeltaChordCommand->SetUnitCategory("Length");
theDeltaChordCommand->AvailableForStates(G4State_PreInit, G4State_Idle);
theStepMaxCommand = new G4UIcmdWithADoubleAndUnit("/FSLdet/StepMax", this);
theStepMaxCommand->SetGuidance("Define a step max");
theStepMaxCommand->SetParameterName("StepMax", false); // Changed "theStepMax" to "StepMax"
theStepMaxCommand->SetUnitCategory("Length");
theStepMaxCommand->AvailableForStates(G4State_PreInit, G4State_Idle);
}
FSLDetectorMessenger::~FSLDetectorMessenger()
......@@ -87,6 +97,7 @@ FSLDetectorMessenger::~FSLDetectorMessenger()
delete theEpsilonMinCommand;
delete theEpsilonMaxCommand;
delete theDeltaChordCommand;
delete theStepMaxCommand;
}
////////////////////////////////////////////////////////////////
//
......@@ -101,7 +112,12 @@ void FSLDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
if (command == theRegionCommand) {
theDetector->SetAddRegions(true);
}
if (command == theStepMaxCommand) {
// G4double newStepMax = theStepMaxCommand->GetNewDoubleValue(newValue);
//theDetector->SetStepMax(newStepMax);
theDetector->SetStepMax(theStepMaxCommand->GetNewDoubleValue(newValue));
}
//////////Adding cmd//////
G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
......@@ -118,21 +134,11 @@ void FSLDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
if (command == theEpsilonMaxCommand) {
fieldMgr->SetMaximumEpsilonStep(theEpsilonMaxCommand->GetNewDoubleValue(newValue));
}
G4ChordFinder* fChordFinder = fieldMgr->GetChordFinder();
if (fChordFinder != nullptr) {
if (command == theDeltaChordCommand)
fieldMgr->GetChordFinder()->SetDeltaChord(theDeltaChordCommand->GetNewDoubleValue(newValue));
//fieldMgr->GetChordFinder()->SetDeltaChord( fDeltaChord);
//fieldMgr->fDeltaChord = theDeltaChordCommand->GetNewDoubleValue(newValue);
//fChordFinder->SetDeltaChord(fDeltaChord);
//G4ChordFinder* fChordFinder = fieldMgr->GetChordFinder();
// if (fChordFinder != nullptr) {
// if (command == theDeltaChordCommand)
// fChordFinder->SetDeltaChord(theDeltaChordCommand->GetNewDoubleValue(newValue));
// fChordFinder->SetDeltaChord(theDeltaChordCommand->GetNewDoubleValue(newValue));
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment