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 232 of file errprop.cc.
References radius, and target.
Referenced by Initialize().
235 G4ErrorTarget*
target = 0;
237 G4Point3D surfPos(221.*cm,0.,0.);
238 G4Normal3D surfNorm(1.,0.,0.);
239 target =
new G4ErrorPlaneSurfaceTarget(surfNorm, surfPos );
240 }
else if( iTarget == 2 ) {
242 target =
new G4ErrorCylSurfaceTarget(radius);
243 }
else if( iTarget == 3 ) {
244 target =
new G4ErrorGeomVolumeTarget(
"MUON");
245 }
else if( iTarget == 4 ) {
246 target =
new G4ErrorTrackLengthTarget(223.*cm);
248 G4Exception(
"exG4eReco",
"Fatal error in Argument",
249 FatalErrorInArgument,
"Target type has to be between 1 and 4");
cout<< "-> Edep in the target
Definition at line 256 of file errprop.cc.
Referenced by main().
258 G4ErrorPropagatorManager::GetErrorPropagatorManager()->CloseGeometry();
Definition at line 100 of file errprop.cc.
References BuildTarget(), target, theG4ErrorMode, and theTarget.
Referenced by export_G4RunManager(), export_G4VisManager(), export_G4VSensitiveDetector(), ArCaptureGammas::GetGammas(), genie::flux::GPowerSpectrumAtmoFlux::GPowerSpectrumAtmoFlux(), main(), cmtool::CMManagerBase::SetClusters(), pma::Track3D::SetTagFlag(), and visio().
102 G4VSteppingVerbose::SetInstance(
new G4SteppingVerbose);
105 G4ErrorPropagatorManager* g4emgr
106 = G4ErrorPropagatorManager::GetErrorPropagatorManager();
107 G4ErrorPropagatorData* g4edata
108 = G4ErrorPropagatorData::GetErrorPropagatorData();
110 g4emgr->SetUserInitialization(
new ExErrorDetectorConstruction);
112 G4UImanager::GetUIpointer()->ApplyCommand(
"/exerror/setField -10. kilogauss");
114 g4emgr->InitGeant4e();
116 G4UImanager::GetUIpointer()->ApplyCommand(
"/control/verbose 1");
117 G4UImanager::GetUIpointer()->ApplyCommand(
"/tracking/verbose 1");
118 G4UImanager::GetUIpointer()->ApplyCommand(
"/geant4e/limits/stepLength 100 mm");
126 char*
target = std::getenv(
"G4ERROR_TARGET");
137 G4Exception(
"exG4eReco",
"Fatal error in Argument",
138 FatalErrorInArgument,
140 " It must be: PLANE_SURFACE, CYL_SURFACE, VOLUME, TRKLEN").c_str());
143 G4Exception(
"exG4eReco",
"Fatal error in Argument",
144 JustWarning,
"Variable G4ERROR_TARGET not defined, taking it = PLANE_SURFACE");
151 char* mode = std::getenv(
"G4ERROR_MODE");
158 G4Exception(
"exG4eReco",
"Fatal error in Argument",
159 FatalErrorInArgument,
161 " It must be: FORWARDS or BACKWARDS").c_str());
164 G4Exception(
"exG4eReco",
"Fatal error in Argument",
165 JustWarning,
"Variable G4ERROR_MODE not defined, taking it = BACKWARDS");
G4ErrorMode theG4ErrorMode
G4ErrorTarget * theTarget
G4ErrorTarget * BuildTarget(G4int iTarget)
cout<< "-> Edep in the target
Definition at line 62 of file errprop.cc.
References Finalize(), Initialize(), and ProcessEvent().
71 char* prop = std::getenv(
"G4ERROR_PROP");
78 G4Exception(
"exG4eReco",
"Fatal error in Argument",
81 " It must be: UNTIL_TARGET or STEP_BY_STEP").c_str());
84 G4Exception(
"exG4eReco",
"Fatal error in Argument",
86 "Variable G4ERROR_PROP not defined, taking it = UNTIL_TARGET");
90 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 171 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().
175 G4ThreeVector xv3( 0, 0, 0 );
176 G4ThreeVector pv3( 20.0*GeV, 0.0, 0.0 );
177 G4ErrorTrajErr
error( 5, 0 );
178 G4ErrorFreeTrajState* g4ErrorTrajState
179 =
new G4ErrorFreeTrajState(
"mu-", xv3, pv3,
error );
181 G4ErrorPropagatorManager* g4emgr
182 = G4ErrorPropagatorManager::GetErrorPropagatorManager();
186 G4Point3D surfPos(224.*cm,0.,0.);
187 G4Normal3D surfNorm(1.,0.,0.);
195 }
else if( iProp == 1){
199 g4emgr->InitTrackPropagation();
210 if( g4emgr->GetPropagator()->CheckIfLastStep( g4ErrorTrajState->GetG4Track() )) {
211 g4emgr->GetPropagator()
212 ->InvokePostUserTrackingAction( g4ErrorTrajState->GetG4Track() );
214 G4cout <<
"STEP_BY_STEP propagation: Last Step " << G4endl;
219 G4cout <<
" $$$ PROPAGATION ENDED " << G4endl;
221 G4Point3D posEnd = g4ErrorTrajState->GetPosition();
222 G4Normal3D momEnd = g4ErrorTrajState->GetMomentum();
223 G4ErrorTrajErr errorEnd = g4ErrorTrajState->GetError();
225 G4cout <<
" Position: " << posEnd << G4endl
226 <<
" Momentum: " << momEnd << G4endl
227 <<
" Error: " << errorEnd << G4endl;
G4ErrorMode theG4ErrorMode
G4ErrorTarget * theTarget
G4ErrorMode theG4ErrorMode |