Main program of the errorpropagation example.
More...
#include "ExErrorDetectorConstruction.hh"
#include "G4SteppingVerbose.hh"
#include "G4ErrorPropagator.hh"
#include "G4ErrorPropagatorData.hh"
#include "G4ErrorPropagatorManager.hh"
#include "G4ErrorPlaneSurfaceTarget.hh"
#include "G4ErrorCylSurfaceTarget.hh"
#include "G4ErrorGeomVolumeTarget.hh"
#include "G4ErrorTrackLengthTarget.hh"
#include "G4ErrorFreeTrajState.hh"
#include "G4UImanager.hh"
#include "G4SystemOfUnits.hh"
Go to the source code of this file.
Main program of the errorpropagation example.
Definition in file errprop.cc.
G4ErrorTarget * BuildTarget |
( |
G4int |
iTarget | ) |
|
Definition at line 233 of file errprop.cc.
References radius, and target.
Referenced by Initialize().
236 G4ErrorTarget*
target = 0;
238 G4Point3D surfPos(221.*cm,0.,0.);
239 G4Normal3D surfNorm(1.,0.,0.);
240 target =
new G4ErrorPlaneSurfaceTarget(surfNorm, surfPos );
241 }
else if( iTarget == 2 ) {
243 target =
new G4ErrorCylSurfaceTarget(radius);
244 }
else if( iTarget == 3 ) {
245 target =
new G4ErrorGeomVolumeTarget(
"MUON");
246 }
else if( iTarget == 4 ) {
247 target =
new G4ErrorTrackLengthTarget(223.*cm);
249 G4Exception(
"exG4eReco",
"Fatal error in Argument",
250 FatalErrorInArgument,
"Target type has to be between 1 and 4");
cout<< "-> Edep in the target
Definition at line 257 of file errprop.cc.
Referenced by main().
259 G4ErrorPropagatorManager::GetErrorPropagatorManager()->CloseGeometry();
Definition at line 101 of file errprop.cc.
References BuildTarget(), target, theG4ErrorMode, and theTarget.
Referenced by export_G4RunManager(), export_G4VisManager(), export_G4VSensitiveDetector(), main(), cmtool::CMManagerBase::SetClusters(), larg4::OpDetSensitiveDetector::~OpDetSensitiveDetector(), and larg4::OpParamSD::~OpParamSD().
103 G4VSteppingVerbose::SetInstance(
new G4SteppingVerbose);
106 G4ErrorPropagatorManager* g4emgr
107 = G4ErrorPropagatorManager::GetErrorPropagatorManager();
108 G4ErrorPropagatorData* g4edata
109 = G4ErrorPropagatorData::GetErrorPropagatorData();
111 g4emgr->SetUserInitialization(
new ExErrorDetectorConstruction);
113 G4UImanager::GetUIpointer()->ApplyCommand(
"/exerror/setField -10. kilogauss");
115 g4emgr->InitGeant4e();
117 G4UImanager::GetUIpointer()->ApplyCommand(
"/control/verbose 1");
118 G4UImanager::GetUIpointer()->ApplyCommand(
"/tracking/verbose 1");
119 G4UImanager::GetUIpointer()->ApplyCommand(
"/geant4e/limits/stepLength 100 mm");
127 char*
target = getenv(
"G4ERROR_TARGET");
138 G4Exception(
"exG4eReco",
"Fatal error in Argument",
139 FatalErrorInArgument,
141 " It must be: PLANE_SURFACE, CYL_SURFACE, VOLUME, TRKLEN").c_str());
144 G4Exception(
"exG4eReco",
"Fatal error in Argument",
145 JustWarning,
"Variable G4ERROR_TARGET not defined, taking it = PLANE_SURFACE");
152 char* mode = getenv(
"G4ERROR_MODE");
159 G4Exception(
"exG4eReco",
"Fatal error in Argument",
160 FatalErrorInArgument,
162 " It must be: FORWARDS or BACKWARDS").c_str());
165 G4Exception(
"exG4eReco",
"Fatal error in Argument",
166 JustWarning,
"Variable G4ERROR_MODE not defined, taking it = BACKWARDS");
cout<< "-> Edep in the target
G4ErrorMode theG4ErrorMode
G4ErrorTarget * theTarget
G4ErrorTarget * BuildTarget(G4int iTarget)
Definition at line 63 of file errprop.cc.
References Finalize(), Initialize(), and ProcessEvent().
72 char* prop = getenv(
"G4ERROR_PROP");
79 G4Exception(
"exG4eReco",
"Fatal error in Argument",
82 " It must be: UNTIL_TARGET or STEP_BY_STEP").c_str());
85 G4Exception(
"exG4eReco",
"Fatal error in Argument",
87 "Variable G4ERROR_PROP not defined, taking it = UNTIL_TARGET");
91 for(
size_t ii = 0; ii < nEvents; ii++ ){
void ProcessEvent(G4int iProp, size_t nEv)
void ProcessEvent |
( |
G4int |
iProp, |
|
|
size_t |
nEv |
|
) |
| |
Definition at line 172 of file errprop.cc.
References theG4ErrorMode, and theTarget.
Referenced by main(), lar_content::MasterAlgorithm::RunCosmicRayReconstruction(), lar_pandora::StandardPandora::RunPandoraInstances(), lar_content::MasterAlgorithm::RunSliceReconstruction(), and lar_content::MasterAlgorithm::RunSlicing().
176 G4ThreeVector xv3( 0, 0, 0 );
177 G4ThreeVector pv3( 20.0*GeV, 0.0, 0.0 );
178 G4ErrorTrajErr
error( 5, 0 );
179 G4ErrorFreeTrajState* g4ErrorTrajState
180 =
new G4ErrorFreeTrajState(
"mu-", xv3, pv3,
error );
182 G4ErrorPropagatorManager* g4emgr
183 = G4ErrorPropagatorManager::GetErrorPropagatorManager();
187 G4Point3D surfPos(224.*cm,0.,0.);
188 G4Normal3D surfNorm(1.,0.,0.);
196 }
else if( iProp == 1){
200 g4emgr->InitTrackPropagation();
211 if( g4emgr->GetPropagator()->CheckIfLastStep( g4ErrorTrajState->GetG4Track() )) {
212 g4emgr->GetPropagator()
213 ->InvokePostUserTrackingAction( g4ErrorTrajState->GetG4Track() );
215 G4cout <<
"STEP_BY_STEP propagation: Last Step " << G4endl;
220 G4cout <<
" $$$ PROPAGATION ENDED " << G4endl;
222 G4Point3D posEnd = g4ErrorTrajState->GetPosition();
223 G4Normal3D momEnd = g4ErrorTrajState->GetMomentum();
224 G4ErrorTrajErr errorEnd = g4ErrorTrajState->GetError();
226 G4cout <<
" Position: " << posEnd << G4endl
227 <<
" Momentum: " << momEnd << G4endl
228 <<
" Error: " << errorEnd << G4endl;
G4ErrorMode theG4ErrorMode
G4ErrorTarget * theTarget
G4ErrorMode theG4ErrorMode |