Changeset 1230 for trunk/examples/extended/electromagnetic
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (16 years ago)
- Location:
- trunk/examples/extended/electromagnetic
- Files:
-
- 681 edited
-
TestEm0/DirectAccess.cc (modified) (1 diff)
-
TestEm0/TestEm0.cc (modified) (2 diffs)
-
TestEm0/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm0/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm0/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm0/include/PhysicsList.hh (modified) (1 diff)
-
TestEm0/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm0/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm0/include/RunAction.hh (modified) (1 diff)
-
TestEm0/src/DetectorConstruction.cc (modified) (4 diffs)
-
TestEm0/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm0/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm0/src/PhysicsList.cc (modified) (5 diffs)
-
TestEm0/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm0/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm0/src/RunAction.cc (modified) (5 diffs)
-
TestEm1/GNUmakefile (modified) (2 diffs)
-
TestEm1/TestEm1.cc (modified) (1 diff)
-
TestEm1/annihil.mac (modified) (2 diffs)
-
TestEm1/brems.mac (modified) (2 diffs)
-
TestEm1/erange.mac (modified) (2 diffs)
-
TestEm1/gammaconversion.mac (modified) (2 diffs)
-
TestEm1/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm1/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm1/include/EventAction.hh (modified) (1 diff)
-
TestEm1/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm1/include/HistoManager.hh (modified) (1 diff)
-
TestEm1/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm1/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm1/include/PhysicsList.hh (modified) (1 diff)
-
TestEm1/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm1/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm1/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm1/include/ProcessesCount.hh (modified) (1 diff)
-
TestEm1/include/RunAction.hh (modified) (1 diff)
-
TestEm1/include/StepMax.hh (modified) (1 diff)
-
TestEm1/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm1/include/SteppingAction.hh (modified) (1 diff)
-
TestEm1/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm1/include/TrackingAction.hh (modified) (1 diff)
-
TestEm1/ionis.mac (modified) (2 diffs)
-
TestEm1/range.mac (modified) (2 diffs)
-
TestEm1/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm1/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm1/src/EventAction.cc (modified) (1 diff)
-
TestEm1/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm1/src/HistoManager.cc (modified) (5 diffs)
-
TestEm1/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm1/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm1/src/PhysicsList.cc (modified) (5 diffs)
-
TestEm1/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm1/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm1/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm1/src/RunAction.cc (modified) (1 diff)
-
TestEm1/src/StepMax.cc (modified) (1 diff)
-
TestEm1/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm1/src/SteppingAction.cc (modified) (1 diff)
-
TestEm1/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm1/src/TrackingAction.cc (modified) (1 diff)
-
TestEm10/GNUmakefile (modified) (2 diffs)
-
TestEm10/TestEm10.cc (modified) (1 diff)
-
TestEm10/include/Em10CalorHit.hh (modified) (1 diff)
-
TestEm10/include/Em10CalorimeterSD.hh (modified) (1 diff)
-
TestEm10/include/Em10DetectorConstruction.hh (modified) (1 diff)
-
TestEm10/include/Em10DetectorMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10EventAction.hh (modified) (1 diff)
-
TestEm10/include/Em10EventActionMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10PhysicsList.hh (modified) (1 diff)
-
TestEm10/include/Em10PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm10/include/Em10PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10RunAction.hh (modified) (1 diff)
-
TestEm10/include/Em10RunMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10StepCut.hh (modified) (1 diff)
-
TestEm10/include/Em10SteppingAction.hh (modified) (1 diff)
-
TestEm10/include/Em10SteppingMessenger.hh (modified) (1 diff)
-
TestEm10/include/Em10SteppingVerbose.hh (modified) (1 diff)
-
TestEm10/include/StepMax.hh (modified) (1 diff)
-
TestEm10/include/TRTDetectorConstruction.hh (modified) (1 diff)
-
TestEm10/include/TRTMaterials.hh (modified) (1 diff)
-
TestEm10/src/Em10CalorHit.cc (modified) (1 diff)
-
TestEm10/src/Em10CalorimeterSD.cc (modified) (1 diff)
-
TestEm10/src/Em10DetectorConstruction.cc (modified) (1 diff)
-
TestEm10/src/Em10DetectorMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10EventAction.cc (modified) (1 diff)
-
TestEm10/src/Em10EventActionMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10PhysicsList.cc (modified) (1 diff)
-
TestEm10/src/Em10PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm10/src/Em10PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10RunAction.cc (modified) (1 diff)
-
TestEm10/src/Em10RunMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10StepCut.cc (modified) (1 diff)
-
TestEm10/src/Em10SteppingAction.cc (modified) (1 diff)
-
TestEm10/src/Em10SteppingMessenger.cc (modified) (1 diff)
-
TestEm10/src/Em10SteppingVerbose.cc (modified) (1 diff)
-
TestEm10/src/StepMax.cc (modified) (1 diff)
-
TestEm11/GNUmakefile (modified) (2 diffs)
-
TestEm11/TestEm11.cc (modified) (1 diff)
-
TestEm11/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm11/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm11/include/EventAction.hh (modified) (1 diff)
-
TestEm11/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm11/include/HistoManager.hh (modified) (1 diff)
-
TestEm11/include/HistoMessenger.hh (modified) (2 diffs)
-
TestEm11/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm11/include/PhysicsList.hh (modified) (1 diff)
-
TestEm11/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm11/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm11/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm11/include/RunAction.hh (modified) (1 diff)
-
TestEm11/include/StepMax.hh (modified) (1 diff)
-
TestEm11/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm11/include/SteppingAction.hh (modified) (1 diff)
-
TestEm11/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm11/include/TrackingAction.hh (modified) (1 diff)
-
TestEm11/range.mac (modified) (2 diffs)
-
TestEm11/run01.mac (modified) (2 diffs)
-
TestEm11/run02.mac (modified) (2 diffs)
-
TestEm11/sandia.mac (modified) (2 diffs)
-
TestEm11/src/DetectorConstruction.cc (modified) (2 diffs)
-
TestEm11/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm11/src/EventAction.cc (modified) (1 diff)
-
TestEm11/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm11/src/HistoManager.cc (modified) (6 diffs)
-
TestEm11/src/HistoMessenger.cc (modified) (4 diffs)
-
TestEm11/src/PhysListEmStandard.cc (modified) (5 diffs)
-
TestEm11/src/PhysicsList.cc (modified) (5 diffs)
-
TestEm11/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm11/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm11/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm11/src/RunAction.cc (modified) (1 diff)
-
TestEm11/src/StepMax.cc (modified) (1 diff)
-
TestEm11/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm11/src/SteppingAction.cc (modified) (1 diff)
-
TestEm11/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm11/src/TrackingAction.cc (modified) (1 diff)
-
TestEm11/water.mac (modified) (2 diffs)
-
TestEm12/GNUmakefile (modified) (2 diffs)
-
TestEm12/TestEm12.cc (modified) (1 diff)
-
TestEm12/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm12/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm12/include/EventAction.hh (modified) (1 diff)
-
TestEm12/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm12/include/HistoManager.hh (modified) (1 diff)
-
TestEm12/include/HistoMessenger.hh (modified) (2 diffs)
-
TestEm12/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm12/include/PhysicsList.hh (modified) (1 diff)
-
TestEm12/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm12/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm12/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm12/include/RunAction.hh (modified) (1 diff)
-
TestEm12/include/StepMax.hh (modified) (1 diff)
-
TestEm12/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm12/include/SteppingAction.hh (modified) (1 diff)
-
TestEm12/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm12/include/TrackingAction.hh (modified) (1 diff)
-
TestEm12/run01.mac (modified) (2 diffs)
-
TestEm12/run02.mac (modified) (2 diffs)
-
TestEm12/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm12/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm12/src/EventAction.cc (modified) (1 diff)
-
TestEm12/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm12/src/HistoManager.cc (modified) (6 diffs)
-
TestEm12/src/HistoMessenger.cc (modified) (4 diffs)
-
TestEm12/src/PhysListEmStandard.cc (modified) (5 diffs)
-
TestEm12/src/PhysicsList.cc (modified) (6 diffs)
-
TestEm12/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm12/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm12/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm12/src/RunAction.cc (modified) (1 diff)
-
TestEm12/src/StepMax.cc (modified) (1 diff)
-
TestEm12/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm12/src/SteppingAction.cc (modified) (1 diff)
-
TestEm12/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm12/src/TrackingAction.cc (modified) (1 diff)
-
TestEm13/GNUmakefile (modified) (2 diffs)
-
TestEm13/TestEm13.cc (modified) (1 diff)
-
TestEm13/gamma.mac (modified) (2 diffs)
-
TestEm13/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm13/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm13/include/EventAction.hh (modified) (1 diff)
-
TestEm13/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm13/include/PhysListEmLivermore.hh (modified) (2 diffs)
-
TestEm13/include/PhysListEmPenelope.hh (modified) (2 diffs)
-
TestEm13/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm13/include/PhysicsList.hh (modified) (1 diff)
-
TestEm13/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm13/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm13/include/ProcessesCount.hh (modified) (1 diff)
-
TestEm13/include/RunAction.hh (modified) (1 diff)
-
TestEm13/include/SteppingAction.hh (modified) (1 diff)
-
TestEm13/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm13/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm13/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm13/src/EventAction.cc (modified) (1 diff)
-
TestEm13/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm13/src/PhysListEmLivermore.cc (modified) (5 diffs)
-
TestEm13/src/PhysListEmPenelope.cc (modified) (5 diffs)
-
TestEm13/src/PhysListEmStandard.cc (modified) (1 diff)
-
TestEm13/src/PhysicsList.cc (modified) (3 diffs)
-
TestEm13/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm13/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm13/src/RunAction.cc (modified) (1 diff)
-
TestEm13/src/SteppingAction.cc (modified) (1 diff)
-
TestEm13/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm14/GNUmakefile (modified) (2 diffs)
-
TestEm14/TestEm14.cc (modified) (1 diff)
-
TestEm14/compton.mac (modified) (3 diffs)
-
TestEm14/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm14/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm14/include/EventAction.hh (modified) (1 diff)
-
TestEm14/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm14/include/HistoManager.hh (modified) (1 diff)
-
TestEm14/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm14/include/PhysListEmLivermore.hh (modified) (2 diffs)
-
TestEm14/include/PhysListEmPenelope.hh (modified) (2 diffs)
-
TestEm14/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm14/include/PhysicsList.hh (modified) (1 diff)
-
TestEm14/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm14/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm14/include/ProcessesCount.hh (modified) (1 diff)
-
TestEm14/include/RunAction.hh (modified) (1 diff)
-
TestEm14/include/SteppingAction.hh (modified) (1 diff)
-
TestEm14/include/SteppingMessenger.hh (modified) (1 diff)
-
TestEm14/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm14/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm14/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm14/src/EventAction.cc (modified) (1 diff)
-
TestEm14/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm14/src/HistoManager.cc (modified) (4 diffs)
-
TestEm14/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm14/src/PhysListEmLivermore.cc (modified) (5 diffs)
-
TestEm14/src/PhysListEmPenelope.cc (modified) (5 diffs)
-
TestEm14/src/PhysListEmStandard.cc (modified) (1 diff)
-
TestEm14/src/PhysicsList.cc (modified) (4 diffs)
-
TestEm14/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm14/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm14/src/RunAction.cc (modified) (1 diff)
-
TestEm14/src/SteppingAction.cc (modified) (1 diff)
-
TestEm14/src/SteppingMessenger.cc (modified) (1 diff)
-
TestEm14/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm15/GNUmakefile (modified) (2 diffs)
-
TestEm15/TestEm15.cc (modified) (1 diff)
-
TestEm15/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm15/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm15/include/EventAction.hh (modified) (1 diff)
-
TestEm15/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm15/include/HistoManager.hh (modified) (1 diff)
-
TestEm15/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm15/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm15/include/PhysicsList.hh (modified) (1 diff)
-
TestEm15/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm15/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm15/include/ProcessesCount.hh (modified) (1 diff)
-
TestEm15/include/RunAction.hh (modified) (1 diff)
-
TestEm15/include/StepMax.hh (modified) (1 diff)
-
TestEm15/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm15/include/SteppingAction.hh (modified) (1 diff)
-
TestEm15/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm15/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm15/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm15/src/EventAction.cc (modified) (1 diff)
-
TestEm15/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm15/src/HistoManager.cc (modified) (5 diffs)
-
TestEm15/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm15/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm15/src/PhysicsList.cc (modified) (1 diff)
-
TestEm15/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm15/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm15/src/RunAction.cc (modified) (1 diff)
-
TestEm15/src/StepMax.cc (modified) (1 diff)
-
TestEm15/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm15/src/SteppingAction.cc (modified) (1 diff)
-
TestEm15/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm16/GNUmakefile (modified) (2 diffs)
-
TestEm16/TestEm16.cc (modified) (1 diff)
-
TestEm16/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm16/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm16/include/EventAction.hh (modified) (1 diff)
-
TestEm16/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm16/include/PhysicsList.hh (modified) (1 diff)
-
TestEm16/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm16/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm16/include/RunAction.hh (modified) (1 diff)
-
TestEm16/include/SteppingAction.hh (modified) (1 diff)
-
TestEm16/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm16/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm16/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm16/src/EventAction.cc (modified) (1 diff)
-
TestEm16/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm16/src/HistoManager.cc (modified) (1 diff)
-
TestEm16/src/PhysicsList.cc (modified) (3 diffs)
-
TestEm16/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm16/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm16/src/RunAction.cc (modified) (1 diff)
-
TestEm16/src/SteppingAction.cc (modified) (1 diff)
-
TestEm16/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm17/GNUmakefile (modified) (2 diffs)
-
TestEm17/TestEm17.cc (modified) (1 diff)
-
TestEm17/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm17/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm17/include/EventAction.hh (modified) (1 diff)
-
TestEm17/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm17/include/HistoManager.hh (modified) (2 diffs)
-
TestEm17/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm17/include/MuCrossSections.hh (modified) (1 diff)
-
TestEm17/include/MuNuclearBuilder.hh (modified) (1 diff)
-
TestEm17/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm17/include/PhysicsList.hh (modified) (1 diff)
-
TestEm17/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm17/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm17/include/ProcessesCount.hh (modified) (1 diff)
-
TestEm17/include/RunAction.hh (modified) (1 diff)
-
TestEm17/include/StackingAction.hh (modified) (1 diff)
-
TestEm17/include/SteppingAction.hh (modified) (1 diff)
-
TestEm17/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm17/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm17/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm17/src/EventAction.cc (modified) (1 diff)
-
TestEm17/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm17/src/HistoManager.cc (modified) (4 diffs)
-
TestEm17/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm17/src/MuCrossSections.cc (modified) (1 diff)
-
TestEm17/src/MuNuclearBuilder.cc (modified) (1 diff)
-
TestEm17/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm17/src/PhysicsList.cc (modified) (1 diff)
-
TestEm17/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm17/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm17/src/RunAction.cc (modified) (3 diffs)
-
TestEm17/src/StackingAction.cc (modified) (1 diff)
-
TestEm17/src/SteppingAction.cc (modified) (2 diffs)
-
TestEm17/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm18/GNUmakefile (modified) (2 diffs)
-
TestEm18/TestEm18.cc (modified) (1 diff)
-
TestEm18/electron.mac (modified) (2 diffs)
-
TestEm18/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm18/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm18/include/EventAction.hh (modified) (1 diff)
-
TestEm18/include/EventMessenger.hh (modified) (1 diff)
-
TestEm18/include/HistoManager.hh (modified) (1 diff)
-
TestEm18/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm18/include/PhysListEmLivermore.hh (modified) (3 diffs)
-
TestEm18/include/PhysListEmPenelope.hh (modified) (3 diffs)
-
TestEm18/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm18/include/PhysicsList.hh (modified) (2 diffs)
-
TestEm18/include/PhysicsListMessenger.hh (modified) (2 diffs)
-
TestEm18/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm18/include/RunAction.hh (modified) (1 diff)
-
TestEm18/include/StackingAction.hh (modified) (1 diff)
-
TestEm18/include/StepMax.hh (modified) (1 diff)
-
TestEm18/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm18/include/SteppingAction.hh (modified) (1 diff)
-
TestEm18/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm18/proton.mac (modified) (2 diffs)
-
TestEm18/src/DetectorConstruction.cc (modified) (2 diffs)
-
TestEm18/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm18/src/EventAction.cc (modified) (1 diff)
-
TestEm18/src/EventMessenger.cc (modified) (1 diff)
-
TestEm18/src/HistoManager.cc (modified) (5 diffs)
-
TestEm18/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm18/src/PhysListEmLivermore.cc (modified) (5 diffs)
-
TestEm18/src/PhysListEmPenelope.cc (modified) (5 diffs)
-
TestEm18/src/PhysListEmStandard.cc (modified) (3 diffs)
-
TestEm18/src/PhysicsList.cc (modified) (5 diffs)
-
TestEm18/src/PhysicsListMessenger.cc (modified) (3 diffs)
-
TestEm18/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm18/src/RunAction.cc (modified) (1 diff)
-
TestEm18/src/StackingAction.cc (modified) (1 diff)
-
TestEm18/src/StepMax.cc (modified) (1 diff)
-
TestEm18/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm18/src/SteppingAction.cc (modified) (1 diff)
-
TestEm18/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm2/GNUmakefile (modified) (2 diffs)
-
TestEm2/TestEm2.cc (modified) (1 diff)
-
TestEm2/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm2/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm2/include/EmAcceptance.hh (modified) (1 diff)
-
TestEm2/include/EventAction.hh (modified) (1 diff)
-
TestEm2/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm2/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm2/include/PhysicsList.hh (modified) (1 diff)
-
TestEm2/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm2/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm2/include/RunAction.hh (modified) (1 diff)
-
TestEm2/include/RunActionMessenger.hh (modified) (1 diff)
-
TestEm2/include/StepMax.hh (modified) (1 diff)
-
TestEm2/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm2/include/SteppingAction.hh (modified) (1 diff)
-
TestEm2/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm2/include/TrackingAction.hh (modified) (1 diff)
-
TestEm2/run01.mac (modified) (2 diffs)
-
TestEm2/run02.mac (modified) (2 diffs)
-
TestEm2/run03.mac (modified) (2 diffs)
-
TestEm2/run05.mac (modified) (3 diffs)
-
TestEm2/src/DetectorConstruction.cc (modified) (10 diffs)
-
TestEm2/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm2/src/EmAcceptance.cc (modified) (1 diff)
-
TestEm2/src/EventAction.cc (modified) (1 diff)
-
TestEm2/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm2/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm2/src/PhysicsList.cc (modified) (14 diffs)
-
TestEm2/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm2/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm2/src/RunAction.cc (modified) (5 diffs)
-
TestEm2/src/RunActionMessenger.cc (modified) (1 diff)
-
TestEm2/src/StepMax.cc (modified) (1 diff)
-
TestEm2/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm2/src/SteppingAction.cc (modified) (1 diff)
-
TestEm2/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm2/src/TrackingAction.cc (modified) (1 diff)
-
TestEm3/GNUmakefile (modified) (2 diffs)
-
TestEm3/TestEm3.cc (modified) (1 diff)
-
TestEm3/atlashec.mac (modified) (2 diffs)
-
TestEm3/dedx.mac (modified) (2 diffs)
-
TestEm3/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm3/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm3/include/EmAcceptance.hh (modified) (1 diff)
-
TestEm3/include/EventAction.hh (modified) (1 diff)
-
TestEm3/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm3/include/HistoManager.hh (modified) (1 diff)
-
TestEm3/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm3/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm3/include/PhysicsList.hh (modified) (2 diffs)
-
TestEm3/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm3/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm3/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm3/include/RunAction.hh (modified) (3 diffs)
-
TestEm3/include/RunActionMessenger.hh (modified) (1 diff)
-
TestEm3/include/StepMax.hh (modified) (1 diff)
-
TestEm3/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm3/include/SteppingAction.hh (modified) (2 diffs)
-
TestEm3/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm3/include/TrackingAction.hh (modified) (1 diff)
-
TestEm3/ionC12.mac (modified) (2 diffs)
-
TestEm3/lhcb.mac (modified) (2 diffs)
-
TestEm3/linac.mac (modified) (2 diffs)
-
TestEm3/lockwood.mac (modified) (2 diffs)
-
TestEm3/retrieveTables.mac (modified) (2 diffs)
-
TestEm3/run01.mac (modified) (2 diffs)
-
TestEm3/run02.mac (modified) (2 diffs)
-
TestEm3/run07.mac (modified) (2 diffs)
-
TestEm3/run08.mac (modified) (2 diffs)
-
TestEm3/run15.mac (modified) (2 diffs)
-
TestEm3/sicapo1.mac (modified) (2 diffs)
-
TestEm3/sicapo2.mac (modified) (2 diffs)
-
TestEm3/sicapo3.mac (modified) (2 diffs)
-
TestEm3/src/DetectorConstruction.cc (modified) (6 diffs)
-
TestEm3/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm3/src/EmAcceptance.cc (modified) (1 diff)
-
TestEm3/src/EventAction.cc (modified) (2 diffs)
-
TestEm3/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm3/src/HistoManager.cc (modified) (5 diffs)
-
TestEm3/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm3/src/PhysListEmStandard.cc (modified) (5 diffs)
-
TestEm3/src/PhysicsList.cc (modified) (9 diffs)
-
TestEm3/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm3/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm3/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm3/src/RunAction.cc (modified) (7 diffs)
-
TestEm3/src/RunActionMessenger.cc (modified) (1 diff)
-
TestEm3/src/StepMax.cc (modified) (1 diff)
-
TestEm3/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm3/src/SteppingAction.cc (modified) (4 diffs)
-
TestEm3/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm3/src/TrackingAction.cc (modified) (1 diff)
-
TestEm3/storeTables.mac (modified) (2 diffs)
-
TestEm4/GNUmakefile (modified) (2 diffs)
-
TestEm4/TestEm4.cc (modified) (1 diff)
-
TestEm4/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm4/include/EventAction.hh (modified) (1 diff)
-
TestEm4/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm4/include/PhysicsList.hh (modified) (1 diff)
-
TestEm4/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm4/include/RunAction.hh (modified) (1 diff)
-
TestEm4/include/SteppingAction.hh (modified) (1 diff)
-
TestEm4/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm4/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm4/src/EventAction.cc (modified) (1 diff)
-
TestEm4/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm4/src/PhysicsList.cc (modified) (3 diffs)
-
TestEm4/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm4/src/RunAction.cc (modified) (2 diffs)
-
TestEm4/src/SteppingAction.cc (modified) (1 diff)
-
TestEm4/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm5/GNUmakefile (modified) (2 diffs)
-
TestEm5/TestEm5.cc (modified) (1 diff)
-
TestEm5/air.mac (modified) (2 diffs)
-
TestEm5/berger.mac (modified) (3 diffs)
-
TestEm5/dedx1.mac (modified) (3 diffs)
-
TestEm5/dedx2.mac (modified) (2 diffs)
-
TestEm5/hadron.mac (modified) (3 diffs)
-
TestEm5/hanson.mac (modified) (2 diffs)
-
TestEm5/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm5/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm5/include/EventAction.hh (modified) (1 diff)
-
TestEm5/include/EventMessenger.hh (modified) (1 diff)
-
TestEm5/include/HistoManager.hh (modified) (2 diffs)
-
TestEm5/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm5/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm5/include/PhysListEmStandardSS.hh (modified) (1 diff)
-
TestEm5/include/PhysicsList.hh (modified) (4 diffs)
-
TestEm5/include/PhysicsListMessenger.hh (modified) (2 diffs)
-
TestEm5/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm5/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm5/include/RunAction.hh (modified) (2 diffs)
-
TestEm5/include/StackingAction.hh (modified) (1 diff)
-
TestEm5/include/StackingMessenger.hh (modified) (1 diff)
-
TestEm5/include/StepMax.hh (modified) (1 diff)
-
TestEm5/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm5/include/SteppingAction.hh (modified) (1 diff)
-
TestEm5/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm5/include/TrackingAction.hh (modified) (1 diff)
-
TestEm5/mumsc.mac (modified) (3 diffs)
-
TestEm5/neutron.mac (modified) (2 diffs)
-
TestEm5/src/DetectorConstruction.cc (modified) (12 diffs)
-
TestEm5/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm5/src/EventAction.cc (modified) (1 diff)
-
TestEm5/src/EventMessenger.cc (modified) (1 diff)
-
TestEm5/src/HistoManager.cc (modified) (6 diffs)
-
TestEm5/src/HistoMessenger.cc (modified) (1 diff)
-
TestEm5/src/PhysListEmStandard.cc (modified) (4 diffs)
-
TestEm5/src/PhysListEmStandardSS.cc (modified) (6 diffs)
-
TestEm5/src/PhysicsList.cc (modified) (14 diffs)
-
TestEm5/src/PhysicsListMessenger.cc (modified) (2 diffs)
-
TestEm5/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm5/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm5/src/RunAction.cc (modified) (3 diffs)
-
TestEm5/src/StackingAction.cc (modified) (2 diffs)
-
TestEm5/src/StackingMessenger.cc (modified) (1 diff)
-
TestEm5/src/StepMax.cc (modified) (1 diff)
-
TestEm5/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm5/src/SteppingAction.cc (modified) (3 diffs)
-
TestEm5/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm5/src/TrackingAction.cc (modified) (10 diffs)
-
TestEm5/tramu.mac (modified) (3 diffs)
-
TestEm6/GNUmakefile (modified) (2 diffs)
-
TestEm6/TestEm6.cc (modified) (1 diff)
-
TestEm6/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm6/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm6/include/EventAction.hh (modified) (1 diff)
-
TestEm6/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm6/include/PhysicsList.hh (modified) (1 diff)
-
TestEm6/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm6/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm6/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm6/include/RunAction.hh (modified) (1 diff)
-
TestEm6/include/SteppingAction.hh (modified) (1 diff)
-
TestEm6/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm6/src/DetectorConstruction.cc (modified) (1 diff)
-
TestEm6/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm6/src/EventAction.cc (modified) (1 diff)
-
TestEm6/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm6/src/PhysicsList.cc (modified) (3 diffs)
-
TestEm6/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm6/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm6/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm6/src/RunAction.cc (modified) (2 diffs)
-
TestEm6/src/SteppingAction.cc (modified) (1 diff)
-
TestEm6/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm7/GNUmakefile (modified) (3 diffs)
-
TestEm7/TestEm7.cc (modified) (1 diff)
-
TestEm7/include/DetectorConstruction.hh (modified) (1 diff)
-
TestEm7/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm7/include/EventAction.hh (modified) (1 diff)
-
TestEm7/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm7/include/G4ScreenedNuclearRecoil.hh (modified) (16 diffs)
-
TestEm7/include/PhysListEmLivermore.hh (modified) (1 diff)
-
TestEm7/include/PhysListEmPenelope.hh (modified) (1 diff)
-
TestEm7/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm7/include/PhysListEmStandardNR.hh (modified) (1 diff)
-
TestEm7/include/PhysListEmStandardSS.hh (modified) (1 diff)
-
TestEm7/include/PhysicsList.hh (modified) (5 diffs)
-
TestEm7/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm7/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm7/include/PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm7/include/RunAction.hh (modified) (5 diffs)
-
TestEm7/include/StepMax.hh (modified) (1 diff)
-
TestEm7/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm7/include/SteppingAction.hh (modified) (1 diff)
-
TestEm7/include/SteppingVerbose.hh (modified) (1 diff)
-
TestEm7/include/TrackingAction.hh (modified) (1 diff)
-
TestEm7/include/c2_function.hh (modified) (50 diffs)
-
TestEm7/include/c2_function.icc (modified) (32 diffs)
-
TestEm7/ionC12.mac (modified) (4 diffs)
-
TestEm7/proton.mac (modified) (3 diffs)
-
TestEm7/snr.mac (modified) (3 diffs)
-
TestEm7/src/DetectorConstruction.cc (modified) (9 diffs)
-
TestEm7/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm7/src/EventAction.cc (modified) (1 diff)
-
TestEm7/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm7/src/G4ScreenedNuclearRecoil.cc (modified) (31 diffs)
-
TestEm7/src/PhysListEmLivermore.cc (modified) (1 diff)
-
TestEm7/src/PhysListEmPenelope.cc (modified) (1 diff)
-
TestEm7/src/PhysListEmStandard.cc (modified) (5 diffs)
-
TestEm7/src/PhysListEmStandardNR.cc (modified) (5 diffs)
-
TestEm7/src/PhysListEmStandardSS.cc (modified) (4 diffs)
-
TestEm7/src/PhysicsList.cc (modified) (16 diffs)
-
TestEm7/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm7/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm7/src/PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm7/src/RunAction.cc (modified) (8 diffs)
-
TestEm7/src/StepMax.cc (modified) (1 diff)
-
TestEm7/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm7/src/SteppingAction.cc (modified) (2 diffs)
-
TestEm7/src/SteppingVerbose.cc (modified) (1 diff)
-
TestEm7/src/TrackingAction.cc (modified) (2 diffs)
-
TestEm8/GNUmakefile (modified) (2 diffs)
-
TestEm8/TestEm8.cc (modified) (1 diff)
-
TestEm8/include/Em8CalorHit.hh (modified) (1 diff)
-
TestEm8/include/Em8CalorimeterSD.hh (modified) (1 diff)
-
TestEm8/include/Em8DetectorConstruction.hh (modified) (1 diff)
-
TestEm8/include/Em8DetectorMessenger.hh (modified) (1 diff)
-
TestEm8/include/Em8EventAction.hh (modified) (1 diff)
-
TestEm8/include/Em8EventActionMessenger.hh (modified) (1 diff)
-
TestEm8/include/Em8PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm8/include/Em8PrimaryGeneratorMessenger.hh (modified) (1 diff)
-
TestEm8/include/Em8RunAction.hh (modified) (1 diff)
-
TestEm8/include/Em8RunMessenger.hh (modified) (1 diff)
-
TestEm8/include/Em8SteppingAction.hh (modified) (1 diff)
-
TestEm8/include/Em8SteppingVerbose.hh (modified) (1 diff)
-
TestEm8/include/PhysicsList.hh (modified) (3 diffs)
-
TestEm8/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm8/include/StepMax.hh (modified) (1 diff)
-
TestEm8/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm8/include/TRTDetectorConstruction.hh (modified) (1 diff)
-
TestEm8/include/TRTMaterials.hh (modified) (1 diff)
-
TestEm8/src/Em8CalorHit.cc (modified) (1 diff)
-
TestEm8/src/Em8CalorimeterSD.cc (modified) (1 diff)
-
TestEm8/src/Em8DetectorConstruction.cc (modified) (1 diff)
-
TestEm8/src/Em8DetectorMessenger.cc (modified) (1 diff)
-
TestEm8/src/Em8EventAction.cc (modified) (1 diff)
-
TestEm8/src/Em8EventActionMessenger.cc (modified) (1 diff)
-
TestEm8/src/Em8PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm8/src/Em8PrimaryGeneratorMessenger.cc (modified) (1 diff)
-
TestEm8/src/Em8RunAction.cc (modified) (1 diff)
-
TestEm8/src/Em8RunMessenger.cc (modified) (1 diff)
-
TestEm8/src/Em8SteppingAction.cc (modified) (1 diff)
-
TestEm8/src/Em8SteppingVerbose.cc (modified) (1 diff)
-
TestEm8/src/PhysicsList.cc (modified) (8 diffs)
-
TestEm8/src/PhysicsListMessenger.cc (modified) (1 diff)
-
TestEm8/src/StepMax.cc (modified) (1 diff)
-
TestEm8/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm9/GNUmakefile (modified) (2 diffs)
-
TestEm9/TestEm9.cc (modified) (1 diff)
-
TestEm9/cms10gev.mac (modified) (3 diffs)
-
TestEm9/csi.mac (modified) (1 diff)
-
TestEm9/include/DetectorConstruction.hh (modified) (6 diffs)
-
TestEm9/include/DetectorMessenger.hh (modified) (1 diff)
-
TestEm9/include/EmAcceptance.hh (modified) (1 diff)
-
TestEm9/include/EventAction.hh (modified) (1 diff)
-
TestEm9/include/EventActionMessenger.hh (modified) (1 diff)
-
TestEm9/include/Histo.hh (modified) (1 diff)
-
TestEm9/include/HistoManager.hh (modified) (5 diffs)
-
TestEm9/include/HistoMessenger.hh (modified) (1 diff)
-
TestEm9/include/PhysListEmLivermore.hh (modified) (1 diff)
-
TestEm9/include/PhysListEmPenelope.hh (modified) (1 diff)
-
TestEm9/include/PhysListEmStandard.hh (modified) (1 diff)
-
TestEm9/include/PhysicsList.hh (modified) (5 diffs)
-
TestEm9/include/PhysicsListMessenger.hh (modified) (1 diff)
-
TestEm9/include/PrimaryGeneratorAction.hh (modified) (1 diff)
-
TestEm9/include/StepMax.hh (modified) (1 diff)
-
TestEm9/include/StepMaxMessenger.hh (modified) (1 diff)
-
TestEm9/include/SteppingAction.hh (modified) (1 diff)
-
TestEm9/src/DetectorConstruction.cc (modified) (19 diffs)
-
TestEm9/src/DetectorMessenger.cc (modified) (1 diff)
-
TestEm9/src/EmAcceptance.cc (modified) (1 diff)
-
TestEm9/src/EventAction.cc (modified) (1 diff)
-
TestEm9/src/EventActionMessenger.cc (modified) (1 diff)
-
TestEm9/src/Histo.cc (modified) (3 diffs)
-
TestEm9/src/HistoManager.cc (modified) (15 diffs)
-
TestEm9/src/HistoMessenger.cc (modified) (3 diffs)
-
TestEm9/src/PhysListEmLivermore.cc (modified) (1 diff)
-
TestEm9/src/PhysListEmPenelope.cc (modified) (1 diff)
-
TestEm9/src/PhysListEmStandard.cc (modified) (6 diffs)
-
TestEm9/src/PhysicsList.cc (modified) (10 diffs)
-
TestEm9/src/PhysicsListMessenger.cc (modified) (2 diffs)
-
TestEm9/src/PrimaryGeneratorAction.cc (modified) (1 diff)
-
TestEm9/src/StepMax.cc (modified) (1 diff)
-
TestEm9/src/StepMaxMessenger.cc (modified) (1 diff)
-
TestEm9/src/SteppingAction.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm0/DirectAccess.cc
r807 r1230 26 26 // 27 27 // $Id: DirectAccess.cc,v 1.2 2006/06/29 16:35:25 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------ -
trunk/examples/extended/electromagnetic/TestEm0/TestEm0.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: TestEm0.cc,v 1. 4 2007/06/21 17:30:53maire Exp $28 // GEANT4 tag $Name: $27 // $Id: TestEm0.cc,v 1.5 2009/11/17 22:48:26 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 57 57 // set user action classes 58 58 runManager->SetUserAction(new RunAction(det,prim)); 59 60 //Initialize G4 kernel61 runManager->Initialize();62 59 63 60 if (argc!=1) // batch mode -
trunk/examples/extended/electromagnetic/TestEm0/include/DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:35:29 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm0/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:35:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:35:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:35:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:35:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:35:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.3 2006/06/29 16:35:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/src/DetectorConstruction.cc
r807 r1230 26 26 27 27 // 28 // $Id: DetectorConstruction.cc,v 1. 9 2006/12/08 16:38:38maire Exp $29 // GEANT4 tag $Name: $28 // $Id: DetectorConstruction.cc,v 1.10 2009/11/14 18:04:20 maire Exp $ 29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // … … 83 83 84 84 G4Element* H = new G4Element("Hydrogen" ,"H" , z= 1., a= 1.01*g/mole); 85 G4Element* C = new G4Element("Carbon" ,"C" , z= 6., a= 12.01*g/mole); 85 86 G4Element* N = new G4Element("Nitrogen" ,"N" , z= 7., a= 14.01*g/mole); 86 87 G4Element* O = new G4Element("Oxygen" ,"O" , z= 8., a= 16.00*g/mole); 87 88 G4Element* Ge = new G4Element("Germanium","Ge", z=32., a= 72.59*g/mole); 89 G4Element* Pb = new G4Element("Lead" ,"Pb", z=82., a= 207.19*g/mole); 88 90 G4Element* Bi = new G4Element("Bismuth" ,"Bi", z=83., a= 208.98*g/mole); 89 91 … … 110 112 ///H2O->SetChemicalFormula("H_2O"); 111 113 H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV); 112 114 113 115 G4Material* steam = 114 116 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1); … … 132 134 new G4Material("Lead" , z=82., a=207.19*g/mole, density= 11.35*g/cm3); 133 135 new G4Material("Uranium" , z=92., a=238.03*g/mole, density= 18.95*g/cm3); 134 135 136 137 G4Material* ams = 138 new G4Material("ams", density= 7.409*g/cm3, ncomponents=3); 139 ams->AddElement(Pb, fractionmass = 94.81*perCent); 140 ams->AddElement(C , fractionmass = 4.79*perCent); 141 ams->AddElement(H , fractionmass = 0.40*perCent); 142 136 143 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 137 144 } -
trunk/examples/extended/electromagnetic/TestEm0/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:35:48 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 2 2006/06/29 16:35:50 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.3 2009/11/14 18:04:20 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4MultipleScattering.hh" 42 41 #include "G4eMultipleScattering.hh" 43 42 #include "G4eIonisation.hh" 44 43 #include "G4eBremsstrahlung.hh" 45 44 #include "G4eplusAnnihilation.hh" 46 45 46 #include "G4MuMultipleScattering.hh" 47 47 #include "G4MuIonisation.hh" 48 48 #include "G4MuBremsstrahlung.hh" 49 49 #include "G4MuPairProduction.hh" 50 50 51 #include "G4hMultipleScattering.hh" 51 52 #include "G4hIonisation.hh" 52 53 #include "G4ionIonisation.hh" … … 83 84 } else if (particleName == "e-") { 84 85 //electron 85 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);86 pmanager->AddProcess(new G4eIonisation, -1, 2,2);87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);86 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 87 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 88 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 88 89 89 90 } else if (particleName == "e+") { 90 91 //positron 91 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);92 pmanager->AddProcess(new G4eIonisation, -1, 2,2);93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);92 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 93 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 94 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 95 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 95 96 96 97 } else if( particleName == "mu+" || 97 98 particleName == "mu-" ) { 98 99 //muon 99 pmanager->AddProcess(new G4Mu ltipleScattering,-1, 1,1);100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);100 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1); 101 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 102 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 103 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 103 104 104 105 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 105 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);106 pmanager->AddProcess(new G4ionIonisation, -1, 2,2);106 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 107 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 107 108 108 109 } else if ((!particle->IsShortLived()) && … … 110 111 (particle->GetParticleName() != "chargedgeantino")) { 111 112 //all others charged particles except geantino 112 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);113 pmanager->AddProcess(new G4hIonisation, -1,2,2);113 pmanager->AddProcess(new G4hMultipleScattering,-1,1,1); 114 pmanager->AddProcess(new G4hIonisation, -1,2,2); 114 115 } 115 116 } -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 5 2006/08/17 13:50:45 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-0 1-patch-02$27 // $Id: PhysicsList.cc,v 1.8 2009/11/17 22:48:26 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 36 36 #include "PhysListEmStandard.hh" 37 #include "G4EmLivermorePhysics.hh" 38 #include "G4EmPenelopePhysics.hh" 37 39 38 40 #include "G4LossTableManager.hh" … … 180 182 // Em options 181 183 // 184 // Main options and setting parameters are shown here. 185 // Several of them have default values. 186 // 182 187 G4EmProcessOptions emOptions; 183 emOptions.SetBuildCSDARange(true); 188 189 //physics tables 190 // 191 emOptions.SetMinEnergy(100*eV); //default 192 emOptions.SetMaxEnergy(100*TeV); //default 193 emOptions.SetDEDXBinning(12*20); //default=12*7 194 emOptions.SetLambdaBinning(12*20); //default=12*7 195 196 emOptions.SetBuildCSDARange(true); 184 197 emOptions.SetMaxEnergyForCSDARange(100*TeV); 185 emOptions.SetDEDXBinningForCSDARange(120); 198 emOptions.SetDEDXBinningForCSDARange(12*20); 199 200 emOptions.SetSplineFlag(true); //default 201 186 202 emOptions.SetVerbose(0); 187 203 } … … 202 218 delete emPhysicsList; 203 219 emPhysicsList = new PhysListEmStandard(name); 220 221 } else if (name == "penelope"){ 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new G4EmPenelopePhysics(); 225 226 } else if (name == "livermore"){ 227 emName = name; 228 delete emPhysicsList; 229 emPhysicsList = new G4EmLivermorePhysics(); 204 230 205 231 } else { … … 218 244 219 245 void PhysicsList::SetCuts() 220 { 246 { 247 // fixe lower limit for cut 248 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV); 249 221 250 // set cut values for gamma at first and for e- second and next for e+, 222 251 // because some processes for e+/e- need cut values for gamma -
trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:35:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm0/src/PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:35:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm0/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 9 2006/12/08 16:38:38maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.10 2007/12/17 17:22:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 59 59 //set precision for printing 60 60 G4int prec = G4cout.precision(6); 61 61 62 //instanciate EmCalculator 63 G4EmCalculator emCal; 64 // emCal.SetVerbose(2); 65 62 66 // get particle 63 67 G4ParticleDefinition* particle = primary->GetParticleGun() … … 77 81 << material->GetName() << " (density: " 78 82 << G4BestUnit(density,"Volumic Mass") << "; radiation length: " 79 << G4BestUnit(radl, "Length") << ")" << G4endl; 83 << G4BestUnit(radl, "Length") << ")" << G4endl; 80 84 81 85 // get cuts … … 90 94 << G4endl; 91 95 } 92 96 97 // max energy transfert 98 if (charge != 0.) { 99 G4double Mass_c2 = particle->GetPDGMass(); 100 G4double moverM = electron_mass_c2/Mass_c2; 101 G4double gamM1 = energy/Mass_c2, gam = gamM1 + 1., gamP1 = gam + 1.; 102 G4double Tmax = 103 (2*electron_mass_c2*gamM1*gamP1)/(1.+2*gam*moverM+moverM*moverM); 104 G4double range = emCal.GetCSDARange(Tmax,G4Electron::Electron(),material); 105 106 G4cout << "\n Max_energy _transferable : " << G4BestUnit(Tmax,"Energy") 107 << " (" << G4BestUnit(range,"Length") << ")" << G4endl; 108 } 109 93 110 // get processList and extract EM processes (but not MultipleScattering) 94 111 G4ProcessVector* plist = particle->GetProcessManager()->GetProcessList(); … … 114 131 G4cout << "\t" << std::setw(13) << emName[j] << "\t"; 115 132 G4cout << "\t" << std::setw(13) <<"total"; 116 117 //instanciate EmCalculator118 G4EmCalculator emCal;119 // emCal.SetVerbose(2);120 133 121 134 //compute cross section per atom (only for single material) -
trunk/examples/extended/electromagnetic/TestEm1/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1.1 3 2006/10/19 17:24:12maire Exp $1 # $Id: GNUmakefile,v 1.14 2008/06/11 22:06:28 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm1/TestEm1.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm1.cc,v 1.15 2007/06/21 17:10:11 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/annihil.mac
r807 r1230 1 # $Id: annihil.mac,v 1. 1 2006/01/25 13:56:40maire Exp $1 # $Id: annihil.mac,v 1.2 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 12 12 /testem/det/setSize 20 cm 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/brems.mac
r807 r1230 1 # $Id: brems.mac,v 1. 3 2006/04/10 10:22:41 vnivanchExp $1 # $Id: brems.mac,v 1.4 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 12 12 /testem/det/setSize 50 cm 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/erange.mac
r807 r1230 1 # $Id: erange.mac,v 1. 1 2007/06/20 15:26:33maire Exp $1 # $Id: erange.mac,v 1.2 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 10 10 /testem/det/setMat Water 11 11 # 12 /testem/phys/addPhysics standard13 ###/testem/phys/addPhysics penelope14 ###/testem/phys/addPhysics livermore12 /testem/phys/addPhysics local 13 ###/testem/phys/addPhysics empenelope 14 ###/testem/phys/addPhysics emlivermore 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/gammaconversion.mac
r807 r1230 1 # $Id: gammaconversion.mac,v 1. 1 2006/01/25 13:56:40maire Exp $1 # $Id: gammaconversion.mac,v 1.2 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 12 12 /testem/det/setSize 1 m 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/include/DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:36:04 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm1/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:36:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/EventAction.hh
r807 r1230 26 26 // 27 27 // $Id: EventAction.hh,v 1.3 2006/06/29 16:36:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm1/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:36:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.6 2007/11/12 15:48:58 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.4 2007/11/12 15:48:58 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.5 2007/11/12 15:48:58 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.4 2006/06/29 16:36:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:36:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:36:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:36:39 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/ProcessesCount.hh
r807 r1230 26 26 // 27 27 // $Id: ProcessesCount.hh,v 1.10 2006/06/29 16:36:41 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.8 2006/06/29 16:36:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.2 2006/06/29 16:36:45 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:36:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:36:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/include/SteppingVerbose.hh
r807 r1230 26 26 // 27 27 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:36:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm1/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:36:53 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/ionis.mac
r807 r1230 1 # $Id: ionis.mac,v 1. 2 2006/01/25 13:56:40maire Exp $1 # $Id: ionis.mac,v 1.3 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 12 12 /testem/det/setSize 50 cm 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/range.mac
r807 r1230 1 # $Id: range.mac,v 1.1 1 2007/06/20 15:26:33maire Exp $1 # $Id: range.mac,v 1.12 2009/09/15 12:51:49 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm1.cc" … … 12 12 /testem/det/setSize 10 cm 13 13 # 14 /testem/phys/addPhysics standard15 ###/testem/phys/addPhysics penelope16 ###/testem/phys/addPhysics livermore14 /testem/phys/addPhysics local 15 ###/testem/phys/addPhysics empenelope 16 ###/testem/phys/addPhysics emlivermore 17 17 # 18 18 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm1/src/DetectorConstruction.cc
r807 r1230 27 27 // 28 28 // $Id: DetectorConstruction.cc,v 1.8 2007/11/12 15:48:58 maire Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // -
trunk/examples/extended/electromagnetic/TestEm1/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:36:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/EventAction.cc
r807 r1230 26 26 // 27 27 // $Id: EventAction.cc,v 1.7 2007/11/12 15:48:58 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm1/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:37:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1.1 0 2007/11/12 15:48:58maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.13 2008/09/12 16:32:25 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem1"; 56 fileType = " hbook";57 fileOption = " --noErrors uncompress";56 fileType = "root"; 57 fileOption = "export=root"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 215 215 void HistoManager::PrintHisto(G4int ih) 216 216 { 217 if (ih < MaxHisto) ascii[ih] = true;217 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 218 218 else 219 219 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 228 228 { 229 229 #ifdef G4ANALYSIS_USE 230 231 if (!ascii[0]) return; 230 232 231 233 G4String name = fileName[0] + ".ascii"; … … 241 243 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 242 244 File << " " << iBin << "\t" 243 << histo[ih]->binMean(iBin) << "\t" 245 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 246 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 244 247 << histo[ih]->binHeight(iBin) 245 248 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm1/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.6 2007/11/12 15:48:58 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 14 2007/06/20 15:26:33maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.21 2009/11/13 15:44:28 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4 MultipleScattering.hh"42 41 #include "G4eMultipleScattering.hh" 42 #include "G4UrbanMscModel93.hh" 43 43 #include "G4eIonisation.hh" 44 44 #include "G4eBremsstrahlung.hh" 45 45 #include "G4eplusAnnihilation.hh" 46 46 47 #include "G4MuMultipleScattering.hh" 47 48 #include "G4MuIonisation.hh" 48 49 #include "G4MuBremsstrahlung.hh" 49 50 #include "G4MuPairProduction.hh" 50 51 52 #include "G4hMultipleScattering.hh" 51 53 #include "G4hIonisation.hh" 54 #include "G4hBremsstrahlung.hh" 55 #include "G4hPairProduction.hh" 56 52 57 #include "G4ionIonisation.hh" 53 58 … … 86 91 } else if (particleName == "e-") { 87 92 //electron 88 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 89 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 90 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 93 G4eMultipleScattering* msc = new G4eMultipleScattering(); 94 msc->AddEmModel(0, new G4UrbanMscModel93()); 95 pmanager->AddProcess(msc, -1, 1, 1); 96 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 97 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 91 98 92 99 } else if (particleName == "e+") { 93 100 //positron 94 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 95 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 96 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 97 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 101 G4eMultipleScattering* msc = new G4eMultipleScattering(); 102 msc->AddEmModel(0, new G4UrbanMscModel93()); 103 pmanager->AddProcess(msc, -1, 1, 1); 104 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 105 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 106 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 98 107 99 108 } else if( particleName == "mu+" || 100 109 particleName == "mu-" ) { 101 110 //muon 102 pmanager->AddProcess(new G4MultipleScattering,-1, 1, 1); 103 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 104 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 105 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 106 107 } else if( particleName == "alpha" || particleName == "He3" 108 || particleName == "GenericIon" ) { 111 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1); 112 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 113 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 114 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 115 116 } else if( particleName == "proton" || 117 particleName == "pi-" || 118 particleName == "pi+" ) { 119 //proton 120 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 121 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 122 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 123 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 124 125 } else if( particleName == "alpha" || 126 particleName == "He3" || 127 particleName == "GenericIon" ) { 109 128 110 pmanager->AddProcess(new G4 MultipleScattering,-1, 1, 1);111 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);129 pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1); 130 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 112 131 113 132 } else if ((!particle->IsShortLived()) && … … 115 134 (particle->GetParticleName() != "chargedgeantino")) { 116 135 //all others charged particles except geantino 117 pmanager->AddProcess(new G4 MultipleScattering,-1, 1, 1);118 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);136 pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1); 137 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 119 138 } 120 139 } 121 140 122 141 // Em options 123 142 // 143 // Main options and setting parameters are shown here. 144 // Several of them have default values. 145 // 124 146 G4EmProcessOptions emOptions; 125 126 // coulomb scattering147 148 //physics tables 127 149 // 128 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); 129 emOptions.SetSkin(2.); 130 150 emOptions.SetMinEnergy(100*eV); //default 151 emOptions.SetMaxEnergy(100*TeV); //default 152 emOptions.SetDEDXBinning(12*20); //default=12*7 153 emOptions.SetLambdaBinning(12*20); //default=12*7 154 emOptions.SetSplineFlag(true); //default 155 156 //multiple coulomb scattering 157 // 158 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 159 emOptions.SetMscRangeFactor(0.04); //default 160 emOptions.SetMscGeomFactor (2.5); //default 161 emOptions.SetSkin(3.); //default 162 131 163 //energy loss 132 164 // 133 emOptions.Set LinearLossLimit(1.e-6);134 emOptions.Set StepFunction(0.2, 100*um);165 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 166 emOptions.SetLinearLossLimit(1.e-2); //default 135 167 136 168 //ionization 137 169 // 138 emOptions.SetSubCutoff(true); 139 140 // define high energy threshold for bremstrahlung 141 // 142 emOptions.SetBremsstrahlungTh(10.*GeV); 170 emOptions.SetSubCutoff(false); //default=false 143 171 } 144 172 -
trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1.1 0 2006/10/19 17:24:13maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.cc,v 1.12 2009/09/15 12:51:49 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 36 36 #include "PhysListEmStandard.hh" 37 #include "PhysListEmLivermore.hh" 38 #include "PhysListEmPenelope.hh" 37 38 #include "G4EmStandardPhysics.hh" 39 #include "G4EmStandardPhysics_option1.hh" 40 #include "G4EmStandardPhysics_option2.hh" 41 #include "G4EmStandardPhysics_option3.hh" 42 #include "G4EmLivermorePhysics.hh" 43 #include "G4EmPenelopePhysics.hh" 39 44 40 45 #include "DetectorConstruction.hh" … … 61 66 62 67 // EM physics 63 emName = G4String(" standard");68 emName = G4String("local"); 64 69 emPhysicsList = new PhysListEmStandard(emName); 65 70 … … 189 194 G4EmProcessOptions emOptions; 190 195 emOptions.SetBuildCSDARange(true); 191 196 emOptions.SetDEDXBinningForCSDARange(8*20); 197 192 198 // Decay Process 193 199 // … … 209 215 if (name == emName) return; 210 216 211 if (name == " standard") {217 if (name == "local") { 212 218 213 219 emName = name; 214 220 delete emPhysicsList; 215 221 emPhysicsList = new PhysListEmStandard(name); 216 217 } else if (name == "livermore") {218 219 emName = name;220 delete emPhysicsList;221 emPhysicsList = new PhysListEmLivermore(name);222 222 223 } else if (name == "penelope") { 224 225 emName = name; 226 delete emPhysicsList; 227 emPhysicsList = new PhysListEmPenelope(name); 228 223 } else if (name == "emstandard_opt0") { 224 225 emName = name; 226 delete emPhysicsList; 227 emPhysicsList = new G4EmStandardPhysics(); 228 229 } else if (name == "emstandard_opt1") { 230 231 emName = name; 232 delete emPhysicsList; 233 emPhysicsList = new G4EmStandardPhysics_option1(); 234 235 } else if (name == "emstandard_opt2") { 236 237 emName = name; 238 delete emPhysicsList; 239 emPhysicsList = new G4EmStandardPhysics_option2(); 240 241 } else if (name == "emstandard_opt3") { 242 243 emName = name; 244 delete emPhysicsList; 245 emPhysicsList = new G4EmStandardPhysics_option3(); 246 247 } else if (name == "emlivermore") { 248 emName = name; 249 delete emPhysicsList; 250 emPhysicsList = new G4EmLivermorePhysics(); 251 252 } else if (name == "empenelope") { 253 emName = name; 254 delete emPhysicsList; 255 emPhysicsList = new G4EmPenelopePhysics(); 256 229 257 } else { 230 258 -
trunk/examples/extended/electromagnetic/TestEm1/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:37:19 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:37:21 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm1/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:37:23 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.19 2006/06/29 16:37:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:37:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:37:29 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.8 2006/06/29 16:37:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/SteppingVerbose.cc
r807 r1230 26 26 // 27 27 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:37:34 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm1/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.10 2006/06/29 16:37:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm10/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 4 2006/10/26 15:19:21maire Exp $1 # $Id: GNUmakefile,v 1.5 2008/06/11 22:34:04 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 15 15 all: lib bin 16 16 17 ifdef G4ANALYSIS_USE 18 CPPFLAGS += -DG4ANALYSIS_USE 19 endif 17 #### G4ANALYSIS_USE := true 20 18 21 19 include $(G4INSTALL)/config/architecture.gmk 22 23 # for the aida-config command see the README file24 ifdef G4ANALYSIS_USE25 CPPFLAGS += `aida-config --include`26 LOADLIBS += `aida-config --lib`27 endif28 20 29 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm10.cc,v 1.9 2007/07/27 17:52:04 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorHit.hh
r807 r1230 26 26 // 27 27 // $Id: Em10CalorHit.hh,v 1.4 2006/06/29 16:37:41 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10CalorimeterSD.hh
r807 r1230 26 26 // 27 27 // $Id: Em10CalorimeterSD.hh,v 1.3 2006/06/29 16:37:43 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: Em10DetectorConstruction.hh,v 1.19 2006/06/29 16:37:46 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10DetectorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em10DetectorMessenger.hh,v 1.7 2006/06/29 16:37:48 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em10EventAction.hh,v 1.3 2006/06/29 16:37:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10EventActionMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em10EventActionMessenger.hh,v 1.3 2006/06/29 16:37:53 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: Em10PhysicsList.hh,v 1.11 2006/06/29 16:37:57 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10PhysicsListMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em10PhysicsListMessenger.hh,v 1.7 2006/06/29 16:37:59 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em10PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:38:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10PrimaryGeneratorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em10PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:38:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em10RunAction.hh,v 1.5 2006/06/29 16:38:06 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10RunMessenger.hh
r807 r1230 27 27 // 28 28 // $Id: Em10RunMessenger.hh,v 1.3 2006/06/29 16:38:09 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10StepCut.hh
r807 r1230 26 26 // 27 27 // $Id: Em10StepCut.hh,v 1.5 2006/06/29 16:38:12 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingAction.hh,v 1.3 2006/06/29 16:38:14 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingMessenger.hh,v 1.3 2006/06/29 16:38:16 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm10/include/Em10SteppingVerbose.hh
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingVerbose.hh,v 1.3 2006/06/29 16:38:19 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.2 2006/06/29 16:38:24 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // -
trunk/examples/extended/electromagnetic/TestEm10/include/TRTDetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: TRTDetectorConstruction.hh,v 1.3 2006/06/29 16:38:27 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/include/TRTMaterials.hh
r807 r1230 26 26 // 27 27 // $Id: TRTMaterials.hh,v 1.3 2006/06/29 16:38:29 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorHit.cc
r807 r1230 26 26 // 27 27 // $Id: Em10CalorHit.cc,v 1.4 2006/06/29 16:38:31 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10CalorimeterSD.cc
r807 r1230 26 26 // 27 27 // $Id: Em10CalorimeterSD.cc,v 1.4 2006/06/29 16:38:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorConstruction.cc
r807 r1230 26 26 // 27 27 // $Id: Em10DetectorConstruction.cc,v 1.32 2007/07/27 17:52:04 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10DetectorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10DetectorMessenger.cc,v 1.11 2006/06/29 16:38:38 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em10EventAction.cc,v 1.6 2006/06/29 16:38:41 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10EventActionMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10EventActionMessenger.cc,v 1.4 2006/06/29 16:38:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsList.cc
r807 r1230 26 26 // 27 27 // $Id: Em10PhysicsList.cc,v 1.24 2006/06/29 16:38:49 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10PhysicsListMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10PhysicsListMessenger.cc,v 1.9 2006/06/29 16:38:52 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em10PrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:38:55 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10PrimaryGeneratorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:38:57 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em10RunAction.cc,v 1.9 2006/06/29 16:38:59 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10RunMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10RunMessenger.cc,v 1.5 2006/06/29 16:39:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10StepCut.cc
r807 r1230 26 26 // 27 27 // $Id: Em10StepCut.cc,v 1.3 2006/06/29 16:39:04 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingAction.cc,v 1.6 2006/06/29 16:39:06 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingMessenger.cc,v 1.4 2006/06/29 16:39:09 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm10/src/Em10SteppingVerbose.cc
r807 r1230 26 26 // 27 27 // $Id: Em10SteppingVerbose.cc,v 1.6 2006/06/29 16:39:12 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... -
trunk/examples/extended/electromagnetic/TestEm10/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:39:16 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 /////////////////////////////////////////////////////////////////////////// -
trunk/examples/extended/electromagnetic/TestEm11/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 5 2006/09/20 09:29:37maire Exp $1 # $Id: GNUmakefile,v 1.10 2008/06/11 22:37:54 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm11/TestEm11.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm11.cc,v 1.3 2006/06/29 16:39:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:39:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:39:22 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:39:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:39:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.5 2007/11/07 17:22:15 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/HistoMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoMessenger.hh,v 1. 4 2007/11/07 17:22:16 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoMessenger.hh,v 1.5 2008/01/11 13:01:57 jjacquem Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 63 63 G4UIcmdWithAString* factoryCmd; 64 64 G4UIcmdWithAString* typeCmd; 65 G4UIcmdWithAString* optionCmd; 65 66 G4UIcommand* histoCmd; 66 67 G4UIcmdWithAnInteger* prhistoCmd; 67 68 G4UIcmdWithAnInteger* rmhistoCmd; 68 69 G4UIcmdWithADoubleAndUnit* csdaCmd; 70 69 71 }; 70 72 -
trunk/examples/extended/electromagnetic/TestEm11/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:39:41 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:39:43 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:39:46 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:39:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.2 2006/06/29 16:39:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.3 2007/08/19 20:52:53 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.3 2006/06/29 16:39:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:40:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:40:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:40:06 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:40:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/range.mac
r807 r1230 1 # $Id: range.mac,v 1. 4 2007/08/19 20:52:53maire Exp $1 # $Id: range.mac,v 1.5 2009/09/22 14:20:31 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm11.cc" … … 13 13 /testem/det/setSizeYZ 5 mm 14 14 # 15 /testem/phys/addPhysics standard16 ###/testem/phys/addPhysics penelope17 ###/testem/phys/addPhysics livermore15 /testem/phys/addPhysics local 16 ###/testem/phys/addPhysics empenelope 17 ###/testem/phys/addPhysics emlivermore 18 18 # 19 19 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm11/run01.mac
r807 r1230 1 # $Id: run01.mac,v 1. 5 2006/07/06 15:56:38maire Exp $1 # $Id: run01.mac,v 1.6 2009/09/22 14:20:31 maire Exp $ 2 2 # 3 3 # limit the step size from histo 1 … … 10 10 /testem/det/setSizeYZ 1 mm 11 11 # 12 /testem/phys/addPhysics standard# em physics13 ###/testem/phys/addPhysics penelope # em physics12 /testem/phys/addPhysics local # em physics 13 ###/testem/phys/addPhysics empenelope # em physics 14 14 # 15 15 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm11/run02.mac
r807 r1230 1 # $Id: run02.mac,v 1. 4 2006/10/26 10:18:59maire Exp $1 # $Id: run02.mac,v 1.5 2009/09/22 14:20:31 maire Exp $ 2 2 # 3 3 # limit the step size by geometry … … 11 11 /testem/det/setNbOfLayers 100 12 12 # 13 /testem/phys/addPhysics standard# em physics14 ###/testem/phys/addPhysics penelope # em physics13 /testem/phys/addPhysics local # em physics 14 ###/testem/phys/addPhysics empenelope # em physics 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm11/sandia.mac
r807 r1230 1 # $Id: sandia.mac,v 1. 1 2007/08/19 20:52:53maire Exp $1 # $Id: sandia.mac,v 1.9 2009/09/22 14:20:31 maire Exp $ 2 2 # 3 3 # limit the step size from histo 8 4 4 # 5 # G.J.Lockwood et al. Sandia report SAND79-0414.UC-34a, February 1987 5 # G.J.Lockwood et al. 6 # Sandia report SAND79-0414.UC-34a, February 1987 6 7 # O.Kadri et al. NIM B 258 (2007) 381 7 8 # … … 10 11 # 11 12 /testem/det/setMat G4_Al 13 ###/testem/det/setMat G4_Mo 12 14 ###/testem/det/setMat G4_Ta 13 15 /testem/det/setSizeX 1 cm 14 16 /testem/det/setSizeYZ 1 cm 15 17 # 16 /testem/phys/addPhysics standard# em physics18 /testem/phys/addPhysics local # em physics 17 19 # 18 20 /run/initialize 19 21 # 20 22 /gun/particle e- 21 /gun/energy 500keV23 /gun/energy 314 keV 22 24 # 23 /testem/histo/setFileType hbook 24 /testem/histo/setFileName Al.500keV 25 ###/testem/histo/setFileType hbook 26 /testem/histo/setFileType root 27 /testem/histo/setFileName sandia/Al.314keV 25 28 /testem/histo/setHisto 8 100 0. 1.0 none #normalized Edep profile 26 ###/testem/histo/setHisto 8 100 0. 0.5 none 29 ###/testem/histo/setHisto 8 100 0. 0.5 none #for Ta 27 30 # 28 31 /testem/event/printModulo 10000 -
trunk/examples/extended/electromagnetic/TestEm11/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1. 8 2007/11/07 17:22:16maire Exp $27 // GEANT4 tag $Name: $26 // $Id: DetectorConstruction.cc,v 1.9 2009/11/16 15:09:10 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 29 29 // … … 91 91 man->FindOrBuildMaterial("G4_Si", isotopes); 92 92 man->FindOrBuildMaterial("G4_Fe", isotopes); 93 man->FindOrBuildMaterial("G4_Cu", isotopes); 93 94 man->FindOrBuildMaterial("G4_Ge", isotopes); 94 95 man->FindOrBuildMaterial("G4_Mo", isotopes); -
trunk/examples/extended/electromagnetic/TestEm11/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:40:12 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:40:15 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:40:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 6 2007/11/07 17:22:16maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.10 2008/09/22 15:11:34 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "dummy"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 223 223 { 224 224 if (ih > MaxHisto) { 225 G4cout << "---> warning from HistoManager:: RemoveHisto() : histo " << ih226 << "does not exist "<< G4endl;225 G4cout << "---> warning from HistoManager::Scale() : histo " << ih 226 << "does not exist (fac = " << fac << ")" << G4endl; 227 227 return; 228 228 } … … 236 236 void HistoManager::PrintHisto(G4int ih) 237 237 { 238 if (ih < MaxHisto) ascii[ih] = true;238 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 239 239 else 240 240 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 249 249 { 250 250 #ifdef G4ANALYSIS_USE 251 252 if (!ascii[0]) return; 251 253 252 254 G4String name = fileName[0] + ".ascii"; … … 262 264 for (G4int iBin=0; iBin<Nbins[ih]; ++iBin) { 263 265 File << " " << iBin << "\t" 264 << histo[ih]->binMean(iBin) << "\t" 266 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 267 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 265 268 << histo[ih]->binHeight(iBin) 266 269 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm11/src/HistoMessenger.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoMessenger.cc,v 1. 5 2007/11/07 17:22:16 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoMessenger.cc,v 1.6 2008/01/11 13:01:57 jjacquem Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 56 56 typeCmd->SetGuidance("set histograms file type: hbook, root, XML"); 57 57 typeCmd->SetCandidates("hbook root XML"); 58 59 optionCmd = new G4UIcmdWithAString("/testem/histo/setFileOption",this); 60 optionCmd->SetGuidance("set option for the histograms file"); 58 61 59 62 histoCmd = new G4UIcommand("/testem/histo/setHisto",this); … … 112 115 delete factoryCmd; 113 116 delete histoDir; 117 delete optionCmd; 114 118 } 115 119 … … 123 127 if (command == typeCmd) 124 128 histoManager->SetFileType(newValues); 129 130 if (command == optionCmd) 131 histoManager->SetFileOption(newValues); 125 132 126 133 if (command == histoCmd) -
trunk/examples/extended/electromagnetic/TestEm11/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmStandard.cc,v 1.3 2006/06/29 16:40:34 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-01-patch-02 $ 26 // $Id: PhysListEmStandard.cc,v 1.11 2009/11/16 15:09:10 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 38 #include "G4PhotoElectricEffect.hh" 40 39 41 #include "G4 MultipleScattering.hh"42 40 #include "G4eMultipleScattering.hh" 41 #include "G4UrbanMscModel93.hh" 43 42 #include "G4eIonisation.hh" 44 43 #include "G4eBremsstrahlung.hh" 45 44 #include "G4eplusAnnihilation.hh" 46 45 46 #include "G4MuMultipleScattering.hh" 47 47 #include "G4MuIonisation.hh" 48 48 #include "G4MuBremsstrahlung.hh" 49 49 #include "G4MuPairProduction.hh" 50 50 51 #include "G4hMultipleScattering.hh" 51 52 #include "G4hIonisation.hh" 53 #include "G4hBremsstrahlung.hh" 54 #include "G4hPairProduction.hh" 55 52 56 #include "G4ionIonisation.hh" 57 #include "G4IonParametrisedLossModel.hh" 58 #include "G4NuclearStopping.hh" 59 60 #include "G4EmProcessOptions.hh" 61 #include "G4MscStepLimitType.hh" 53 62 54 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 68 77 { 69 78 // Add standard EM Processes 70 79 // 80 71 81 theParticleIterator->reset(); 72 82 while( (*theParticleIterator)() ){ … … 76 86 77 87 if (particleName == "gamma") { 78 // gamma 88 // gamma 79 89 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); 80 90 pmanager->AddDiscreteProcess(new G4ComptonScattering); … … 83 93 } else if (particleName == "e-") { 84 94 //electron 85 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 86 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 88 95 G4eMultipleScattering* msc = new G4eMultipleScattering(); 96 msc->AddEmModel(0, new G4UrbanMscModel93()); 97 pmanager->AddProcess(msc, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 100 89 101 } else if (particleName == "e+") { 90 102 //positron 91 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 92 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 103 G4eMultipleScattering* msc = new G4eMultipleScattering(); 104 msc->AddEmModel(0, new G4UrbanMscModel93()); 105 pmanager->AddProcess(msc, -1, 1, 1); 106 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 95 109 96 } else if (particleName == "mu+" ||110 } else if (particleName == "mu+" || 97 111 particleName == "mu-" ) { 98 112 //muon 99 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 113 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 114 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 115 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 116 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 117 118 } else if( particleName == "proton" || 119 particleName == "pi-" || 120 particleName == "pi+" ) { 121 //proton 122 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 123 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 124 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 125 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 103 126 104 } else if( particleName == "GenericIon" ) { 105 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 106 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 107 127 } else if( particleName == "alpha" || 128 particleName == "He3" ) { 129 //alpha 130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 132 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 133 134 } else if( particleName == "GenericIon" ) { 135 //Ions 136 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 137 G4ionIonisation* ionIoni = new G4ionIonisation(); 138 ionIoni->SetEmModel(new G4IonParametrisedLossModel()); 139 pmanager->AddProcess(ionIoni, -1, 2, 2); 140 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 141 108 142 } else if ((!particle->IsShortLived()) && 109 143 (particle->GetPDGCharge() != 0.0) && 110 144 (particle->GetParticleName() != "chargedgeantino")) { 111 145 //all others charged particles except geantino 112 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);113 pmanager->AddProcess(new G4hIonisation, -1,2,2);146 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 147 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 114 148 } 115 149 } 150 151 // Em options 152 // 153 // Main options and setting parameters are shown here. 154 // Several of them have default values. 155 // 156 G4EmProcessOptions emOptions; 157 158 //physics tables 159 // 160 emOptions.SetMinEnergy(100*eV); //default 161 emOptions.SetMaxEnergy(100*TeV); //default 162 emOptions.SetDEDXBinning(12*20); //default=12*7 163 emOptions.SetLambdaBinning(12*20); //default=12*7 164 emOptions.SetSplineFlag(true); //default 165 166 //multiple coulomb scattering 167 // 168 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 169 emOptions.SetMscRangeFactor(0.04); //default 170 emOptions.SetMscGeomFactor (2.5); //default 171 emOptions.SetSkin(3.); //default 172 173 //energy loss 174 // 175 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 176 emOptions.SetLinearLossLimit(1.e-2); //default 177 178 //ionization 179 // 180 emOptions.SetSubCutoff(false); //default 116 181 } 117 182 -
trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 5 2006/10/26 10:18:59maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.7 2009/09/22 14:20:31 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmLivermore.hh" 37 #include "PhysListEmPenelope.hh" 36 37 #include "G4EmStandardPhysics.hh" 38 #include "G4EmStandardPhysics_option1.hh" 39 #include "G4EmStandardPhysics_option2.hh" 40 #include "G4EmStandardPhysics_option3.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 38 43 39 44 #include "G4LossTableManager.hh" … … 57 62 58 63 // EM physics 59 emPhysicsList = new PhysListEmStandard(emName = " standard");64 emPhysicsList = new PhysListEmStandard(emName = "local"); 60 65 61 66 } … … 186 191 G4EmProcessOptions emOptions; 187 192 emOptions.SetBuildCSDARange(true); 188 193 emOptions.SetDEDXBinningForCSDARange(8*20); 194 189 195 // decay process 190 196 // … … 206 212 if (name == emName) return; 207 213 208 if (name == " standard") {214 if (name == "local") { 209 215 210 216 emName = name; 211 217 delete emPhysicsList; 212 218 emPhysicsList = new PhysListEmStandard(name); 219 220 } else if (name == "emstandard_opt0") { 221 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new G4EmStandardPhysics(); 213 225 214 } else if (name == "livermore") { 215 216 emName = name; 217 delete emPhysicsList; 218 emPhysicsList = new PhysListEmLivermore(name); 226 } else if (name == "emstandard_opt1") { 227 228 emName = name; 229 delete emPhysicsList; 230 emPhysicsList = new G4EmStandardPhysics_option1(); 231 232 } else if (name == "emstandard_opt2") { 233 234 emName = name; 235 delete emPhysicsList; 236 emPhysicsList = new G4EmStandardPhysics_option2(); 237 238 } else if (name == "emstandard_opt3") { 239 240 emName = name; 241 delete emPhysicsList; 242 emPhysicsList = new G4EmStandardPhysics_option3(); 243 244 } else if (name == "emlivermore") { 245 emName = name; 246 delete emPhysicsList; 247 emPhysicsList = new G4EmLivermorePhysics(); 219 248 220 } else if (name == "penelope") { 221 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new PhysListEmPenelope(name); 249 } else if (name == "empenelope") { 250 emName = name; 251 delete emPhysicsList; 252 emPhysicsList = new G4EmPenelopePhysics(); 225 253 226 254 } else { -
trunk/examples/extended/electromagnetic/TestEm11/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:40:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:40:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.2 2006/06/29 16:40:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.7 2007/08/19 20:52:53 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.3 2006/06/29 16:40:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:40:53 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.5 2007/08/19 20:52:53 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:41:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:41:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm11/water.mac
r807 r1230 1 # $Id: water.mac,v 1. 4 2006/09/18 17:26:20maire Exp $1 # $Id: water.mac,v 1.5 2009/09/22 14:20:31 maire Exp $ 2 2 # 3 3 # no constraint on tracking step … … 10 10 /testem/det/setSizeYZ 3 cm 11 11 # 12 /testem/phys/addPhysics standard # em physics 13 ###/testem/phys/addPhysics g4v52 # em physics 12 /testem/phys/addPhysics local # em physics 14 13 # 15 14 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm12/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 2 2006/10/25 17:27:01maire Exp $1 # $Id: GNUmakefile,v 1.5 2008/06/11 22:40:49 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm12/TestEm12.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm12.cc,v 1.4 2006/06/29 16:41:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:42:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:42:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:42:06 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:42:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.6 2007/11/09 17:35:06 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/HistoMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoMessenger.hh,v 1. 3 2007/11/09 17:35:06 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoMessenger.hh,v 1.4 2008/01/11 13:11:31 jjacquem Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 63 63 G4UIcmdWithAString* factoryCmd; 64 64 G4UIcmdWithAString* typeCmd; 65 G4UIcmdWithAString* optionCmd; 65 66 G4UIcommand* histoCmd; 66 67 G4UIcmdWithAnInteger* prhistoCmd; -
trunk/examples/extended/electromagnetic/TestEm12/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:42:25 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:42:37 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:42:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:42:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.2 2006/06/29 16:42:44 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.4 2007/04/27 10:38:11 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.3 2006/06/29 16:42:50 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:42:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:42:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:42:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:42:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/run01.mac
r807 r1230 1 # $Id: run01.mac,v 1. 6 2007/04/27 10:38:11maire Exp $1 # $Id: run01.mac,v 1.7 2009/09/22 15:18:20 maire Exp $ 2 2 # 3 3 # limit the step size from histos 1 and 8 … … 9 9 /testem/det/setRadius 3 cm 10 10 # 11 /testem/phys/addPhysics standard# em physics12 ###/testem/phys/addPhysics livermore # em physics13 ###/testem/phys/addPhysics penelope # em physics11 /testem/phys/addPhysics local # em physics 12 ###/testem/phys/addPhysics emlivermore # em physics 13 ###/testem/phys/addPhysics empenelope # em physics 14 14 # 15 15 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm12/run02.mac
r807 r1230 1 # $Id: run02.mac,v 1. 5 2007/04/27 10:38:11maire Exp $1 # $Id: run02.mac,v 1.6 2009/09/22 15:18:20 maire Exp $ 2 2 # 3 3 # limit the step size by geometry … … 10 10 /testem/det/setNbOfLayers 150 11 11 # 12 /testem/phys/addPhysics standard# em physics13 ###/testem/phys/addPhysics livermore # em physics14 ###/testem/phys/addPhysics penelope # em physics12 /testem/phys/addPhysics local # em physics 13 ###/testem/phys/addPhysics emlivermore # em physics 14 ###/testem/phys/addPhysics empenelope # em physics 15 15 # 16 16 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm12/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.2 2006/06/29 16:43:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:43:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:43:05 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:43:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 6 2007/11/09 17:35:06maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.11 2008/09/23 20:48:12 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem12"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 224 224 if (ih > MaxHisto) { 225 225 G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih 226 << "does not exist "<< G4endl;226 << "does not exist (fac = " << fac << ")" << G4endl; 227 227 return; 228 228 } … … 236 236 void HistoManager::PrintHisto(G4int ih) 237 237 { 238 if (ih < MaxHisto) ascii[ih] = true;238 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 239 239 else 240 240 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 249 249 { 250 250 #ifdef G4ANALYSIS_USE 251 251 252 if (!ascii[0] ) return; 253 252 254 G4String name = fileName[0] + ".ascii"; 253 255 std::ofstream File(name, std::ios::out); … … 262 264 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 263 265 File << " " << iBin << "\t" 264 << histo[ih]->binMean(iBin) << "\t" 266 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 267 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 265 268 << histo[ih]->binHeight(iBin) 266 269 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm12/src/HistoMessenger.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoMessenger.cc,v 1. 4 2007/11/09 17:35:06 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoMessenger.cc,v 1.5 2008/01/11 13:11:31 jjacquem Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 56 56 typeCmd->SetGuidance("set histograms file type: hbook, root, XML"); 57 57 typeCmd->SetCandidates("hbook root XML"); 58 59 optionCmd = new G4UIcmdWithAString("/testem/histo/setFileOption",this); 60 optionCmd->SetGuidance("set option for the histograms file"); 61 58 62 59 63 histoCmd = new G4UIcommand("/testem/histo/setHisto",this); … … 112 116 delete factoryCmd; 113 117 delete histoDir; 118 delete optionCmd; 114 119 } 115 120 … … 123 128 if (command == typeCmd) 124 129 histoManager->SetFileType(newValues); 130 131 if (command == optionCmd) 132 histoManager->SetFileOption(newValues); 133 134 125 135 126 136 if (command == histoCmd) -
trunk/examples/extended/electromagnetic/TestEm12/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmStandard.cc,v 1.2 2006/06/29 16:43:25 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmStandard.cc,v 1.8 2009/11/16 16:18:27 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 38 #include "G4PhotoElectricEffect.hh" 40 39 41 #include "G4 MultipleScattering.hh"42 40 #include "G4eMultipleScattering.hh" 41 #include "G4UrbanMscModel93.hh" 43 42 #include "G4eIonisation.hh" 44 43 #include "G4eBremsstrahlung.hh" 45 44 #include "G4eplusAnnihilation.hh" 46 45 46 #include "G4MuMultipleScattering.hh" 47 47 #include "G4MuIonisation.hh" 48 48 #include "G4MuBremsstrahlung.hh" 49 49 #include "G4MuPairProduction.hh" 50 50 51 #include "G4hMultipleScattering.hh" 51 52 #include "G4hIonisation.hh" 53 #include "G4hBremsstrahlung.hh" 54 #include "G4hPairProduction.hh" 55 52 56 #include "G4ionIonisation.hh" 57 #include "G4IonParametrisedLossModel.hh" 58 #include "G4NuclearStopping.hh" 59 60 #include "G4EmProcessOptions.hh" 61 #include "G4MscStepLimitType.hh" 53 62 54 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 68 77 { 69 78 // Add standard EM Processes 79 // 70 80 71 81 theParticleIterator->reset(); … … 76 86 77 87 if (particleName == "gamma") { 78 // gamma 88 // gamma 79 89 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); 80 90 pmanager->AddDiscreteProcess(new G4ComptonScattering); … … 83 93 } else if (particleName == "e-") { 84 94 //electron 85 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 86 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 95 G4eMultipleScattering* msc = new G4eMultipleScattering(); 96 msc->AddEmModel(0, new G4UrbanMscModel93()); 97 pmanager->AddProcess(msc, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 88 100 89 101 } else if (particleName == "e+") { 90 102 //positron 91 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 92 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 95 96 } else if( particleName == "mu+" || 103 G4eMultipleScattering* msc = new G4eMultipleScattering(); 104 msc->AddEmModel(0, new G4UrbanMscModel93()); 105 pmanager->AddProcess(msc, -1, 1, 1); 106 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 109 110 } else if (particleName == "mu+" || 97 111 particleName == "mu-" ) { 98 112 //muon 99 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 113 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 114 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 115 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 116 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 117 118 } else if( particleName == "proton" || 119 particleName == "pi-" || 120 particleName == "pi+" ) { 121 //proton 122 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 123 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 124 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 125 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 103 126 104 } else if( particleName == "GenericIon" ) { 105 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 106 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 107 127 } else if( particleName == "alpha" || 128 particleName == "He3" ) { 129 //alpha 130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 132 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 133 134 } else if( particleName == "GenericIon" ) { 135 //Ions 136 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 137 G4ionIonisation* ionIoni = new G4ionIonisation(); 138 ionIoni->SetEmModel(new G4IonParametrisedLossModel()); 139 pmanager->AddProcess(ionIoni, -1, 2, 2); 140 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 141 108 142 } else if ((!particle->IsShortLived()) && 109 143 (particle->GetPDGCharge() != 0.0) && 110 144 (particle->GetParticleName() != "chargedgeantino")) { 111 145 //all others charged particles except geantino 112 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);113 pmanager->AddProcess(new G4hIonisation, -1,2,2);146 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 147 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 114 148 } 115 149 } 150 151 // Em options 152 // 153 // Main options and setting parameters are shown here. 154 // Several of them have default values. 155 // 156 G4EmProcessOptions emOptions; 157 158 //physics tables 159 // 160 emOptions.SetMinEnergy(100*eV); //default 161 emOptions.SetMaxEnergy(100*TeV); //default 162 emOptions.SetDEDXBinning(12*20); //default=12*7 163 emOptions.SetLambdaBinning(12*20); //default=12*7 164 emOptions.SetSplineFlag(true); //default 165 166 //multiple coulomb scattering 167 // 168 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 169 emOptions.SetMscRangeFactor(0.04); //default 170 emOptions.SetMscGeomFactor (2.5); //default 171 emOptions.SetSkin(3.); //default 172 173 //energy loss 174 // 175 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 176 emOptions.SetLinearLossLimit(1.e-2); //default 177 178 //ionization 179 // 180 emOptions.SetSubCutoff(false); //default 116 181 } 117 182 -
trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 6 2007/08/19 20:57:28maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.8 2009/09/22 15:18:20 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmLivermore.hh" 37 #include "PhysListEmPenelope.hh" 36 37 #include "G4EmStandardPhysics.hh" 38 #include "G4EmStandardPhysics_option1.hh" 39 #include "G4EmStandardPhysics_option2.hh" 40 #include "G4EmStandardPhysics_option3.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 38 43 39 44 #include "G4LossTableManager.hh" … … 57 62 58 63 // EM physics 59 emPhysicsList = new PhysListEmStandard(emName = " standard");64 emPhysicsList = new PhysListEmStandard(emName = "local"); 60 65 61 66 } … … 186 191 G4EmProcessOptions emOptions; 187 192 emOptions.SetBuildCSDARange(true); 188 193 emOptions.SetDEDXBinningForCSDARange(8*20); 194 189 195 // decay process 190 196 // … … 206 212 if (name == emName) return; 207 213 208 if (name == " standard") {214 if (name == "local") { 209 215 210 216 emName = name; … … 212 218 emPhysicsList = new PhysListEmStandard(name); 213 219 214 } else if (name == " livermore") {215 216 emName = name; 217 delete emPhysicsList; 218 emPhysicsList = new PhysListEmLivermore(name);220 } else if (name == "emstandard_opt0") { 221 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new G4EmStandardPhysics(); 219 225 220 } else if (name == "penelope") { 221 222 emName = name; 223 delete emPhysicsList; 224 emPhysicsList = new PhysListEmPenelope(name); 226 } else if (name == "emstandard_opt1") { 227 228 emName = name; 229 delete emPhysicsList; 230 emPhysicsList = new G4EmStandardPhysics_option1(); 231 232 } else if (name == "emstandard_opt2") { 233 234 emName = name; 235 delete emPhysicsList; 236 emPhysicsList = new G4EmStandardPhysics_option2(); 237 238 } else if (name == "emstandard_opt3") { 239 240 emName = name; 241 delete emPhysicsList; 242 emPhysicsList = new G4EmStandardPhysics_option3(); 243 244 } else if (name == "emlivermore") { 245 emName = name; 246 delete emPhysicsList; 247 emPhysicsList = new G4EmLivermorePhysics(); 248 249 } else if (name == "empenelope") { 250 emName = name; 251 delete emPhysicsList; 252 emPhysicsList = new G4EmPenelopePhysics(); 253 225 254 226 255 } else { -
trunk/examples/extended/electromagnetic/TestEm12/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:43:30 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:43:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.2 2006/06/29 16:43:34 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.8 2007/08/19 20:57:29 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.3 2006/06/29 16:43:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:43:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.4 2007/04/27 10:38:11 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:43:46 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm12/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:43:48 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 3 2006/10/24 16:04:29maire Exp $1 # $Id: GNUmakefile,v 1.4 2008/06/11 22:44:24 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 include $(G4INSTALL)/config/architecture.gmk 18 18 19 ifdef G4ANALYSIS_USE20 # for the aida-config command see the README file21 CPPFLAGS += `aida-config --include`22 LOADLIBS += `aida-config --lib`23 endif24 25 19 include $(G4INSTALL)/config/binmake.gmk 26 20 -
trunk/examples/extended/electromagnetic/TestEm13/TestEm13.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm13.cc,v 1.5 2007/06/24 22:26:54 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/gamma.mac
r807 r1230 1 # $Id: gamma.mac,v 1. 4 2007/06/24 22:26:54maire Exp $1 # $Id: gamma.mac,v 1.5 2009/09/25 11:27:13 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm13.cc" … … 12 12 /testem/det/setSize 1 cm 13 13 # 14 /testem/phys/addPhysics standard15 #16 14 /run/initialize 17 15 # -
trunk/examples/extended/electromagnetic/TestEm13/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:43:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:43:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:43:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:44:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmLivermore.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmLivermore.hh,v 1.2 2006/06/29 16:44:04 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmLivermore.hh,v 1.4 2009/11/19 17:30:25 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 41 { 43 42 public: 44 PhysListEmLivermore(const G4String& name = " Livermore");43 PhysListEmLivermore(const G4String& name = "livermore"); 45 44 ~PhysListEmLivermore(); 46 45 -
trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmPenelope.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmPenelope.hh,v 1.2 2006/06/29 16:44:06 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmPenelope.hh,v 1.4 2009/11/19 17:30:25 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 41 { 43 42 public: 44 PhysListEmPenelope(const G4String& name = " Penelope");43 PhysListEmPenelope(const G4String& name = "penelope"); 45 44 ~PhysListEmPenelope(); 46 45 -
trunk/examples/extended/electromagnetic/TestEm13/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:44:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:44:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:44:12 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:44:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/ProcessesCount.hh
r807 r1230 25 25 // 26 26 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:44:16 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.3 2006/06/29 16:44:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:44:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:44:22 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm13/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.5 2006/06/29 16:44:24 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:44:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:44:30 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:44:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmLivermore.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.cc,v 1. 3 2006/06/29 16:44:34 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmLivermore.cc,v 1.5 2009/11/19 17:30:25 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4LowEnergyCompton.hh" 38 #include "G4LowEnergyGammaConversion.hh" 39 #include "G4LowEnergyPhotoElectric.hh" 40 #include "G4LowEnergyRayleigh.hh" 37 // gamma 41 38 42 #include "G4LowEnergyIonisation.hh" 43 #include "G4LowEnergyBremsstrahlung.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4LivermorePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4LivermoreComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4LivermoreGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4LivermoreRayleighModel.hh" 50 51 // e- 52 44 53 #include "G4eIonisation.hh" 54 #include "G4LivermoreIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 45 57 #include "G4eBremsstrahlung.hh" 58 #include "G4LivermoreBremsstrahlungModel.hh" 59 60 // e+ 61 46 62 #include "G4eplusAnnihilation.hh" 63 64 // mu 47 65 48 66 #include "G4MuIonisation.hh" … … 50 68 #include "G4MuPairProduction.hh" 51 69 52 #include "G4hLowEnergyIonisation.hh" 70 // hadrons, ions 71 72 #include "G4hIonisation.hh" 73 #include "G4ionIonisation.hh" 74 53 75 54 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 67 89 void PhysListEmLivermore::ConstructProcess() 68 90 { 69 // Add LowEn orstandard EM Processes91 // Add standard EM Processes 70 92 71 93 theParticleIterator->reset(); … … 74 96 G4ProcessManager* pmanager = particle->GetProcessManager(); 75 97 G4String particleName = particle->GetParticleName(); 76 98 99 //Applicability range for Livermore models 100 //for higher energies, the Standard models are used 101 G4double highEnergyLimit = 1*GeV; 102 77 103 if (particleName == "gamma") { 78 104 // gamma 79 pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric); 80 pmanager->AddDiscreteProcess(new G4LowEnergyCompton); 81 pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion); 82 pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); 105 106 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 107 G4LivermorePhotoElectricModel* 108 photModel = new G4LivermorePhotoElectricModel(); 109 photModel->SetHighEnergyLimit(highEnergyLimit); 110 phot->AddEmModel(0, photModel); 111 pmanager->AddDiscreteProcess(phot); 112 113 G4ComptonScattering* compt = new G4ComptonScattering(); 114 G4LivermoreComptonModel* 115 comptModel = new G4LivermoreComptonModel(); 116 comptModel->SetHighEnergyLimit(highEnergyLimit); 117 compt->AddEmModel(0, comptModel); 118 pmanager->AddDiscreteProcess(compt); 119 120 G4GammaConversion* conv = new G4GammaConversion(); 121 G4LivermoreGammaConversionModel* 122 convModel = new G4LivermoreGammaConversionModel(); 123 convModel->SetHighEnergyLimit(highEnergyLimit); 124 conv->AddEmModel(0, convModel); 125 pmanager->AddDiscreteProcess(conv); 126 127 G4RayleighScattering* rayl = new G4RayleighScattering(); 128 G4LivermoreRayleighModel* 129 raylModel = new G4LivermoreRayleighModel(); 130 raylModel->SetHighEnergyLimit(highEnergyLimit); 131 rayl->AddEmModel(0, raylModel); 132 pmanager->AddDiscreteProcess(rayl); 83 133 84 134 } else if (particleName == "e-") { 85 135 //electron 86 pmanager->AddProcess(new G4LowEnergyIonisation, -1, 1, 1); 87 pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2); 88 136 137 G4eIonisation* eIoni = new G4eIonisation(); 138 G4LivermoreIonisationModel* 139 eIoniModel = new G4LivermoreIonisationModel(); 140 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 141 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 142 pmanager->AddProcess(eIoni, -1, 1, 1); 143 144 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 145 G4LivermoreBremsstrahlungModel* 146 eBremModel = new G4LivermoreBremsstrahlungModel(); 147 eBremModel->SetHighEnergyLimit(highEnergyLimit); 148 eBrem->AddEmModel(0, eBremModel); 149 pmanager->AddProcess(eBrem, -1, 2, 2); 150 89 151 } else if (particleName == "e+") { 90 152 //positron 91 pmanager->AddProcess(new G4eIonisation, -1, 1, 1);92 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);93 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3);153 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 154 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 155 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 94 156 95 157 } else if( particleName == "mu+" || 96 158 particleName == "mu-" ) { 97 159 //muon 98 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);99 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);100 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);160 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 161 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 162 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 101 163 164 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 165 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 166 102 167 } else if ((!particle->IsShortLived()) && 103 168 (particle->GetPDGCharge() != 0.0) && 104 169 (particle->GetParticleName() != "chargedgeantino")) { 105 170 //all others charged particles except geantino 106 pmanager->AddProcess(new G4h LowEnergyIonisation,-1, 1, 1);171 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 107 172 } 108 173 } -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmPenelope.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmPenelope.cc,v 1. 3 2006/06/29 16:44:36 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmPenelope.cc,v 1.6 2009/11/19 17:30:25 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4PenelopeCompton.hh" 38 #include "G4PenelopeGammaConversion.hh" 39 #include "G4PenelopePhotoElectric.hh" 40 #include "G4PenelopeRayleigh.hh" 37 // gamma 41 38 42 #include "G4PenelopeIonisation.hh" 43 #include "G4PenelopeBremsstrahlung.hh" 44 #include "G4PenelopeAnnihilation.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4PenelopePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4PenelopeComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4PenelopeGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4PenelopeRayleighModel.hh" 50 51 // e- 52 53 #include "G4eIonisation.hh" 54 #include "G4PenelopeIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 57 #include "G4eBremsstrahlung.hh" 58 #include "G4PenelopeBremsstrahlungModel.hh" 59 60 // e+ 61 62 #include "G4eplusAnnihilation.hh" 63 #include "G4PenelopeAnnihilationModel.hh" 64 65 // mu 45 66 46 67 #include "G4MuIonisation.hh" … … 48 69 #include "G4MuPairProduction.hh" 49 70 71 // hadrons, ions 72 50 73 #include "G4hIonisation.hh" 51 74 #include "G4ionIonisation.hh" 75 52 76 53 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 66 90 void PhysListEmPenelope::ConstructProcess() 67 91 { 68 // Add Penelope orstandard EM Processes92 // Add standard EM Processes 69 93 70 94 theParticleIterator->reset(); … … 73 97 G4ProcessManager* pmanager = particle->GetProcessManager(); 74 98 G4String particleName = particle->GetParticleName(); 75 99 100 //Applicability range for Penelope models 101 //for higher energies, the Standard models are used 102 G4double highEnergyLimit = 1*GeV; 103 76 104 if (particleName == "gamma") { 77 105 // gamma 78 pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric); 79 pmanager->AddDiscreteProcess(new G4PenelopeCompton); 80 pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion); 81 pmanager->AddDiscreteProcess(new G4PenelopeRayleigh); 106 107 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 108 G4PenelopePhotoElectricModel* 109 photModel = new G4PenelopePhotoElectricModel(); 110 photModel->SetHighEnergyLimit(highEnergyLimit); 111 phot->AddEmModel(0, photModel); 112 pmanager->AddDiscreteProcess(phot); 113 114 G4ComptonScattering* compt = new G4ComptonScattering(); 115 G4PenelopeComptonModel* 116 comptModel = new G4PenelopeComptonModel(); 117 comptModel->SetHighEnergyLimit(highEnergyLimit); 118 compt->AddEmModel(0, comptModel); 119 pmanager->AddDiscreteProcess(compt); 120 121 G4GammaConversion* conv = new G4GammaConversion(); 122 G4PenelopeGammaConversionModel* 123 convModel = new G4PenelopeGammaConversionModel(); 124 convModel->SetHighEnergyLimit(highEnergyLimit); 125 conv->AddEmModel(0, convModel); 126 pmanager->AddDiscreteProcess(conv); 127 128 G4RayleighScattering* rayl = new G4RayleighScattering(); 129 G4PenelopeRayleighModel* 130 raylModel = new G4PenelopeRayleighModel(); 131 raylModel->SetHighEnergyLimit(highEnergyLimit); 132 rayl->AddEmModel(0, raylModel); 133 pmanager->AddDiscreteProcess(rayl); 82 134 83 135 } else if (particleName == "e-") { 84 136 //electron 85 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 86 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 87 137 138 G4eIonisation* eIoni = new G4eIonisation(); 139 G4PenelopeIonisationModel* 140 eIoniModel = new G4PenelopeIonisationModel(); 141 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 142 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 143 pmanager->AddProcess(eIoni, -1, 1, 1); 144 145 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 146 G4PenelopeBremsstrahlungModel* 147 eBremModel = new G4PenelopeBremsstrahlungModel(); 148 eBremModel->SetHighEnergyLimit(highEnergyLimit); 149 eBrem->AddEmModel(0, eBremModel); 150 pmanager->AddProcess(eBrem, -1, 2, 2); 151 88 152 } else if (particleName == "e+") { 89 153 //positron 90 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 91 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 92 pmanager->AddProcess(new G4PenelopeAnnihilation, 0,-1, 3); 154 G4eIonisation* eIoni = new G4eIonisation(); 155 G4PenelopeIonisationModel* 156 eIoniModel = new G4PenelopeIonisationModel(); 157 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 158 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 159 pmanager->AddProcess(eIoni, -1, 1, 1); 93 160 161 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 162 G4PenelopeBremsstrahlungModel* 163 eBremModel = new G4PenelopeBremsstrahlungModel(); 164 eBremModel->SetHighEnergyLimit(highEnergyLimit); 165 eBrem->AddEmModel(0, eBremModel); 166 pmanager->AddProcess(eBrem, -1, 2, 2); 167 168 G4eplusAnnihilation* eAnni = new G4eplusAnnihilation(); 169 G4PenelopeAnnihilationModel* 170 eAnniModel = new G4PenelopeAnnihilationModel(); 171 eAnniModel->SetHighEnergyLimit(highEnergyLimit); 172 eAnni->AddEmModel(0, eAnniModel); 173 pmanager->AddProcess(eAnni, 0,-1, 3); 174 94 175 } else if( particleName == "mu+" || 95 176 particleName == "mu-" ) { 96 177 //muon 97 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);98 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);99 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);178 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 179 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 180 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 100 181 101 182 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 102 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1);103 183 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 184 104 185 } else if ((!particle->IsShortLived()) && 105 186 (particle->GetPDGCharge() != 0.0) && 106 187 (particle->GetParticleName() != "chargedgeantino")) { 107 188 //all others charged particles except geantino 108 pmanager->AddProcess(new G4hIonisation, -1, 1, 1);189 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 109 190 } 110 191 } -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysListEmStandard.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.cc,v 1.3 2006/06/29 16:44:38 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 5 2006/06/29 16:44:40 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.cc,v 1.7 2009/11/19 17:30:25 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 199 199 200 200 if (name == "standard") { 201 202 201 emName = name; 203 202 delete emPhysicsList; 204 203 emPhysicsList = new PhysListEmStandard(name); 205 204 206 205 } else if (name == "livermore") { 207 206 emName = name; … … 213 212 delete emPhysicsList; 214 213 emPhysicsList = new PhysListEmPenelope(name); 215 214 216 215 } else { 217 216 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" -
trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:44:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:44:45 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.6 2006/06/29 16:44:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 6 2007/06/24 22:26:54maire Exp $27 // GEANT4 tag $Name: $26 // $Id: SteppingAction.cc,v 1.7 2009/09/25 11:27:13 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm13/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:44:51 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 3 2006/10/24 16:54:16maire Exp $1 # $Id: GNUmakefile,v 1.4 2008/06/11 22:47:10 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm14/TestEm14.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm14.cc,v 1.4 2007/06/23 22:23:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/compton.mac
r807 r1230 1 # $Id: compton.mac,v 1. 3 2006/09/06 09:56:06maire Exp $1 # $Id: compton.mac,v 1.4 2009/09/25 11:43:33 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm14.cc" … … 12 12 # 13 13 /testem/phys/addPhysics standard 14 ####/testem/phys/addPhysics livermore15 ####/testem/phys/addPhysics penelope16 14 # 17 15 /run/initialize … … 24 22 /gun/energy 300 keV 25 23 # 26 /testem/histo/setFileName compton27 /testem/histo/setFileType hbook24 /testem/histo/setFileName testem14 25 /testem/histo/setFileType root 28 26 /testem/histo/setHisto 1 100 0. 300. keV #energy of primary 29 27 /testem/histo/setHisto 2 200 -1. +1. none #costeta of primary -
trunk/examples/extended/electromagnetic/TestEm14/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:44:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:44:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.3 2006/06/29 16:45:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:45:02 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.4 2007/11/13 12:13:32 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.4 2007/11/13 12:13:32 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmLivermore.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmLivermore.hh,v 1.2 2006/06/29 16:45:10 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmLivermore.hh,v 1.4 2009/11/19 10:36:37 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 41 { 43 42 public: 44 PhysListEmLivermore(const G4String& name = " Livermore");43 PhysListEmLivermore(const G4String& name = "livermore"); 45 44 ~PhysListEmLivermore(); 46 45 -
trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmPenelope.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmPenelope.hh,v 1.2 2006/06/29 16:45:12 gunter Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmPenelope.hh,v 1.4 2009/11/19 10:36:37 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 41 { 43 42 public: 44 PhysListEmPenelope(const G4String& name = " Penelope");43 PhysListEmPenelope(const G4String& name = "penelope"); 45 44 ~PhysListEmPenelope(); 46 45 -
trunk/examples/extended/electromagnetic/TestEm14/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 16:45:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.3 2006/06/29 16:45:16 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:45:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:45:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/ProcessesCount.hh
r807 r1230 25 25 // 26 26 // $Id: ProcessesCount.hh,v 1.3 2006/06/29 16:45:22 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.4 2006/09/06 09:56:06 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.4 2006/09/06 09:56:06 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/SteppingMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingMessenger.hh,v 1.2 2006/06/29 16:45:29 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:45:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm14/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.4 2006/06/29 16:45:33 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:45:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.3 2006/06/29 16:45:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:45:39 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 5 2007/11/13 12:13:32maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.7 2008/09/24 18:53:56 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem14"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 218 218 void HistoManager::PrintHisto(G4int ih) 219 219 { 220 if (ih < MaxHisto) ascii[ih] = true;220 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 221 221 else 222 222 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 231 231 { 232 232 #ifdef G4ANALYSIS_USE 233 234 if (!ascii[0]) return; 233 235 234 236 G4String name = fileName[0] + ".ascii"; -
trunk/examples/extended/electromagnetic/TestEm14/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.4 2007/11/13 12:17:07 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmLivermore.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.cc,v 1. 2 2006/06/29 16:45:47 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmLivermore.cc,v 1.4 2009/11/19 10:36:37 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4LowEnergyCompton.hh" 38 #include "G4LowEnergyGammaConversion.hh" 39 #include "G4LowEnergyPhotoElectric.hh" 40 #include "G4LowEnergyRayleigh.hh" 37 // gamma 41 38 42 #include "G4LowEnergyIonisation.hh" 43 #include "G4LowEnergyBremsstrahlung.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4LivermorePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4LivermoreComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4LivermoreGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4LivermoreRayleighModel.hh" 50 51 // e- 52 44 53 #include "G4eIonisation.hh" 54 #include "G4LivermoreIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 45 57 #include "G4eBremsstrahlung.hh" 58 #include "G4LivermoreBremsstrahlungModel.hh" 59 60 // e+ 61 46 62 #include "G4eplusAnnihilation.hh" 63 64 // mu 47 65 48 66 #include "G4MuIonisation.hh" … … 50 68 #include "G4MuPairProduction.hh" 51 69 52 #include "G4hLowEnergyIonisation.hh" 70 // hadrons, ions 71 72 #include "G4hIonisation.hh" 73 #include "G4ionIonisation.hh" 74 53 75 54 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 67 89 void PhysListEmLivermore::ConstructProcess() 68 90 { 69 // Add LowEn orstandard EM Processes91 // Add standard EM Processes 70 92 71 93 theParticleIterator->reset(); … … 74 96 G4ProcessManager* pmanager = particle->GetProcessManager(); 75 97 G4String particleName = particle->GetParticleName(); 76 98 99 //Applicability range for Livermore models 100 //for higher energies, the Standard models are used 101 G4double highEnergyLimit = 1*GeV; 102 77 103 if (particleName == "gamma") { 78 104 // gamma 79 pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric); 80 pmanager->AddDiscreteProcess(new G4LowEnergyCompton); 81 pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion); 82 pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); 105 106 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 107 G4LivermorePhotoElectricModel* 108 photModel = new G4LivermorePhotoElectricModel(); 109 photModel->SetHighEnergyLimit(highEnergyLimit); 110 phot->AddEmModel(0, photModel); 111 pmanager->AddDiscreteProcess(phot); 112 113 G4ComptonScattering* compt = new G4ComptonScattering(); 114 G4LivermoreComptonModel* 115 comptModel = new G4LivermoreComptonModel(); 116 comptModel->SetHighEnergyLimit(highEnergyLimit); 117 compt->AddEmModel(0, comptModel); 118 pmanager->AddDiscreteProcess(compt); 119 120 G4GammaConversion* conv = new G4GammaConversion(); 121 G4LivermoreGammaConversionModel* 122 convModel = new G4LivermoreGammaConversionModel(); 123 convModel->SetHighEnergyLimit(highEnergyLimit); 124 conv->AddEmModel(0, convModel); 125 pmanager->AddDiscreteProcess(conv); 126 127 G4RayleighScattering* rayl = new G4RayleighScattering(); 128 G4LivermoreRayleighModel* 129 raylModel = new G4LivermoreRayleighModel(); 130 raylModel->SetHighEnergyLimit(highEnergyLimit); 131 rayl->AddEmModel(0, raylModel); 132 pmanager->AddDiscreteProcess(rayl); 83 133 84 134 } else if (particleName == "e-") { 85 135 //electron 86 pmanager->AddProcess(new G4LowEnergyIonisation, -1, 1, 1); 87 pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2); 88 136 137 G4eIonisation* eIoni = new G4eIonisation(); 138 G4LivermoreIonisationModel* 139 eIoniModel = new G4LivermoreIonisationModel(); 140 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 141 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 142 pmanager->AddProcess(eIoni, -1, 1, 1); 143 144 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 145 G4LivermoreBremsstrahlungModel* 146 eBremModel = new G4LivermoreBremsstrahlungModel(); 147 eBremModel->SetHighEnergyLimit(highEnergyLimit); 148 eBrem->AddEmModel(0, eBremModel); 149 pmanager->AddProcess(eBrem, -1, 2, 2); 150 89 151 } else if (particleName == "e+") { 90 152 //positron 91 pmanager->AddProcess(new G4eIonisation, -1, 1, 1);92 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);93 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3);153 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 154 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 155 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 94 156 95 157 } else if( particleName == "mu+" || 96 158 particleName == "mu-" ) { 97 159 //muon 98 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);99 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);100 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);160 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 161 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 162 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 101 163 164 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 165 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 166 102 167 } else if ((!particle->IsShortLived()) && 103 168 (particle->GetPDGCharge() != 0.0) && 104 169 (particle->GetParticleName() != "chargedgeantino")) { 105 170 //all others charged particles except geantino 106 pmanager->AddProcess(new G4h LowEnergyIonisation,-1, 1, 1);171 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 107 172 } 108 173 } -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmPenelope.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmPenelope.cc,v 1. 2 2006/06/29 16:45:49 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmPenelope.cc,v 1.4 2009/11/19 10:36:37 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4PenelopeCompton.hh" 38 #include "G4PenelopeGammaConversion.hh" 39 #include "G4PenelopePhotoElectric.hh" 40 #include "G4PenelopeRayleigh.hh" 37 // gamma 41 38 42 #include "G4PenelopeIonisation.hh" 43 #include "G4PenelopeBremsstrahlung.hh" 44 #include "G4PenelopeAnnihilation.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4PenelopePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4PenelopeComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4PenelopeGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4PenelopeRayleighModel.hh" 50 51 // e- 52 53 #include "G4eIonisation.hh" 54 #include "G4PenelopeIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 57 #include "G4eBremsstrahlung.hh" 58 #include "G4PenelopeBremsstrahlungModel.hh" 59 60 // e+ 61 62 #include "G4eplusAnnihilation.hh" 63 #include "G4PenelopeAnnihilationModel.hh" 64 65 // mu 45 66 46 67 #include "G4MuIonisation.hh" … … 48 69 #include "G4MuPairProduction.hh" 49 70 71 // hadrons, ions 72 50 73 #include "G4hIonisation.hh" 51 74 #include "G4ionIonisation.hh" 75 52 76 53 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 66 90 void PhysListEmPenelope::ConstructProcess() 67 91 { 68 // Add Penelope orstandard EM Processes92 // Add standard EM Processes 69 93 70 94 theParticleIterator->reset(); … … 73 97 G4ProcessManager* pmanager = particle->GetProcessManager(); 74 98 G4String particleName = particle->GetParticleName(); 75 99 100 //Applicability range for Penelope models 101 //for higher energies, the Standard models are used 102 G4double highEnergyLimit = 1*GeV; 103 76 104 if (particleName == "gamma") { 77 105 // gamma 78 pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric); 79 pmanager->AddDiscreteProcess(new G4PenelopeCompton); 80 pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion); 81 pmanager->AddDiscreteProcess(new G4PenelopeRayleigh); 106 107 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 108 G4PenelopePhotoElectricModel* 109 photModel = new G4PenelopePhotoElectricModel(); 110 photModel->SetHighEnergyLimit(highEnergyLimit); 111 phot->AddEmModel(0, photModel); 112 pmanager->AddDiscreteProcess(phot); 113 114 G4ComptonScattering* compt = new G4ComptonScattering(); 115 G4PenelopeComptonModel* 116 comptModel = new G4PenelopeComptonModel(); 117 comptModel->SetHighEnergyLimit(highEnergyLimit); 118 compt->AddEmModel(0, comptModel); 119 pmanager->AddDiscreteProcess(compt); 120 121 G4GammaConversion* conv = new G4GammaConversion(); 122 G4PenelopeGammaConversionModel* 123 convModel = new G4PenelopeGammaConversionModel(); 124 convModel->SetHighEnergyLimit(highEnergyLimit); 125 conv->AddEmModel(0, convModel); 126 pmanager->AddDiscreteProcess(conv); 127 128 G4RayleighScattering* rayl = new G4RayleighScattering(); 129 G4PenelopeRayleighModel* 130 raylModel = new G4PenelopeRayleighModel(); 131 raylModel->SetHighEnergyLimit(highEnergyLimit); 132 rayl->AddEmModel(0, raylModel); 133 pmanager->AddDiscreteProcess(rayl); 82 134 83 135 } else if (particleName == "e-") { 84 136 //electron 85 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 86 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 87 137 138 G4eIonisation* eIoni = new G4eIonisation(); 139 G4PenelopeIonisationModel* 140 eIoniModel = new G4PenelopeIonisationModel(); 141 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 142 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 143 pmanager->AddProcess(eIoni, -1, 1, 1); 144 145 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 146 G4PenelopeBremsstrahlungModel* 147 eBremModel = new G4PenelopeBremsstrahlungModel(); 148 eBremModel->SetHighEnergyLimit(highEnergyLimit); 149 eBrem->AddEmModel(0, eBremModel); 150 pmanager->AddProcess(eBrem, -1, 2, 2); 151 88 152 } else if (particleName == "e+") { 89 153 //positron 90 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 91 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 92 pmanager->AddProcess(new G4PenelopeAnnihilation, 0,-1, 3); 154 G4eIonisation* eIoni = new G4eIonisation(); 155 G4PenelopeIonisationModel* 156 eIoniModel = new G4PenelopeIonisationModel(); 157 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 158 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 159 pmanager->AddProcess(eIoni, -1, 1, 1); 93 160 161 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 162 G4PenelopeBremsstrahlungModel* 163 eBremModel = new G4PenelopeBremsstrahlungModel(); 164 eBremModel->SetHighEnergyLimit(highEnergyLimit); 165 eBrem->AddEmModel(0, eBremModel); 166 pmanager->AddProcess(eBrem, -1, 2, 2); 167 168 G4eplusAnnihilation* eAnni = new G4eplusAnnihilation(); 169 G4PenelopeAnnihilationModel* 170 eAnniModel = new G4PenelopeAnnihilationModel(); 171 eAnniModel->SetHighEnergyLimit(highEnergyLimit); 172 eAnni->AddEmModel(0, eAnniModel); 173 pmanager->AddProcess(eAnni, 0,-1, 3); 174 94 175 } else if( particleName == "mu+" || 95 176 particleName == "mu-" ) { 96 177 //muon 97 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);98 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);99 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);178 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 179 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 180 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 100 181 101 182 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 102 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1);103 183 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 184 104 185 } else if ((!particle->IsShortLived()) && 105 186 (particle->GetPDGCharge() != 0.0) && 106 187 (particle->GetParticleName() != "chargedgeantino")) { 107 188 //all others charged particles except geantino 108 pmanager->AddProcess(new G4hIonisation, -1, 1, 1);189 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 109 190 } 110 191 } -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysListEmStandard.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.cc,v 1.4 2006/10/24 16:54:16 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 4 2006/10/24 16:54:16maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.cc,v 1.6 2009/11/19 10:36:37 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 36 36 #include "PhysListEmStandard.hh" 37 38 37 #include "PhysListEmLivermore.hh" 39 38 #include "PhysListEmPenelope.hh" … … 200 199 201 200 if (name == "standard") { 202 203 201 emName = name; 204 202 delete emPhysicsList; 205 203 emPhysicsList = new PhysListEmStandard(name); 206 204 207 205 } else if (name == "livermore") { 208 206 emName = name; … … 214 212 delete emPhysicsList; 215 213 emPhysicsList = new PhysListEmPenelope(name); 216 214 217 215 } else { 218 216 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" -
trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:45:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:45:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.4 2006/09/06 09:56:06 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.5 2007/06/23 22:23:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingMessenger.cc,v 1.2 2006/06/29 16:46:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:46:05 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 2 2006/10/24 10:28:10maire Exp $1 # $Id: GNUmakefile,v 1.3 2008/06/11 22:50:19 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm15/TestEm15.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm15.cc,v 1.2 2006/06/29 16:46:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:46:10 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:46:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:46:17 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:46:19 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.4 2007/11/13 14:13:31 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.3 2007/11/13 14:13:31 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:46:26 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:46:28 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:46:30 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:46:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/ProcessesCount.hh
r807 r1230 25 25 // 26 26 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:46:34 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.3 2006/06/29 16:46:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.2 2006/06/29 16:46:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:46:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:46:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:46:44 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm15/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.3 2006/06/29 16:46:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:46:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:46:51 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:46:53 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 5 2007/11/13 14:13:31 maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.8 2008/09/26 19:47:51 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem15"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 221 221 void HistoManager::PrintHisto(G4int ih) 222 222 { 223 if (ih < MaxHisto) ascii[ih] = true;223 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 224 224 else 225 225 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 234 234 { 235 235 #ifdef G4ANALYSIS_USE 236 237 if (!ascii[0]) return; 236 238 237 239 G4String name = fileName[0] + ".ascii"; … … 247 249 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 248 250 File << " " << iBin << "\t" 249 << histo[ih]->binMean(iBin) << "\t" 251 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 252 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 250 253 << histo[ih]->binHeight(iBin) 251 254 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm15/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.3 2007/11/13 14:13:31 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 2 2006/06/29 16:47:02 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.4 2009/11/19 17:58:25 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4MultipleScattering.hh" 41 #include "G4eMultipleScattering.hh" 42 #include "G4hMultipleScattering.hh" 43 #include "G4MuMultipleScattering.hh" 42 44 43 45 #include "G4eIonisation.hh" … … 83 85 } else if (particleName == "e-") { 84 86 //electron 85 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);86 pmanager->AddProcess(new G4eIonisation, -1, 2,2);87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);87 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 88 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 88 90 89 91 } else if (particleName == "e+") { 90 92 //positron 91 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);92 pmanager->AddProcess(new G4eIonisation, -1, 2,2);93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);93 pmanager->AddProcess(new G4eMultipleScattering, -1, 1,1); 94 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 95 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 96 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 95 97 96 98 } else if( particleName == "mu+" || 97 99 particleName == "mu-" ) { 98 100 //muon 99 pmanager->AddProcess(new G4Mu ltipleScattering,-1, 1,1);100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);101 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1); 102 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 103 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 104 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 103 105 104 106 } else if( particleName == "GenericIon" ) { 105 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);106 pmanager->AddProcess(new G4ionIonisation, -1, 2,2);107 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 108 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 107 109 108 110 } else if ((!particle->IsShortLived()) && … … 110 112 (particle->GetParticleName() != "chargedgeantino")) { 111 113 //all others charged particles except geantino 112 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);113 pmanager->AddProcess(new G4hIonisation, -1,2,2);114 pmanager->AddProcess(new G4hMultipleScattering,-1,1,1); 115 pmanager->AddProcess(new G4hIonisation, -1,2,2); 114 116 } 115 117 } -
trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.cc,v 1.2 2006/06/29 16:47:04 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:47:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:47:10 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.5 2006/06/29 16:47:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:47:16 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:47:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.6 2007/03/15 15:52:39 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm15/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:47:22 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 5 2007/01/18 10:24:35 vnivanchExp $1 # $Id: GNUmakefile,v 1.6 2008/06/11 22:52:28 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # add -v to see what is going on.27 # for the aida-config command see the README file28 CPPFLAGS += `aida-config --include`29 LOADLIBS += `aida-config --lib`30 endif31 20 32 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm16/TestEm16.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm16.cc,v 1.3 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.4 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.4 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:47:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:47:33 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsList.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsList.hh,v 1.4 2006/06/29 16:47:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.4 2006/06/29 16:47:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:47:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.5 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.3 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:47:46 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm16/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.4 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:47:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:47:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/HistoManager.cc
r807 r1230 52 52 53 53 fileName[0] = "testem16"; 54 fileType = " hbook";55 fileOption = "--noErrors uncompress";54 fileType = "root"; 55 fileOption = "--noErrors export=root uncompress"; 56 56 // histograms 57 57 for (G4int k=0; k<MaxHisto; k++) { -
trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 4 2006/06/29 16:47:56 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.5 2009/11/19 18:12:32 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 42 #include "G4PhotoElectricEffect.hh" 43 43 44 #include "G4MultipleScattering.hh" 45 44 #include "G4eMultipleScattering.hh" 46 45 #include "G4eIonisation.hh" 47 46 #include "G4eBremsstrahlung.hh" 48 47 #include "G4eplusAnnihilation.hh" 49 48 49 #include "G4MuMultipleScattering.hh" 50 50 #include "G4MuIonisation.hh" 51 51 #include "G4MuBremsstrahlung.hh" … … 143 143 } else if (particleName == "e-") { 144 144 //electron 145 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);146 pmanager->AddProcess(new G4eIonisation, -1, 2, 2);147 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);145 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 146 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 147 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 148 148 if (SRType) 149 pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 4);149 pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 4); 150 150 else 151 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 4);152 pmanager->AddProcess(new G4StepLimiter, -1,-1, 5);151 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 4); 152 pmanager->AddProcess(new G4StepLimiter, -1,-1, 5); 153 153 154 154 } else if (particleName == "e+") { 155 155 //positron 156 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);157 pmanager->AddProcess(new G4eIonisation, -1, 2, 2);158 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);159 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);156 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 157 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 158 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 159 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 160 160 if (SRType) 161 pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 5);161 pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 5); 162 162 else 163 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5);164 pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);163 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5); 164 pmanager->AddProcess(new G4StepLimiter, -1,-1, 6); 165 165 166 166 } else if( particleName == "mu+" || 167 167 particleName == "mu-" ) { 168 168 //muon 169 pmanager->AddProcess(new G4Mu ltipleScattering,-1, 1,1);170 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);171 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);172 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);169 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 170 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 171 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 172 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 173 173 174 174 } -
trunk/examples/extended/electromagnetic/TestEm16/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.4 2006/06/29 16:47:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:48:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.8 2007/01/18 10:24:35 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.5 2007/01/18 09:07:20 hbu Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm16/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:48:06 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 2 2006/10/24 10:06:21maire Exp $1 # $Id: GNUmakefile,v 1.3 2008/06/11 22:55:02 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm17/TestEm17.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm17.cc,v 1.2 2006/06/29 16:48:08 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:48:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm17/include/DetectorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorMessenger.hh,v 1.2 2006/06/29 16:48:13 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm17/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:48:15 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.2 2006/06/29 16:48:17 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/HistoManager.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.hh,v 1. 2 2006/06/29 16:48:19 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.hh,v 1.3 2008/03/18 15:30:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 46 46 class HistoMessenger; 47 47 48 const G4int MaxHisto = 5;48 const G4int MaxHisto = 8; 49 49 50 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.2 2006/06/29 16:48:21 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/MuCrossSections.hh
r807 r1230 25 25 // 26 26 // $Id: MuCrossSections.hh,v 1.2 2006/06/29 16:48:23 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/MuNuclearBuilder.hh
r807 r1230 25 25 // 26 26 // $Id: MuNuclearBuilder.hh,v 1.2 2006/06/29 16:48:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.2 2006/06/29 16:48:30 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsList.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:48:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:48:34 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:48:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/ProcessesCount.hh
r807 r1230 25 25 // 26 26 // $Id: ProcessesCount.hh,v 1.2 2006/06/29 16:48:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.2 2006/06/29 16:48:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/StackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: StackingAction.hh,v 1.2 2006/06/29 16:48:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:48:44 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:48:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm17/src/DetectorConstruction.cc
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.cc,v 1.3 2007/05/12 16:33:53 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/DetectorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: DetectorMessenger.cc,v 1.2 2006/06/29 16:48:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm17/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.2 2006/06/29 16:48:53 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.2 2006/06/29 16:48:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 2 2006/06/29 16:48:58 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.4 2008/09/26 20:15:04 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem17"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 164 164 } 165 165 166 const G4String id[] = { "0", "1", "2", "3", "4" };166 const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7"}; 167 167 const G4String title[] = 168 168 { "dummy", //0 … … 170 170 "log10(Etransfert/Emu) Pair", //2 171 171 "log10(Etransfert/Emu) Brems", //3 172 "log10(Etransfert/Emu) Nuclear" //4 172 "log10(Etransfert/Emu) Nuclear", //4 173 "log10(Etransfert/Emu) Ionization", //5 174 "log10(Etransfert/Emu) Pair", //6 175 "log10(Etransfert/Emu) Brems" //7 173 176 }; 174 177 -
trunk/examples/extended/electromagnetic/TestEm17/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.2 2006/06/29 16:49:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/MuCrossSections.cc
r807 r1230 25 25 // 26 26 // $Id: MuCrossSections.cc,v 1.2 2006/06/29 16:49:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/MuNuclearBuilder.cc
r807 r1230 26 26 // 27 27 // $Id: MuNuclearBuilder.cc,v 1.2 2006/06/29 16:49:05 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 2 2006/06/29 16:49:09 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysListEmStandard.cc,v 1.4 2008/05/07 13:57:56 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4MuonPlus.hh" 36 36 #include "G4MuonMinus.hh" 37 #include "G4PionPlus.hh" 38 #include "G4PionMinus.hh" 39 #include "G4Proton.hh" 37 40 38 41 #include "G4ProcessManager.hh" … … 40 43 #include "G4MuBremsstrahlung.hh" 41 44 #include "G4MuPairProduction.hh" 45 #include "G4hIonisation.hh" 46 #include "G4hBremsstrahlung.hh" 47 #include "G4hPairProduction.hh" 42 48 #include "G4LossTableManager.hh" 43 49 … … 57 63 void PhysListEmStandard::ConstructProcess() 58 64 { 59 // Common processes for mu+ and mu- 60 // 61 G4MuIonisation* muioni = new G4MuIonisation(); 62 G4MuBremsstrahlung* mubrem = new G4MuBremsstrahlung(); 63 G4MuPairProduction* mupair = new G4MuPairProduction(); 64 65 // mu+ 65 66 G4ParticleDefinition* particle = G4MuonPlus::MuonPlus(); 66 67 G4ProcessManager* pmanager = particle->GetProcessManager(); 67 // 68 pmanager->AddProcess(muioni, -1, 2,2); 69 pmanager->AddProcess(mubrem, -1,-1,3); 70 pmanager->AddProcess(mupair, -1,-1,4); 68 pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2); 69 pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3); 70 pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4); 71 71 72 // mu- 72 73 particle = G4MuonMinus::MuonMinus(); 73 74 pmanager = particle->GetProcessManager(); 74 // 75 pmanager->AddProcess(muioni, -1, 2,2); 76 pmanager->AddProcess(mubrem, -1,-1,3); 77 pmanager->AddProcess(mupair, -1,-1,4); 78 75 pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2); 76 pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3); 77 pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4); 78 79 // pi+ 80 particle = G4PionPlus::PionPlus(); 81 pmanager = particle->GetProcessManager(); 82 pmanager->AddProcess(new G4hIonisation(), -1, 2, 2); 83 pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3); 84 pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4); 85 86 // pi- 87 particle = G4PionMinus::PionMinus(); 88 pmanager = particle->GetProcessManager(); 89 pmanager->AddProcess(new G4hIonisation(), -1, 2, 2); 90 pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3); 91 pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4); 92 93 // proton 94 particle = G4Proton::Proton(); 95 pmanager = particle->GetProcessManager(); 96 pmanager->AddProcess(new G4hIonisation(), -1, 2, 2); 97 pmanager->AddProcess(new G4hBremsstrahlung(), -1, 3, 3); 98 pmanager->AddProcess(new G4hPairProduction(), -1, 4, 4); 99 79 100 //extend binning of PhysicsTables 80 101 // 81 G4LossTableManager::Instance()->SetMaxEnergy(1000.0*PeV); 82 G4LossTableManager::Instance()->SetDEDXBinning(220); 83 G4LossTableManager::Instance()->SetLambdaBinning(220); 84 G4LossTableManager::Instance()->SetVerbose(0); 102 G4LossTableManager::Instance()->SetMinEnergy(100*eV); 103 G4LossTableManager::Instance()->SetMaxEnergy(1000*PeV); 104 G4LossTableManager::Instance()->SetDEDXBinning(160); 105 G4LossTableManager::Instance()->SetLambdaBinning(160); 106 G4LossTableManager::Instance()->SetSplineFlag(true); 107 G4LossTableManager::Instance()->SetVerbose(1); 85 108 } 86 109 -
trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.cc,v 1.4 2006/10/24 10:06:21 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 16:49:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:49:15 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 2 2006/06/29 16:49:17 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.4 2008/03/31 10:22:59 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 139 139 //compute theoritical predictions 140 140 // 141 totalCrossSection = 0.; 142 for (size_t i=0; i< ProcCounter->size();i++) { 143 G4String procName = (*ProcCounter)[i]->GetName(); 144 if (procName != "Transportation") 145 totalCrossSection += ComputeTheory(procName, NbOfEvents); 146 } 147 148 MeanFreePath = 1./totalCrossSection; 149 massCrossSection = totalCrossSection/density; 150 151 G4cout << " Theory: " 152 << "total CrossSection = " << totalCrossSection*cm << " /cm" 153 << "\t MeanFreePath = " << G4BestUnit(MeanFreePath,"Length") 154 << "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g" 155 << G4endl; 156 141 if(particle == "mu+" || particle == "mu-") { 142 totalCrossSection = 0.; 143 for (size_t i=0; i< ProcCounter->size();i++) { 144 G4String procName = (*ProcCounter)[i]->GetName(); 145 if (procName != "Transportation") 146 totalCrossSection += ComputeTheory(procName, NbOfEvents); 147 } 148 149 MeanFreePath = 1./totalCrossSection; 150 massCrossSection = totalCrossSection/density; 151 152 G4cout << " Theory: " 153 << "total CrossSection = " << totalCrossSection*cm << " /cm" 154 << "\t MeanFreePath = " << G4BestUnit(MeanFreePath,"Length") 155 << "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g" 156 << G4endl; 157 } 157 158 158 159 G4cout.setf(mode,std::ios::floatfield); … … 183 184 184 185 G4int id = 0; G4double cut = 0.; 185 if (process == "muIoni") {id = 1; cut = GetEnergyCut(material,1);}186 if (process == "muPairProd") {id = 2; cut = 2*(GetEnergyCut(material,1)186 if (process == "muIoni") {id = 1; cut = GetEnergyCut(material,1);} 187 else if (process == "muPairProd") {id = 2; cut = 2*(GetEnergyCut(material,1) 187 188 + electron_mass_c2); } 188 if (process == "muBrems") {id = 3; cut = GetEnergyCut(material,0); } 189 if (process == "muNucl") id = 4; 189 else if (process == "muBrems") {id = 3; cut = GetEnergyCut(material,0);} 190 else if (process == "muNucl") id = 4; 191 else if (process == "hIoni") {id = 5; cut = GetEnergyCut(material,1);} 192 else if (process == "hPairProd") {id = 6; cut = 2*(GetEnergyCut(material,1) 193 + electron_mass_c2); } 194 else if (process == "hBrems") {id = 7; cut = GetEnergyCut(material,0);} 190 195 if (id == 0) return 0.; 191 196 -
trunk/examples/extended/electromagnetic/TestEm17/src/StackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: StackingAction.cc,v 1.2 2006/06/29 16:49:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm17/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 2 2006/06/29 16:49:22 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: SteppingAction.cc,v 1.4 2008/03/31 10:22:59 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 70 70 71 71 G4int id = 0; 72 if (procName == "muIoni") id = 1; 73 if (procName == "muPairProd") id = 2; 74 if (procName == "muBrems") id = 3; 75 if (procName == "muNucl") id = 4; 72 if (procName == "muIoni") id = 1; 73 else if (procName == "muPairProd") id = 2; 74 else if (procName == "muBrems") id = 3; 75 else if (procName == "muNucl") id = 4; 76 else if (procName == "hIoni") id = 5; 77 else if (procName == "hPairProd") id = 6; 78 else if (procName == "hBrems") id = 7; 76 79 histoManager->FillHisto(id,lgepsE); 77 80 } -
trunk/examples/extended/electromagnetic/TestEm17/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:49:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 1 2007/02/13 17:57:19maire Exp $1 # $Id: GNUmakefile,v 1.2 2008/06/11 22:57:25 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm18/TestEm18.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm18.cc,v 1.1 2007/02/13 17:57:19 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/electron.mac
r807 r1230 1 # $Id: electron.mac,v 1. 1 2007/02/13 17:57:20maire Exp $1 # $Id: electron.mac,v 1.2 2009/10/12 21:47:57 maire Exp $ 2 2 # 3 3 # macro file for TestEm18.cc … … 8 8 /testem/det/setMat Water 9 9 /testem/det/setSize 1 cm 10 # 11 /testem/phys/addPhysics standard 10 12 # 11 13 /testem/phys/setCuts 100 um -
trunk/examples/extended/electromagnetic/TestEm18/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/EventMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.2 2007/11/13 16:43:59 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.2 2007/11/13 16:43:59 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmLivermore.hh
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 27 // $Id: PhysListEmLivermore.hh,v 1.2 2009/10/12 21:47:57 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 32 29 33 30 #ifndef PhysListEmLivermore_h … … 41 38 class PhysListEmLivermore : public G4VPhysicsConstructor 42 39 { 43 public: 40 public: 44 41 PhysListEmLivermore(const G4String& name = "Livermore"); 42 45 43 virtual ~PhysListEmLivermore(); 46 44 47 public: 48 // This method is dummy for physics 49 void ConstructParticle() {}; 50 51 // This method will be invoked in the Construct() method. 52 // each physics process will be instantiated and 53 // registered to the process manager of each particle type 54 void ConstructProcess(); 45 virtual void ConstructParticle() { }; 46 virtual void ConstructProcess(); 55 47 }; 56 48 … … 64 56 65 57 66 67 -
trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmPenelope.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmPenelope.hh,v 1.1 2007/02/13 17:57:20 maire Exp $27 // GEANT4 tag $Name: $28 26 // 29 // ....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......30 // ....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......27 // $Id: PhysListEmPenelope.hh,v 1.2 2009/10/12 21:47:57 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 31 29 32 30 #ifndef PhysListEmPenelope_h … … 40 38 class PhysListEmPenelope : public G4VPhysicsConstructor 41 39 { 42 public: 43 PhysListEmPenelope(const G4String& name = "penelope"); 40 public: 41 PhysListEmPenelope(const G4String& name = "Penelope"); 42 44 43 virtual ~PhysListEmPenelope(); 45 44 46 public: 47 // This method is dummy for physics 48 void ConstructParticle() {}; 49 50 // This method will be invoked in the Construct() method. 51 // each physics process will be instantiated and 52 // registered to the process manager of each particle type 53 void ConstructProcess(); 45 virtual void ConstructParticle() { }; 46 virtual void ConstructProcess(); 54 47 }; 55 48 … … 63 56 64 57 65 66 -
trunk/examples/extended/electromagnetic/TestEm18/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsList.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.hh,v 1. 1 2007/02/13 17:57:20maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.hh,v 1.3 2009/03/06 18:24:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 57 57 void SetCutForElectron(G4double); 58 58 void SetCutForPositron(G4double); 59 59 60 60 private: 61 61 -
trunk/examples/extended/electromagnetic/TestEm18/include/PhysicsListMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.hh,v 1. 1 2007/02/13 17:57:20maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsListMessenger.hh,v 1.3 2009/03/06 18:24:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 60 60 G4UIcmdWithADoubleAndUnit* gammaCutCmd; 61 61 G4UIcmdWithADoubleAndUnit* electCutCmd; 62 G4UIcmdWithADoubleAndUnit* allCutCmd; 62 G4UIcmdWithADoubleAndUnit* allCutCmd; 63 63 }; 64 64 -
trunk/examples/extended/electromagnetic/TestEm18/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/StackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: StackingAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm18/proton.mac
r807 r1230 1 # $Id: proton.mac,v 1. 1 2007/02/13 17:57:20maire Exp $1 # $Id: proton.mac,v 1.2 2009/02/22 17:48:53 maire Exp $ 2 2 # 3 3 # macro file for TestEm18.cc … … 16 16 /gun/energy 100 MeV 17 17 # 18 /testem/histo/setFileName proton 18 /testem/histo/setFileName proton 19 /testem/histo/setFileType hbook 20 # 19 21 /testem/histo/setHisto 1 100 0 10 MeV #continuous eLoss 20 22 /testem/histo/setHisto 2 100 0 10 MeV #secondary eLoss -
trunk/examples/extended/electromagnetic/TestEm18/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1. 2 2007/02/16 11:59:47 maire Exp $27 // GEANT4 tag $Name: $26 // $Id: DetectorConstruction.cc,v 1.3 2009/03/06 18:24:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 113 113 new G4Material("Tungsten" , z=74., a=183.85*g/mole, density= 19.30*g/cm3); 114 114 new G4Material("Lead" , z=82., a=207.19*g/mole, density= 11.35*g/cm3); 115 115 116 new G4Material("ArgonGas" , z=18., a=39.948*g/mole, density= 1.782*mg/cm3, 117 kStateGas, 273.15*kelvin, 1*atmosphere); 118 116 119 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 117 120 } -
trunk/examples/extended/electromagnetic/TestEm18/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/EventMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1. 2 2007/11/13 16:43:59maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.5 2008/09/26 20:26:01 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem18"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 217 217 void HistoManager::PrintHisto(G4int ih) 218 218 { 219 if (ih < MaxHisto) ascii[ih] = true;219 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 220 220 else 221 221 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 230 230 { 231 231 #ifdef G4ANALYSIS_USE 232 232 233 if (!ascii[0]) return; 234 233 235 G4String name = fileName[0] + ".ascii"; 234 236 std::ofstream File(name, std::ios::out); … … 243 245 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 244 246 File << " " << iBin << "\t" 245 << histo[ih]->binMean(iBin) << "\t" 247 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 248 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 246 249 << histo[ih]->binHeight(iBin) 247 250 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm18/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.2 2007/11/13 16:43:59 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmLivermore.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmLivermore.cc,v 1. 1 2007/02/13 17:57:20maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmLivermore.cc,v 1.3 2009/11/19 18:46:04 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4LowEnergyCompton.hh" 38 #include "G4LowEnergyGammaConversion.hh" 39 #include "G4LowEnergyPhotoElectric.hh" 40 #include "G4LowEnergyRayleigh.hh" 37 // gamma 41 38 42 #include "G4LowEnergyIonisation.hh" 43 #include "G4LowEnergyBremsstrahlung.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4LivermorePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4LivermoreComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4LivermoreGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4LivermoreRayleighModel.hh" 50 51 // e- 52 44 53 #include "G4eIonisation.hh" 54 #include "G4LivermoreIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 45 57 #include "G4eBremsstrahlung.hh" 58 #include "G4LivermoreBremsstrahlungModel.hh" 59 60 // e+ 61 46 62 #include "G4eplusAnnihilation.hh" 63 64 // mu 47 65 48 66 #include "G4MuIonisation.hh" … … 50 68 #include "G4MuPairProduction.hh" 51 69 52 #include "G4hLowEnergyIonisation.hh" 70 // hadrons, ions 71 72 #include "G4hIonisation.hh" 73 #include "G4ionIonisation.hh" 74 53 75 54 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 67 89 void PhysListEmLivermore::ConstructProcess() 68 90 { 69 // Add LowEn orstandard EM Processes91 // Add standard EM Processes 70 92 71 93 theParticleIterator->reset(); … … 74 96 G4ProcessManager* pmanager = particle->GetProcessManager(); 75 97 G4String particleName = particle->GetParticleName(); 76 98 99 //Applicability range for Livermore models 100 //for higher energies, the Standard models are used 101 G4double highEnergyLimit = 1*GeV; 102 77 103 if (particleName == "gamma") { 78 104 // gamma 79 pmanager->AddDiscreteProcess(new G4LowEnergyPhotoElectric); 80 pmanager->AddDiscreteProcess(new G4LowEnergyCompton); 81 pmanager->AddDiscreteProcess(new G4LowEnergyGammaConversion); 82 pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh); 105 106 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 107 G4LivermorePhotoElectricModel* 108 photModel = new G4LivermorePhotoElectricModel(); 109 photModel->SetHighEnergyLimit(highEnergyLimit); 110 phot->AddEmModel(0, photModel); 111 pmanager->AddDiscreteProcess(phot); 112 113 G4ComptonScattering* compt = new G4ComptonScattering(); 114 G4LivermoreComptonModel* 115 comptModel = new G4LivermoreComptonModel(); 116 comptModel->SetHighEnergyLimit(highEnergyLimit); 117 compt->AddEmModel(0, comptModel); 118 pmanager->AddDiscreteProcess(compt); 119 120 G4GammaConversion* conv = new G4GammaConversion(); 121 G4LivermoreGammaConversionModel* 122 convModel = new G4LivermoreGammaConversionModel(); 123 convModel->SetHighEnergyLimit(highEnergyLimit); 124 conv->AddEmModel(0, convModel); 125 pmanager->AddDiscreteProcess(conv); 126 127 G4RayleighScattering* rayl = new G4RayleighScattering(); 128 G4LivermoreRayleighModel* 129 raylModel = new G4LivermoreRayleighModel(); 130 raylModel->SetHighEnergyLimit(highEnergyLimit); 131 rayl->AddEmModel(0, raylModel); 132 pmanager->AddDiscreteProcess(rayl); 83 133 84 134 } else if (particleName == "e-") { 85 135 //electron 86 pmanager->AddProcess(new G4LowEnergyIonisation, -1, 1, 1); 87 pmanager->AddProcess(new G4LowEnergyBremsstrahlung, -1,-1, 2); 88 136 137 G4eIonisation* eIoni = new G4eIonisation(); 138 G4LivermoreIonisationModel* 139 eIoniModel = new G4LivermoreIonisationModel(); 140 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 141 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 142 pmanager->AddProcess(eIoni, -1, 1, 1); 143 144 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 145 G4LivermoreBremsstrahlungModel* 146 eBremModel = new G4LivermoreBremsstrahlungModel(); 147 eBremModel->SetHighEnergyLimit(highEnergyLimit); 148 eBrem->AddEmModel(0, eBremModel); 149 pmanager->AddProcess(eBrem, -1, 2, 2); 150 89 151 } else if (particleName == "e+") { 90 152 //positron 91 pmanager->AddProcess(new G4eIonisation, -1, 1, 1);92 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);93 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3);153 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 154 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 155 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 94 156 95 157 } else if( particleName == "mu+" || 96 158 particleName == "mu-" ) { 97 159 //muon 98 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);99 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);100 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);160 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 161 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 162 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 101 163 164 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 165 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 166 102 167 } else if ((!particle->IsShortLived()) && 103 168 (particle->GetPDGCharge() != 0.0) && 104 169 (particle->GetParticleName() != "chargedgeantino")) { 105 170 //all others charged particles except geantino 106 pmanager->AddProcess(new G4h LowEnergyIonisation,-1, 1, 1);171 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 107 172 } 108 173 } -
trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmPenelope.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmPenelope.cc,v 1. 1 2007/02/13 17:57:20maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmPenelope.cc,v 1.3 2009/11/19 18:46:04 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "G4ProcessManager.hh" 36 36 37 #include "G4PenelopeCompton.hh" 38 #include "G4PenelopeGammaConversion.hh" 39 #include "G4PenelopePhotoElectric.hh" 40 #include "G4PenelopeRayleigh.hh" 37 // gamma 41 38 42 #include "G4PenelopeIonisation.hh" 43 #include "G4PenelopeBremsstrahlung.hh" 44 #include "G4PenelopeAnnihilation.hh" 39 #include "G4PhotoElectricEffect.hh" 40 #include "G4PenelopePhotoElectricModel.hh" 41 42 #include "G4ComptonScattering.hh" 43 #include "G4PenelopeComptonModel.hh" 44 45 #include "G4GammaConversion.hh" 46 #include "G4PenelopeGammaConversionModel.hh" 47 48 #include "G4RayleighScattering.hh" 49 #include "G4PenelopeRayleighModel.hh" 50 51 // e- 52 53 #include "G4eIonisation.hh" 54 #include "G4PenelopeIonisationModel.hh" 55 #include "G4UniversalFluctuation.hh" 56 57 #include "G4eBremsstrahlung.hh" 58 #include "G4PenelopeBremsstrahlungModel.hh" 59 60 // e+ 61 62 #include "G4eplusAnnihilation.hh" 63 #include "G4PenelopeAnnihilationModel.hh" 64 65 // mu 45 66 46 67 #include "G4MuIonisation.hh" … … 48 69 #include "G4MuPairProduction.hh" 49 70 71 // hadrons, ions 72 50 73 #include "G4hIonisation.hh" 51 74 #include "G4ionIonisation.hh" 75 52 76 53 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 66 90 void PhysListEmPenelope::ConstructProcess() 67 91 { 68 // Add Penelope orstandard EM Processes92 // Add standard EM Processes 69 93 70 94 theParticleIterator->reset(); … … 73 97 G4ProcessManager* pmanager = particle->GetProcessManager(); 74 98 G4String particleName = particle->GetParticleName(); 75 99 100 //Applicability range for Penelope models 101 //for higher energies, the Standard models are used 102 G4double highEnergyLimit = 1*GeV; 103 76 104 if (particleName == "gamma") { 77 105 // gamma 78 pmanager->AddDiscreteProcess(new G4PenelopePhotoElectric); 79 pmanager->AddDiscreteProcess(new G4PenelopeCompton); 80 pmanager->AddDiscreteProcess(new G4PenelopeGammaConversion); 81 pmanager->AddDiscreteProcess(new G4PenelopeRayleigh); 106 107 G4PhotoElectricEffect* phot = new G4PhotoElectricEffect(); 108 G4PenelopePhotoElectricModel* 109 photModel = new G4PenelopePhotoElectricModel(); 110 photModel->SetHighEnergyLimit(highEnergyLimit); 111 phot->AddEmModel(0, photModel); 112 pmanager->AddDiscreteProcess(phot); 113 114 G4ComptonScattering* compt = new G4ComptonScattering(); 115 G4PenelopeComptonModel* 116 comptModel = new G4PenelopeComptonModel(); 117 comptModel->SetHighEnergyLimit(highEnergyLimit); 118 compt->AddEmModel(0, comptModel); 119 pmanager->AddDiscreteProcess(compt); 120 121 G4GammaConversion* conv = new G4GammaConversion(); 122 G4PenelopeGammaConversionModel* 123 convModel = new G4PenelopeGammaConversionModel(); 124 convModel->SetHighEnergyLimit(highEnergyLimit); 125 conv->AddEmModel(0, convModel); 126 pmanager->AddDiscreteProcess(conv); 127 128 G4RayleighScattering* rayl = new G4RayleighScattering(); 129 G4PenelopeRayleighModel* 130 raylModel = new G4PenelopeRayleighModel(); 131 raylModel->SetHighEnergyLimit(highEnergyLimit); 132 rayl->AddEmModel(0, raylModel); 133 pmanager->AddDiscreteProcess(rayl); 82 134 83 135 } else if (particleName == "e-") { 84 136 //electron 85 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 86 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 87 137 138 G4eIonisation* eIoni = new G4eIonisation(); 139 G4PenelopeIonisationModel* 140 eIoniModel = new G4PenelopeIonisationModel(); 141 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 142 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 143 pmanager->AddProcess(eIoni, -1, 1, 1); 144 145 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 146 G4PenelopeBremsstrahlungModel* 147 eBremModel = new G4PenelopeBremsstrahlungModel(); 148 eBremModel->SetHighEnergyLimit(highEnergyLimit); 149 eBrem->AddEmModel(0, eBremModel); 150 pmanager->AddProcess(eBrem, -1, 2, 2); 151 88 152 } else if (particleName == "e+") { 89 153 //positron 90 pmanager->AddProcess(new G4PenelopeIonisation, -1, 1, 1); 91 pmanager->AddProcess(new G4PenelopeBremsstrahlung, -1,-1, 2); 92 pmanager->AddProcess(new G4PenelopeAnnihilation, 0,-1, 3); 154 G4eIonisation* eIoni = new G4eIonisation(); 155 G4PenelopeIonisationModel* 156 eIoniModel = new G4PenelopeIonisationModel(); 157 eIoniModel->SetHighEnergyLimit(highEnergyLimit); 158 eIoni->AddEmModel(0, eIoniModel, new G4UniversalFluctuation() ); 159 pmanager->AddProcess(eIoni, -1, 1, 1); 93 160 161 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung(); 162 G4PenelopeBremsstrahlungModel* 163 eBremModel = new G4PenelopeBremsstrahlungModel(); 164 eBremModel->SetHighEnergyLimit(highEnergyLimit); 165 eBrem->AddEmModel(0, eBremModel); 166 pmanager->AddProcess(eBrem, -1, 2, 2); 167 168 G4eplusAnnihilation* eAnni = new G4eplusAnnihilation(); 169 G4PenelopeAnnihilationModel* 170 eAnniModel = new G4PenelopeAnnihilationModel(); 171 eAnniModel->SetHighEnergyLimit(highEnergyLimit); 172 eAnni->AddEmModel(0, eAnniModel); 173 pmanager->AddProcess(eAnni, 0,-1, 3); 174 94 175 } else if( particleName == "mu+" || 95 176 particleName == "mu-" ) { 96 177 //muon 97 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);98 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);99 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);178 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 179 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 180 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 100 181 101 182 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 102 pmanager->AddProcess(new G4ionIonisation, -1, 1,1);103 183 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 184 104 185 } else if ((!particle->IsShortLived()) && 105 186 (particle->GetPDGCharge() != 0.0) && 106 187 (particle->GetParticleName() != "chargedgeantino")) { 107 188 //all others charged particles except geantino 108 pmanager->AddProcess(new G4hIonisation, -1, 1, 1);189 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 109 190 } 110 191 } -
trunk/examples/extended/electromagnetic/TestEm18/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 1 2007/02/13 17:57:20maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandard.cc,v 1.2 2009/11/19 18:46:04 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 81 81 } else if (particleName == "e-") { 82 82 //electron 83 pmanager->AddProcess(new G4eIonisation, -1, 1, 1);84 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);83 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 84 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 85 85 86 86 } else if (particleName == "e+") { 87 87 //positron 88 pmanager->AddProcess(new G4eIonisation, -1, 1, 1);89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2);90 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3);88 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 90 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 91 91 92 92 } else if (particleName == "mu+" || 93 93 particleName == "mu-" ) { 94 94 //muon 95 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1);96 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2);97 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3);95 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 96 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 97 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 98 98 99 99 } else if (particleName == "alpha" || particleName == "GenericIon" ) { 100 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1);100 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 101 101 102 102 } else if ((!particle->IsShortLived()) && … … 104 104 (particle->GetParticleName() != "chargedgeantino")) { 105 105 //all others charged particles except geantino 106 pmanager->AddProcess(new G4hIonisation, -1, 1,1);106 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 107 107 } 108 108 } -
trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 2 2007/11/20 14:15:18maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.5 2009/03/06 18:24:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 cutForGamma = defaultCutValue; 55 55 cutForElectron = defaultCutValue; 56 56 57 57 SetVerboseLevel(1); 58 58 } … … 185 185 //physics tables 186 186 // 187 emOptions.SetMinEnergy(100*eV); 188 emOptions.SetMaxEnergy(100*TeV); 189 emOptions.SetDEDXBinning(1200); 190 emOptions.SetLambdaBinning(1200); 187 emOptions.SetMinEnergy(100*eV); //default 188 emOptions.SetMaxEnergy(100*TeV); //default 189 emOptions.SetDEDXBinning(12*20); //default=12*7 190 emOptions.SetLambdaBinning(12*20); //default=12*7 191 emOptions.SetSplineFlag(true); 191 192 192 193 //energy loss 193 194 // 194 emOptions.SetStepFunction(0.2, 10*um); 195 emOptions.SetLinearLossLimit(1.e- 6);195 emOptions.SetStepFunction(0.2, 10*um); //default=(0.2, 1*mm) 196 emOptions.SetLinearLossLimit(1.e-2); //default 196 197 197 198 //build CSDA range … … 199 200 emOptions.SetBuildCSDARange(true); 200 201 emOptions.SetMaxEnergyForCSDARange(100*TeV); 201 emOptions.SetDEDXBinningForCSDARange(1200); 202 emOptions.SetDEDXBinningForCSDARange(12*20); 203 204 //ionization 205 // 206 emOptions.SetSubCutoff(false); //default 202 207 } 203 208 … … 228 233 void PhysicsList::SetCuts() 229 234 { 230 231 235 if (verboseLevel >0){ 232 236 G4cout << "PhysicsList::SetCuts:"; -
trunk/examples/extended/electromagnetic/TestEm18/src/PhysicsListMessenger.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.cc,v 1. 1 2007/02/13 17:57:20maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsListMessenger.cc,v 1.3 2009/03/06 18:24:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 69 69 allCutCmd->SetUnitCategory("Length"); 70 70 allCutCmd->SetRange("cut>0.0"); 71 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 71 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 72 72 } 73 73 … … 101 101 pPhysicsList->SetCutForGamma(cut); 102 102 pPhysicsList->SetCutForElectron(cut); 103 } 103 } 104 104 } 105 105 -
trunk/examples/extended/electromagnetic/TestEm18/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/RunAction.cc
r807 r1230 25 25 // 26 26 // $Id: RunAction.cc,v 1.2 2007/02/16 11:59:47 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/StackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: StackingAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm18/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.1 2007/02/13 17:57:20 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1.2 1 2006/10/20 16:03:39maire Exp $1 # $Id: GNUmakefile,v 1.23 2008/06/10 09:33:05 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm2/TestEm2.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm2.cc,v 1.14 2007/06/21 17:47:08 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.9 2006/06/29 16:49:29 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.6 2006/06/29 16:49:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/EmAcceptance.hh
r807 r1230 25 25 // 26 26 // $Id: EmAcceptance.hh,v 1.3 2006/06/29 16:49:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.3 2006/06/29 16:49:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:49:41 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.4 2006/06/29 16:49:50 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.8 2006/06/29 16:49:52 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.5 2006/06/29 16:49:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.5 2006/06/29 16:49:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.9 2006/06/29 16:49:59 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/RunActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: RunActionMessenger.hh,v 1.4 2006/06/29 16:50:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.2 2006/06/29 16:50:04 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:50:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:50:09 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:50:11 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm2/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:50:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/run01.mac
r807 r1230 1 # $Id: run01.mac,v 1.2 5 2007/06/21 14:21:46maire Exp $1 # $Id: run01.mac,v 1.27 2009/09/16 18:07:30 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm2.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/det/setMat PbWO411 /testem/det/setMat G4_PbWO4 12 12 /testem/det/setLbin 40 0.5 13 13 /testem/det/setRbin 50 0.1 14 14 # 15 /testem/phys/addPhysics standard15 /testem/phys/addPhysics emstandard_opt0 16 16 # 17 17 /testem/phys/setCuts 1 mm 18 18 # 19 19 # histogram file 20 /testem/histo/setFileName stand20 /testem/histo/setFileName run01 21 21 /testem/histo/setFileType hbook 22 22 # -
trunk/examples/extended/electromagnetic/TestEm2/run02.mac
r807 r1230 1 # $Id: run02.mac,v 1.1 0 2006/10/20 16:03:39maire Exp $1 # $Id: run02.mac,v 1.12 2009/09/16 18:07:30 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm2.cc" … … 12 12 /run/verbose 2 13 13 # 14 /testem/det/setMat Aluminium14 /testem/det/setMat G4_Al 15 15 /testem/det/setLbin 12 1.1245 16 16 /testem/det/setRbin 12 0.11245 17 17 # 18 /testem/phys/addPhysics standard18 /testem/phys/addPhysics emstandard_opt0 19 19 # 20 20 /testem/phys/setCuts 2.0 mm -
trunk/examples/extended/electromagnetic/TestEm2/run03.mac
r807 r1230 1 # $Id: run03.mac,v 1.1 1 2006/10/20 16:03:40 maire Exp $1 # $Id: run03.mac,v 1.13 2009/09/16 18:07:30 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm2.cc" … … 16 16 /testem/det/setRbin 6 0.111 17 17 # 18 /testem/phys/addPhysics standard18 /testem/phys/addPhysics emstandard_opt0 19 19 # 20 20 /testem/phys/setCuts 5.0 mm -
trunk/examples/extended/electromagnetic/TestEm2/run05.mac
r807 r1230 1 # $Id: run05.mac,v 1. 5 2006/10/20 16:03:40 maire Exp $1 # $Id: run05.mac,v 1.7 2009/09/16 18:07:30 maire Exp $ 2 2 # 3 3 # … … 10 10 /run/verbose 2 11 11 # 12 /testem/phys/addPhysics standard12 /testem/phys/addPhysics local 13 13 # 14 14 /testem/phys/setCuts 1 mm … … 20 20 /run/beamOn 10 21 21 # 22 / run/particle/applyCuts22 /process/em/applyCuts true 23 23 /run/beamOn 10 24 24 /run/dumpCouples -
trunk/examples/extended/electromagnetic/TestEm2/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: DetectorConstruction.cc,v 1.1 2 2006/10/20 16:03:40 maire Exp $28 // GEANT4 tag $Name: $27 // $Id: DetectorConstruction.cc,v 1.14 2009/09/16 18:07:30 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 43 43 #include "G4LogicalVolumeStore.hh" 44 44 #include "G4SolidStore.hh" 45 46 #include "G4FieldManager.hh" 47 #include "G4TransportationManager.hh" 48 49 #include "G4NistManager.hh" 50 #include "G4RunManager.hh" 45 51 46 52 #include "G4UnitsTable.hh" … … 56 62 { 57 63 DefineMaterials(); 58 SetMaterial(" PbWO4");64 SetMaterial("G4_PbWO4"); 59 65 detectorMessenger = new DetectorMessenger(this); 60 66 } … … 77 83 { 78 84 // 79 // define few Elements 85 // define few Elements by hand 80 86 // 81 87 G4double a, z; 82 88 83 89 G4Element* H = new G4Element("Hydrogen", "H", z= 1., a= 1.01*g/mole); 84 G4Element* N = new G4Element("Nitrogen", "N", z= 7., a= 14.01*g/mole);85 90 G4Element* O = new G4Element("Oxygen" , "O", z= 8., a= 16.00*g/mole); 86 91 G4Element* Ge = new G4Element("Germanium", "Ge",z=32., a= 72.59*g/mole); 87 G4Element* W = new G4Element("Tungsten", "W", z=74., a= 183.84*g/mole);88 G4Element* Pb = new G4Element("Lead", "Pb",z=82., a= 207.19*g/mole);89 92 G4Element* Bi = new G4Element("Bismuth", "Bi",z=83., a= 208.98*g/mole); 90 93 … … 93 96 // 94 97 G4double density; 95 G4double fractionmass; G4int ncomponents, natoms; 96 97 G4Material* Air = 98 new G4Material("Air", density= 1.29*mg/cm3, ncomponents=2); 99 Air->AddElement(N, fractionmass=0.7); 100 Air->AddElement(O, fractionmass=0.3); 101 98 G4int ncomponents, natoms; 99 100 // water with ionisation potential 75 eV 102 101 G4Material* H2O = 103 102 new G4Material("Water", density= 1.00*g/cm3, ncomponents=2); … … 106 105 H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV); 107 106 107 // pure materails 108 108 new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3); 109 110 109 new G4Material("Aluminium", z=13., a= 26.98*g/mole, density= 2.7*g/cm3); 111 112 new G4Material("Iron", z=26., a= 55.85*g/mole, density= 7.87*g/cm3); 113 114 new G4Material("Copper" , z=29., a= 63.55*g/mole, density= 8.960*g/cm3); 115 116 new G4Material("Lead", z=82., a=207.19*g/mole, density=11.35*g/cm3); 117 110 new G4Material("Iron", z=26., a= 55.85*g/mole, density= 7.87*g/cm3); 111 new G4Material("Copper", z=29., a= 63.55*g/mole, density= 8.960*g/cm3); 112 new G4Material("Tungsten", z=74., a=183.84*g/mole, density=19.35*g/cm3); 113 new G4Material("Lead", z=82., a=207.19*g/mole, density=11.35*g/cm3); 118 114 new G4Material("Uranium" , z=92., a=238.03*g/mole, density= 18.95*g/cm3); 119 115 116 // compound material 120 117 G4Material* BGO = 121 118 new G4Material("BGO", density= 7.10*g/cm3, ncomponents=3); … … 124 121 BGO->AddElement(Bi, natoms= 4); 125 122 126 G4Material* PbWO =127 new G4Material("PbWO4", density= 8.28*g/cm3, ncomponents=3);128 PbWO->AddElement(O , natoms=4);129 PbWO->AddElement(Pb, natoms=1);130 PbWO->AddElement(W , natoms=1);131 132 123 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 133 124 } … … 171 162 { 172 163 // search the material by its name 173 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice); 174 if (pttoMaterial) myMaterial = pttoMaterial; 164 G4Material* pttoMaterial = 165 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 166 167 if (pttoMaterial) { 168 myMaterial = pttoMaterial; 169 if(logicEcal) logicEcal->SetMaterial(myMaterial); 170 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 171 } 175 172 } 176 173 … … 202 199 203 200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 204 205 #include "G4FieldManager.hh"206 #include "G4TransportationManager.hh"207 201 208 202 void DetectorConstruction::SetMagField(G4double fieldValue) … … 226 220 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 227 221 228 #include "G4RunManager.hh"229 230 222 void DetectorConstruction::UpdateGeometry() 231 223 { -
trunk/examples/extended/electromagnetic/TestEm2/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.8 2006/06/29 16:50:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/EmAcceptance.cc
r807 r1230 25 25 // 26 26 // $Id: EmAcceptance.cc,v 1.5 2006/06/29 16:50:22 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.3 2006/06/29 16:50:24 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/EventActionMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:50:26 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm2/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 6 2007/06/21 14:21:46maire Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.13 2009/11/13 16:01:10 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4 MultipleScattering.hh"42 41 #include "G4eMultipleScattering.hh" 42 #include "G4UrbanMscModel93.hh" 43 43 #include "G4eIonisation.hh" 44 44 #include "G4eBremsstrahlung.hh" 45 45 #include "G4eplusAnnihilation.hh" 46 46 47 #include "G4MuMultipleScattering.hh" 47 48 #include "G4MuIonisation.hh" 48 49 #include "G4MuBremsstrahlung.hh" 49 50 #include "G4MuPairProduction.hh" 50 51 52 #include "G4hMultipleScattering.hh" 51 53 #include "G4hIonisation.hh" 54 #include "G4hBremsstrahlung.hh" 55 #include "G4hPairProduction.hh" 56 52 57 #include "G4ionIonisation.hh" 53 58 … … 87 92 } else if (particleName == "e-") { 88 93 //electron 89 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 90 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 91 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 94 G4eMultipleScattering* msc = new G4eMultipleScattering(); 95 msc->AddEmModel(0, new G4UrbanMscModel93()); 96 pmanager->AddProcess(msc, -1, 1, 1); 97 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 98 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 92 99 93 100 } else if (particleName == "e+") { 94 101 //positron 95 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 96 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 97 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 98 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 102 G4eMultipleScattering* msc = new G4eMultipleScattering(); 103 msc->AddEmModel(0, new G4UrbanMscModel93()); 104 pmanager->AddProcess(msc, -1, 1, 1); 105 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 106 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 107 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 99 108 100 109 } else if( particleName == "mu+" || 101 110 particleName == "mu-" ) { 102 111 //muon 103 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 104 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 105 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 106 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 112 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 113 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 114 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 115 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 116 117 } else if( particleName == "proton" || 118 particleName == "pi-" || 119 particleName == "pi+" ) { 120 //proton 121 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 122 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 123 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 124 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 107 125 108 } else if( particleName == "GenericIon" ) { 109 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 110 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 126 } else if( particleName == "alpha" || 127 particleName == "He3" || 128 particleName == "GenericIon" ) { 129 //Ions 130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 111 132 112 133 } else if ((!particle->IsShortLived()) && … … 114 135 (particle->GetParticleName() != "chargedgeantino")) { 115 136 //all others charged particles except geantino 116 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);117 pmanager->AddProcess(new G4hIonisation, -1,2,2);137 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 138 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 118 139 } 119 140 } 120 141 121 142 // Em options 122 143 // 144 // Main options and setting parameters are shown here. 145 // Several of them have default values. 146 // 123 147 G4EmProcessOptions emOptions; 124 125 // coulomb scattering148 149 //physics tables 126 150 // 127 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); 128 emOptions.SetSkin(2.); 129 151 emOptions.SetMinEnergy(100*eV); //default 152 emOptions.SetMaxEnergy(100*TeV); //default 153 emOptions.SetDEDXBinning(12*20); //default=12*7 154 emOptions.SetLambdaBinning(12*20); //default=12*7 155 emOptions.SetSplineFlag(true); //default 156 157 //multiple coulomb scattering 158 // 159 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 160 emOptions.SetMscRangeFactor(0.04); //default 161 emOptions.SetMscGeomFactor (2.5); //default 162 emOptions.SetSkin(3.); //default 163 130 164 //energy loss 131 165 // 132 emOptions.Set LinearLossLimit(1.e-6);133 emOptions.Set StepFunction(0.2, 100*um);166 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 167 emOptions.SetLinearLossLimit(1.e-2); //default 134 168 135 169 //ionization 136 170 // 137 emOptions.SetSubCutoff(true); 138 139 // define high energy threshold for bremstrahlung 140 // 141 emOptions.SetBremsstrahlungTh(10.*GeV); 171 emOptions.SetSubCutoff(false); //default=false 142 172 } 143 173 -
trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1.1 3 2007/06/22 16:35:07 vnivanchExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.16 2009/09/16 18:07:30 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmLivermore.hh"37 #include "PhysListEmPenelope.hh"38 36 39 37 #include "G4EmStandardPhysics.hh" 40 38 #include "G4EmStandardPhysics_option1.hh" 41 39 #include "G4EmStandardPhysics_option2.hh" 40 #include "G4EmStandardPhysics_option3.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 43 44 #include "G4Decay.hh" 45 #include "StepMax.hh" 42 46 43 47 #include "G4LossTableManager.hh" 48 #include "G4ProcessManager.hh" 49 44 50 #include "G4UnitsTable.hh" 45 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......47 48 PhysicsList::PhysicsList() : G4VModularPhysicsList()49 {50 G4LossTableManager::Instance();51 defaultCutValue = 1.*mm;52 cutForGamma = defaultCutValue;53 cutForElectron = defaultCutValue;54 cutForPositron = defaultCutValue;55 56 pMessenger = new PhysicsListMessenger(this);57 58 SetVerboseLevel(1);59 60 // EM physics61 emPhysicsList = new PhysListEmStandard(emName = "standard");62 63 }64 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......66 67 PhysicsList::~PhysicsList()68 {69 delete pMessenger;70 delete emPhysicsList;71 }72 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......74 51 75 52 // Bosons … … 77 54 #include "G4Geantino.hh" 78 55 #include "G4Gamma.hh" 79 #include "G4OpticalPhoton.hh"80 56 81 57 // leptons 58 #include "G4Electron.hh" 59 #include "G4Positron.hh" 82 60 #include "G4MuonPlus.hh" 83 61 #include "G4MuonMinus.hh" … … 119 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 120 98 99 PhysicsList::PhysicsList() : G4VModularPhysicsList() 100 { 101 G4LossTableManager::Instance(); 102 defaultCutValue = 1.*mm; 103 cutForGamma = defaultCutValue; 104 cutForElectron = defaultCutValue; 105 cutForPositron = defaultCutValue; 106 107 pMessenger = new PhysicsListMessenger(this); 108 109 SetVerboseLevel(1); 110 111 // EM physics 112 ///emName = "emstandard_opt0"; 113 ///emPhysicsList = new G4EmStandardPhysics(); 114 emName = "local"; 115 emPhysicsList = new PhysListEmStandard(emName); 116 } 117 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 119 120 PhysicsList::~PhysicsList() 121 { 122 delete pMessenger; 123 delete emPhysicsList; 124 } 125 126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 127 121 128 void PhysicsList::ConstructParticle() 122 129 { 123 // pseudo-particles130 // pseudo-particles 124 131 G4Geantino::GeantinoDefinition(); 125 132 G4ChargedGeantino::ChargedGeantinoDefinition(); 126 133 127 // gamma134 // gamma 128 135 G4Gamma::GammaDefinition(); 129 136 130 // optical photon 131 G4OpticalPhoton::OpticalPhotonDefinition(); 132 133 // leptons 137 // leptons 134 138 G4Electron::ElectronDefinition(); 135 139 G4Positron::PositronDefinition(); … … 142 146 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 143 147 144 // mesons148 // mesons 145 149 G4PionPlus::PionPlusDefinition(); 146 150 G4PionMinus::PionMinusDefinition(); … … 155 159 G4KaonZeroShort::KaonZeroShortDefinition(); 156 160 157 // barions161 // barions 158 162 G4Proton::ProtonDefinition(); 159 163 G4AntiProton::AntiProtonDefinition(); … … 161 165 G4AntiNeutron::AntiNeutronDefinition(); 162 166 163 // ions167 // ions 164 168 G4Deuteron::DeuteronDefinition(); 165 169 G4Triton::TritonDefinition(); … … 170 174 171 175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 172 173 #include "G4ProcessManager.hh"174 176 175 177 void PhysicsList::ConstructProcess() … … 202 204 if (name == emName) return; 203 205 204 if (name == " standard") {206 if (name == "local") { 205 207 206 208 emName = name; … … 208 210 emPhysicsList = new PhysListEmStandard(name); 209 211 210 } else if (name == "emstandard ") {212 } else if (name == "emstandard_opt0") { 211 213 212 214 emName = name; … … 226 228 emPhysicsList = new G4EmStandardPhysics_option2(); 227 229 228 } else if (name == " livermore") {229 230 emName = name; 231 delete emPhysicsList; 232 emPhysicsList = new PhysListEmLivermore(name);230 } else if (name == "emstandard_opt3") { 231 232 emName = name; 233 delete emPhysicsList; 234 emPhysicsList = new G4EmStandardPhysics_option3(); 233 235 234 } else if (name == "penelope") { 235 236 emName = name; 237 delete emPhysicsList; 238 emPhysicsList = new PhysListEmPenelope(name); 239 236 } else if (name == "empenelope"){ 237 emName = name; 238 delete emPhysicsList; 239 emPhysicsList = new G4EmPenelopePhysics(); 240 241 } else if (name == "emlivermore"){ 242 emName = name; 243 delete emPhysicsList; 244 emPhysicsList = new G4EmLivermorePhysics(); 245 240 246 } else { 241 247 … … 247 253 248 254 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 249 250 #include "G4Decay.hh"251 255 252 256 void PhysicsList::AddDecay() … … 275 279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 276 280 277 #include "StepMax.hh"278 279 281 void PhysicsList::AddStepMax() 280 282 { … … 295 297 296 298 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 297 298 #include "G4Gamma.hh"299 #include "G4Electron.hh"300 #include "G4Positron.hh"301 299 302 300 void PhysicsList::SetCuts() -
trunk/examples/extended/electromagnetic/TestEm2/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.5 2006/06/29 16:50:41 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:50:44 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.2 1 2006/06/29 16:50:47 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.24 2009/09/16 18:07:30 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 87 87 88 88 histoName[0] = "testem2"; 89 histoType = " hbook";89 histoType = "root"; 90 90 } 91 91 … … 112 112 G4bool readOnly = false; 113 113 G4bool createNew = true; 114 G4String options = "--noErrors uncompress";114 G4String options = "--noErrors export=root uncompress"; 115 115 AIDA::ITreeFactory* tf = af->createTreeFactory(); 116 116 tree = tf->create(histoName[1], histoType, readOnly, createNew, options); … … 291 291 #ifdef G4ANALYSIS_USE 292 292 if(tree) { 293 G4double bin = i*dLradl;293 G4double bin = (i+0.5)*dLradl; 294 294 histo[3]->fill(bin,MeanELongit[i]/dLradl); 295 295 bin = (i+1)*dLradl; … … 319 319 #ifdef G4ANALYSIS_USE 320 320 if(tree) { 321 G4double bin = i*dRradl;321 G4double bin = (i+0.5)*dRradl; 322 322 histo[6]->fill(bin,MeanERadial[i]/dRradl); 323 323 bin = (i+1)*dRradl; -
trunk/examples/extended/electromagnetic/TestEm2/src/RunActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: RunActionMessenger.cc,v 1.4 2006/06/29 16:50:50 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:50:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 16:50:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.6 2006/06/29 16:50:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:50:59 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm2/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.3 2006/06/29 16:51:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1.2 0 2006/10/31 12:53:48maire Exp $1 # $Id: GNUmakefile,v 1.21 2008/06/11 22:12:32 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm3/TestEm3.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm3.cc,v 1.23 2007/06/22 09:22:05 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/atlashec.mac
r807 r1230 1 # $Id: atlashec.mac,v 1. 7 2007/05/18 19:00:43 vnivanchExp $1 # $Id: atlashec.mac,v 1.8 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 14 14 /testem/det/setSizeYZ 17 cm 15 15 # 16 /testem/phys/addPhysics emstandard 16 /testem/phys/addPhysics emstandard_opt0 17 17 /testem/phys/setCuts 0.7 mm 18 18 # -
trunk/examples/extended/electromagnetic/TestEm3/dedx.mac
r807 r1230 1 # $Id: dedx.mac,v 1. 4 2006/03/20 12:26:03maire Exp $1 # $Id: dedx.mac,v 1.5 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 15 15 /testem/det/setSizeYZ 1 cm 16 16 # 17 /testem/phys/addPhysics standard17 /testem/phys/addPhysics local 18 18 /testem/phys/setCuts 1 km 19 19 # -
trunk/examples/extended/electromagnetic/TestEm3/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.13 2006/06/29 16:51:06 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.8 2006/06/29 16:51:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/EmAcceptance.hh
r807 r1230 25 25 // 26 26 // $Id: EmAcceptance.hh,v 1.4 2006/06/29 16:51:11 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.10 2006/06/29 16:51:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:51:17 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/HistoManager.hh
r807 r1230 25 25 // 26 26 // $Id: HistoManager.hh,v 1.8 2007/11/12 17:04:55 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.5 2007/11/12 17:04:55 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.4 2006/06/29 16:51:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsList.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.hh,v 1. 6 2006/06/29 16:51:58 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.hh,v 1.8 2009/11/13 17:01:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 44 44 class PhysicsList: public G4VModularPhysicsList 45 45 { 46 public:46 public: 47 47 PhysicsList(); 48 ~PhysicsList();48 virtual ~PhysicsList(); 49 49 50 50 void ConstructParticle(); -
trunk/examples/extended/electromagnetic/TestEm3/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:52:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:52:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:52:05 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/RunAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.hh,v 1.1 8 2007/04/22 16:25:21vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: RunAction.hh,v 1.19 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 56 56 57 57 RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*); 58 virtual~RunAction();58 ~RunAction(); 59 59 60 60 void BeginOfRunAction(const G4Run*); … … 64 64 65 65 void sumEnergyFlow(G4int plane, G4double Eflow) 66 {EnergyFlow[plane] += Eflow;};66 {EnergyFlow[plane] += Eflow;}; 67 67 void sumLateralEleak(G4int cell, G4double Eflow) 68 {lateralEleak[cell] += Eflow;};68 {lateralEleak[cell] += Eflow;}; 69 69 70 70 void PrintDedxTables(); -
trunk/examples/extended/electromagnetic/TestEm3/include/RunActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: RunActionMessenger.hh,v 1.10 2007/04/22 16:25:21 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.7 2006/06/29 16:52:11 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:52:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/include/SteppingAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.hh,v 1. 8 2006/06/29 16:52:16 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: SteppingAction.hh,v 1.9 2008/03/14 15:40:03 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 52 52 void UserSteppingAction(const G4Step*); 53 53 54 G4double Birk Attenuation(const G4Step*);54 G4double BirksAttenuation(const G4Step*); 55 55 56 56 private: -
trunk/examples/extended/electromagnetic/TestEm3/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.5 2006/06/29 16:52:18 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm3/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:52:20 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/ionC12.mac
r807 r1230 1 # $Id: ionC12.mac,v 1.1 0 2006/10/31 12:53:48maire Exp $1 # $Id: ionC12.mac,v 1.11 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 12 12 # select EM PhysicsList 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /testem/phys/setCuts 1 mm -
trunk/examples/extended/electromagnetic/TestEm3/lhcb.mac
r807 r1230 1 # $Id: lhcb.mac,v 1. 3 2007/05/18 19:00:44 vnivanchExp $1 # $Id: lhcb.mac,v 1.4 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 14 14 /testem/det/setSizeYZ 20 cm 15 15 # 16 /testem/phys/addPhysics emstandard 16 /testem/phys/addPhysics emstandard_opt0 17 17 # 18 18 /gun/particle e- -
trunk/examples/extended/electromagnetic/TestEm3/linac.mac
r807 r1230 1 # $Id: linac.mac,v 1. 5 2006/11/08 10:27:18maire Exp $1 # $Id: linac.mac,v 1.6 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3" … … 16 16 /testem/det/setSizeYZ 30 cm 17 17 # 18 /testem/phys/addPhysics standard18 /testem/phys/addPhysics local 19 19 /testem/phys/setCuts 10 um 20 20 # -
trunk/examples/extended/electromagnetic/TestEm3/lockwood.mac
r807 r1230 1 # $Id: lockwood.mac,v 1. 5 2006/03/20 12:26:03maire Exp $1 # $Id: lockwood.mac,v 1.6 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 11 11 /run/verbose 2 12 12 # 13 ###/testem/phys/addPhysics g4v52 14 /testem/phys/addPhysics standard 13 /testem/phys/addPhysics local 15 14 # 16 15 /testem/det/setNbOfLayers 1 -
trunk/examples/extended/electromagnetic/TestEm3/retrieveTables.mac
r807 r1230 1 # $Id: retrieveTables.mac,v 1. 4 2007/05/18 19:00:44 vnivanchExp $1 # $Id: retrieveTables.mac,v 1.6 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "exampleN03.cc" … … 10 10 # select EM PhysicsList 11 11 # 12 /testem/phys/addPhysics emstandard 12 /testem/phys/addPhysics emstandard_opt0 13 13 # 14 14 /run/particle/retrievePhysicsTable physdata 15 15 /run/initialize 16 /process/eLoss/verbose 1 17 /process/eLoss/CSDARange true 16 18 # 17 19 /gun/particle e- -
trunk/examples/extended/electromagnetic/TestEm3/run01.mac
r807 r1230 1 # $Id: run01.mac,v 1.1 7 2006/10/31 12:53:48maire Exp $1 # $Id: run01.mac,v 1.19 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "exampleN03.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/phys/addPhysics standard11 /testem/phys/addPhysics local 12 12 # 13 /testem/phys/setCuts 0.1um13 /testem/phys/setCuts 100 um 14 14 # 15 15 /run/initialize -
trunk/examples/extended/electromagnetic/TestEm3/run02.mac
r807 r1230 1 # $Id: run02.mac,v 1.1 5 2006/10/31 12:53:48maire Exp $1 # $Id: run02.mac,v 1.16 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/phys/addPhysics standard11 /testem/phys/addPhysics local 12 12 # 13 13 /testem/det/setNbOfLayers 50 -
trunk/examples/extended/electromagnetic/TestEm3/run07.mac
r807 r1230 1 # $Id: run07.mac,v 1.1 2 2006/10/31 12:53:48maire Exp $1 # $Id: run07.mac,v 1.13 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/phys/addPhysics standard11 /testem/phys/addPhysics local 12 12 # 13 13 /testem/det/setNbOfLayers 2 -
trunk/examples/extended/electromagnetic/TestEm3/run08.mac
r807 r1230 1 # $Id: run08.mac,v 1. 9 2006/10/31 12:53:48maire Exp $1 # $Id: run08.mac,v 1.10 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/phys/addPhysics standard11 /testem/phys/addPhysics local 12 12 # 13 13 /testem/phys/setCuts 1 mm -
trunk/examples/extended/electromagnetic/TestEm3/run15.mac
r807 r1230 1 # $Id: run15.mac,v 1.1 5 2006/10/31 12:53:48maire Exp $1 # $Id: run15.mac,v 1.16 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 9 9 /run/verbose 2 10 10 # 11 /testem/phys/addPhysics standard11 /testem/phys/addPhysics local 12 12 # 13 13 /testem/det/setNbOfLayers 20 -
trunk/examples/extended/electromagnetic/TestEm3/sicapo1.mac
r807 r1230 1 # $Id: sicapo1.mac,v 1. 4 2006/10/31 12:53:48maire Exp $1 # $Id: sicapo1.mac,v 1.5 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 12 12 /run/verbose 2 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /testem/det/setNbOfLayers 15 -
trunk/examples/extended/electromagnetic/TestEm3/sicapo2.mac
r807 r1230 1 # $Id: sicapo2.mac,v 1. 4 2006/10/31 12:53:48maire Exp $1 # $Id: sicapo2.mac,v 1.5 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 12 12 /run/verbose 2 13 13 # 14 /testem/phys/addPhysics standard14 /testem/phys/addPhysics local 15 15 # 16 16 /testem/det/setNbOfLayers 15 -
trunk/examples/extended/electromagnetic/TestEm3/sicapo3.mac
r807 r1230 1 # $Id: sicapo3.mac,v 1. 5 2006/10/31 12:53:48maire Exp $1 # $Id: sicapo3.mac,v 1.6 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm3.cc" … … 11 11 /run/verbose 2 12 12 # 13 /testem/phys/addPhysics standard13 /testem/phys/addPhysics local 14 14 # 15 15 /testem/det/setNbOfLayers 10 -
trunk/examples/extended/electromagnetic/TestEm3/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1.2 0 2007/03/19 20:10:38 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: DetectorConstruction.cc,v 1.23 2009/03/04 18:49:17 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 105 105 G4Element* H = manager->FindOrBuildElement(1); 106 106 G4Element* C = manager->FindOrBuildElement(6); 107 G4Element* N = manager->FindOrBuildElement(7); 107 108 G4Element* O = manager->FindOrBuildElement(8); 108 109 G4Element* Si = manager->FindOrBuildElement(14); … … 164 165 Sci->AddElement(C, natoms=9); 165 166 Sci->AddElement(H, natoms=10); 167 168 Sci->GetIonisation()->SetBirksConstant(0.126*mm/MeV); 166 169 167 170 G4Material* Lct = … … 199 202 BGO->AddElement(Bi, natoms= 4); 200 203 204 //SiNx 205 density= 3.1 *g/cm3; 206 G4Material* SiNx= new G4Material("SiNx", density, ncomponents=3); 207 SiNx-> AddElement(Si, 300); 208 SiNx-> AddElement(N, 310); 209 SiNx-> AddElement(H, 6); 210 201 211 // 202 212 // define gaseous materials using G4 NIST database … … 205 215 206 216 G4Material* Air = manager->FindOrBuildMaterial("G4_AIR"); 207 manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin, 1.*atmosphere);217 manager->ConstructNewGasMaterial("Air20","G4_AIR",293.*kelvin,1.*atmosphere); 208 218 209 219 G4Material* lAr = manager->FindOrBuildMaterial("G4_lAr"); … … 242 252 kStateGas, temperature= 273*kelvin, pressure= 1*atmosphere); 243 253 steam->AddMaterial(H2O, fractionmass=1.); 244 254 255 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 256 kStateGas, 273.15*kelvin, 1*atmosphere); 245 257 // 246 258 // examples of vacuum -
trunk/examples/extended/electromagnetic/TestEm3/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.11 2006/06/29 16:52:26 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/EmAcceptance.cc
r807 r1230 25 25 // 26 26 // $Id: EmAcceptance.cc,v 1.6 2006/06/29 16:52:28 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/EventAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1.1 5 2007/04/22 16:25:21vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: EventAction.cc,v 1.16 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 71 71 //initialize EnergyDeposit per event 72 72 // 73 for (G4int k=0; k<MaxAbsor; k++) 73 for (G4int k=0; k<MaxAbsor; k++) { 74 74 energyDeposit[k] = trackLengthCh[k] = 0.0; 75 } 75 76 } 76 77 -
trunk/examples/extended/electromagnetic/TestEm3/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:52:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1.1 4 2007/11/12 17:04:55maire Exp $27 // GEANT4 tag $Name: $26 // $Id: HistoManager.cc,v 1.17 2009/03/04 18:49:17 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem3"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 241 241 void HistoManager::PrintHisto(G4int ih) 242 242 { 243 if (ih < MaxHisto) ascii[ih] = true;243 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 244 244 else 245 245 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 254 254 { 255 255 #ifdef G4ANALYSIS_USE 256 256 257 if (!ascii[0]) return; 258 257 259 G4String name = fileName[0] + ".ascii"; 258 260 std::ofstream File(name, std::ios::out); … … 267 269 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 268 270 File << " " << iBin << "\t" 269 << histo[ih]->binMean(iBin) << "\t" 271 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 272 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 270 273 << histo[ih]->binHeight(iBin) 271 274 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm3/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.9 2007/11/12 17:04:55 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 14 2007/06/22 09:22:05maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandard.cc,v 1.23 2009/11/13 17:01:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 38 38 #include "G4PhotoElectricEffect.hh" 39 39 40 #include "G4 MultipleScattering.hh"41 40 #include "G4eMultipleScattering.hh" 41 #include "G4UrbanMscModel93.hh" 42 42 #include "G4eIonisation.hh" 43 43 #include "G4eBremsstrahlung.hh" 44 44 #include "G4eplusAnnihilation.hh" 45 45 46 #include "G4MuMultipleScattering.hh" 46 47 #include "G4MuIonisation.hh" 47 48 #include "G4MuBremsstrahlung.hh" 48 49 #include "G4MuPairProduction.hh" 49 50 51 #include "G4hMultipleScattering.hh" 50 52 #include "G4hIonisation.hh" 53 #include "G4hBremsstrahlung.hh" 54 #include "G4hPairProduction.hh" 55 51 56 #include "G4ionIonisation.hh" 52 57 … … 85 90 } else if (particleName == "e-") { 86 91 //electron 87 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 88 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 89 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 92 G4eMultipleScattering* msc = new G4eMultipleScattering(); 93 msc->AddEmModel(0, new G4UrbanMscModel93()); 94 pmanager->AddProcess(msc, -1, 1, 1); 95 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 96 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 90 97 91 98 } else if (particleName == "e+") { 92 99 //positron 93 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 94 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 95 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 96 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 100 G4eMultipleScattering* msc = new G4eMultipleScattering(); 101 msc->AddEmModel(0, new G4UrbanMscModel93()); 102 pmanager->AddProcess(msc, -1, 1, 1); 103 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 104 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3); 105 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 97 106 98 } else if( particleName == "mu +" ||99 particleName == "mu -" ) {107 } else if( particleName == "mu-" || 108 particleName == "mu+" ) { 100 109 //muon 101 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 102 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 103 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 104 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 110 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 111 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 112 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 113 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 114 115 } else if( particleName == "proton" || 116 particleName == "pi-" || 117 particleName == "pi+" ) { 118 //proton 119 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 120 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 121 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 122 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 105 123 106 124 } else if( particleName == "alpha" || 107 125 particleName == "He3" || 108 particleName == "GenericIon" ) { 109 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); 110 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 126 particleName == "GenericIon" ) { 127 //Ions 128 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 129 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 111 130 112 131 } else if ((!particle->IsShortLived()) && … … 114 133 (particle->GetParticleName() != "chargedgeantino")) { 115 134 //all others charged particles except geantino 116 pmanager->AddProcess(new G4 MultipleScattering, -1, 1, 1);117 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);135 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 136 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 118 137 } 119 138 } … … 121 140 // Em options 122 141 // 142 // Main options and setting parameters are shown here. 143 // Several of them have default values. 144 // 123 145 G4EmProcessOptions emOptions; 124 125 // coulomb scattering146 147 //physics tables 126 148 // 127 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); 128 emOptions.SetSkin(2.); 129 149 emOptions.SetMinEnergy(100*eV); //default 150 emOptions.SetMaxEnergy(100*TeV); //default 151 emOptions.SetDEDXBinning(12*20); //default=12*7 152 emOptions.SetLambdaBinning(12*20); //default=12*7 153 emOptions.SetSplineFlag(true); //default 154 155 //multiple coulomb scattering 156 // 157 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 158 emOptions.SetMscRangeFactor(0.04); //default 159 emOptions.SetMscGeomFactor (2.5); //default 160 emOptions.SetSkin(3.); //default 161 130 162 //energy loss 131 163 // 132 emOptions.Set LinearLossLimit(1.e-6);133 emOptions.Set StepFunction(0.2, 100*um);164 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 165 emOptions.SetLinearLossLimit(1.e-2); //default 134 166 135 167 //ionization 136 168 // 137 emOptions.SetSubCutoff( true);169 emOptions.SetSubCutoff(false); //default=false 138 170 } 139 171 -
trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 20 2007/11/13 14:37:05 vnivanchExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.30 2009/11/13 17:01:44 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmStandardIG.hh"37 #include "PhysListEmLivermore.hh"38 #include "PhysListEmPenelope.hh"39 36 40 37 #include "G4EmStandardPhysics.hh" 41 38 #include "G4EmStandardPhysics_option1.hh" 42 39 #include "G4EmStandardPhysics_option2.hh" 43 44 #include "G4LossTableManager.hh" 40 #include "G4EmStandardPhysics_option3.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 43 45 44 #include "G4UnitsTable.hh" 45 #include "G4UrbanMscModel.hh" 46 46 47 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 49 49 PhysicsList::PhysicsList() : G4VModularPhysicsList() 50 50 { 51 G4LossTableManager::Instance();52 51 currentDefaultCut = 1.0*mm; 53 52 cutForGamma = currentDefaultCut; … … 60 59 61 60 // EM physics 62 emName = G4String(" standard");61 emName = G4String("local"); 63 62 emPhysicsList = new PhysListEmStandard(emName); 64 63 … … 214 213 if (name == emName) return; 215 214 216 if (name == " standard") {215 if (name == "local") { 217 216 218 217 emName = name; … … 220 219 emPhysicsList = new PhysListEmStandard(name); 221 220 222 } else if (name == "emstandard ") {221 } else if (name == "emstandard_opt0") { 223 222 224 223 emName = name; … … 237 236 delete emPhysicsList; 238 237 emPhysicsList = new G4EmStandardPhysics_option2(); 239 240 } else if (name == " standardIG") {241 242 emName = name; 243 delete emPhysicsList; 244 emPhysicsList = new PhysListEmStandardIG(name);245 246 } else if (name == " livermore") {247 248 emName = name; 249 delete emPhysicsList; 250 emPhysicsList = new PhysListEmLivermore(name);251 252 } else if (name == " penelope") {253 254 emName = name; 255 delete emPhysicsList; 256 emPhysicsList = new PhysListEmPenelope(name);238 239 } else if (name == "emstandard_opt3") { 240 241 emName = name; 242 delete emPhysicsList; 243 emPhysicsList = new G4EmStandardPhysics_option3(); 244 245 } else if (name == "emlivermore") { 246 247 emName = name; 248 delete emPhysicsList; 249 emPhysicsList = new G4EmLivermorePhysics(); 250 251 } else if (name == "empenelope") { 252 253 emName = name; 254 delete emPhysicsList; 255 emPhysicsList = new G4EmPenelopePhysics(); 257 256 258 257 } else { … … 288 287 289 288 void PhysicsList::SetCuts() 290 { 291 289 { 292 290 if (verboseLevel >0){ 293 291 G4cout << "PhysicsList::SetCuts:"; … … 306 304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 307 305 308 #include "G4Gamma.hh"309 #include "G4Electron.hh"310 #include "G4Positron.hh"311 312 306 void PhysicsList::SetCutForGamma(G4double cut) 313 307 { -
trunk/examples/extended/electromagnetic/TestEm3/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:52:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.7 2006/06/29 16:53:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:53:02 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.3 4 2007/04/24 13:05:14vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.37 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 131 131 G4cout << "\n------------------------------------------------------------\n"; 132 132 G4cout << std::setw(14) << "material" 133 << std::setw(17) << " Total Edep"133 << std::setw(17) << "Edep RMS" 134 134 << std::setw(33) << "sqrt(E0(GeV))*rmsE/Emean" 135 135 << std::setw(23) << "total tracklen \n \n"; … … 139 139 MeanEAbs = sumEAbs[k]*norm; 140 140 MeanEAbs2 = sum2EAbs[k]*norm; 141 rmsEAbs = std::sqrt(std::fabs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 142 141 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 142 //G4cout << "k= " << k << " RMS= " << rmsEAbs 143 // << " applyLimit: " << applyLimit << G4endl; 143 144 if(applyLimit) { 144 145 G4int nn = 0; … … 159 160 MeanEAbs = sume*norm1; 160 161 MeanEAbs2 = sume2*norm1; 161 rmsEAbs = std::sqrt(std:: fabs(MeanEAbs2 - MeanEAbs*MeanEAbs));162 rmsEAbs = std::sqrt(std::abs(MeanEAbs2 - MeanEAbs*MeanEAbs)); 162 163 } 163 164 … … 171 172 MeanLAbs = sumLAbs[k]*norm; 172 173 MeanLAbs2 = sum2LAbs[k]*norm; 173 rmsLAbs = std::sqrt(std:: fabs(MeanLAbs2 - MeanLAbs*MeanLAbs));174 rmsLAbs = std::sqrt(std::abs(MeanLAbs2 - MeanLAbs*MeanLAbs)); 174 175 175 176 //print … … 178 179 << std::setw(14) << Detector->GetAbsorMaterial(k)->GetName() << ": " 179 180 << std::setprecision(5) 180 << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " +-"181 << std::setw(6) << G4BestUnit(MeanEAbs,"Energy") << " : " 181 182 << std::setprecision(4) 182 183 << std::setw(5) << G4BestUnit( rmsEAbs,"Energy") … … 189 190 } 190 191 G4cout << "\n------------------------------------------------------------\n"; 192 193 G4cout << " Beam particle " 194 << Primary->GetParticleGun()-> 195 GetParticleDefinition()->GetParticleName() 196 << " E = " << G4BestUnit(beamEnergy,"Energy") << G4endl; 191 197 192 198 //Energy flow -
trunk/examples/extended/electromagnetic/TestEm3/src/RunActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: RunActionMessenger.cc,v 1.13 2007/04/25 10:07:27 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.4 2006/06/29 16:53:19 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:53:21 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1.2 5 2006/06/29 16:53:23 gunterExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: SteppingAction.cc,v 1.28 2008/05/29 16:59:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 47 47 :G4UserSteppingAction(),detector(det),runAct(run),eventAct(evt), 48 48 histoManager(hist) 49 { }49 { } 50 50 51 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 81 81 G4double stepl = 0.; 82 82 if (particle->GetPDGCharge() != 0.) stepl = aStep->GetStepLength(); 83 83 84 // G4cout << "Nabs= " << absorNum << " edep(keV)= " << edep << G4endl; 85 84 86 // sum up per event 85 87 eventAct->SumEnergy(absorNum,edep,stepl); 86 88 87 89 //longitudinal profile of edep per absorber 88 if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, layerNum+1., edep); 90 if (edep>0.) histoManager->FillHisto(MaxAbsor+absorNum, 91 G4double(layerNum+1), edep); 89 92 90 93 //energy flow … … 108 111 109 112 //// example of Birk attenuation 110 /// /G4double destep = aStep->GetTotalEnergyDeposit();111 /// / G4double response = BirkAttenuation(aStep);112 /// /G4cout << " Destep: " << destep/keV << " keV"113 /// / << " response after Birk: "<< response/keV << " keV" << G4endl;113 ///G4double destep = aStep->GetTotalEnergyDeposit(); 114 ///G4double response = BirksAttenuation(aStep); 115 ///G4cout << " Destep: " << destep/keV << " keV" 116 /// << " response after Birks: " << response/keV << " keV" << G4endl; 114 117 } 115 118 116 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 120 118 G4double SteppingAction::Birk Attenuation(const G4Step* aStep)121 G4double SteppingAction::BirksAttenuation(const G4Step* aStep) 119 122 { 120 123 //Example of Birk attenuation law in organic scintillators. 121 124 //adapted from Geant3 PHYS337. See MIN 80 (1970) 239-244 122 125 // 123 const G4String myMaterial = "Scintillator"; 124 const G4double birk1 = 0.013*g/(MeV*cm2); 125 // 126 G4Material* material = aStep->GetTrack()->GetMaterial(); 127 G4double birk1 = material->GetIonisation()->GetBirksConstant(); 126 128 G4double destep = aStep->GetTotalEnergyDeposit(); 127 G4 Material* material = aStep->GetTrack()->GetMaterial();129 G4double stepl = aStep->GetStepLength(); 128 130 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge(); 129 131 // 130 132 G4double response = destep; 131 if ( (material->GetName()==myMaterial)&&(charge!=0.))133 if (birk1*destep*stepl*charge != 0.) 132 134 { 133 G4double correction = 134 birk1*destep/((material->GetDensity())*(aStep->GetStepLength())); 135 response = destep/(1. + correction); 135 response = destep/(1. + birk1*destep/stepl); 136 136 } 137 137 return response; -
trunk/examples/extended/electromagnetic/TestEm3/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.4 2006/06/29 16:53:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/src/TrackingAction.cc
r807 r1230 26 26 // 27 27 // $Id: TrackingAction.cc,v 1.2 2006/06/29 16:53:27 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm3/storeTables.mac
r807 r1230 1 # $Id: storeTables.mac,v 1. 8 2007/05/18 19:00:44 vnivanchExp $1 # $Id: storeTables.mac,v 1.10 2009/09/17 20:06:26 maire Exp $ 2 2 # 3 3 # Macro file for "testEm3.cc" … … 8 8 /control/verbose 2 9 9 # 10 /testem/phys/addPhysics emstandard 10 /testem/phys/addPhysics emstandard_opt0 11 11 # 12 12 /run/initialize 13 /process/eLoss/verbose 1 14 /process/eLoss/CSDARange true 13 15 /run/beamOn 3 14 16 # -
trunk/examples/extended/electromagnetic/TestEm4/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1.1 4 2006/10/20 16:38:15maire Exp $1 # $Id: GNUmakefile,v 1.15 2008/06/11 22:15:20 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm4/TestEm4.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm4.cc,v 1.12 2007/06/22 09:55:22 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... -
trunk/examples/extended/electromagnetic/TestEm4/include/DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:53:31 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm4/include/EventAction.hh
r807 r1230 26 26 // 27 27 // $Id: EventAction.hh,v 1.2 2006/06/29 16:53:33 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/include/EventActionMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:53:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm4/include/PhysicsList.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsList.hh,v 1.2 2006/06/29 16:53:37 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/include/PrimaryGeneratorAction.hh
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.hh,v 1.2 2006/06/29 16:53:40 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.7 2006/06/29 16:53:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm4/include/SteppingAction.hh
r807 r1230 26 26 // 27 27 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:53:45 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/include/SteppingVerbose.hh
r807 r1230 26 26 // 27 27 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:53:48 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm4/src/DetectorConstruction.cc
r807 r1230 26 26 // 27 27 // $Id: DetectorConstruction.cc,v 1.3 2006/06/29 16:53:51 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 -
trunk/examples/extended/electromagnetic/TestEm4/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.7 2006/06/29 16:53:57 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm4/src/EventActionMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 16:54:15 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1. 6 2006/06/29 16:54:17 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.cc,v 1.7 2008/04/07 13:09:43 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 … … 95 95 #include "G4PhotoElectricEffect.hh" 96 96 97 #include "G4 MultipleScattering.hh"97 #include "G4eMultipleScattering.hh" 98 98 99 99 #include "G4eIonisation.hh" … … 121 121 //electron 122 122 123 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);124 pmanager->AddProcess(new G4eIonisation, -1, 2,2);125 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);123 pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1); 124 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 125 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 126 126 127 127 } else if (particleName == "e+") { 128 128 //positron 129 129 130 pmanager->AddProcess(new G4 MultipleScattering,-1, 1,1);131 pmanager->AddProcess(new G4eIonisation, -1, 2,2);132 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);133 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);130 pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1); 131 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 132 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 133 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 134 134 } 135 135 } -
trunk/examples/extended/electromagnetic/TestEm4/src/PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:54:19 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.1 0 2006/06/29 16:54:21 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: RunAction.cc,v 1.11 2008/09/12 18:46:14 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 59 59 G4bool readOnly = false; 60 60 G4bool createNew = true; 61 G4String options = "--noErrors uncompress";62 tree = tf->create("testem4.hbook","hbook",readOnly,createNew, options);63 //tree = tf->create("testem4.root","root",readOnly,createNew, options);61 G4String options = "--noErrors export=root uncompress"; 62 //tree = tf->create("testem4.hbook","hbook",readOnly,createNew, options); 63 tree = tf->create("testem4.root","root",readOnly,createNew, options); 64 64 //tree = tf->create("testem4.XML" ,"XML" ,readOnly,createNew, options); 65 65 delete tf; -
trunk/examples/extended/electromagnetic/TestEm4/src/SteppingAction.cc
r807 r1230 26 26 // 27 27 // $Id: SteppingAction.cc,v 1.2 2006/06/29 16:54:23 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm4/src/SteppingVerbose.cc
r807 r1230 26 26 // 27 27 // $Id: SteppingVerbose.cc,v 1.2 2006/06/29 16:54:26 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 19 2006/09/25 17:06:28 maire Exp $1 # $Id: GNUmakefile,v 1.22 2008/06/11 22:17:58 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm5/TestEm5.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm5.cc,v 1.17 2007/06/22 10:48:00 maire Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/air.mac
r807 r1230 1 # $Id: air.mac,v 1. 2 2007/07/31 16:51:29maire Exp $1 # $Id: air.mac,v 1.3 2009/09/18 14:03:24 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 11 11 /testem/det/setAbsYZ 15 cm 12 12 # 13 /testem/phys/addPhysics standard13 /testem/phys/addPhysics local 14 14 #### /testem/phys/addPhysics standardSS 15 15 # -
trunk/examples/extended/electromagnetic/TestEm5/berger.mac
r807 r1230 1 # $Id: berger.mac,v 1. 3 2006/03/20 11:41:46maire Exp $1 # $Id: berger.mac,v 1.7 2009/01/21 17:49:59 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc 4 4 # 5 5 # energy deposit by 1 MeV electrons in silicon counters. 6 # M.J.Berger et al. NIM 69 (1969) page 181 .6 # M.J.Berger et al. NIM 69 (1969) page 181 7 7 # 8 8 /control/verbose 2 … … 10 10 # 11 11 /testem/det/setAbsMat Silicon 12 /testem/det/setAbsThick 61 um12 ###/testem/det/setAbsThick 61 um 13 13 ###/testem/det/setAbsThick 105 um 14 14 ###/testem/det/setAbsThick 191 um 15 ###/testem/det/setAbsThick 530 um15 /testem/det/setAbsThick 530 um 16 16 ###/testem/det/setAbsThick 1 mm 17 17 ###/testem/det/setAbsThick 3 mm 18 18 /testem/det/setAbsYZ 1 cm 19 19 # 20 /testem/phys/setGCut 2.13 mm 21 /testem/phys/setECut 7 um 22 /testem/phys/setPCut 7 um 20 /testem/phys/setCuts 10 um 23 21 # 24 22 /run/initialize … … 28 26 /gun/energy 1 MeV 29 27 # 30 /testem/histo/setFileName berger 31 /testem/histo/setFileType hbook32 /testem/histo/setHisto 1 55 0.0 1.1MeV #energy deposit28 /testem/histo/setFileName berger/Si530um 29 /testem/histo/setFileType root 30 /testem/histo/setHisto 1 105 0 1.05 MeV #energy deposit 33 31 # 34 /testem/event/printModulo 100000 32 /testem/event/printModulo 100000 33 # 35 34 /run/beamOn 1000000 -
trunk/examples/extended/electromagnetic/TestEm5/dedx1.mac
r807 r1230 1 # $Id: dedx1.mac,v 1. 4 2006/03/28 15:03:08maire Exp $1 # $Id: dedx1.mac,v 1.6 2009/09/18 14:03:24 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 8 8 /run/verbose 2 9 9 # 10 /testem/det/setAbsMat Silicon11 /testem/det/setAbsThick 1 mm12 /testem/det/setAbsYZ 1 mm10 /testem/det/setAbsMat Air 11 /testem/det/setAbsThick 1 cm 12 /testem/det/setAbsYZ 1 cm 13 13 # 14 /testem/phys/addPhysics standard 15 ###/testem/phys/addPhysics livermore 16 ###/testem/phys/addPhysics penelope 14 /testem/phys/addPhysics local 17 15 # 18 16 /testem/phys/setCuts 1 km … … 24 22 # 25 23 /testem/gun/setDefault 26 /gun/particle e-27 /gun/energy 1 MeV24 /gun/particle proton 25 /gun/energy 10 MeV 28 26 # 29 27 /tracking/verbose 1 -
trunk/examples/extended/electromagnetic/TestEm5/dedx2.mac
r807 r1230 1 # $Id: dedx2.mac,v 1. 5 2006/03/28 15:03:08maire Exp $1 # $Id: dedx2.mac,v 1.6 2009/09/18 14:03:24 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 12 12 /testem/det/setAbsYZ 10 um 13 13 # 14 /testem/phys/addPhysics standard15 ###/testem/phys/addPhysics livermore16 ###/testem/phys/addPhysics penelope14 /testem/phys/addPhysics local 15 ###/testem/phys/addPhysics emlivermore 16 ###/testem/phys/addPhysics empenelope 17 17 # 18 18 /testem/phys/setCuts 1 km -
trunk/examples/extended/electromagnetic/TestEm5/hadron.mac
r807 r1230 1 # $Id: hadron.mac,v 1. 2 2004/11/22 15:43:39maire Exp $1 # $Id: hadron.mac,v 1.4 2009/09/18 14:03:24 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 11 11 /testem/det/setAbsYZ 1 m 12 12 # 13 /testem/phys/addPhysics standard 14 /testem/phys/addPhysics binary 15 /testem/phys/addPhysics binary_ion 16 /testem/phys/addPhysics elastic 13 /testem/phys/addPhysics local 17 14 # 18 15 /testem/phys/setCuts 1 km … … 27 24 # 28 25 /run/beamOn 1 29 30 -
trunk/examples/extended/electromagnetic/TestEm5/hanson.mac
r807 r1230 1 # $Id: hanson.mac,v 1. 4 2007/07/31 16:51:29 maireExp $1 # $Id: hanson.mac,v 1.5 2009/06/19 12:42:04 vnivanch Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 19 19 /testem/phys/setPCut 1.12 um 20 20 # 21 /testem/phys/addPhysics emstandard_opt3 22 #/testem/phys/addPhysics standardGS 23 # 21 24 /run/initialize 22 25 # -
trunk/examples/extended/electromagnetic/TestEm5/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.6 2006/06/29 16:54:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.5 2006/06/29 16:54:33 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.3 2006/06/29 16:54:35 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/EventMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventMessenger.hh,v 1.5 2006/06/29 16:54:38 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/HistoManager.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.hh,v 1.1 3 2007/11/12 17:48:16maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.hh,v 1.14 2007/11/30 11:46:25 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 64 64 void FillHisto(G4int id, G4double e, G4double weight = 1.0); 65 65 void RemoveHisto (G4int); 66 void Scale (G4int, G4double); 66 67 void PrintHisto (G4int); 67 68 -
trunk/examples/extended/electromagnetic/TestEm5/include/HistoMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.hh,v 1.8 2007/11/12 17:48:16 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandard.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandard.hh,v 1.6 2006/08/10 08:44:39 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/PhysListEmStandardSS.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandardSS.hh,v 1.1 2006/08/10 08:45:14 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsList.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.hh,v 1. 6 2007/03/20 18:50:53 vnivanchExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.hh,v 1.11 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 37 37 38 38 class G4VPhysicsConstructor; 39 class StepMax;40 39 class PhysicsListMessenger; 41 40 … … 55 54 void AddDecay(); 56 55 void AddStepMax(); 57 58 StepMax* GetStepMaxProcess() {return stepMaxProcess;};59 56 60 57 void SetCuts(); … … 64 61 65 62 private: 66 63 67 64 PhysicsListMessenger* pMessenger; 68 65 69 66 G4String emName; 70 67 G4VPhysicsConstructor* emPhysicsList; 71 std::vector<G4VPhysicsConstructor*> hadronPhys;72 73 StepMax* stepMaxProcess;74 68 75 69 G4double cutForGamma; 76 70 G4double cutForElectron; 77 71 G4double cutForPositron; 78 79 G4bool helIsRegisted;80 G4bool bicIsRegisted;81 G4bool biciIsRegisted;82 72 83 73 }; -
trunk/examples/extended/electromagnetic/TestEm5/include/PhysicsListMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.hh,v 1. 7 2006/06/29 16:55:05 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsListMessenger.hh,v 1.9 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 45 45 class PhysicsListMessenger: public G4UImessenger 46 46 { 47 public:47 public: 48 48 49 PhysicsListMessenger(PhysicsList* );50 ~PhysicsListMessenger();49 PhysicsListMessenger(PhysicsList* ); 50 ~PhysicsListMessenger(); 51 51 52 void SetNewValue(G4UIcommand*, G4String);52 void SetNewValue(G4UIcommand*, G4String); 53 53 54 private:54 private: 55 55 56 PhysicsList* pPhysicsList;56 PhysicsList* pPhysicsList; 57 57 58 G4UIdirectory* physDir;59 G4UIcmdWithAString* pListCmd;60 G4UIcmdWithADoubleAndUnit* gammaCutCmd;61 G4UIcmdWithADoubleAndUnit* electCutCmd;62 G4UIcmdWithADoubleAndUnit* protoCutCmd;63 G4UIcmdWithADoubleAndUnit* allCutCmd;58 G4UIdirectory* physDir; 59 G4UIcmdWithAString* pListCmd; 60 G4UIcmdWithADoubleAndUnit* gammaCutCmd; 61 G4UIcmdWithADoubleAndUnit* electCutCmd; 62 G4UIcmdWithADoubleAndUnit* protoCutCmd; 63 G4UIcmdWithADoubleAndUnit* allCutCmd; 64 64 }; 65 65 -
trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:55:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:55:10 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/RunAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.hh,v 1. 8 2007/11/21 17:41:19 maireExp $27 // GEANT4 tag $Name: $26 // $Id: RunAction.hh,v 1.9 2009/01/22 17:41:43 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 52 52 class RunAction : public G4UserRunAction 53 53 { 54 public: 54 55 public: 56 55 57 RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*); 56 ~RunAction();58 virtual ~RunAction(); 57 59 58 public:59 60 void BeginOfRunAction(const G4Run*); 60 61 void EndOfRunAction(const G4Run*); 61 62 62 63 void AddEnergy (G4double edep) 63 {EnergyDeposit += edep; EnergyDeposit2 += edep*edep;};64 {EnergyDeposit += edep; EnergyDeposit2 += edep*edep;}; 64 65 65 66 void AddTrakLenCharg (G4double length) -
trunk/examples/extended/electromagnetic/TestEm5/include/StackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: StackingAction.hh,v 1.4 2006/09/25 17:06:29 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/StackingMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StackingMessenger.hh,v 1.6 2006/09/25 17:06:29 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.3 2006/06/29 16:55:19 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 16:55:21 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/SteppingAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.hh,v 1. 3 2006/06/29 16:55:23 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: SteppingAction.hh,v 1.4 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:55:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm5/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.4 2006/06/29 16:55:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/mumsc.mac
r807 r1230 1 # $Id: mumsc.mac,v 1. 8 2007/07/31 16:51:29maire Exp $1 # $Id: mumsc.mac,v 1.20 2009/11/15 22:10:03 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 14 14 /testem/det/setWorldYZ 1 m 15 15 # 16 /testem/phys/setCuts 0.1 mm 16 /testem/phys/addPhysics local 17 # 18 /testem/phys/setCuts 1 mm 17 19 # 18 20 /run/initialize … … 20 22 /testem/gun/setDefault 21 23 /gun/particle mu+ 22 /gun/energy 50 GeV24 /gun/energy 100 GeV 23 25 # 24 /testem/histo/setFileName mumsc 26 /testem/histo/setFileName mumsc/ref09.local 25 27 /testem/histo/setFileType hbook 26 /testem/histo/setHisto 1 3 200 -20.0 +20.0 mrad #projected angle27 /testem/histo/setHisto 1 4 200 -10.0 +10.0 mm #projected deviation28 /testem/histo/setHisto 14 100 -5.0 +5.0 mm #x-position at exit 29 /testem/histo/setHisto 15 100 0. +10.0 mm #radius at exit 28 30 # 29 31 /testem/stack/killSecondaries 30 32 # 31 /testem/event/printModulo 100032 /run/beamOn 1000033 /testem/event/printModulo 4000 34 /run/beamOn 40000 -
trunk/examples/extended/electromagnetic/TestEm5/neutron.mac
r807 r1230 1 # $Id: neutron.mac,v 1. 4 2007/07/31 16:51:29maire Exp $1 # $Id: neutron.mac,v 1.5 2009/09/18 14:03:24 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 14 14 /testem/det/setAbsYZ 20 cm 15 15 # 16 /testem/phys/addPhysics standard 17 /testem/phys/addPhysics elastic 16 /testem/phys/addPhysics local 18 17 # 19 18 /testem/phys/setCuts 1 km -
trunk/examples/extended/electromagnetic/TestEm5/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1.1 3 2006/09/25 17:06:29 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: DetectorConstruction.cc,v 1.15 2009/01/22 17:41:43 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 46 46 #include "G4UnitsTable.hh" 47 47 #include "G4NistManager.hh" 48 #include "G4RunManager.hh" 48 49 49 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 88 89 void DetectorConstruction::DefineMaterials() 89 90 { 90 //This function illustrates the possible ways to define materials91 //This function illustrates the possible ways to define materials 91 92 92 G4String symbol; //a=mass of a mole; 93 G4double a, z, density; //z=mean number of protons; 94 95 G4int ncomponents, natoms; 96 G4double fractionmass; 97 G4double temperature, pressure; 98 99 // 100 // define Elements 101 // 102 103 G4Element* H = new G4Element("Hydrogen",symbol="H", z= 1, a= 1.01*g/mole); 104 G4Element* C = new G4Element("Carbon", symbol="C", z= 6, a= 12.01*g/mole); 105 G4Element* N = new G4Element("Nitrogen",symbol="N", z= 7, a= 14.01*g/mole); 106 G4Element* O = new G4Element("Oxygen", symbol="O", z= 8, a= 16.00*g/mole); 107 G4Element* Na = new G4Element("Sodium", symbol="Na", z=11, a= 22.99*g/mole); 108 G4Element* Ar = new G4Element("Argon", symbol="Ar", z=18, a= 39.95*g/mole); 109 G4Element* I = new G4Element("Iodine", symbol="I" , z=53, a= 126.90*g/mole); 110 G4Element* Xe = new G4Element("Xenon", symbol="Xe", z=54, a= 131.29*g/mole); 111 112 // 113 // define simple materials 114 // 115 116 new G4Material("H2Liq" , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3); 117 new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3); 118 new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3); 119 new G4Material("Silicon" , z=14, a=28.09*g/mole, density= 2.330*g/cm3); 120 121 G4Material* lAr = 122 new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1); 123 lAr->AddElement(Ar, natoms=1); 124 125 new G4Material("Iron", z=26, a= 55.85*g/mole, density= 7.870*g/cm3); 126 new G4Material("Copper", z=29, a= 63.55*g/mole, density= 8.960*g/cm3); 127 new G4Material("Silver", z=47, a=107.87*g/mole, density= 10.50*g/cm3); 128 new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3); 129 new G4Material("Gold", z=79, a=196.97*g/mole, density= 19.32*g/cm3); 130 new G4Material("Lead", z=82, a=207.19*g/mole, density= 11.35*g/cm3); 131 132 // 133 // define a material from elements. case 1: chemical molecule 134 // 135 136 G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); 137 H2O->AddElement(H, natoms=2); 138 H2O->AddElement(O, natoms=1); 139 H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV); 140 141 G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2); 142 CH->AddElement(C, natoms=1); 143 CH->AddElement(H, natoms=1); 144 145 G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2); 146 NaI->AddElement(Na, natoms=1); 147 NaI->AddElement(I , natoms=1); 148 NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV); 149 150 // 151 // define a material from elements. case 2: mixture by fractional mass 152 // 153 154 G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2); 155 Air->AddElement(N, fractionmass=0.7); 156 Air->AddElement(O, fractionmass=0.3); 157 158 G4Material* Air20 = 159 new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2, 160 kStateGas, 293.*kelvin, 1.*atmosphere); 161 Air20->AddElement(N, fractionmass=0.7); 162 Air20->AddElement(O, fractionmass=0.3); 163 164 //Graphite 165 // 166 G4Material* Graphite = 167 new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1); 168 Graphite->AddElement(C, fractionmass=1.); 169 170 //Havar 171 // 172 G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a= 51.996*g/mole); 173 G4Element* Fe = new G4Element("Iron" , "Fe", z=26, a= 55.845*g/mole); 174 G4Element* Co = new G4Element("Cobalt", "Co", z=27, a= 58.933*g/mole); 175 G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a= 58.693*g/mole); 176 G4Element* W = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole); 177 178 G4Material* Havar = 179 new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5); 180 Havar->AddElement(Cr, fractionmass=0.1785); 181 Havar->AddElement(Fe, fractionmass=0.1822); 182 Havar->AddElement(Co, fractionmass=0.4452); 183 Havar->AddElement(Ni, fractionmass=0.1310); 184 Havar->AddElement(W , fractionmass=0.0631); 185 186 // 187 // examples of gas 188 // 189 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 190 kStateGas, 273.15*kelvin, 1*atmosphere); 93 G4String symbol; //a=mass of a mole; 94 G4double a, z, density; //z=mean number of protons; 95 96 G4int ncomponents, natoms; 97 G4double fractionmass; 98 G4double temperature, pressure; 99 100 // 101 // define Elements 102 // 103 104 G4Element* H = new G4Element("Hydrogen",symbol="H", z= 1, a= 1.01*g/mole); 105 G4Element* C = new G4Element("Carbon", symbol="C", z= 6, a= 12.01*g/mole); 106 G4Element* N = new G4Element("Nitrogen",symbol="N", z= 7, a= 14.01*g/mole); 107 G4Element* O = new G4Element("Oxygen", symbol="O", z= 8, a= 16.00*g/mole); 108 G4Element* Na = new G4Element("Sodium", symbol="Na", z=11, a= 22.99*g/mole); 109 G4Element* Ar = new G4Element("Argon", symbol="Ar", z=18, a= 39.95*g/mole); 110 G4Element* I = new G4Element("Iodine", symbol="I" , z=53, a= 126.90*g/mole); 111 G4Element* Xe = new G4Element("Xenon", symbol="Xe", z=54, a= 131.29*g/mole); 112 113 // 114 // define simple materials 115 // 116 117 new G4Material("H2Liq" , z= 1, a= 1.01*g/mole, density= 70.8*mg/cm3); 118 new G4Material("Beryllium", z= 4, a= 9.01*g/mole, density= 1.848*g/cm3); 119 new G4Material("Aluminium", z=13, a=26.98*g/mole, density= 2.700*g/cm3); 120 new G4Material("Silicon" , z=14, a=28.09*g/mole, density= 2.330*g/cm3); 121 122 G4Material* lAr = 123 new G4Material("liquidArgon", density= 1.390*g/cm3, ncomponents=1); 124 lAr->AddElement(Ar, natoms=1); 125 126 new G4Material("Iron", z=26, a= 55.85*g/mole, density= 7.870*g/cm3); 127 new G4Material("Copper", z=29, a= 63.55*g/mole, density= 8.960*g/cm3); 128 new G4Material("Germanium",z=32, a= 72.61*g/mole, density= 5.323*g/cm3); 129 new G4Material("Silver", z=47, a=107.87*g/mole, density= 10.50*g/cm3); 130 new G4Material("Tungsten", z=74, a=183.85*g/mole, density= 19.30*g/cm3); 131 new G4Material("Gold", z=79, a=196.97*g/mole, density= 19.32*g/cm3); 132 new G4Material("Lead", z=82, a=207.19*g/mole, density= 11.35*g/cm3); 133 134 // 135 // define a material from elements. case 1: chemical molecule 136 // 137 138 G4Material* H2O = new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); 139 H2O->AddElement(H, natoms=2); 140 H2O->AddElement(O, natoms=1); 141 H2O->GetIonisation()->SetMeanExcitationEnergy(75*eV); 142 143 G4Material* CH = new G4Material("Plastic", density= 1.04*g/cm3, ncomponents=2); 144 CH->AddElement(C, natoms=1); 145 CH->AddElement(H, natoms=1); 146 147 G4Material* NaI = new G4Material("NaI", density= 3.67*g/cm3, ncomponents=2); 148 NaI->AddElement(Na, natoms=1); 149 NaI->AddElement(I , natoms=1); 150 NaI->GetIonisation()->SetMeanExcitationEnergy(452*eV); 151 152 // 153 // define a material from elements. case 2: mixture by fractional mass 154 // 155 156 G4Material* Air = new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2); 157 Air->AddElement(N, fractionmass=0.7); 158 Air->AddElement(O, fractionmass=0.3); 159 160 G4Material* Air20 = 161 new G4Material("Air20", density= 1.205*mg/cm3, ncomponents=2, 162 kStateGas, 293.*kelvin, 1.*atmosphere); 163 Air20->AddElement(N, fractionmass=0.7); 164 Air20->AddElement(O, fractionmass=0.3); 165 166 //Graphite 167 // 168 G4Material* Graphite = 169 new G4Material("Graphite", density= 1.7*g/cm3, ncomponents=1); 170 Graphite->AddElement(C, fractionmass=1.); 171 172 //Havar 173 // 174 G4Element* Cr = new G4Element("Chrome", "Cr", z=25, a= 51.996*g/mole); 175 G4Element* Fe = new G4Element("Iron" , "Fe", z=26, a= 55.845*g/mole); 176 G4Element* Co = new G4Element("Cobalt", "Co", z=27, a= 58.933*g/mole); 177 G4Element* Ni = new G4Element("Nickel", "Ni", z=28, a= 58.693*g/mole); 178 G4Element* W = new G4Element("Tungsten","W", z=74, a= 183.850*g/mole); 179 180 G4Material* Havar = 181 new G4Material("Havar", density= 8.3*g/cm3, ncomponents=5); 182 Havar->AddElement(Cr, fractionmass=0.1785); 183 Havar->AddElement(Fe, fractionmass=0.1822); 184 Havar->AddElement(Co, fractionmass=0.4452); 185 Havar->AddElement(Ni, fractionmass=0.1310); 186 Havar->AddElement(W , fractionmass=0.0631); 187 188 // 189 // examples of gas 190 // 191 new G4Material("ArgonGas", z=18, a=39.948*g/mole, density= 1.782*mg/cm3, 192 kStateGas, 273.15*kelvin, 1*atmosphere); 191 193 192 new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3,193 kStateGas, 293.15*kelvin, 1*atmosphere);194 new G4Material("XenonGas", z=54, a=131.29*g/mole, density= 5.458*mg/cm3, 195 kStateGas, 293.15*kelvin, 1*atmosphere); 194 196 195 G4Material* CO2 =196 new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2);197 CO2->AddElement(C, natoms=1);198 CO2->AddElement(O, natoms=2);199 200 G4Material* ArCO2 =201 new G4Material("ArgonCO2", density= 1.8223*mg/cm3, ncomponents=2);202 ArCO2->AddElement (Ar, fractionmass=0.7844);203 ArCO2->AddMaterial(CO2, fractionmass=0.2156);204 205 //another way to define mixture of gas per volume206 G4Material* NewArCO2 =207 new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3);208 NewArCO2->AddElement (Ar, natoms=8);209 NewArCO2->AddElement (C, natoms=2);210 NewArCO2->AddElement (O, natoms=4);211 212 G4Material* ArCH4 =213 new G4Material("ArgonCH4", density= 1.709*mg/cm3, ncomponents=3);214 ArCH4->AddElement (Ar, natoms=93);215 ArCH4->AddElement (C, natoms=7);216 ArCH4->AddElement (H, natoms=28);217 218 G4Material* XeCH =219 new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3,220 kStateGas, 293.15*kelvin, 1*atmosphere);221 XeCH->AddElement (Xe, natoms=875);222 XeCH->AddElement (C, natoms=225);223 XeCH->AddElement (H, natoms=700);224 225 G4Material* steam =226 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1);227 steam->AddMaterial(H2O, fractionmass=1.);228 steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV);229 230 //231 // example of vacuum232 //233 234 density = universe_mean_density; //from PhysicalConstants.h235 pressure = 3.e-18*pascal;236 temperature = 2.73*kelvin;237 new G4Material("Galactic", z=1, a=1.01*g/mole,density,238 kStateGas,temperature,pressure);197 G4Material* CO2 = 198 new G4Material("CarbonicGas", density= 1.977*mg/cm3, ncomponents=2); 199 CO2->AddElement(C, natoms=1); 200 CO2->AddElement(O, natoms=2); 201 202 G4Material* ArCO2 = 203 new G4Material("ArgonCO2", density= 1.8223*mg/cm3, ncomponents=2); 204 ArCO2->AddElement (Ar, fractionmass=0.7844); 205 ArCO2->AddMaterial(CO2, fractionmass=0.2156); 206 207 //another way to define mixture of gas per volume 208 G4Material* NewArCO2 = 209 new G4Material("NewArgonCO2", density= 1.8223*mg/cm3, ncomponents=3); 210 NewArCO2->AddElement (Ar, natoms=8); 211 NewArCO2->AddElement (C, natoms=2); 212 NewArCO2->AddElement (O, natoms=4); 213 214 G4Material* ArCH4 = 215 new G4Material("ArgonCH4", density= 1.709*mg/cm3, ncomponents=3); 216 ArCH4->AddElement (Ar, natoms=93); 217 ArCH4->AddElement (C, natoms=7); 218 ArCH4->AddElement (H, natoms=28); 219 220 G4Material* XeCH = 221 new G4Material("XenonMethanePropane", density= 4.9196*mg/cm3, ncomponents=3, 222 kStateGas, 293.15*kelvin, 1*atmosphere); 223 XeCH->AddElement (Xe, natoms=875); 224 XeCH->AddElement (C, natoms=225); 225 XeCH->AddElement (H, natoms=700); 226 227 G4Material* steam = 228 new G4Material("WaterSteam", density= 1.0*mg/cm3, ncomponents=1); 229 steam->AddMaterial(H2O, fractionmass=1.); 230 steam->GetIonisation()->SetMeanExcitationEnergy(71.6*eV); 231 232 // 233 // example of vacuum 234 // 235 236 density = universe_mean_density; //from PhysicalConstants.h 237 pressure = 3.e-18*pascal; 238 temperature = 2.73*kelvin; 239 new G4Material("Galactic", z=1, a=1.01*g/mole,density, 240 kStateGas,temperature,pressure); 239 241 } 240 242 … … 300 302 0); //copy number 301 303 302 PrintCalorParameters();304 PrintCalorParameters(); 303 305 304 306 //always return the physical World … … 336 338 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 337 339 338 if (pttoMaterial) AbsorberMaterial = pttoMaterial; 340 if (pttoMaterial && AbsorberMaterial != pttoMaterial) { 341 AbsorberMaterial = pttoMaterial; 342 if(logicAbsorber) logicAbsorber->SetMaterial(AbsorberMaterial); 343 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 344 } 339 345 } 340 346 … … 347 353 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 348 354 349 if (pttoMaterial) WorldMaterial = pttoMaterial; 355 if (pttoMaterial && WorldMaterial != pttoMaterial) { 356 WorldMaterial = pttoMaterial; 357 if(logicWorld) logicWorld->SetMaterial(WorldMaterial); 358 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 359 } 350 360 } 351 361 … … 355 365 { 356 366 AbsorberThickness = val; 367 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 357 368 } 358 369 … … 362 373 { 363 374 AbsorberSizeYZ = val; 375 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 364 376 } 365 377 … … 370 382 WorldSizeX = val; 371 383 defaultWorld = false; 384 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 372 385 } 373 386 … … 378 391 WorldSizeYZ = val; 379 392 defaultWorld = false; 393 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 380 394 } 381 395 … … 385 399 { 386 400 XposAbs = val; 401 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 387 402 } 388 403 … … 412 427 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 413 428 414 #include "G4RunManager.hh"415 416 429 void DetectorConstruction::UpdateGeometry() 417 430 { 431 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 418 432 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter()); 419 433 } -
trunk/examples/extended/electromagnetic/TestEm5/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.4 2006/06/29 16:55:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/EventAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 6 2006/06/29 16:55:34 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: EventAction.cc,v 1.7 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/EventMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventMessenger.cc,v 1.5 2006/06/29 16:55:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/HistoManager.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.cc,v 1.2 1 2007/11/28 12:37:56maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: HistoManager.cc,v 1.26 2008/09/13 17:05:40 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 54 54 55 55 fileName[0] = "testem5"; 56 fileType = " hbook";57 fileOption = "--noErrors uncompress";56 fileType = "root"; 57 fileOption = "--noErrors export=root uncompress"; 58 58 // histograms 59 59 for (G4int k=0; k<MaxHisto; k++) { … … 199 199 "dummy","dummy","dummy","dummy","dummy","dummy", //34-39 200 200 "(reflect , neutral) : kinetic energy at exit", //40 201 "(reflect , neutral) : ener fluence: dE(MeV)/dOmega" //41201 "(reflect , neutral) : ener fluence: dE(MeV)/dOmega", //41 202 202 "(reflect , neutral) : space angle: dN/dOmega", //42 203 203 "(reflect , neutral) : projected angle at exit", //43 … … 245 245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 246 246 247 void HistoManager::Scale(G4int ih, G4double fac) 248 { 249 if (ih > MaxHisto) { 250 G4cout << "---> warning from HistoManager::Scale() : histo " << ih 251 << "does not exist. (fac = " << fac << ")" << G4endl; 252 return; 253 } 254 #ifdef G4ANALYSIS_USE 255 if(exist[ih]) histo[ih]->scale(fac); 256 #endif 257 } 258 259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 260 247 261 void HistoManager::PrintHisto(G4int ih) 248 262 { 249 if (ih < MaxHisto) ascii[ih] = true;263 if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; } 250 264 else 251 265 G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih … … 260 274 { 261 275 #ifdef G4ANALYSIS_USE 276 277 if (!ascii[0]) return; 262 278 263 279 G4String name = fileName[0] + ".ascii"; … … 273 289 for (G4int iBin=0; iBin<Nbins[ih]; iBin++) { 274 290 File << " " << iBin << "\t" 275 << histo[ih]->binMean(iBin) << "\t" 291 << 0.5*(histo[ih]->axis().binLowerEdge(iBin) + 292 histo[ih]->axis().binUpperEdge(iBin)) << "\t" 276 293 << histo[ih]->binHeight(iBin) 277 294 << G4endl; -
trunk/examples/extended/electromagnetic/TestEm5/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: HistoMessenger.cc,v 1.8 2007/11/12 17:48:16 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandard.cc,v 1. 14 2007/11/21 17:41:19maire Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysListEmStandard.cc,v 1.24 2009/11/15 22:10:03 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 38 38 #include "G4PhotoElectricEffect.hh" 39 39 40 #include "G4 MultipleScattering.hh"41 40 #include "G4eMultipleScattering.hh" 41 #include "G4UrbanMscModel93.hh" 42 42 #include "G4eIonisation.hh" 43 43 #include "G4eBremsstrahlung.hh" 44 44 #include "G4eplusAnnihilation.hh" 45 45 46 #include "G4MuMultipleScattering.hh" 46 47 #include "G4MuIonisation.hh" 47 48 #include "G4MuBremsstrahlung.hh" 48 49 #include "G4MuPairProduction.hh" 49 50 51 #include "G4hMultipleScattering.hh" 50 52 #include "G4hIonisation.hh" 53 #include "G4hBremsstrahlung.hh" 54 #include "G4hPairProduction.hh" 55 51 56 #include "G4ionIonisation.hh" 57 #include "G4IonParametrisedLossModel.hh" 58 #include "G4NuclearStopping.hh" 52 59 53 60 #include "G4EmProcessOptions.hh" … … 86 93 } else if (particleName == "e-") { 87 94 //electron 88 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 89 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 90 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 95 G4eMultipleScattering* msc = new G4eMultipleScattering(); 96 msc->AddEmModel(0, new G4UrbanMscModel93()); 97 pmanager->AddProcess(msc, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 91 100 92 101 } else if (particleName == "e+") { 93 102 //positron 94 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 95 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 96 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 97 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 103 G4eMultipleScattering* msc = new G4eMultipleScattering(); 104 msc->AddEmModel(0, new G4UrbanMscModel93()); 105 pmanager->AddProcess(msc, -1, 1, 1); 106 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 98 109 99 110 } else if (particleName == "mu+" || 100 111 particleName == "mu-" ) { 101 112 //muon 102 pmanager->AddProcess(new G4Mu ltipleScattering, -1, 1,1);103 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);104 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);105 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);113 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1); 114 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 115 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 116 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 106 117 107 } else if (particleName == "alpha" || particleName == "GenericIon" ) { 108 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); 109 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 118 } else if( particleName == "proton" || 119 particleName == "pi-" || 120 particleName == "pi+" ) { 121 //proton 122 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 123 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 124 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 125 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 110 126 127 } else if( particleName == "alpha" || 128 particleName == "He3" ) { 129 //alpha 130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 132 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 133 134 } else if( particleName == "GenericIon" ) { 135 //Ions 136 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 137 G4ionIonisation* ionIoni = new G4ionIonisation(); 138 ionIoni->SetEmModel(new G4IonParametrisedLossModel()); 139 pmanager->AddProcess(ionIoni, -1, 2, 2); 140 pmanager->AddProcess(new G4NuclearStopping, -1, 3,-1); 141 111 142 } else if ((!particle->IsShortLived()) && 112 143 (particle->GetPDGCharge() != 0.0) && 113 144 (particle->GetParticleName() != "chargedgeantino")) { 114 145 //all others charged particles except geantino 115 pmanager->AddProcess(new G4 MultipleScattering, -1,1,1);116 pmanager->AddProcess(new G4hIonisation, -1,2,2);146 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 147 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 117 148 } 118 149 } … … 120 151 // Em options 121 152 // 153 // Main options and setting parameters are shown here. 154 // Several of them have default values. 155 // 122 156 G4EmProcessOptions emOptions; 123 124 //coulomb scattering125 //126 emOptions.SetMscStepLimitation(fUseDistanceToBoundary);127 emOptions.SetSkin(4.);128 157 129 158 //physics tables 130 159 // 131 emOptions.SetMinEnergy(100*eV); 132 emOptions.SetMaxEnergy(100*TeV); 133 emOptions.SetDEDXBinning(1200); 134 emOptions.SetLambdaBinning(1200); 135 160 emOptions.SetMinEnergy(100*eV); //default 161 emOptions.SetMaxEnergy(100*TeV); //default 162 emOptions.SetDEDXBinning(12*20); //default=12*7 163 emOptions.SetLambdaBinning(12*20); //default=12*7 164 emOptions.SetSplineFlag(true); //default 165 166 //multiple coulomb scattering 167 // 168 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 169 emOptions.SetMscRangeFactor(0.04); //default 170 emOptions.SetMscGeomFactor (2.5); //default 171 emOptions.SetSkin(3.); //default 172 136 173 //energy loss 137 174 // 138 emOptions.Set LinearLossLimit(1.e-6);139 emOptions.Set StepFunction(0.2, 100*um);175 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 176 emOptions.SetLinearLossLimit(1.e-2); //default 140 177 141 178 //ionization 142 179 // 143 emOptions.SetSubCutoff(false); 180 emOptions.SetSubCutoff(false); //default 144 181 } 145 182 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysListEmStandardSS.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandardSS.cc,v 1. 3 2007/07/31 16:51:29maire Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandardSS.cc,v 1.6 2008/11/16 18:51:42 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 31 31 32 32 #include "PhysListEmStandardSS.hh" 33 33 34 #include "G4ParticleDefinition.hh" 34 35 #include "G4ProcessManager.hh" … … 38 39 #include "G4PhotoElectricEffect.hh" 39 40 40 #include "G4 MultipleScattering.hh"41 #include "G4CoulombScattering.hh" 41 42 42 43 #include "G4eIonisation.hh" … … 50 51 #include "G4hIonisation.hh" 51 52 #include "G4ionIonisation.hh" 52 #include "G4CoulombScattering.hh" 53 54 #include "G4EmProcessOptions.hh" 53 55 54 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 83 85 } else if (particleName == "e-") { 84 86 //electron 85 pmanager->Add Process(new G4eIonisation, -1, 1,1);86 pmanager->AddProcess(new G4e Bremsstrahlung, -1, 2,2);87 pmanager->Add DiscreteProcess(new G4CoulombScattering);87 pmanager->AddDiscreteProcess(new G4CoulombScattering); 88 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 89 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 88 90 89 91 } else if (particleName == "e+") { 90 92 //positron 91 pmanager->Add Process(new G4eIonisation, -1, 1,1);92 pmanager->AddProcess(new G4e Bremsstrahlung, -1, 2,2);93 pmanager->AddProcess(new G4e plusAnnihilation, 0,-1,3);94 pmanager->Add DiscreteProcess(new G4CoulombScattering);93 pmanager->AddDiscreteProcess(new G4CoulombScattering); 94 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 95 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 96 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 95 97 96 98 } else if (particleName == "mu+" || 97 99 particleName == "mu-" ) { 98 //muon 99 pmanager->Add Process(new G4MuIonisation, -1, 1,1);100 pmanager->AddProcess(new G4Mu Bremsstrahlung, -1, 2,2);101 pmanager->AddProcess(new G4Mu PairProduction, -1, 3,3);102 pmanager->Add DiscreteProcess(new G4CoulombScattering);100 //muon 101 pmanager->AddDiscreteProcess(new G4CoulombScattering); 102 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 103 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 104 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 103 105 104 106 } else if (particleName == "alpha" || particleName == "He3") { 105 pmanager->Add Process(new G4ionIonisation, -1, 1,1);106 pmanager->Add DiscreteProcess(new G4CoulombScattering);107 pmanager->AddDiscreteProcess(new G4CoulombScattering); 108 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 107 109 108 110 } else if (particleName == "GenericIon" ) { 109 pmanager->AddProcess(new G4ionIonisation, -1, 1,1);110 111 G4CoulombScattering* cs = new G4CoulombScattering(); 111 112 cs->SetBuildTableFlag(false); 112 113 pmanager->AddDiscreteProcess(cs); 113 114 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 114 115 115 116 } else if ((!particle->IsShortLived()) && … … 117 118 (particle->GetParticleName() != "chargedgeantino")) { 118 119 //all others charged particles except geantino 119 pmanager->Add Process(new G4hIonisation, -1,1,1);120 pmanager->Add DiscreteProcess(new G4CoulombScattering);120 pmanager->AddDiscreteProcess(new G4CoulombScattering); 121 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 121 122 } 122 123 } 124 125 // Em options 126 // 127 // Main options and setting parameters are shown here. 128 // Several of them have default values. 129 // 130 G4EmProcessOptions emOptions; 131 132 //physics tables 133 // 134 emOptions.SetMinEnergy(100*eV); //default 135 emOptions.SetMaxEnergy(100*TeV); //default 136 emOptions.SetDEDXBinning(12*20); //default=12*7 137 emOptions.SetLambdaBinning(12*20); //default=12*7 138 emOptions.SetSplineFlag(true); //default 139 140 //energy loss 141 // 142 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 143 emOptions.SetLinearLossLimit(1.e-2); //default 144 145 //ionization 146 // 147 emOptions.SetSubCutoff(false); //default 123 148 } 124 149 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 21 2007/11/19 14:57:07 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysicsList.cc,v 1.40 2009/11/15 22:10:03 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "PhysListEmStandard.hh" 36 36 #include "PhysListEmStandardSS.hh" 37 #include "PhysListEmStandardIG.hh" 38 #include "PhysListEmLivermore.hh" 39 #include "PhysListEmPenelope.hh" 37 #include "PhysListEmStandardGS.hh" 40 38 41 39 #include "G4EmStandardPhysics.hh" 42 40 #include "G4EmStandardPhysics_option1.hh" 43 41 #include "G4EmStandardPhysics_option2.hh" 44 45 #include "G4HadronElasticPhysics.hh" 46 #include "G4HadronDElasticPhysics.hh" 47 #include "G4HadronHElasticPhysics.hh" 48 #include "G4HadronQElasticPhysics.hh" 49 #include "G4HadronInelasticQBBC.hh" 50 #include "G4IonBinaryCascadePhysics.hh" 51 52 #include "G4LossTableManager.hh" 42 #include "G4EmStandardPhysics_option3.hh" 43 #include "G4EmLivermorePhysics.hh" 44 #include "G4EmPenelopePhysics.hh" 45 46 #include "G4Decay.hh" 47 #include "StepMax.hh" 48 53 49 #include "G4UnitsTable.hh" 54 50 55 51 #include "G4ParticleDefinition.hh" 56 52 #include "G4ProcessManager.hh" 57 #include "G4Decay.hh"58 #include "StepMax.hh"59 53 60 54 // Bosons … … 84 78 PhysicsList::PhysicsList() : G4VModularPhysicsList() 85 79 { 86 G4LossTableManager::Instance();87 80 pMessenger = new PhysicsListMessenger(this); 88 81 89 82 // EM physics 90 emName = G4String(" standard");83 emName = G4String("local"); 91 84 emPhysicsList = new PhysListEmStandard(emName); 92 93 helIsRegisted = false; 94 bicIsRegisted = false; 95 biciIsRegisted = false; 96 97 stepMaxProcess = 0; 98 85 99 86 defaultCutValue = 1.*mm; 87 100 88 cutForGamma = defaultCutValue; 101 89 cutForElectron = defaultCutValue; … … 110 98 { 111 99 delete emPhysicsList; 112 for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i];113 100 delete pMessenger; 114 101 } … … 118 105 void PhysicsList::ConstructParticle() 119 106 { 120 // pseudo-particles107 // pseudo-particles 121 108 G4Geantino::GeantinoDefinition(); 122 109 G4ChargedGeantino::ChargedGeantinoDefinition(); 123 110 124 // gamma111 // gamma 125 112 G4Gamma::GammaDefinition(); 126 113 127 // optical photon 128 G4OpticalPhoton::OpticalPhotonDefinition(); 129 130 // leptons 114 // leptons 131 115 G4Electron::ElectronDefinition(); 132 116 G4Positron::PositronDefinition(); … … 139 123 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 140 124 141 // mesons125 // mesons 142 126 G4MesonConstructor mConstructor; 143 127 mConstructor.ConstructParticle(); 144 128 145 // barions129 // barions 146 130 G4BaryonConstructor bConstructor; 147 131 bConstructor.ConstructParticle(); 148 132 149 // ions133 // ions 150 134 G4IonConstructor iConstructor; 151 135 iConstructor.ConstructParticle(); … … 158 142 AddTransportation(); 159 143 emPhysicsList->ConstructProcess(); 160 for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();161 144 AddDecay(); 162 145 AddStepMax(); … … 193 176 { 194 177 // Step limitation seen as a process 195 stepMaxProcess = new StepMax();178 StepMax* stepMaxProcess = new StepMax(); 196 179 197 180 theParticleIterator->reset(); … … 217 200 if (name == emName) return; 218 201 219 if (name == " standard") {202 if (name == "local") { 220 203 221 204 emName = name; … … 223 206 emPhysicsList = new PhysListEmStandard(name); 224 207 225 } else if (name == "emstandard ") {208 } else if (name == "emstandard_opt0") { 226 209 227 210 emName = name; … … 240 223 delete emPhysicsList; 241 224 emPhysicsList = new G4EmStandardPhysics_option2(); 242 225 226 } else if (name == "emstandard_opt3") { 227 228 emName = name; 229 delete emPhysicsList; 230 emPhysicsList = new G4EmStandardPhysics_option3(); 231 243 232 } else if (name == "standardSS") { 244 233 … … 246 235 delete emPhysicsList; 247 236 emPhysicsList = new PhysListEmStandardSS(name); 248 249 } else if (name == "standardIG") { 250 251 emName = name; 252 delete emPhysicsList; 253 emPhysicsList = new PhysListEmStandardIG(name); 254 255 } else if (name == "livermore") { 256 257 emName = name; 258 delete emPhysicsList; 259 emPhysicsList = new PhysListEmLivermore(name); 260 261 } else if (name == "penelope") { 262 263 emName = name; 264 delete emPhysicsList; 265 emPhysicsList = new PhysListEmPenelope(name); 266 267 } else if (name == "elastic" && !helIsRegisted) { 268 hadronPhys.push_back( new G4HadronElasticPhysics()); 269 helIsRegisted = true; 270 271 } else if (name == "DElastic" && !helIsRegisted) { 272 hadronPhys.push_back( new G4HadronDElasticPhysics()); 273 helIsRegisted = true; 274 275 } else if (name == "HElastic" && !helIsRegisted) { 276 hadronPhys.push_back( new G4HadronHElasticPhysics()); 277 helIsRegisted = true; 278 279 } else if (name == "QElastic" && !helIsRegisted) { 280 hadronPhys.push_back( new G4HadronQElasticPhysics()); 281 helIsRegisted = true; 282 283 } else if (name == "binary" && !bicIsRegisted) { 284 hadronPhys.push_back(new G4HadronInelasticQBBC()); 285 bicIsRegisted = true; 286 287 } else if (name == "binary_ion" && !biciIsRegisted) { 288 hadronPhys.push_back(new G4IonBinaryCascadePhysics()); 289 biciIsRegisted = true; 290 237 238 } else if (name == "standardGS") { 239 240 emName = name; 241 delete emPhysicsList; 242 emPhysicsList = new PhysListEmStandardGS(name); 243 244 } else if (name == "empenelope"){ 245 emName = name; 246 delete emPhysicsList; 247 emPhysicsList = new G4EmPenelopePhysics(); 248 249 } else if (name == "emlivermore"){ 250 emName = name; 251 delete emPhysicsList; 252 emPhysicsList = new G4EmLivermorePhysics(); 253 291 254 } else { 292 255 … … 301 264 void PhysicsList::SetCuts() 302 265 { 303 304 266 if (verboseLevel >0){ 305 267 G4cout << "PhysicsList::SetCuts:"; … … 341 303 342 304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 343 -
trunk/examples/extended/electromagnetic/TestEm5/src/PhysicsListMessenger.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsListMessenger.cc,v 1. 6 2006/06/29 16:56:07 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsListMessenger.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 77 77 allCutCmd->SetRange("cut>0.0"); 78 78 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 79 79 80 } 80 81 -
trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:56:09 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:56:12 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.2 5 2007/11/21 17:41:19 maireExp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.29 2009/06/18 19:08:18 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 122 122 else rmsStNe = 0.; 123 123 124 G4double Gamma = ( double)nbGamma/TotNbofEvents;125 G4double Elect = ( double)nbElect/TotNbofEvents;126 G4double Posit = ( double)nbPosit/TotNbofEvents;124 G4double Gamma = (G4double)nbGamma/TotNbofEvents; 125 G4double Elect = (G4double)nbElect/TotNbofEvents; 126 G4double Posit = (G4double)nbPosit/TotNbofEvents; 127 127 128 128 G4double transmit[2]; … … 252 252 // compute width of the Gaussian central part of the MultipleScattering 253 253 // 254 if (histoManager->HistoExist(13)) { 255 G4cout << "\n MultipleScattering:" 256 << "\n rms proj angle of transmit primary particle = " 257 << rmsMsc/mrad << " mrad (central part only)" << G4endl; 258 259 G4cout << " computed theta0 (Highland formula) = " 260 << ComputeMscHighland()/mrad << " mrad" << G4endl; 254 G4cout << "\n MultipleScattering:" 255 << "\n rms proj angle of transmit primary particle = " 256 << rmsMsc/mrad << " mrad (central part only)" << G4endl; 257 258 G4cout << " computed theta0 (Highland formula) = " 259 << ComputeMscHighland()/mrad << " mrad" << G4endl; 261 260 262 G4cout << " central part defined as +- " 263 << MscThetaCentral/mrad << " mrad; " 264 << " Tail ratio = " << tailMsc << " %" << G4endl; 265 } 261 G4cout << " central part defined as +- " 262 << MscThetaCentral/mrad << " mrad; " 263 << " Tail ratio = " << tailMsc << " %" << G4endl; 266 264 267 265 G4cout.precision(prec); 268 266 267 // normalize histograms 268 // 269 G4int ih = 1; 270 G4double binWidth = histoManager->GetBinWidth(ih); 271 G4double unit = histoManager->GetHistoUnit(ih); 272 G4double fac = unit/(TotNbofEvents*binWidth); 273 histoManager->Scale(ih,fac); 274 275 ih = 10; 276 binWidth = histoManager->GetBinWidth(ih); 277 unit = histoManager->GetHistoUnit(ih); 278 fac = unit/(TotNbofEvents*binWidth); 279 histoManager->Scale(ih,fac); 280 281 // save histograms 269 282 histoManager->save(); 270 283 -
trunk/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: StackingAction.cc,v 1. 7 2006/09/25 17:06:29maire Exp $27 // GEANT4 tag $Name: $26 // $Id: StackingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 79 79 //stack or delete secondaries 80 80 G4ClassificationOfNewTrack status = fUrgent; 81 if (killSecondary) 82 {if (killSecondary == 1) eventaction->AddEnergy(energy); 83 status = fKill;} 81 if (killSecondary) { 82 if (killSecondary == 1) { 83 eventaction->AddEnergy(energy); 84 } 85 status = fKill; 86 } 84 87 85 88 return status; -
trunk/examples/extended/electromagnetic/TestEm5/src/StackingMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StackingMessenger.cc,v 1.5 2006/09/25 17:06:29 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.2 2006/06/29 16:56:21 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:56:23 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 7 2006/06/29 16:56:25 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: SteppingAction.cc,v 1.8 2009/03/06 18:04:23 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 57 57 if (aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume() 58 58 != detector->GetAbsorber()) return; 59 59 60 60 eventaction->AddEnergy (aStep->GetTotalEnergyDeposit()); 61 61 … … 67 67 eventaction->AddTrakLenNeutr(aStep->GetStepLength()); 68 68 eventaction->CountStepsNeutr(); 69 } 69 } 70 70 } 71 71 -
trunk/examples/extended/electromagnetic/TestEm5/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:56:27 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm5/src/TrackingAction.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: TrackingAction.cc,v 1.1 6 2007/11/28 12:37:57maire Exp $28 // GEANT4 tag $Name: $27 // $Id: TrackingAction.cc,v 1.18 2008/08/28 15:28:04 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 65 65 { 66 66 G4ThreeVector position = aTrack->GetPosition(); 67 G4double charge = aTrack->GetDefinition()->GetPDGCharge(); 67 G4ThreeVector vertex = aTrack->GetVertexPosition(); 68 G4double charge = aTrack->GetDefinition()->GetPDGCharge(); 68 69 69 G4bool transmit = ( position.x() >= xendAbs);70 G4bool reflect = (position.x() <= xstartAbs);70 G4bool transmit = ((position.x() >= xendAbs) && (vertex.x() < xendAbs)); 71 G4bool reflect = (position.x() <= xstartAbs); 71 72 G4bool notabsor = (transmit || reflect); 72 73 … … 82 83 //histograms 83 84 // 84 G4int id = 0;85 85 G4bool charged = (charge != 0.); 86 86 G4bool neutral = !charged; … … 88 88 //energy spectrum at exit 89 89 // 90 G4int id = 0; 90 91 if (transmit && charged) id = 10; 91 92 else if (transmit && neutral) id = 20; 92 93 else if (reflect && charged) id = 30; 93 94 else if (reflect && neutral) id = 40; 94 95 96 if (id>0) 95 97 histoManager->FillHisto(id, aTrack->GetKineticEnergy()); 96 98 … … 108 110 //space angle distribution at exit : dN/dOmega 109 111 // 112 G4ThreeVector direction = aTrack->GetMomentumDirection(); 113 id = 0; 110 114 if (transmit && charged) id = 12; 111 115 else if (transmit && neutral) id = 22; … … 113 117 else if (reflect && neutral) id = 42; 114 118 115 G4ThreeVector direction = aTrack->GetMomentumDirection(); 116 if (histoManager->HistoExist(id)) { 119 if (id>0) { 117 120 G4double theta = std::acos(direction.x()); 118 121 G4double dteta = histoManager->GetBinWidth(id); … … 124 127 //energy fluence at exit : dE(MeV)/dOmega 125 128 // 129 id = 0; 126 130 if (transmit && charged) id = 11; 127 131 else if (transmit && neutral) id = 21; … … 129 133 else if (reflect && neutral) id = 41; 130 134 131 if ( histoManager->HistoExist(id)) {135 if (id>0) { 132 136 G4double theta = std::acos(direction.x()); 133 137 G4double dteta = histoManager->GetBinWidth(id); … … 140 144 //projected angles distribution at exit 141 145 // 146 id = 0; 142 147 if (transmit && charged) id = 13; 143 148 else if (transmit && neutral) id = 23; … … 157 162 //projected position and radius at exit 158 163 // 164 id = 0; 159 165 if (transmit && charged) id = 14; 160 166 -
trunk/examples/extended/electromagnetic/TestEm5/tramu.mac
r807 r1230 1 # $Id: tramu.mac,v 1. 7 2007/07/31 16:51:29maire Exp $1 # $Id: tramu.mac,v 1.13 2008/10/31 11:36:46 maire Exp $ 2 2 # 3 3 # macro file for TestEm5.cc … … 14 14 /testem/det/setAbsYZ 3 m 15 15 # 16 ##/testem/phys/addPhysics g4v5217 #18 16 /testem/phys/setCuts 1 mm 19 17 # … … 24 22 /gun/energy 1 TeV 25 23 # 26 /testem/histo/setFileName tramu 27 /testem/histo/setFileType hbook28 /testem/histo/setHisto 10 50 950 1000 GeV #energy at exit24 /testem/histo/setFileName tramu/tramu 25 /testem/histo/setFileType root 26 /testem/histo/setHisto 10 100 950 1000 GeV #energy at exit 29 27 # 30 28 /testem/stack/killSecondaries 31 29 # 32 /testem/event/printModulo 1000 33 /run/beamOn 10000 30 /testem/event/printModulo 10000 31 # 32 /run/beamOn 100000 -
trunk/examples/extended/electromagnetic/TestEm6/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1.1 3 2006/10/20 16:47:47 maire Exp $1 # $Id: GNUmakefile,v 1.14 2008/09/18 16:42:07 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm6/TestEm6.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm6.cc,v 1.15 2006/06/29 16:56:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.3 2006/06/29 16:56:34 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.4 2006/06/29 16:56:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.3 2006/06/29 16:56:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:56:43 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsList.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsList.hh,v 1.7 2006/06/29 16:56:45 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.5 2006/06/29 16:56:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:56:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:56:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/RunAction.hh
r807 r1230 25 25 // 26 26 // $Id: RunAction.hh,v 1.9 2006/06/29 16:56:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.4 2006/06/29 16:56:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.3 2006/06/29 16:56:58 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // This class manages the verbose outputs in G4SteppingManager. -
trunk/examples/extended/electromagnetic/TestEm6/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.cc,v 1.10 2006/06/29 16:57:00 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.5 2006/06/29 16:57:02 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.6 2006/06/29 16:57:04 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.6 2006/06/29 16:57:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1.1 2 2006/06/29 16:57:09 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.cc,v 1.13 2009/05/13 17:25:33 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 190 190 // to make the process of e+e- annihilation more visible, 191 191 // do not enable the other standard processes: 192 //pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);193 //pmanager->AddProcess(new G4eIonisation, -1, 2,2);194 //pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);195 //pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);192 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 193 pmanager->AddProcess(new G4eIonisation, -1, 2,2); 194 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); 195 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); 196 196 197 197 theAnnihiToMuPairProcess = new G4AnnihiToMuPair(); … … 230 230 G4EmProcessOptions opt; 231 231 opt.SetVerbose(1); 232 opt.SetMinEnergy(100*eV); 233 opt.SetMaxEnergy(1000*TeV); 234 opt.SetDEDXBinning(13*7); 235 opt.SetLambdaBinning(13*7); 232 236 } 233 237 -
trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.8 2006/06/29 16:57:11 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 16:57:14 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 16:57:17 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.1 2 2006/06/29 16:57:20 gunterExp $27 // GEANT4 tag $Name: $26 // $Id: RunAction.cc,v 1.13 2008/09/18 16:42:07 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 59 59 G4bool readOnly = false; 60 60 G4bool createNew = true; 61 G4String options = "--noErrors uncompress";62 tree = tf->create("testem6.hbook","hbook",readOnly,createNew,options);63 //tree = tf->create("testem6.root", "root",readOnly,createNew,options);61 G4String options = "--noErrors export=root uncompress"; 62 //tree = tf->create("testem6.hbook","hbook",readOnly,createNew,options); 63 tree = tf->create("testem6.root", "root",readOnly,createNew,options); 64 64 //tree = tf->create("testem6.XML" ,"XML" ,readOnly,createNew,options); 65 65 delete tf; -
trunk/examples/extended/electromagnetic/TestEm6/src/SteppingAction.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.9 2006/06/29 16:57:23 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm6/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.5 2006/06/29 16:57:25 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 9 2007/06/22 12:44:42 maireExp $1 # $Id: GNUmakefile,v 1.11 2008/09/21 16:03:10 vnivanch Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 17 17 #### G4ANALYSIS_USE := true 18 18 19 ifdef G4ANALYSIS_USE20 CPPFLAGS += -DG4ANALYSIS_USE21 endif22 23 19 include $(G4INSTALL)/config/architecture.gmk 24 25 ifdef G4ANALYSIS_USE26 # for the aida-config command see the README file27 CPPFLAGS += `aida-config --include`28 LOADLIBS += `aida-config --lib`29 endif30 20 31 21 include $(G4INSTALL)/config/binmake.gmk … … 36 26 37 27 histclean: 38 rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/ RunAction.o28 rm ${G4WORKDIR}/tmp/${G4SYSTEM}/${G4TARGET}/Histo.o -
trunk/examples/extended/electromagnetic/TestEm7/TestEm7.cc
r807 r1230 25 25 // 26 26 // $Id: TestEm7.cc,v 1.8 2007/06/22 12:44:42 maire Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:57:29 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/DetectorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:57:31 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/EventAction.hh
r807 r1230 25 25 // 26 26 // $Id: EventAction.hh,v 1.2 2006/06/29 16:57:34 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:57:36 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/G4ScreenedNuclearRecoil.hh
r807 r1230 25 25 // 26 26 // 27 // $Id: G4ScreenedNuclearRecoil.hh,v 1.3 2007/12/07 17:51:10 vnivanch Exp $28 // GEANT4 tag $Name: $27 // G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp 28 // GEANT4 tag 29 29 // 30 30 // … … 45 45 // 46 46 // First version, April 2004, Marcus H. Mendenhall, Vanderbilt University 47 // May 1, 2008 -- Added code to allow process to have zero cross section above max energy, to coordinate with G4MSC. -- mhm 47 48 // 48 49 // Class Description - End … … 54 55 #include "globals.hh" 55 56 #include "G4VDiscreteProcess.hh" 57 #include "G4ParticleChange.hh" 56 58 #include "c2_function.hh" 57 59 … … 59 61 #include <vector> 60 62 61 class G4VParticleChange; 63 class G4VNIELPartition; 64 65 typedef c2_const_ptr<G4double> G4_c2_const_ptr; 66 typedef c2_ptr<G4double> G4_c2_ptr; 67 typedef c2_function<G4double> G4_c2_function; 62 68 63 69 typedef struct G4ScreeningTables { 64 70 G4double z1, z2, m1, m2, au, emin; 65 c2_function<G4double> *EMphiData;71 G4_c2_const_ptr EMphiData; 66 72 } G4ScreeningTables; 67 73 … … 70 76 { 71 77 public: 72 G4ScreenedCoulombCrossSectionInfo() { } 73 ~G4ScreenedCoulombCrossSectionInfo() { } 74 75 const char *CVSHeaderVers() { return 76 ""; 77 } 78 79 const char *CVSFileVers() { return ""; } 78 G4ScreenedCoulombCrossSectionInfo() { } 79 ~G4ScreenedCoulombCrossSectionInfo() { } 80 81 static const char* CVSHeaderVers() { return 82 "G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp GEANT4 tag "; 83 } 84 static const char* CVSFileVers(); 80 85 }; 81 86 … … 114 119 115 120 // get the mean-free-path table for the indexed material 116 c 2_function<G4double>* operator [] (G4int materialIndex) {117 return MFPTables.find(materialIndex)!=MFPTables.end() ? MFPTables[materialIndex] : (c2_function<G4double>*)0;121 const G4_c2_function * operator [] (G4int materialIndex) { 122 return MFPTables.find(materialIndex)!=MFPTables.end() ? &(MFPTables[materialIndex].get()) : (G4_c2_function *)0; 118 123 } 119 124 … … 122 127 ParticleCache targetMap; 123 128 G4int verbosity; 124 std::map<G4int, c2_function<G4double> *> sigmaMap; // total cross section for each element125 std::map<G4int, c2_function<G4double> *> MFPTables; // MFP for each material129 std::map<G4int, G4_c2_const_ptr > sigmaMap; // total cross section for each element 130 std::map<G4int, G4_c2_const_ptr > MFPTables; // MFP for each material 126 131 127 132 private: … … 134 139 G4ScreenedCoulombCrossSection *crossSection; 135 140 G4double a1, a2, sinTheta, cosTheta, sinZeta, cosZeta, eRecoil; 136 G4ParticleDefinition *recoilIon; } G4CoulombKinematicsInfo; 141 G4ParticleDefinition *recoilIon; 142 const G4Material *targetMaterial; 143 } G4CoulombKinematicsInfo; 137 144 138 145 class G4ScreenedCollisionStage { … … 146 153 147 154 public: 148 G4ScreenedCoulombClassicalKinematics() { }155 G4ScreenedCoulombClassicalKinematics(); 149 156 virtual void DoCollisionStep(class G4ScreenedNuclearRecoil *master, 150 157 const class G4Track& aTrack, const class G4Step& aStep); … … 153 160 const G4ScreeningTables *screen, 154 161 G4double eps, G4double beta); 155 virtual ~G4ScreenedCoulombClassicalKinematics() {} 162 virtual ~G4ScreenedCoulombClassicalKinematics() { } 163 protected: 164 // the c2_functions we need to do the work. 165 c2_const_plugin_function_p<G4double> &phifunc; 166 c2_linear_p<G4double> &xovereps; 167 G4_c2_ptr diff; 168 156 169 }; 157 170 … … 165 178 }; 166 179 180 /** 181 \brief A process which handles screened Coulomb collisions between nuclei 182 183 */ 184 167 185 class G4ScreenedNuclearRecoil : public G4ScreenedCoulombCrossSectionInfo, public G4VDiscreteProcess 168 186 { … … 171 189 friend class G4ScreenedCollisionStage; 172 190 191 /// \brief Construct the process and set some physics parameters for it. 192 /// \param processName the name to assign the process 193 /// \param ScreeningKey the name of a screening function to use. 194 /// The default functions are "zbl" (recommended for soft scattering), 195 /// "lj" (recommended for backscattering) and "mol" (Moliere potential) 196 /// \param GenerateRecoils if frue, ions struck by primary are converted into new moving particles. 197 /// If false, energy is deposited, but no new moving ions are created. 198 /// \param RecoilCutoff energy below which no new moving particles will be created, 199 /// even if \a GenerateRecoils is true. 200 /// Also, a moving primary particle will be stopped if its energy falls below this limit. 201 /// \param PhysicsCutoff the energy transfer to which screening tables are calucalted. 202 /// There is no really 203 /// compelling reason to change it from the 10.0 eV default. However, see the paper on running this 204 /// in thin targets for further discussion, and its interaction with SetMFPScaling() 173 205 G4ScreenedNuclearRecoil(const G4String& processName = "ScreenedElastic", 174 206 const G4String &ScreeningKey="zbl", G4bool GenerateRecoils=1, 175 207 G4double RecoilCutoff=100.0*eV, G4double PhysicsCutoff=10.0*eV); 176 208 /// \brief destructor 177 209 virtual ~G4ScreenedNuclearRecoil(); 178 210 /// \brief used internally by Geant4 machinery 179 211 virtual G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition* ); 180 212 /// \brief used internally by Geant4 machinery 181 213 virtual G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep); 182 214 /// \brief test if a prticle of type \a aParticleType can use this process 215 /// \param aParticleType the particle to test 183 216 virtual G4bool IsApplicable(const G4ParticleDefinition& aParticleType); 184 217 /// \brief Build physics tables in advance. Not Implemented. 218 /// \param aParticleType the type of particle to build tables for 185 219 virtual void BuildPhysicsTable(const G4ParticleDefinition&) { } 186 220 /// \brief Export physics tables for persistency. Not Implemented. 221 /// \param aParticleType the type of particle to build tables for 187 222 virtual void DumpPhysicsTable(const G4ParticleDefinition& aParticleType); 188 223 /// \brief deterine if the moving particle is within the strong force range of the selected nucleus 224 /// \param A the nucleon number of the beam 225 /// \param A1 the nucleon number of the target 226 /// \param apsis the distance of closest approach 189 227 virtual G4bool CheckNuclearCollision(G4double A, G4double A1, G4double apsis); // return true if hard collision 190 228 191 229 virtual G4ScreenedCoulombCrossSection *GetNewCrossSectionHandler(void); 192 230 193 G4double GetNIEL() const { return NIEL; } // Get non-ionizing energy loss for last step 194 231 /// \brief Get non-ionizing energy loss for last step 232 G4double GetNIEL() const { return NIEL; } 233 234 /// \brief clear precomputed screening tables 195 235 void ResetTables(); // clear all data tables to allow changing energy cutoff, materials, etc. 196 236 237 /// \brief set the upper energy beyond which this process has no cross section 238 /// 239 /// This funciton is used to coordinate this process with G4MSC. Typically, G4MSC should 240 /// not be allowed to operate in a range which overlaps that of this process. The criterion which is most reasonable 241 /// is that the transition should be somewhere in the modestly relativistic regime (500 MeV/u for example). 242 /// \param energy energy per nucleon for the cutoff 243 void SetMaxEnergyForScattering(G4double energy) { processMaxEnergy=energy; } 244 /// \brief find out what screening funciton we are using 197 245 std::string GetScreeningKey() const { return screeningKey; } 246 /// \brief enable or disable all energy deposition by this process 247 /// \param flag if true, enable deposition of energy (the default). If false, disable deposition. 198 248 void AllowEnergyDeposition(G4bool flag) { registerDepositedEnergy=flag; } 249 /// \brief get flag indicating whether deposition is enabled 199 250 G4bool GetAllowEnergyDeposition() const { return registerDepositedEnergy; } 251 /// \brief enable or disable the generation of recoils. 252 /// If recoils are disabled, the energy they would have received is just deposited. 253 /// \param flag if true, create recoil ions in cases in which the energy is above the recoilCutoff. 254 /// If false, just deposit the energy. 200 255 void EnableRecoils(G4bool flag) { generateRecoils=flag; } 256 /// \brief find out if generation of recoils is enabled. 201 257 G4bool GetEnableRecoils() const { return generateRecoils; } 258 /// \brief set the mean free path scaling as specified 259 /// \param scale the factor by which the default MFP will be scaled. 260 /// Set to less than 1 for very thin films, typically, to sample multiple scattering, 261 /// or to greater than 1 for quick simulaitons with a very long flight path. 202 262 void SetMFPScaling(G4double scale) { MFPScale=scale; } 263 /// \brief get the MFPScaling parameter 203 264 G4double GetMFPScaling() const { return MFPScale; } 265 /// \brief enable or disable whether this process will skip collisions 266 /// which are close enough they need hadronic phsyics. Default is true (skip close collisions). 267 /// Disabling this results in excess nuclear stopping power. 268 /// \param flag true results in hard collisions being skipped. false allows hard collisions. 204 269 void AvoidNuclearReactions(G4bool flag) { avoidReactions=flag; } 270 /// \brief get the flag indicating whether hadronic collisions are ignored. 205 271 G4bool GetAvoidNuclearReactions() const { return avoidReactions; } 272 /// \brief set the minimum energy (per nucleon) at which recoils can be generated, 273 /// and the energy (per nucleon) below which all ions are stopped. 274 /// \param energy energy per nucleon 206 275 void SetRecoilCutoff(G4double energy) { recoilCutoff=energy; } 276 /// \brief get the recoil cutoff 207 277 G4double GetRecoilCutoff() const { return recoilCutoff; } 278 /// \brief set the energy to which screening tables are computed. Typically, this is 10 eV or so, and not often changed. 279 /// \param energy the cutoff energy 208 280 void SetPhysicsCutoff(G4double energy) { physicsCutoff=energy; ResetTables(); } 281 /// \brief get the physics cutoff energy. 209 282 G4double GetPhysicsCutoff() const { return physicsCutoff; } 210 class G4ParticleChange &GetParticleChange() { return aParticleChange; } 211 void AddToNIEL(G4double energy) { NIEL+=energy; } 283 /// \brief set the pointer to a class for paritioning energy into NIEL 284 /// \brief part the pointer to the class. 285 void SetNIELPartitionFunction(const G4VNIELPartition *part); 286 /// \brief set the cross section boost to provide faster computation of backscattering 287 /// \param fraction the fraction of particles to have their cross section boosted. 288 /// \param HardeningFactor the factor by which to boost the scattering cross section. 212 289 void SetCrossSectionHardening(G4double fraction, G4double HardeningFactor) { 213 290 hardeningFraction=fraction; 214 291 hardeningFactor=HardeningFactor; 215 292 } 293 /// \brief get the fraction of particles which will have boosted scattering 216 294 G4double GetHardeningFraction() const { return hardeningFraction; } 295 /// \brief get the boost factor in use. 217 296 G4double GetHardeningFactor() const { return hardeningFactor; } 297 /// \brief the the interaciton length used in the last scattering. 218 298 G4double GetCurrentInteractionLength() const { return currentInteractionLength; } 299 /// \brief set a function to compute screening tables, if the user needs non-standard behavior. 300 /// \param cs a class which constructs the screening tables. 219 301 void SetExternalCrossSectionHandler(G4ScreenedCoulombCrossSection *cs) { 220 302 externalCrossSectionConstructor=cs; 221 303 } 304 /// \brief get the verbosity. 222 305 G4int GetVerboseLevel() const { return verboseLevel; } 306 223 307 std::map<G4int, G4ScreenedCoulombCrossSection*> &GetCrossSectionHandlers() 224 308 { return crossSectionHandlers; } … … 228 312 void SetValidCollision(G4bool flag) { validCollision=flag; } 229 313 G4bool GetValidCollision() const { return validCollision; } 314 315 /// \brief get the pointer to our ParticleChange object. for internal use, primarily. 316 class G4ParticleChange &GetParticleChange() { return static_cast<G4ParticleChange &>(*pParticleChange); } 317 /// \brief take the given energy, and use the material information to partition it into NIEL and ionizing energy. 318 void DepositEnergy(G4int z1, G4double a1, const G4Material *material, G4double energy); 230 319 231 320 protected: 232 G4double highEnergyLimit, lowEnergyLimit; 321 /// \brief the energy per nucleon above which the MFP is constant 322 G4double highEnergyLimit; 323 /// \brief the energy per nucleon below which the MFP is zero 324 G4double lowEnergyLimit; 325 /// \brief the energy per nucleon beyond which the cross section is zero, to cross over to G4MSC 326 G4double processMaxEnergy; 233 327 G4String screeningKey; 234 328 G4bool generateRecoils, avoidReactions; 235 329 G4double recoilCutoff, physicsCutoff; 236 330 G4bool registerDepositedEnergy; 237 G4double NIEL;331 G4double IonizingLoss, NIEL; 238 332 G4double MFPScale; 239 333 G4double hardeningFraction, hardeningFactor; … … 243 337 244 338 std::map<G4int, G4ScreenedCoulombCrossSection*> crossSectionHandlers; 245 std::map<G4int, c2_function<G4double>*> meanFreePathTables;246 339 247 340 G4bool validCollision; 248 341 G4CoulombKinematicsInfo kinematics; 249 342 const G4VNIELPartition *NIELPartitionFunction; 250 343 }; 251 344 … … 268 361 std::vector<G4String> GetScreeningKeys() const; 269 362 270 typedef c2_function<G4double>&(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au);363 typedef G4_c2_function &(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au); 271 364 272 365 void AddScreeningFunction(G4String name, ScreeningFunc fn) { … … 279 372 }; 280 373 281 374 G4_c2_function &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval); 375 G4_c2_function &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval); 376 G4_c2_function &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval); 377 G4_c2_function &LJZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval); 282 378 283 379 #endif -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmLivermore.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmLivermore.hh,v 1.1 2006/11/22 18:56:20 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmPenelope.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmPenelope.hh,v 1.1 2006/11/22 18:56:21 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 16:57:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardNR.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandardNR.hh,v 1.1 2008/01/14 12:11:38 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysListEmStandardSS.hh
r807 r1230 25 25 // 26 26 // $Id: PhysListEmStandardSS.hh,v 1.1 2006/10/24 11:37:56 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsList.hh
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.hh,v 1. 6 2006/11/22 18:56:21vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.hh,v 1.8 2008/11/20 20:34:50 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 40 40 #include "G4VModularPhysicsList.hh" 41 #include "G4EmConfigurator.hh" 41 42 #include "globals.hh" 42 43 … … 50 51 { 51 52 public: 53 52 54 PhysicsList(); 53 55 virtual ~PhysicsList(); … … 67 69 68 70 private: 71 72 G4EmConfigurator em_config; 73 69 74 G4double cutForGamma; 70 75 G4double cutForElectron; … … 77 82 G4String emName; 78 83 G4VPhysicsConstructor* emPhysicsList; 84 G4VPhysicsConstructor* decPhysicsList; 79 85 std::vector<G4VPhysicsConstructor*> hadronPhys; 80 86 -
trunk/examples/extended/electromagnetic/TestEm7/include/PhysicsListMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:57:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorAction.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:57:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/PrimaryGeneratorMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:57:56 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/RunAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.hh,v 1.1 2 2008/01/14 12:11:39vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.hh,v 1.14 2008/08/22 18:30:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 40 40 class PrimaryGeneratorAction; 41 41 class G4Run; 42 43 namespace AIDA { 44 class IAnalysisFactory; 45 class ITree; 46 class IHistogram1D; 47 } 42 class Histo; 48 43 49 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 52 47 { 53 48 public: 54 RunAction(DetectorConstruction*, PhysicsList*,PrimaryGeneratorAction*); 49 RunAction(DetectorConstruction*, PhysicsList*, 50 PrimaryGeneratorAction*); 55 51 virtual ~RunAction(); 56 52 … … 58 54 void EndOfRunAction(const G4Run*); 59 55 60 void FillTallyEdep(G4int n, G4double e) {tallyEdep[n] += e;};56 void FillTallyEdep(G4int n, G4double e) {tallyEdep[n] += e;}; 61 57 void FillEdep(G4double de, G4double eni) {edeptot += de; eniel += eni;}; 62 58 63 59 G4double GetBinLength() {return binLength;}; 64 60 G4double GetLength() {return length;}; 65 G4double GetOffsetX() {return offsetX;} 66 void FillHisto(G4int id, G4double x, G4double weight = 1.0); 61 G4double GetOffsetX() {return offsetX;} 62 63 void FillHisto(G4int id, G4double x, G4double weight = 1.0); 67 64 68 void AddProjRange (G4double x) {projRange += x; projRange2 += x*x;}; 65 void AddProjRange (G4double x) 66 {projRange += x; projRange2 += x*x; nRange++;}; 69 67 void AddPrimaryStep() {nPrimarySteps++;}; 70 68 71 69 private: 72 void bookHisto();73 void cleanHisto();74 70 75 private:76 71 DetectorConstruction* detector; 77 72 PhysicsList* physics; … … 84 79 G4double edeptot, eniel; 85 80 G4int nPrimarySteps; 86 87 AIDA::IAnalysisFactory* af; 88 AIDA::ITree* tree; 89 AIDA::IHistogram1D* histo[1]; 81 G4int nRange; 82 83 Histo* histo; 90 84 }; 91 85 -
trunk/examples/extended/electromagnetic/TestEm7/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.3 2006/06/29 16:58:01 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:58:03 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/SteppingAction.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingAction.hh,v 1.2 2006/06/29 16:58:05 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/SteppingVerbose.hh
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:58:07 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/TrackingAction.hh
r807 r1230 25 25 // 26 26 // $Id: TrackingAction.hh,v 1.2 2006/06/29 16:58:09 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.hh
r807 r1230 1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 1 27 /** 2 28 * \file … … 7 33 * \author Copyright 2005 __Vanderbilt University__. All rights reserved. 8 34 * 9 * \version c2_function.hh,v 1.53 2007/11/12 13:58:57 marcus Exp 35 * \version c2_function.hh,v 1.238 2008/05/22 12:45:19 marcus Exp 36 * \see \ref c2_factory "Factory Functions" for information on constructing things in here 10 37 */ 11 38 12 #ifndef __has_C2Functions_c2_h 13 #define __has_C2Functions_c2_h 1 39 #ifndef __has_c2_function_hh 40 #define __has_c2_function_hh 1 41 42 // MSVC does not automatically define numerical constants such as M_PI without this. 43 // this came from the msdn website, so it should be right... 44 #ifdef _MSC_VER 45 #define _USE_MATH_DEFINES 46 #define c2_isnan _isnan 47 #define c2_isfinite _finite 48 #else 49 #define c2_isnan std::isnan 50 #define c2_isfinite std::isfinite 51 #endif 14 52 15 53 #include <cmath> 16 54 #include <vector> 55 #include <utility> 17 56 #include <string> 57 #include <stdexcept> 58 #include <typeinfo> 59 #include <sstream> 18 60 19 61 /// \brief the exception class for c2_function operations. … … 32 74 33 75 // put these forward references here, and with a bogus typename to make swig happy. 34 template <typename float_type> class c2_composed_function; 35 template <typename float_type> class c2_sum; 36 template <typename float_type> class c2_diff; 37 template <typename float_type> class c2_product; 38 template <typename float_type> class c2_ratio; 76 template <typename float_type> class c2_composed_function_p; 77 template <typename float_type> class c2_sum_p; 78 template <typename float_type> class c2_diff_p; 79 template <typename float_type> class c2_product_p; 80 template <typename float_type> class c2_ratio_p; 81 template <typename float_type> class c2_piecewise_function_p; 82 template <typename float_type> class c2_quadratic_p; 83 template <typename float_type> class c2_ptr; 84 /** 85 \defgroup abstract_classes Abstract Classes 86 \defgroup arithmetic_functions Arithmetic Functions 87 \defgroup math_functions Mathemetical Functions 88 \defgroup parametric_functions Parametric Families of Functions 89 \defgroup interpolators Interpolating Functions 90 \defgroup containers Functions which are containers for, or functions of, other functions 91 \defgroup factories Factory classes which reduce silly template typing 92 \defgroup transforms Classes which provide coordinate system transformations, wih derivatives 93 */ 94 95 /// \brief structure used to hold evaluated function data at a point. 96 /// 97 /// Contains all the information for the function at one point. 98 template <typename float_type> class c2_fblock 99 { 100 public: 101 /// \brief the abscissa 102 float_type x; 103 /// \brief the value of the function at \a x 104 float_type y; 105 /// \brief the derivative at \a x 106 float_type yp; 107 /// \brief the second derivative at \a x 108 float_type ypp; 109 /// flag, filled in by c2_function::fill_fblock(), indicating the derivative is NaN of Inf 110 bool ypbad; 111 /// flag, filled in by c2_function::fill_fblock(), indicating the second derivative is NaN of Inf 112 bool yppbad; 113 }; 39 114 40 115 /** 41 116 \brief the parent class for all c2_functions. 42 117 \ingroup abstract_classes 43 118 c2_functions know their value, first, and second derivative at almost every point. 44 119 They can be efficiently combined with binary operators, via c2_binary_function, 45 composed via c2_composed_function ,120 composed via c2_composed_function_, 46 121 have their roots found via find_root(), 47 122 and be adaptively integrated via partial_integrals() or integral(). … … 53 128 log_log_interpolating_function, and arrhenius_interpolating_function, 54 129 as well as the template functions 55 inverse_integrated_density ().130 inverse_integrated_density_function(). 56 131 57 \warning 58 The composite flavors of c2_functions (c2_sum, c2_composed_function, c2_binary_function, e.g.) make no effort to manage 59 deletion of their component functions. 60 These are just container classes, and the user (along with normal automatic variable semantics) 61 is responsible for the lifetime of components. 62 Inappropriate attention to this can cause massive memory leaks. 63 However, in most cases these do exactly what is intended. 64 The classes will be left this way since the only other option is to use copy constructors on everything, 65 which would make this all very slow. 132 For a discussion of memory management, see \ref memory_management 66 133 67 134 */ … … 71 138 /// \return the CVS Id string 72 139 const std::string cvs_header_vers() const { return 73 "c2_function.hh,v 1. 53 2007/11/12 13:58:57marcus Exp";140 "c2_function.hh,v 1.238 2008/05/22 12:45:19 marcus Exp"; 74 141 } 75 142 … … 80 147 public: 81 148 /// \brief destructor 82 virtual ~c2_function() { if(sampling_grid && !no_overwrite_grid) delete sampling_grid; } 149 virtual ~c2_function() { 150 if(sampling_grid && !no_overwrite_grid) delete sampling_grid; 151 if(root_info) delete root_info; 152 if(owner_count) { 153 std::ostringstream outstr; 154 outstr << "attempt to delete an object with non-zero ownership in class "; 155 outstr << typeid(*this).name() << std::endl; 156 throw c2_exception(outstr.str().c_str()); 157 } 158 } 83 159 84 160 /// \brief get the value and derivatives. … … 97 173 inline float_type operator () (float_type x) const throw(c2_exception) 98 174 { return value_with_derivatives(x, (float_type *)0, (float_type *)0); } 99 100 /// \brief compose this function outside another.101 /// \param inner the inner function102 /// \return the composed function103 c2_composed_function<float_type> & operator ()(const c2_function<float_type> &inner) const104 { return *new c2_composed_function<float_type>((*this), inner); }105 175 106 176 /// \brief get the value and derivatives. … … 130 200 /// \param[out] final_yprime2 If pointer is not zero, return second derivative of function at root 131 201 /// \return the position of the root. 202 /// \see \ref rootfinder_subsec "Root finding sample" 132 203 float_type find_root(float_type lower_bracket, float_type upper_bracket, float_type start, 133 204 float_type value, int *error=0, … … 151 222 /// with no error checking. 152 223 /// \param extrapolate if true, use simple Richardson extrapolation on the final 2 steps to reduce the error. 153 /// \return sum of partial integrals, wh cih is the definite integral from the first value in \a xgrid to the last.224 /// \return sum of partial integrals, which is the definite integral from the first value in \a xgrid to the last. 154 225 float_type partial_integrals(std::vector<float_type> xgrid, std::vector<float_type> *partials = 0, 155 float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) const; 226 float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) 227 const throw(c2_exception); 156 228 157 229 /// \brief a fully-automated integrator which uses the information provided by the get_sampling_grid() function … … 164 236 /// \param xmax upper bound of the domain for integration 165 237 /// \param partials if non-NULL, a vector in which to receive the partial integrals. 166 /// It will automatically be sized appr propriately, if provided, to contain \a n - 1 elements where \a n is the length of \a xgrid238 /// It will automatically be sized appropriately, if provided, to contain \a n - 1 elements where \a n is the length of \a xgrid 167 239 /// \param abs_tol the absolute error bound for each segment 168 240 /// \param rel_tol the fractional error bound for each segment. … … 173 245 /// with no error checking. 174 246 /// \param extrapolate if true, use simple Richardson extrapolation on the final 2 steps to reduce the error. 175 /// \return sum of partial integrals, wh cih is the definite integral from the first value in \a xgrid to the last.247 /// \return sum of partial integrals, which is the definite integral from the first value in \a xgrid to the last. 176 248 float_type integral(float_type xmin, float_type xmax, std::vector<float_type> *partials = 0, 177 float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) const; 178 249 float_type abs_tol=1e-12, float_type rel_tol=1e-12, int derivs=2, bool adapt=true, bool extrapolate=true) 250 const throw(c2_exception); 251 252 /// \brief create a c2_piecewise_function_p from c2_connector_function_p segments which 253 /// is a representation of the parent function to the specified accuracy, but maybe much cheaper to evaluate 254 /// 255 /// This method has three modes, depending on the \a derivs flag. 256 /// 257 /// If \a derivs is 2, 258 /// it computes a c2_piecewise_function_p representation of its parent function, which may be a much faster 259 /// function to use in codes if the parent function is expensive. If \a xvals and \a yvals are non-null, 260 /// it will also fill them in with the function values at each grid point the adaptive algorithm chooses. 261 /// 262 /// If \a derivs is 1, this does not create the connectors, 263 /// and returns an null pointer, but will fill in the \a xvals and \a yvals 264 /// vectors with values of the function at points such that the linear interpolation error between the points 265 /// is bounded by the tolerance values given. Because it uses derivative information from the function to manage the 266 /// error control, it is almost completely free of issues with missing periods of oscillatory functions, 267 /// even with no information provided in the sampling grid. 268 /// This is typically useful for sampling a function for plotting. 269 /// 270 /// If \a derivs is 0, this does something very like what it does if \a derivs = 1, but without derivatives. 271 /// Instead, to compute the intermediate value of the function for error control, it just uses 272 /// 3-point parabolic interpolation. This is useful amost exclusively for converting a non-c2_function, 273 /// with no derivatives, but wrapped in a c2_classic_function wrapper, into a table of values to seed an interpolating_function_p. 274 /// Note, however, that without derivatives, this is very susceptible to missing periods of oscillatory 275 /// functions, so it is important to set a sampling grid which isn't too much coarser than the typical oscillations. 276 /// 277 /// \note the \a sampling_grid of the returned function matches the \a sampling_grid of its parent. 278 /// \see \ref sample_function_for_plotting "Adaptive Sampling Examples" 279 /// \param xmin lower bound of the domain for sampling 280 /// \param xmax upper bound of the domain for sampling 281 /// \param abs_tol the absolute error bound for each segment 282 /// \param rel_tol the fractional error bound for each segment. 283 /// \param derivs if 0 or 1, return a useless function, but fill in the \a xvals and \a yvals vectors (if non-null). 284 /// Also, if 0 or 1, tolerances refer to linear interpolation, not high-order interpolation. 285 /// If 2, return a full piecewise collection of c2_connector_function_p segments. See discussion above. 286 /// \param [in,out] xvals vector of abscissas at which the function was actually sampled (if non-null) 287 /// \param [in,out] yvals vector of function values corresponding to \a xvals (if non-null) 288 /// \return a new, sampled representation, if \a derivs is 2. A null pointer if \a derivs is 0 or 1. 289 c2_piecewise_function_p<float_type> *adaptively_sample(float_type xmin, float_type xmax, 290 float_type abs_tol=1e-12, float_type rel_tol=1e-12, 291 int derivs=2, std::vector<float_type> *xvals=0, std::vector<float_type> *yvals=0) const throw(c2_exception); 292 179 293 /// \brief return the lower bound of the domain for this function as set by set_domain() 180 294 inline float_type xmin() const { return fXMin; } … … 186 300 /// \brief this is a counter owned by the function but which can be used to monitor efficiency of algorithms. 187 301 /// 188 /// It is not maintained automatically in general! 189 /// The adaptive integrator and root finder do clear it at the start and update it for performance checking. 302 /// It is not maintained automatically in general! The root finder, integrator, and sampler do increment it. 190 303 /// \return number of evaluations logged since last reset. 191 volatile int get_evaluations() const { return evaluations; }304 volatile size_t get_evaluations() const { return evaluations; } 192 305 /// \brief reset the counter 193 306 void reset_evaluations() const { evaluations=0; } // evaluations are 'invisible' to constant … … 200 313 /// \param message an informative string to include in an exception if this throws c2_exception 201 314 /// \return true if in decreasing order, false if increasing 202 bool check_monotonicity(const std::vector<float_type> &data, const char message[]) throw(c2_exception);315 bool check_monotonicity(const std::vector<float_type> &data, const char message[]) const throw(c2_exception); 203 316 204 317 /// \brief establish a grid of 'interesting' points on the function. … … 212 325 virtual void set_sampling_grid(const std::vector<float_type> &grid) throw(c2_exception); 213 326 327 /// \brief get the sampling grid, which may be a null pointer 328 /// \return pointer to the sampling grid 329 std::vector<float_type> *get_sampling_grid_pointer() const { return sampling_grid; } 330 214 331 /// \brief return the grid of 'interesting' points along this function which lie in the region requested 215 332 /// … … 217 334 /// \param xmin the lower bound for which the function is to be sampled 218 335 /// \param xmax the upper bound for which the function is to be sampled 219 /// \ return a newvector containing the samplng grid.220 virtual std::vector<float_type> &get_sampling_grid(float_type xmin, float_type xmax) const ;336 /// \param [in,out] grid filled vector containing the samplng grid. 337 virtual void get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const ; 221 338 222 339 /// \brief clean up endpoints on a grid of points 223 ///224 340 /// \param[in,out] result the sampling grid with excessively closely space endpoints removed. 225 341 /// The grid is modified in place. 226 342 void preen_sampling_grid(std::vector<float_type> *result) const; 227 343 /// \brief refine a grid by splitting each interval into more intervals 228 /// \param grid the grid to refine344 /// \param [in,out] grid the grid to refine in place 229 345 /// \param refinement the number of new steps for each old step 230 /// \return a new sampling grid with more points. 231 std::vector<float_type> & refine_sampling_grid(const std::vector<float_type> &grid, size_t refinement) const; 346 void refine_sampling_grid(std::vector<float_type> &grid, size_t refinement) const; 232 347 233 348 /// \brief create a new c2_function from this one which is normalized on the interval … … 236 351 /// \param norm the desired integral for the function over the region 237 352 /// \return a new c2_function with the desired \a norm. 238 c2_function<float_type> &normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) ;353 c2_function<float_type> &normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) const throw(c2_exception); 239 354 /// \brief create a new c2_function from this one which is square-normalized on the interval 240 355 /// \param xmin lower bound of the domain for integration … … 242 357 /// \param norm the desired integral for the function over the region 243 358 /// \return a new c2_function with the desired \a norm. 244 c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) ;359 c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, float_type norm=1.0) const throw(c2_exception); 245 360 /// \brief create a new c2_function from this one which is square-normalized with the provided \a weight on the interval 246 361 /// \param xmin lower bound of the domain for integration … … 249 364 /// \param norm the desired integral for the function over the region 250 365 /// \return a new c2_function with the desired \a norm. 251 c2_function<float_type> &square_normalized_function(float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm=1.0); 252 253 /// \brief factory function to create a c2_sum from an regular algebraic expression. 254 /// \note 255 /// be very wary of ownership issues if this is used in a complex expression. 256 c2_sum<float_type> &operator + (const c2_function<float_type> &rhs) { return *new c2_sum<float_type>(*this, rhs); } 257 /// \brief factory function to create a c2_diff from an regular algebraic expression. 258 /// \note 259 /// be very wary of ownership issues if this is used in a complex expression. 260 c2_diff<float_type> &operator - (const c2_function<float_type> &rhs) { return *new c2_diff<float_type>(*this, rhs); } 261 /// \brief factory function to create a c2_product from an regular algebraic expression. 262 /// \note 263 /// be very wary of ownership issues if this is used in a complex expression. 264 c2_product<float_type> &operator * (const c2_function<float_type> &rhs) { return *new c2_product<float_type>(*this, rhs); } 265 /// \brief factory function to create a c2_ratio from an regular algebraic expression. 266 /// \note 267 /// be very wary of ownership issues if this is used in a complex expression. 268 c2_ratio<float_type> &operator / (const c2_function<float_type> &rhs) { return *new c2_ratio<float_type>(*this, rhs); } 269 270 271 272 std::vector<float_type> *sampling_grid; 273 bool no_overwrite_grid; 274 366 c2_function<float_type> &square_normalized_function( 367 float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm=1.0) 368 const throw(c2_exception); 369 370 /// \brief factory function to create a c2_sum_p from a regular algebraic expression. 371 /// \param rhs the right-hand term of the sum 372 /// \return a new c2_function 373 c2_sum_p<float_type> &operator + (const c2_function<float_type> &rhs) const 374 { return *new c2_sum_p<float_type>(*this, rhs); } 375 /// \brief factory function to create a c2_diff_p from a regular algebraic expression. 376 /// \param rhs the right-hand term of the difference 377 /// \return a new c2_function 378 c2_diff_p<float_type> &operator - (const c2_function<float_type> &rhs) const 379 { return *new c2_diff_p<float_type>(*this, rhs); } 380 /// \brief factory function to create a c2_product_p from a regular algebraic expression. 381 /// \param rhs the right-hand term of the product 382 /// \return a new c2_function 383 c2_product_p<float_type> &operator * (const c2_function<float_type> &rhs) const 384 { return *new c2_product_p<float_type>(*this, rhs); } 385 /// \brief factory function to create a c2_ratio_p from a regular algebraic expression. 386 /// \param rhs the right-hand term of the ratio (the denominator) 387 /// \return a new c2_function 388 c2_ratio_p<float_type> &operator / (const c2_function<float_type> &rhs) const 389 { return *new c2_ratio_p<float_type>(*this, rhs); } 390 /// \brief compose this function outside another. 391 /// \param inner the inner function 392 /// \return the composed function 393 /// \anchor compose_operator 394 c2_composed_function_p<float_type> & operator ()(const c2_function<float_type> &inner) const 395 { return *new c2_composed_function_p<float_type>((*this), inner); } 396 397 /// \brief Find out where a calculation ran into trouble, if it got a nan. 398 /// If the most recent computation did not return a nan, this is undefined. 399 /// \return \a x value of point at which something went wrong, if integrator (or otherwise) returned a nan. 400 float_type get_trouble_point() const { return bad_x_point; } 401 402 /// \brief increment our reference count. Destruction is only legal if the count is zero. 403 void claim_ownership() const { owner_count++; } 404 /// \brief decrement our reference count. Do not destroy at zero. 405 /// \return final owner count, to check whether object should disappear. 406 size_t release_ownership_for_return() const throw(c2_exception) { 407 if(!owner_count) { 408 std::ostringstream outstr; 409 outstr << "attempt to release ownership of an unowned function in class "; 410 outstr << typeid(*this).name() << std::endl; 411 throw c2_exception(outstr.str().c_str()); 412 } 413 owner_count--; 414 return owner_count; 415 } 416 /// \brief decrement our reference count. If the count reaches zero, destroy ourself. 417 void release_ownership() const throw(c2_exception) { 418 if(!release_ownership_for_return()) delete this; 419 } 420 /// \brief get the reference count, mostly for debugging 421 /// \return the count 422 size_t count_owners() const { return owner_count; } 423 275 424 protected: 276 425 c2_function(const c2_function<float_type> &src) : sampling_grid(0), 277 426 no_overwrite_grid(false), 278 fXMin(src.fXMin), fXMax(src.fXMax), root Initialized(false)427 fXMin(src.fXMin), fXMax(src.fXMax), root_info(0), owner_count(0) 279 428 {} // copy constructor only copies domain, and is only for internal use 280 429 c2_function() : 281 430 sampling_grid(0), no_overwrite_grid(0), 282 431 fXMin(-std::numeric_limits<float_type>::max()), 283 fXMax(std::numeric_limits<float_type>::max()), 284 rootInitialized(false) 432 fXMax(std::numeric_limits<float_type>::max()), root_info(0), owner_count(0) 285 433 {} // prevent accidental naked construction (impossible any since this has pure virtual methods) 286 434 … … 293 441 } 294 442 443 std::vector<float_type> * sampling_grid; 444 bool no_overwrite_grid; 445 295 446 float_type fXMin, fXMax; 296 mutable int evaluations; 297 447 mutable size_t evaluations; 448 /// \brief this point may be used to record where a calculation ran into trouble 449 mutable float_type bad_x_point; 450 public: 451 /// \brief fill in a c2_fblock<float_type>... a shortcut for the integrator & sampler 452 /// \param [in,out] fb the block to fill in with information 453 inline void fill_fblock(c2_fblock<float_type> &fb) const throw(c2_exception) 454 { 455 fb.y=value_with_derivatives(fb.x, &fb.yp, &fb.ypp); 456 fb.ypbad=c2_isnan(fb.yp) || !c2_isfinite(fb.yp); 457 fb.yppbad=c2_isnan(fb.ypp) || !c2_isfinite(fb.ypp); 458 increment_evaluations(); 459 } 460 298 461 private: 299 /// \brief structure used for recursion in adaptive integrator. 300 /// 301 /// Contains all the information for the function at one point. 302 struct c2_integrate_fblock { float_type x, y, yp, ypp; }; 303 /// \brief structure used to pass information recursively. 462 /// \brief the data element for the internal recursion stack for the sampler and integrator 463 struct recur_item { 464 c2_fblock<float_type> f1; size_t depth; 465 float_type previous_estimate, abs_tol, step_sum; 466 bool done; 467 size_t f0index, f2index; 468 }; 469 470 471 /// \brief structure used to pass information recursively in integrator. 304 472 /// 305 473 /// the \a abs_tol is scaled by a factor of two at each division. 306 474 /// Everything else is just passed down. 307 struct c2_integrate_recur { struct c2_integrate_fblock *f0, *f1, *f2; 308 float_type abs_tol, rel_tol, *lr, eps_scale, extrap_coef, extrap2; 309 int depth, derivs; 310 bool adapt, extrapolate; 475 struct c2_integrate_recur { 476 c2_fblock<float_type> *f0, *f1; 477 float_type abs_tol, rel_tol, eps_scale, extrap_coef, extrap2, dx_tolerance, abs_tol_min; 478 std::vector< recur_item > *rb_stack; 479 int derivs; 480 bool adapt, extrapolate, inited; 481 }; 482 483 /// \brief structure used to pass information recursively in sampler. 484 /// 485 struct c2_sample_recur { 486 c2_fblock<float_type> *f0, *f1; 487 float_type abs_tol, rel_tol, dx_tolerance, abs_tol_min; 488 int derivs; 489 c2_piecewise_function_p<float_type> *out; 490 std::vector<float_type> *xvals, *yvals; 491 std::vector< recur_item > *rb_stack; 492 bool inited; 493 }; 494 495 /// \brief structure used to hold root bracketing information 496 /// 497 struct c2_root_info { 498 c2_fblock<float_type> lower, upper; 499 bool inited; 311 500 }; 312 501 … … 316 505 /// to allow very efficient recursion. 317 506 /// \param rb a pointer to the recur struct. 318 float_type integrate_step(struct c2_integrate_recur &rb) const ;507 float_type integrate_step(struct c2_integrate_recur &rb) const throw(c2_exception); 319 508 320 /// these carry a memory of the last root bracketing, 509 /// \brief Carry out the recursive subdivision for sampling. 510 /// 511 /// This passes information recursively through the \a recur block pointer 512 /// to allow very efficient recursion. 513 /// \param rb a pointer to the recur struct. 514 void sample_step(struct c2_sample_recur &rb) const throw(c2_exception); 515 516 /// this carry a memory of the last root bracketing, 321 517 /// to avoid the necessity of evaluating the function on the brackets every time 322 518 /// if the brackets have not been changed. 323 mutable float_type lastRootLowerX, lastRootUpperX, lastRootLowerY, lastRootUpperY; 324 mutable int rootInitialized; 325 326 }; 327 519 /// it is declared as a pointer, since many c2_functions may never need one allocated 520 mutable struct c2_root_info *root_info; 521 522 mutable size_t owner_count; 523 }; 524 525 /// \brief a container into which any conventional c-style function can be dropped, 526 /// to create a degenerate c2_function without derivatives. 527 /// Mostly useful for sampling into interpolating functions. 528 /// construct a reference to this with c2_classic_function() 529 /// \ingroup containers 530 /// The factory function c2_factory::classic_function() creates *new c2_classic_function_p() 531 template <typename float_type=double> class c2_classic_function_p : public c2_function<float_type> { 532 public: 533 /// \brief construct the container 534 /// \param c_func a pointer to a conventional c-style function 535 c2_classic_function_p(const float_type (*c_func)(float_type)) : c2_function<float_type>(), func(c_func) {} 536 537 /// \copydoc c2_function::value_with_derivatives 538 /// Uses the internal function pointer set by set_function(). 539 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 540 { 541 if(!func) throw c2_exception("c2_classic_function called with null function"); 542 if(yprime) *yprime=0; 543 if(yprime2) *yprime2=0; 544 return func(x); 545 } 546 ~c2_classic_function_p() { } 547 548 protected: 549 /// \brief pointer to our function 550 const float_type (*func)(float_type); 551 }; 552 553 /// \brief create a container for a c2_function which handles the reference counting. 554 /// \ingroup containers 555 /// It is useful as a smart container to hold a c2_function and keep the reference count correct. 556 /// The recommended way for a class to store a c2_function which is handed in from the outside 557 /// is for it to have a c2_ptr member into which the passed-in function is stored. 558 /// This way, when the class instance is deleted, it will automatically dereference any function 559 /// which it was handed. 560 /// 561 /// This class contains a copy constructor and operator=, to make it fairly easy to make 562 /// a std::vector of these objects, and have it work as expected. 563 template <typename float_type> class c2_const_ptr { 564 public: 565 /// \brief construct the container with no function 566 c2_const_ptr() : func(0) {} 567 /// \brief construct the container with a pre-defined function 568 /// \param f the function to store 569 c2_const_ptr(const c2_function<float_type> &f) : func(0) 570 { set_function(&f); } 571 /// \brief copy constructor 572 /// \param src the container to copy 573 c2_const_ptr(const c2_const_ptr<float_type> &src) : func(0) 574 { set_function(src.get_ptr()); } 575 /// \brief fill the container with a new function, or clear it with a null pointer 576 /// \param f the function to store, releasing any previously held function 577 void set_function(const c2_function<float_type> *f) 578 { 579 if(func) func->release_ownership(); 580 func=f; 581 if(func) func->claim_ownership(); 582 } 583 584 /// \brief fill the container from another container 585 /// \param f the container to copy 586 void operator =(const c2_const_ptr<float_type> &f) 587 { set_function(f.get_ptr()); } 588 /// \brief fill the container with a function 589 /// \param f the function 590 void operator =(const c2_function<float_type> &f) 591 { set_function(&f); } 592 /// \brief release the function without destroying it, so it can be returned from a function 593 /// 594 /// This is usually the very last line of a function before the return statement, so that 595 /// any exceptions that happen during execution of the function will cause proper cleanup. 596 /// Once the function has been released from its container this way, it is an orhpaned object 597 /// until the caller claims it, so it could get lost if an exception happens. 598 void release_for_return() throw(c2_exception) 599 { 600 if(func) func->release_ownership_for_return(); 601 func=0; 602 } 603 /// \brief clear the function 604 /// 605 /// Any attempt to use this c2_plugin_function_p throws an exception if the saved function is cleared. 606 void unset_function(void) { set_function(0); } 607 /// \brief destructor 608 ~c2_const_ptr() { set_function(0); } 609 610 /// \brief get a reference to our owned function 611 inline const c2_function<float_type> &get() const throw(c2_exception) 612 { 613 if(!func) throw c2_exception("c2_ptr accessed uninitialized"); 614 return *func; 615 } 616 /// \brief get an unchecked pointer to our owned function 617 inline const c2_function<float_type> *get_ptr() const { return func; } 618 /// \brief get a checked pointer to our owned function 619 inline const c2_function<float_type> *operator -> () const 620 { return &get(); } 621 /// \brief check if we have a valid function 622 bool valid() const { return func != 0; } 623 624 /// \brief type coercion operator which lets us use a pointer as if it were a const c2_function 625 operator const c2_function<float_type>& () const { return this->get(); } 626 627 /// \brief convenience operator to make us look like a function 628 /// \param x the value at which to evaluate the contained function 629 /// \return the evaluated function 630 /// \note If you using this repeatedly, do const c2_function<float_type> &func=ptr; 631 /// and use func(x). Calling this operator wastes some time, since it checks the validity of the 632 /// pointer every time. 633 float_type operator()(float_type x) const throw(c2_exception) { return get()(x); } 634 /// \brief convenience operator to make us look like a function 635 /// \param x the value at which to evaluate the contained function 636 /// \param yprime the derivative 637 /// \param yprime2 the second derivative 638 /// \return the evaluated function 639 /// \note If you using this repeatedly, do const c2_function<float_type> &func=ptr; 640 /// and use func(x). Calling this operator wastes some time, since it checks the validity of the 641 /// pointer every time. 642 float_type operator()(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 643 { return get().value_with_derivatives(x, yprime, yprime2); } 644 /// \brief factory function to create a c2_sum_p from a regular algebraic expression. 645 /// \param rhs the right-hand term of the sum 646 /// \return a new c2_function 647 c2_sum_p<float_type> &operator + (const c2_function<float_type> &rhs) const throw(c2_exception) 648 { return *new c2_sum_p<float_type>(get(), rhs); } 649 /// \brief factory function to create a c2_diff_p from a regular algebraic expression. 650 /// \param rhs the right-hand term of the difference 651 /// \return a new c2_function 652 c2_diff_p<float_type> &operator - (const c2_function<float_type> &rhs) const throw(c2_exception) 653 { return *new c2_diff_p<float_type>(get(), rhs); } 654 /// \brief factory function to create a c2_product_p from a regular algebraic expression. 655 /// \param rhs the right-hand term of the product 656 /// \return a new c2_function 657 c2_product_p<float_type> &operator * (const c2_function<float_type> &rhs) const throw(c2_exception) 658 { return *new c2_product_p<float_type>(get(), rhs); } 659 /// \brief factory function to create a c2_ratio_p from a regular algebraic expression. 660 /// \param rhs the right-hand term of the ratio (the denominator) 661 /// \return a new c2_function 662 c2_ratio_p<float_type> &operator / (const c2_function<float_type> &rhs) const throw(c2_exception) 663 { return *new c2_ratio_p<float_type>(get(), rhs); } 664 /// \brief compose this function outside another. 665 /// \param inner the inner function 666 /// \return the composed function 667 c2_composed_function_p<float_type> & operator ()(const c2_function<float_type> &inner) const throw(c2_exception) 668 { return *new c2_composed_function_p<float_type>(get(), inner); } 669 670 protected: 671 const c2_function<float_type> * func; 672 }; 673 674 /// \brief create a container for a c2_function which handles the reference counting. 675 /// \ingroup containers 676 /// 677 /// \see c2_const_ptr and \ref memory_management "Use of c2_ptr for memory management" 678 679 template <typename float_type> class c2_ptr : public c2_const_ptr<float_type > 680 { 681 public: 682 /// \brief construct the container with no function 683 c2_ptr() : c2_const_ptr<float_type>() {} 684 /// \brief construct the container with a pre-defined function 685 /// \param f the function to store 686 c2_ptr(c2_function<float_type> &f) : 687 c2_const_ptr<float_type>() { set_function(&f); } 688 /// \brief copy constructor 689 /// \param src the container to copy 690 c2_ptr(const c2_ptr<float_type> &src) : 691 c2_const_ptr<float_type>() { set_function(src.get_ptr()); } 692 /// \brief get a checked pointer to our owned function 693 inline c2_function<float_type> &get() const throw(c2_exception) 694 { return *const_cast<c2_function<float_type>*>(&c2_const_ptr<float_type>::get()); } 695 /// \brief get an unchecked pointer to our owned function 696 inline c2_function<float_type> *get_ptr() const 697 { return const_cast<c2_function<float_type>*>(this->func); } 698 /// \brief get a checked pointer to our owned function 699 inline c2_function<float_type> *operator -> () const 700 { return &get(); } 701 /// \brief fill the container from another container 702 /// \param f the container to copy 703 void operator =(const c2_ptr<float_type> &f) 704 { set_function(f.get_ptr()); } 705 /// \brief fill the container with a function 706 /// \param f the function 707 void operator =(c2_function<float_type> &f) 708 { set_function(&f); } 709 private: 710 /// \brief hidden non-const-safe version of operator= 711 void operator =(const c2_const_ptr<float_type> &f) { } 712 /// \brief hidden non-const-safe version of operator= 713 void operator =(const c2_function<float_type> &f) { } 714 }; 715 716 /// \brief create a non-generic container for a c2_function which handles the reference counting. 717 /// \ingroup containers 718 /// 719 /// \see c2_const_ptr and \ref memory_management "Use of c2_ptr for memory management" 720 /// 721 /// \note Overuse of this class will generate massive bloat. Use c2_ptr and c2_const_ptr if you don't _really_ need specific pointer types. 722 /// \see \ref memory_management "Use of c2_ptr for memory management" 723 /* 724 template <typename float_type, template <typename> class c2_class > class c2_typed_ptr : public c2_const_ptr<float_type> { 725 public: 726 /// \brief construct the container with no function 727 c2_typed_ptr() : c2_ptr<float_type>() {} 728 /// \brief construct the container with a pre-defined function 729 /// \param f the function to store 730 c2_typed_ptr(c2_class<float_type> &f) 731 : c2_const_ptr<float_type>() { this->set_function(&f); } 732 /// \brief copy constructor 733 /// \param src the container to copy 734 c2_typed_ptr(const c2_typed_ptr<float_type, c2_class> &src) 735 : c2_const_ptr<float_type>() { this->set_function(src.get_ptr()); } 736 737 /// \brief get a reference to our owned function 738 inline c2_class<float_type> &get() const throw(c2_exception) 739 { 740 return *static_cast<c2_class<float_type> *>(const_cast<c2_function<float_type>*>(&c2_const_ptr<float_type>::get())); 741 } 742 /// \brief get a checked pointer to our owned function 743 inline c2_class<float_type> *operator -> () const 744 { return &get(); } 745 /// \brief get an unchecked pointer to our owned function 746 inline c2_class<float_type> *get_ptr() const 747 { return static_cast<c2_class<float_type> *>(const_cast<c2_function<float_type>*>(this->func)); } 748 /// \brief type coercion operator which lets us use a pointer as if it were a c2_function 749 operator c2_class<float_type>&() const { return get(); } 750 /// \brief fill the container from another container 751 /// \param f the container to copy 752 void operator =(const c2_typed_ptr<float_type, c2_class> &f) 753 { set_function(f.get_ptr()); } 754 /// \brief fill the container with a function 755 /// \param f the function 756 void operator =(c2_class<float_type> &f) 757 { set_function(&f); } 758 private: 759 /// \brief hidden downcasting version of operator= 760 void operator =(const c2_const_ptr<float_type> &f) { } 761 /// \brief hidden downcasting version of operator=. Use an explicit dynamic_cast<c2_class<float_type>&>(f) if you need to try this. 762 void operator =(const c2_function<float_type> &f) { } 763 }; 764 */ 328 765 /// \brief a container into which any other c2_function can be dropped, to allow expressions 329 766 /// with replacable components. 330 /// 767 /// \ingroup containers 331 768 ///It is useful for plugging different InterpolatingFunctions into a c2_function expression. 332 769 ///It saves a lot of effort in other places with casting away const declarations. … … 334 771 /// It is also useful as a wrapper for a function if it is necessary to have a copy of a function 335 772 /// which has a different domain or sampling grid than the parent function. This can be 336 /// be used, for example, to patch badly-behaved functions with c2_piecewise_function by773 /// be used, for example, to patch badly-behaved functions with c2_piecewise_function_p by 337 774 /// taking the parent function, creating two plugins of it with domains on each side of the 338 775 /// nasty bit, and then inserting a nice function in the hole. 339 template <typename float_type=double> class c2_plugin_function : public c2_function<float_type> { 776 /// 777 /// This can also be used as a fancier c2_ptr which allows direct evaluation 778 /// instead of having to dereference the container first. 779 /// 780 /// The factory function c2_factory::plugin_function() creates *new c2_plugin_function_p() 781 template <typename float_type=double> class c2_plugin_function_p : 782 public c2_function<float_type> { 340 783 public: 341 784 /// \brief construct the container with no function 342 c2_plugin_function () : c2_function<float_type>(), func(0), owns(false) {}785 c2_plugin_function_p() : c2_function<float_type>(), func() {} 343 786 /// \brief construct the container with a pre-defined function 344 c2_plugin_function (const c2_function<float_type> &f) : c2_function<float_type>(), func(0), owns(false) { set_function(f); }345 /// \brief fill the container with a new function346 void set_function(const c2_function<float_type> &f)347 {348 if(owns && func) delete func;349 func=&f; set_domain(f.xmin(), f.xmax());350 set_sampling_grid_pointer(*f.sampling_grid);351 owns=false;787 c2_plugin_function_p(c2_function<float_type> &f) : 788 c2_function<float_type>(),func(f) { } 789 /// \brief fill the container with a new function, or clear it with a null pointer 790 /// and copy our domain 791 void set_function(c2_function<float_type> *f) 792 { 793 func.set_function(f); 794 if(f) set_domain(f->xmin(), f->xmax()); 352 795 } 353 796 /// \copydoc c2_function::value_with_derivatives … … 355 798 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 356 799 { 357 if(!func ) throw c2_exception("c2_plugin_function<float_type>called uninitialized");358 return this->func->value_with_derivatives(x, yprime, yprime2);800 if(!func.valid()) throw c2_exception("c2_plugin_function_p called uninitialized"); 801 return func->value_with_derivatives(x, yprime, yprime2); 359 802 } 360 /// \brief clear the function361 ///362 /// Any attempt to use this c2_plugin_function throws an exception if the saved function is cleared.363 void unset_function(void) { if(owns && func) delete func; func=0; owns=false; }364 803 /// \brief destructor 365 ~c2_plugin_function() { if(owns && func) delete func; } 366 /// \brief tell us we should delete the function at destruction. NOT sticky when function is reset 367 void set_ownership() { this->owns=true; } 368 804 ~c2_plugin_function_p() { } 805 806 /// \brief clear our function 807 void unset_function() { func.unset_function(); } 808 809 virtual void get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const 810 { 811 if(!func.valid()) throw c2_exception("c2_plugin_function_p called uninitialized"); 812 if(this->sampling_grid) c2_function<float_type>::get_sampling_grid(xmin, xmax, grid); 813 else func->get_sampling_grid(xmin, xmax, grid); 814 } 369 815 protected: 370 const c2_function<float_type> *func; 371 bool owns; 372 816 c2_ptr<float_type> func; 817 }; 818 819 /// \brief a c2_plugin_function_p which promises not to fiddle with the plugged function. 820 /// \ingroup containers 821 /// 822 /// The factory function c2_factory::const_plugin_function() creates *new c2_const_plugin_function_p() 823 template <typename float_type=double> class c2_const_plugin_function_p : public c2_plugin_function_p<float_type> { 824 public: 825 /// \brief construct the container with no function 826 c2_const_plugin_function_p() : c2_plugin_function_p<float_type>() {} 827 /// \brief construct the container with a pre-defined function 828 c2_const_plugin_function_p(const c2_function<float_type> &f) : 829 c2_plugin_function_p<float_type>() { set_function(&f); } 830 /// \brief fill the container with a new function, or clear it with a null pointer 831 void set_function(const c2_function<float_type> *f) 832 { c2_plugin_function_p<float_type>::set_function(const_cast<c2_function<float_type>*>(f)); } 833 /// \brief destructor 834 ~c2_const_plugin_function_p() { } 835 836 /// \brief get a const reference to our owned function, for direct access 837 const c2_function<float_type> &get() const throw(c2_exception) 838 { return this->func.get(); } 373 839 }; 374 840 375 841 /// \brief Provides support for c2_function objects which are constructed from two other c2_function 376 842 /// objects. 377 /// 378 /// It provides a very primitive ownership concept, so that the creator can tag a function 379 /// as being owned by this function, so that when this function is deleted, the owned function will be deleted, too. 380 /// This allows a piece of code to create various c2_function objects, combine them with binary operators, 381 /// appropriately mark wich ones have no other possible owners, and return the final function with 382 /// reasonable faith that everything will get cleaned up when the final function is deleted. Note that 383 /// none of this marking is automatic, to keep this class very lightweight. 843 /// \ingroup abstract_classes 384 844 template <typename float_type=double> class c2_binary_function : public c2_function<float_type> { 385 845 public: 386 387 388 846 /// \brief function to manage the binary operation, used by c2_binary_function::value_with_derivatives() 389 847 /// 390 /// Normally not used alone, but can be used to combine functions in other contexts.391 /// See interpolating_function::binary_operator() for an example.392 /// \param left the function on the left of the binary operator or outside the composition393 /// \param right the function to the right of the operator or inside the composition394 /// \param[in] x the point at which to evaluate the function395 /// \param[out] yprime the first derivative (if pointer is non-null)396 /// \param[out] yprime2 the second derivative (if pointer is non-null)397 /// \return the value of the function398 virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right,399 float_type x, float_type *yprime, float_type *yprime2) const =0;400 848 401 849 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception) 402 850 { 403 return this->combine(this->Left, this->Right, x, yprime, yprime2); 851 if(stub) throw c2_exception("attempt to evaluate a c2_binary_function stub"); 852 return this->combine(*Left.get_ptr(), *Right.get_ptr(), x, yprime, yprime2); 404 853 } 405 854 406 /// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup855 /// \brief destructor releases ownership of member functions 407 856 /// 408 /// upon destruction, this will cause disposal of the left member function 409 void set_left_ownership(void) { leftown=true; } 410 /// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup 411 /// 412 /// upon destruction, this will cause disposal of the right member function 413 void set_right_ownership(void) { rightown=true; } 414 /// \brief allow c2_binary_function to remember ownership of contained functions for automatic cleanup 415 /// 416 /// upon destruction, this will cause disposal of both member functions 417 void set_ownership(void) { leftown=rightown=true; } 418 /// \brief destructor executes disposal of member functions if flagged 419 /// 420 /// depends on judicious use of set_ownership(), set_right_ownership(), or set_left_ownership() 421 virtual ~c2_binary_function() { 422 if(leftown) delete &Left; 423 if(rightown) delete &Right; 424 } 425 857 virtual ~c2_binary_function() { } 858 426 859 protected: 427 860 /// \brief construct the binary function 861 /// \param combiner pointer to the function which actualy knows how to execute the binary 428 862 /// \param left the c2_function to be used in the left side of the binary relation 429 863 /// \param right the c2_function to be used in the right side of the binary relation 430 c2_binary_function( const c2_function<float_type> &left, const c2_function<float_type> &right) : 431 c2_function<float_type>(), 432 Left(left), Right(right), leftown(false), rightown(false) 864 c2_binary_function( 865 float_type (*combiner)(const c2_function<float_type> &left, const c2_function<float_type> &right, 866 float_type x, float_type *yprime, float_type *yprime2), 867 const c2_function<float_type> &left, const c2_function<float_type> &right) : 868 c2_function<float_type>(), combine(combiner), Left(left), Right(right), stub(false) 433 869 { 434 set_domain(435 (left.xmin() > right.xmin()) ? left.xmin() : right.xmin(),436 (left.xmax() < right.xmax()) ? left.xmax() : right.xmax()437 );870 set_domain( 871 (left.xmin() > right.xmin()) ? left.xmin() : right.xmin(), 872 (left.xmax() < right.xmax()) ? left.xmax() : right.xmax() 873 ); 438 874 } 439 875 440 876 /// \brief construct a 'stub' c2_binary_function, which provides access to the combine() function 441 877 /// \note Do not evaluate a 'stub' ever. It is only used so that combine() can be called 442 c2_binary_function() : c2_function<float_type>(), 443 Left(*((c2_function<float_type> *)0)), Right(*((c2_function<float_type> *)0)) {} 444 445 const c2_function<float_type> &Left, &Right; 446 bool leftown, rightown; 447 878 c2_binary_function( 879 float_type (*combiner)(const c2_function<float_type> &left, const c2_function<float_type> &right, 880 float_type x, float_type *yprime, float_type *yprime2) 881 ) : c2_function<float_type>(), combine(combiner), Left(), Right(), stub(true) { } 882 883 public: 884 float_type (* const combine)(const c2_function<float_type> &left, const c2_function<float_type> &right, 885 float_type x, float_type *yprime, float_type *yprime2); 886 887 protected: 888 const c2_const_ptr<float_type> Left, Right; 889 /// \brief if true, we don't own any functions, we are just a source of a combining function. 890 bool stub; 891 448 892 }; 449 893 450 894 /// \brief Create a very lightweight method to return a scalar multiple of another function. 451 /// 452 template <typename float_type=double> class c2_scaled_function : public c2_plugin_function<float_type> { 895 /// \ingroup containers \ingroup arithmetic_functions \ingroup parametric_functions 896 /// 897 /// The factory function c2_factory::scaled_function() creates *new c2_scaled_function_p 898 template <typename float_type=double> class c2_scaled_function_p : public c2_function<float_type> { 453 899 public: 454 900 /// \brief construct the function with its scale factor. … … 456 902 /// \param outer the function to be scaled 457 903 /// \param scale the multiplicative scale factor 458 c2_scaled_function (const c2_function<float_type> &outer, float_type scale) :459 c2_ plugin_function<float_type>(outer), yscale(scale) { }904 c2_scaled_function_p(const c2_function<float_type> &outer, float_type scale) : 905 c2_function<float_type>(), func(outer), yscale(scale) { } 460 906 461 907 /// \brief set a new scale factor … … 475 921 476 922 protected: 477 c2_scaled_function<float_type>() {} // hide default constructor, since its use is almost always an error. 923 c2_scaled_function_p<float_type>() : func() {} // hide default constructor, since its use is almost always an error. 924 /// \brief the scaling factor for the function 925 const c2_const_ptr<float_type> func; 478 926 float_type yscale; 479 927 }; 480 928 481 929 /// \brief A container into which any other c2_function can be dropped. 482 /// 930 /// \ingroup containers 483 931 /// It allows a function to be pre-evaluated at a point, and used at multiple places in an expression 484 932 /// efficiently. If it is re-evaluated at the previous point, it returns the remembered values; 485 933 /// otherwise, it re-evauates the function at the new point. 486 934 /// 487 template <typename float_type=double> class c2_cached_function : public c2_plugin_function<float_type> { 935 /// The factory function c2_factory::cached_function() creates *new c2_cached_function_p 936 template <typename float_type=double> class c2_cached_function_p : public c2_function<float_type> { 488 937 public: 489 938 /// \brief construct the container 490 939 /// 491 940 /// \param f the function to be cached 492 c2_cached_function(const c2_function<float_type> &f) : c2_plugin_function<float_type>(f), init(false) {} 941 c2_cached_function_p(const c2_function<float_type> &f) : c2_function<float_type>(), 942 func(f), init(false) {} 493 943 /// \copydoc c2_function::value_with_derivatives 494 944 /// … … 508 958 509 959 protected: 510 c2_cached_function() {} // hide default constructor, since its use is almost always an error. 960 c2_cached_function_p() : func() {} // hide default constructor, since its use is almost always an error. 961 const c2_const_ptr<float_type> func; 511 962 mutable bool init; 512 963 mutable float_type x0, y, yp, ypp; … … 515 966 516 967 /// \brief Provides function composition (nesting) 517 /// 968 /// \ingroup arithmetic_functions 518 969 /// This allows evaluation of \a f(g(x)) where \a f and \a g are c2_function objects. 519 970 /// 520 /// \note See c2_binary_function for discussion of ownership.521 template <typename float_type=double> class c2_composed_function : public c2_binary_function<float_type> {971 /// This should always be constructed using \ref compose_operator "c2_function::operator()" 972 template <typename float_type=double> class c2_composed_function_p : public c2_binary_function<float_type> { 522 973 public: 523 974 … … 526 977 /// \param outer the outer function 527 978 /// \param inner the inner function 528 c2_composed_function(const c2_function<float_type> &outer, const c2_function<float_type> &inner) : c2_binary_function<float_type>(outer, inner) {} 979 c2_composed_function_p(const c2_function<float_type> &outer, const c2_function<float_type> &inner) : 980 c2_binary_function<float_type>(combine, outer, inner) { this->set_domain(inner.xmin(), inner.xmax()); } 529 981 /// \brief Create a stub just for the combiner to avoid statics. 530 c2_composed_function() : c2_binary_function<float_type>() {} ; 531 532 virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 533 float_type x, float_type *yprime, float_type *yprime2) const 982 c2_composed_function_p() : c2_binary_function<float_type>(combine) {} 983 984 /// \brief execute math necessary to do composition 985 static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 986 float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception) 534 987 { 535 float_type y0, yp0, ypp0, y1, yp1, ypp1; 536 float_type *yp0p, *ypp0p, *yp1p, *ypp1p; 988 float_type y0, y1; 537 989 if(yprime || yprime2) { 538 yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1; 990 float_type yp0, ypp0, yp1, ypp1; 991 y0=right.value_with_derivatives(x, &yp0, &ypp0); 992 y1=left.value_with_derivatives(y0, &yp1, &ypp1); 993 if(yprime) *yprime=yp1*yp0; 994 if(yprime2) *yprime2=ypp0*yp1+yp0*yp0*ypp1; 539 995 } else { 540 yp0p=ypp0p=yp1p=ypp1p=0; 996 y0=right(x); 997 y1=left(y0); 541 998 } 542 543 y0=right.value_with_derivatives(x, yp0p, ypp0p);544 y1=left.value_with_derivatives(y0, yp1p, ypp1p);545 if(yprime) *yprime=yp1*yp0;546 if(yprime2) *yprime2=ypp0*yp1+yp0*yp0*ypp1;547 999 return y1; 548 1000 } … … 550 1002 551 1003 /// \brief create a c2_function which is the sum of two other c2_function objects. 552 /// 553 /// \note See c2_binary_function for discussion of ownership.554 template <typename float_type=double> class c2_sum : public c2_binary_function<float_type> {1004 /// \ingroup arithmetic_functions 1005 /// This should always be constructed using c2_function::operator+() 1006 template <typename float_type=double> class c2_sum_p : public c2_binary_function<float_type> { 555 1007 public: 556 1008 /// \brief construct \a left + \a right 557 /// \note See c2_binary_function for discussion of ownership. 1009 /// \param left the left function 1010 /// \param right the right function 1011 c2_sum_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {} 1012 /// \brief Create a stub just for the combiner to avoid statics. 1013 c2_sum_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics 1014 1015 /// \brief execute math necessary to do addition 1016 static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 1017 float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception) 1018 { 1019 float_type y0, y1; 1020 if(yprime || yprime2) { 1021 float_type yp0, ypp0, yp1, ypp1; 1022 y0=left.value_with_derivatives(x, &yp0, &ypp0); 1023 y1=right.value_with_derivatives(x, &yp1, &ypp1); 1024 if(yprime) *yprime=yp0+yp1; 1025 if(yprime2) *yprime2=ypp0+ypp1; 1026 } else { 1027 y0=left(x); 1028 y1=right(x); 1029 } 1030 return y0+y1; 1031 } 1032 }; 1033 1034 1035 /// \brief create a c2_function which is the difference of two other c2_functions. 1036 /// \ingroup arithmetic_functions 1037 /// This should always be constructed using c2_function::operator-() 1038 template <typename float_type=double> class c2_diff_p : public c2_binary_function<float_type> { 1039 public: 1040 /// \brief construct \a left - \a right 558 1041 /// \param left the left function 559 1042 /// \param right the right function 560 c2_ sum(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}1043 c2_diff_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {} 561 1044 /// \brief Create a stub just for the combiner to avoid statics. 562 c2_ sum() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics563 564 // function to do derivative arithmetic for sums565 virtualfloat_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right,566 float_type x, float_type *yprime, float_type *yprime2) const1045 c2_diff_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics 1046 1047 /// \brief execute math necessary to do subtraction 1048 static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 1049 float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception) 567 1050 { 568 float_type y0, yp0, ypp0, y1, yp1, ypp1; 569 float_type *yp0p, *ypp0p, *yp1p, *ypp1p; 1051 float_type y0, y1; 570 1052 if(yprime || yprime2) { 571 yp0p=&yp0; ypp0p=& ypp0; yp1p=&yp1; ypp1p=&ypp1; 1053 float_type yp0, ypp0, yp1, ypp1; 1054 y0=left.value_with_derivatives(x, &yp0, &ypp0); 1055 y1=right.value_with_derivatives(x, &yp1, &ypp1); 1056 if(yprime) *yprime=yp0-yp1; 1057 if(yprime2) *yprime2=ypp0-ypp1; 572 1058 } else { 573 yp0p=ypp0p=yp1p=ypp1p=0; 1059 y0=left(x); 1060 y1=right(x); 574 1061 } 575 y0=left.value_with_derivatives(x, yp0p, ypp0p); 576 y1=right.value_with_derivatives(x, yp1p, ypp1p); 577 if(yprime) *yprime=yp0+yp1; 578 if(yprime2) *yprime2=ypp0+ypp1; 579 return y0+y1; 1062 return y0-y1; 580 1063 } 581 1064 }; 582 1065 583 1066 584 /// \brief create a c2_function which is the differenceof two other c2_functions.585 /// 586 /// \note See c2_binary_function for discussion of ownership.587 template <typename float_type=double> class c2_ diff: public c2_binary_function<float_type> {1067 /// \brief create a c2_function which is the product of two other c2_functions. 1068 /// \ingroup arithmetic_functions 1069 /// This should always be constructed using c2_function::operator*() 1070 template <typename float_type=double> class c2_product_p : public c2_binary_function<float_type> { 588 1071 public: 589 /// \brief construct \a left - \a right 590 /// \note See c2_binary_function for discussion of ownership. 1072 /// \brief construct \a left * \a right 591 1073 /// \param left the left function 592 1074 /// \param right the right function 593 c2_ diff(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}1075 c2_product_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {} 594 1076 /// \brief Create a stub just for the combiner to avoid statics. 595 c2_ diff() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics596 597 // function to do derivative arithmetic for diffs598 virtualfloat_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right,599 float_type x, float_type *yprime, float_type *yprime2) const1077 c2_product_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics 1078 1079 /// \brief execute math necessary to do multiplication 1080 static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 1081 float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception) 600 1082 { 601 float_type y0, yp0, ypp0, y1, yp1, ypp1; 602 float_type *yp0p, *ypp0p, *yp1p, *ypp1p; 1083 float_type y0, y1; 603 1084 if(yprime || yprime2) { 604 yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1; 1085 float_type yp0, ypp0, yp1, ypp1; 1086 y0=left.value_with_derivatives(x, &yp0, &ypp0); 1087 y1=right.value_with_derivatives(x, &yp1, &ypp1); 1088 if(yprime) *yprime=y1*yp0+y0*yp1; 1089 if(yprime2) *yprime2=ypp0*y1+2.0*yp0*yp1+ypp1*y0; 605 1090 } else { 606 yp0p=ypp0p=yp1p=ypp1p=0; 1091 y0=left(x); 1092 y1=right(x); 607 1093 } 608 y0=left.value_with_derivatives(x, yp0p, ypp0p); 609 y1=right.value_with_derivatives(x, yp1p, ypp1p); 610 if(yprime) *yprime=yp0-yp1; 611 if(yprime2) *yprime2=ypp0-ypp1; 612 return y0-y1; 1094 return y0*y1; 613 1095 } 614 1096 }; 615 1097 616 1098 617 /// \brief create a c2_function which is the productof two other c2_functions.618 /// 619 /// \note See c2_binary_function for discussion of ownership.620 template <typename float_type=double> class c2_ product: public c2_binary_function<float_type> {1099 /// \brief create a c2_function which is the ratio of two other c2_functions. 1100 /// \ingroup arithmetic_functions 1101 /// This should always be constructed using c2_function::operator/() 1102 template <typename float_type=double> class c2_ratio_p : public c2_binary_function<float_type> { 621 1103 public: 622 /// \brief construct \a left * \a right 623 /// \note See c2_binary_function for discussion of ownership. 1104 /// \brief construct \a left / \a right 624 1105 /// \param left the left function 625 1106 /// \param right the right function 626 c2_ product(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}1107 c2_ratio_p(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(combine, left, right) {} 627 1108 /// \brief Create a stub just for the combiner to avoid statics. 628 c2_product() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics 629 630 virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 631 float_type x, float_type *yprime, float_type *yprime2) const 1109 c2_ratio_p() : c2_binary_function<float_type>(combine) {} ; // create a stub just for the combiner to avoid statics 1110 1111 /// \brief execute math necessary to do division 1112 static float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right, 1113 float_type x, float_type *yprime, float_type *yprime2) throw(c2_exception) 632 1114 { 633 float_type y0, yp0, ypp0, y1, yp1, ypp1; 634 float_type *yp0p, *ypp0p, *yp1p, *ypp1p; 1115 float_type y0, y1; 635 1116 if(yprime || yprime2) { 636 yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1; 1117 float_type yp0, ypp0, yp1, ypp1; 1118 y0=left.value_with_derivatives(x, &yp0, &ypp0); 1119 y1=right.value_with_derivatives(x, &yp1, &ypp1); 1120 if(yprime) *yprime=(yp0*y1-y0*yp1)/(y1*y1); // first deriv of ratio 1121 if(yprime2) *yprime2=(y1*y1*ypp0+y0*(2*yp1*yp1-y1*ypp1)-2*y1*yp0*yp1)/(y1*y1*y1); 637 1122 } else { 638 yp0p=ypp0p=yp1p=ypp1p=0; 1123 y0=left(x); 1124 y1=right(x); 639 1125 } 640 y0=left.value_with_derivatives(x, yp0p, ypp0p);641 y1=right.value_with_derivatives(x, yp1p, ypp1p);642 if(yprime) *yprime=y1*yp0+y0*yp1;643 if(yprime2) *yprime2=ypp0*y1+2.0*yp0*yp1+ypp1*y0;644 return y0*y1;645 }646 };647 648 649 /// \brief create a c2_function which is the ratio of two other c2_functions.650 ///651 /// \note See c2_binary_function for discussion of ownership.652 template <typename float_type=double> class c2_ratio : public c2_binary_function<float_type> {653 public:654 /// \brief construct \a left / \a right655 /// \note See c2_binary_function for discussion of ownership.656 /// \param left the left function657 /// \param right the right function658 c2_ratio(const c2_function<float_type> &left, const c2_function<float_type> &right) : c2_binary_function<float_type>(left, right) {}659 /// \brief Create a stub just for the combiner to avoid statics.660 c2_ratio() : c2_binary_function<float_type>() {} ; // create a stub just for the combiner to avoid statics661 662 virtual float_type combine(const c2_function<float_type> &left, const c2_function<float_type> &right,663 float_type x, float_type *yprime, float_type *yprime2) const664 {665 float_type y0, yp0, ypp0, y1, yp1, ypp1;666 float_type *yp0p, *ypp0p, *yp1p, *ypp1p;667 if(yprime || yprime2) {668 yp0p=&yp0; ypp0p=&ypp0; yp1p=&yp1; ypp1p=&ypp1;669 } else {670 yp0p=ypp0p=yp1p=ypp1p=0;671 }672 y0=left.value_with_derivatives(x, yp0p, ypp0p);673 y1=right.value_with_derivatives(x, yp1p, ypp1p);674 if(yprime) *yprime=(yp0*y1-y0*yp1)/(y1*y1); // first deriv of ratio675 if(yprime2) *yprime2=(y1*y1*ypp0+y0*(2*yp1*yp1-y1*ypp1)-2*y1*yp0*yp1)/(y1*y1*y1); // second deriv of ratio676 1126 return y0/y1; 677 1127 } … … 679 1129 }; 680 1130 681 /// \brief a c2_function which is constant : can do interpolating_function f2=f1 + c2_constant(11.3) 682 template <typename float_type> class c2_constant : public c2_function<float_type> { 683 public: 684 c2_constant(float_type x=0.0) : c2_function<float_type>(), value(x) {} 1131 /// \brief a c2_function which is constant 1132 /// \ingroup parametric_functions 1133 /// 1134 /// The factory function c2_factory::constant() creates *new c2_constant_p() 1135 template <typename float_type> class c2_constant_p : public c2_function<float_type> { 1136 public: 1137 c2_constant_p(float_type x) : c2_function<float_type>(), value(x) {} 685 1138 void reset(float_type val) { value=val; } 686 1139 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) … … 691 1144 }; 692 1145 1146 /// \brief a transformation of a coordinate, including an inverse 1147 /// \ingroup transforms 1148 template <typename float_type> class c2_transformation { 1149 public: 1150 /// \brief initialize all our function pointers 1151 /// \param transformed true if this function is not the identity 1152 /// \param xin input X transform 1153 /// \param xinp input X transform derivative 1154 /// \param xinpp input X transform second derivative 1155 /// \param xout output X transform, which MUST be the inverse of \a xin 1156 c2_transformation(bool transformed, 1157 float_type (*xin)(float_type), float_type (*xinp)(float_type), float_type (*xinpp)(float_type), float_type (*xout)(float_type) 1158 ) : 1159 fTransformed(transformed), fHasStaticTransforms(true), 1160 pIn(xin), pInPrime(xinp), pInDPrime(xinpp), pOut(xout) { } 1161 1162 /// \brief initialize all our function pointers so that only the (overridden) virtual functions can be called without an error 1163 /// \param transformed true if this function is nonlinear 1164 c2_transformation(bool transformed) : 1165 fTransformed(transformed), fHasStaticTransforms(false), 1166 pIn(report_error), pInPrime(report_error), pInDPrime(report_error), pOut(report_error) { } 1167 /// \brief the destructor 1168 virtual ~c2_transformation() { } 1169 /// \brief flag to indicate if this transform is not the identity 1170 const bool fTransformed; 1171 /// \brief flag to indicate if the static function pointers can be used for efficiency 1172 const bool fHasStaticTransforms; 1173 1174 /// \note the pointers to functions allow highly optimized access when static functions are available. 1175 /// They are only used inside value_with_derivatives(), which is assumed to be the most critical routine. 1176 /// \brief non-virtual pointer to input X transform 1177 float_type (* const pIn)(float_type); 1178 /// \brief non-virtual pointer to input X transform derivative 1179 float_type (* const pInPrime)(float_type); 1180 /// \brief non-virtual pointer to input X transform second derivative 1181 float_type (* const pInDPrime)(float_type); 1182 /// \brief non-virtual pointer to output X transform 1183 float_type (* const pOut)(float_type); 1184 1185 /// \brief virtual input X transform 1186 virtual float_type fIn(float_type x) const { return pIn(x); } 1187 /// \brief virtual input X transform derivative 1188 virtual float_type fInPrime(float_type x) const { return pInPrime(x); } 1189 /// \brief virtual input X transform second derivative 1190 virtual float_type fInDPrime(float_type x) const { return pInDPrime(x); } 1191 /// \brief virtual output X transform 1192 virtual float_type fOut(float_type x) const { return pOut(x); } 1193 1194 protected: 1195 /// \brief utility function for unimplemented conversion 1196 static float_type report_error(float_type x) { throw c2_exception("use of improperly constructed axis transform"); return x; } 1197 /// \brief utility function f(x)=x useful in axis transforms 1198 static float_type ident(float_type x) { return x; } 1199 /// \brief utility function f(x)=1 useful in axis transforms 1200 static float_type one(float_type) { return 1; } 1201 /// \brief utility function f(x)=0 useful in axis transforms 1202 static float_type zero(float_type) { return 0; } 1203 /// \brief utility function f(x)=1/x useful in axis transforms 1204 static float_type recip(float_type x) { return 1.0/x; } 1205 /// \brief utility function f(x)=-1/x**2 useful in axis transforms 1206 static float_type recip_prime(float_type x) { return -1/(x*x); } 1207 /// \brief utility function f(x)=2/x**3 useful in axis transforms 1208 static float_type recip_prime2(float_type x) { return 2/(x*x*x); } 1209 1210 }; 1211 1212 /// \brief the identity transform 1213 /// \ingroup transforms 1214 template <typename float_type> class c2_transformation_linear : public c2_transformation<float_type> { 1215 public: 1216 /// \brief constructor 1217 c2_transformation_linear() : c2_transformation<float_type>(false, this->ident, this->one, this->zero, this->ident) { } 1218 /// \brief destructor 1219 ~c2_transformation_linear() { } 1220 }; 1221 /// \brief log axis transform 1222 /// \ingroup transforms 1223 template <typename float_type> class c2_transformation_log : public c2_transformation<float_type> { 1224 public: 1225 /// \brief constructor 1226 c2_transformation_log() : c2_transformation<float_type>(true, std::log, this->recip, this->recip_prime, std::exp) { } 1227 /// \brief destructor 1228 ~c2_transformation_log() { } 1229 }; 1230 /// \brief reciprocal axis transform 1231 /// \ingroup transforms 1232 template <typename float_type> class c2_transformation_recip : public c2_transformation<float_type> { 1233 public: 1234 /// \brief constructor 1235 c2_transformation_recip() : c2_transformation<float_type>(true, this->recip, this->recip_prime, this->recip_prime2, this->recip) { } 1236 /// \brief destructor 1237 ~c2_transformation_recip() { } 1238 }; 1239 1240 /// \brief a transformation of a function in and out of a coordinate space, using 2 c2_transformations 1241 /// 1242 /// This class is a container for two axis transforms, but also provides the critical evaluate() 1243 /// function which converts a result in internal coordinates (with derivatives) into the external representation 1244 /// \ingroup transforms 1245 template <typename float_type> 1246 class c2_function_transformation { 1247 public: 1248 /// \brief construct this from two c2_transformation instances 1249 /// \param xx the X axis transform 1250 /// \param yy the Y axis transform 1251 c2_function_transformation( 1252 const c2_transformation<float_type> &xx, const c2_transformation<float_type> &yy) : 1253 isIdentity(!(xx.fTransformed || yy.fTransformed)), X(xx), Y(yy) { } 1254 /// \brief destructor 1255 virtual ~c2_function_transformation() { delete &X; delete &Y; } 1256 /// \brief evaluate the transformation from internal coordinates to external coordinates 1257 /// \param xraw the value of \a x in external cordinates at which the transform is taking place 1258 /// \param y the value of the function in internal coordinates 1259 /// \param yp0 the derivative in internal coordinates 1260 /// \param ypp0 the second derivative in internal coordinates 1261 /// \param [out] yprime pointer to the derivative, or NULL, in external coordinates 1262 /// \param [out] yprime2 pointer to the second derivative, or NULL, in external coordinates 1263 /// \return the value of the function in external coordinates 1264 virtual float_type evaluate(float_type xraw, 1265 float_type y, float_type yp0, float_type ypp0, 1266 float_type *yprime, float_type *yprime2) const; 1267 /// \brief flag indicating of the transform is the identity, and can be skipped for efficiency 1268 const bool isIdentity; 1269 /// \brief the X axis transform 1270 const c2_transformation<float_type> &X; 1271 /// \brief the Y axis transform 1272 const c2_transformation<float_type> &Y; 1273 }; 1274 1275 /// \brief a transformation of a function in and out of lin-lin space 1276 /// 1277 /// \ingroup transforms 1278 template <typename float_type> class c2_lin_lin_function_transformation : 1279 public c2_function_transformation<float_type> { 1280 public: 1281 c2_lin_lin_function_transformation() : 1282 c2_function_transformation<float_type>( 1283 *new c2_transformation_linear<float_type>, 1284 *new c2_transformation_linear<float_type> 1285 ) { } 1286 virtual ~c2_lin_lin_function_transformation() { } 1287 }; 1288 1289 /// \brief a transformation of a function in and out of log-log space 1290 /// 1291 /// \ingroup transforms 1292 template <typename float_type> class c2_log_log_function_transformation : 1293 public c2_function_transformation<float_type> { 1294 public: 1295 c2_log_log_function_transformation() : 1296 c2_function_transformation<float_type>( 1297 *new c2_transformation_log<float_type>, 1298 *new c2_transformation_log<float_type> 1299 ) { } 1300 virtual ~c2_log_log_function_transformation() { } 1301 }; 1302 1303 /// \brief a transformation of a function in and out of lin-log space 1304 /// 1305 /// \ingroup transforms 1306 template <typename float_type> class c2_lin_log_function_transformation : 1307 public c2_function_transformation<float_type> { 1308 public: 1309 c2_lin_log_function_transformation() : 1310 c2_function_transformation<float_type>( 1311 *new c2_transformation_linear<float_type>, 1312 *new c2_transformation_log<float_type> 1313 ) { } 1314 virtual ~c2_lin_log_function_transformation() { } 1315 }; 1316 1317 /// \brief a transformation of a function in and out of log-lin space 1318 /// 1319 /// \ingroup transforms 1320 template <typename float_type> class c2_log_lin_function_transformation : 1321 public c2_function_transformation<float_type> { 1322 public: 1323 c2_log_lin_function_transformation() : 1324 c2_function_transformation<float_type>( 1325 *new c2_transformation_log<float_type>, 1326 *new c2_transformation_linear<float_type> 1327 ) { } 1328 virtual ~c2_log_lin_function_transformation() { } 1329 }; 1330 1331 /// \brief a transformation of a function in and out of Arrhenuis (1/x vs. log(y)) space 1332 /// 1333 /// \ingroup transforms 1334 template <typename float_type> class c2_arrhenius_function_transformation : 1335 public c2_function_transformation<float_type> { 1336 public: 1337 c2_arrhenius_function_transformation() : 1338 c2_function_transformation<float_type>( 1339 *new c2_transformation_recip<float_type>, 1340 *new c2_transformation_log<float_type> 1341 ) { } 1342 virtual ~c2_arrhenius_function_transformation() { } 1343 }; 1344 693 1345 /** 694 1346 \brief create a cubic spline interpolation of a set of (x,y) pairs 695 1347 \ingroup interpolators 696 1348 This is one of the main reasons for c2_function objects to exist. 697 1349 … … 707 1359 (vanishing second derivative), is created as: \n 708 1360 \code 1361 c2_ptr<double> c2p; 1362 c2_factory<double> c2; 709 1363 std::vector<double> xvals(10), yvals(10); 710 1364 // < fill in xvals and yvals > 711 interpolating_function<double> myfunc(xvals, yvals);1365 c2p myfunc=c2.interpolating_function().load(xvals, yvals,true,0,true,0); 712 1366 // and it can be evaluated at a point for its value only by: 713 1367 double y=myfunc(x); … … 716 1370 double y=myfunc(x,&yprime, &yprime2); 717 1371 \endcode 1372 1373 The factory function c2_factory::interpolating_function() creates *new interpolating_function_p() 718 1374 */ 719 1375 720 template <typename float_type=double> class interpolating_function : public c2_function<float_type> {721 public: 722 /// \brief create the most general interpolating_function which defaults to linear-linear space1376 template <typename float_type=double> class interpolating_function_p : public c2_function<float_type> { 1377 public: 1378 /// \brief an empty linear-linear cubic-spline interpolating_function_p 723 1379 /// 724 1380 /// lots to say here, but see Numerical Recipes for a discussion of cubic splines. 1381 /// 1382 interpolating_function_p() : c2_function<float_type>(), 1383 fTransform(*new c2_lin_lin_function_transformation<float_type>) { } 1384 1385 /// \brief an empty cubic-spline interpolating_function_p with a specific transform 1386 /// 1387 interpolating_function_p(const c2_function_transformation<float_type> &transform) : c2_function<float_type>(), 1388 fTransform(transform) { } 1389 1390 /// \brief do the dirty work of constructing the spline from a function. 725 1391 /// \param x the list of abscissas. Must be either strictly increasing or strictly decreasing. 726 1392 /// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid. … … 730 1396 /// \param upperSlopeNatural if true, set y''(last point)=0, otherwise compute it from \a upperSope 731 1397 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 732 /// \param inputXConversion a function (not a c2_function) which converts \a x into the internal space. \n 733 /// If this is NULL, use linear space and ignore inputXConversionPrime, inputXConversionDPrime 734 /// \param inputYConversion a function (not a c2_function) which converts \a y into the internal space. \n 735 /// If this is NULL, use linear space and ignore inputYConversionPrime, inputYConversionDPrime, outputYConversion 736 /// \param outputYConversion a function (not a c2_function) which converts \a y out of the internal space 737 /// \param inputXConversionPrime the derivative of \a inputXConversion 738 /// \param inputYConversionPrime the derivative of \a inputYConversion 739 /// \param inputXConversionDPrime the second derivative of \a inputXConversion 740 /// \param inputYConversionDPrime the second derivative of \a inputYConversion 741 interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 742 bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 743 bool upperSlopeNatural=true, float_type upperSlope=0.0, 744 float_type (*inputXConversion)(float_type)=0, 745 float_type (*inputYConversion)(float_type)=0, 746 float_type (*outputYConversion)(float_type)=0, 747 float_type (*inputXConversionPrime)(float_type)=0, 748 float_type (*inputYConversionPrime)(float_type)=0, 749 float_type (*inputXConversionDPrime)(float_type)=0, 750 float_type (*inputYConversionDPrime)(float_type)=0 751 ) throw(c2_exception) : c2_function<float_type>() 752 { init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 753 inputXConversion, inputYConversion, outputYConversion, 754 inputXConversionPrime, inputYConversionPrime, 755 inputXConversionDPrime, inputYConversionDPrime 756 ); 757 } 758 759 /// \brief copy constructor 760 /// \param rhs interpolating_function to copy from 761 interpolating_function(const interpolating_function <float_type> &rhs) : c2_function<float_type>(rhs), 762 Xraw(rhs.Xraw), X(rhs.X), F(rhs.F), y2(rhs.y2), 763 fXin(rhs.fXin), fYin(rhs.fYin), fYout(rhs.fYout), 764 fXinPrime(rhs.fXinPrime), fYinPrime(rhs.fYinPrime), 765 fXinDPrime(rhs.fXinDPrime), fYinDPrime(rhs.fYinDPrime) , 766 xInverted(rhs.xInverted), lastKLow(-1) 767 { set_sampling_grid_pointer(Xraw); } 768 769 virtual ~interpolating_function() { } // just to suppress warnings about no virtual destructor 1398 /// \param splined if true (default), use cubic spline, if false, use linear interpolation. 1399 /// \return the same interpolating function, filled 1400 interpolating_function_p<float_type> & load(const std::vector<float_type> &x, const std::vector<float_type> &f, 1401 bool lowerSlopeNatural, float_type lowerSlope, 1402 bool upperSlopeNatural, float_type upperSlope, bool splined=true 1403 ) throw(c2_exception); 1404 1405 /// \brief do the dirty work of constructing the spline from a function. 1406 /// \param data std::vector of std::pairs of x,y. Will be sorted into x increasing order in place. 1407 /// \param lowerSlopeNatural if true, set y''(first point)=0, otherwise compute it from \a lowerSope 1408 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 1409 /// \param upperSlopeNatural if true, set y''(last point)=0, otherwise compute it from \a upperSope 1410 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 1411 /// \param splined if true (default), use cubic spline, if false, use linear interpolation. 1412 /// \return the same interpolating function, filled 1413 interpolating_function_p<float_type> & load_pairs( 1414 std::vector<std::pair<float_type, float_type> > &data, 1415 bool lowerSlopeNatural, float_type lowerSlope, 1416 bool upperSlopeNatural, float_type upperSlope, bool splined=true 1417 ) throw(c2_exception); 1418 1419 /// \brief do the dirty work of constructing the spline from a function. 1420 /// \param func a function without any requirement of valid derivatives to sample into an interpolating function. 1421 /// Very probably a c2_classic_function. 1422 /// \param xmin the lower bound of the region to sample 1423 /// \param xmax the upper bound of the region to sample 1424 /// \param abs_tol the maximum absolute error permitted when linearly interpolating the points. 1425 /// the real error will be much smaller, since this uses cubic splines at the end. 1426 /// \param rel_tol the maximum relative error permitted when linearly interpolating the points. 1427 /// the real error will be much smaller, since this uses cubic splines at the end. 1428 /// \param lowerSlopeNatural if true, set y'(first point) from 3-point parabola, otherwise compute it from \a lowerSope 1429 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 1430 /// \param upperSlopeNatural if true, set y'(last point) from 3-point parabola, otherwise compute it from \a upperSope 1431 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 1432 /// \return the same interpolating function, filled 1433 /// \note If the interpolator being filled has a log vertical axis, put the desired relative error in 1434 /// \a abs_tol, and 0 in \a rel_tol since the absolute error on the log of a function is the relative error 1435 /// on the function itself. 1436 interpolating_function_p<float_type> & sample_function(const c2_function<float_type> &func, 1437 float_type xmin, float_type xmax, float_type abs_tol, float_type rel_tol, 1438 bool lowerSlopeNatural, float_type lowerSlope, 1439 bool upperSlopeNatural, float_type upperSlope 1440 ) throw(c2_exception); 1441 1442 1443 /// \brief initialize from a grid of points and a c2_function (un-normalized) to an 1444 /// interpolator which, when evaluated with a uniform random variate on [0,1] returns random numbers 1445 /// distributed as the input function. 1446 /// \see \ref random_subsec "Arbitrary random generation" 1447 /// inverse_integrated_density starts with a probability density std::vector, generates the integral, 1448 /// and generates an interpolating_function_p of the inverse function which, when evaluated using a uniform random on [0,1] returns values 1449 /// with a density distribution equal to the input distribution 1450 /// If the data are passed in reverse order (large X first), the integral is carried out from the big end. 1451 /// \param bincenters the positions at which to sample the function \a binheights 1452 /// \param binheights a function which describes the density of the random number distribution to be produced. 1453 /// \return an initialized interpolator, which 1454 /// if evaluated randomly with a uniform variate on [0,1] produces numbers 1455 /// distributed according to \a binheights 1456 interpolating_function_p<float_type> & load_random_generator_function( 1457 const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights) 1458 throw(c2_exception); 1459 1460 /// \brief initialize from a grid of points and an std::vector of probability densities (un-normalized) to an 1461 /// interpolator which, when evaluated with a uniform random variate on [0,1] returns random numbers 1462 /// distributed as the input histogram. 1463 /// \see \ref random_subsec "Arbitrary random generation" 1464 /// inverse_integrated_density starts with a probability density std::vector, generates the integral, 1465 /// and generates an interpolating_function_p of the inverse function which, when evaluated using a uniform random on [0,1] returns values 1466 /// with a density distribution equal to the input distribution 1467 /// If the data are passed in reverse order (large X first), the integral is carried out from the big end. 1468 /// \param bins if \a bins .size()==\a binheights .size(), the centers of the bins. \n 1469 /// if \a bins .size()==\a binheights .size()+1, the edges of the bins 1470 /// \param binheights a vector which describes the density of the random number distribution to be produced. 1471 /// Note density... the numbers in the bins are not counts, but counts/unit bin width. 1472 /// \return an initialized interpolator, which 1473 /// if evaluated randomly with a uniform variate on [0,1] produces numbers 1474 /// distributed according to \a binheights 1475 interpolating_function_p<float_type> & load_random_generator_bins( 1476 const std::vector<float_type> &bins, const std::vector<float_type> &binheights) 1477 throw(c2_exception); 1478 1479 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception); 1480 1481 /// \brief destructor 1482 virtual ~interpolating_function_p() { delete &fTransform; } 1483 1484 /// \brief create a new, empty interpolating function of this type (virtual constructor) 1485 virtual interpolating_function_p<float_type> &clone() const throw(c2_exception) 1486 { return *new interpolating_function_p<float_type>(); } 770 1487 771 1488 /// \brief retrieve copies of the x & y tables from which this was built 772 1489 /// 773 1490 /// This is often useful in the creation of new interpolating functions with transformed data. 774 /// The vectors will have their sizes set correctly on return.1491 /// The vectors will have their sizes set correctly on return. 775 1492 /// \param [in, out] xvals the abscissas 776 1493 /// \param [in, out] yvals the ordinates … … 793 1510 // preserving the X bounds and mapping functions of the host (left hand) function. 794 1511 795 /// \brief create a new interpolating_function which is the \a source1512 /// \brief create a new interpolating_function_p which is the \a source 796 1513 /// function applied to every point in the interpolating tables 797 1514 /// 798 1515 /// This carefully manages the derivative of the composed function at the two ends. 799 1516 /// \param source the function to apply 800 /// \return a new interpolating_function with the same mappings for x and y801 interpolating_function <float_type> & unary_operator(const c2_function<float_type> &source) const;802 803 /// \brief create a new interpolating_function which is the parent interpolating_function1517 /// \return a new interpolating_function_p with the same mappings for x and y 1518 interpolating_function_p <float_type> & unary_operator(const c2_function<float_type> &source) const; 1519 1520 /// \brief create a new interpolating_function_p which is the parent interpolating_function_p 804 1521 /// combined with \a rhs using \a combiner at every point in the interpolating tables 805 1522 /// … … 807 1524 /// \param rhs the function to apply 808 1525 /// \param combining_stub a function which defines which binary operation to use. 809 /// \return a new interpolating_function with the same mappings for x and y810 interpolating_function <float_type> & binary_operator(const c2_function<float_type> &rhs,811 c 2_binary_function<float_type> *combining_stub1526 /// \return a new interpolating_function_p with the same mappings for x and y 1527 interpolating_function_p <float_type> & binary_operator(const c2_function<float_type> &rhs, 1528 const c2_binary_function<float_type> *combining_stub 812 1529 ) const; 813 814 // InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 815 // when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 816 // can be upcast back to a c2_function to produce unprocessed binaries. 817 818 /// \brief produce a newly resampled interpolating_function which is the specified sum. 1530 /// \brief produce a newly resampled interpolating_function_p which is the specified sum. 819 1531 /// \param rhs the function to add, pointwise 820 /// \return a new interpolating_function 821 /// \note 822 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 823 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 824 /// can be upcast back to a c2_function to produce unprocessed binaries. 825 interpolating_function <float_type> & operator + (const c2_function<float_type> &rhs) const { 826 return binary_operator(rhs, new c2_sum<float_type>()); } 827 /// \brief produce a newly resampled interpolating_function which is the specified difference. 1532 /// \return a new interpolating_function_p 1533 interpolating_function_p <float_type> & add_pointwise (const c2_function<float_type> &rhs) const { 1534 return binary_operator(rhs, new c2_sum_p<float_type>()); } 1535 /// \brief produce a newly resampled interpolating_function_p which is the specified difference. 828 1536 /// \param rhs the function to subtract, pointwise 829 /// \return a new interpolating_function 830 /// \note 831 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 832 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 833 /// can be upcast back to a c2_function to produce unprocessed binaries. 834 interpolating_function <float_type> & operator - (const c2_function<float_type> &rhs) const { 835 return binary_operator(rhs, new c2_diff<float_type>()); } 836 /// \brief produce a newly resampled interpolating_function which is the specified product. 1537 /// \return a new interpolating_function_p 1538 interpolating_function_p <float_type> & subtract_pointwise (const c2_function<float_type> &rhs) const { 1539 return binary_operator(rhs, new c2_diff_p<float_type>()); } 1540 /// \brief produce a newly resampled interpolating_function_p which is the specified product. 837 1541 /// \param rhs the function to multiply, pointwise 838 /// \return a new interpolating_function 839 /// \note 840 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 841 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 842 /// can be upcast back to a c2_function to produce unprocessed binaries. 843 interpolating_function <float_type> & operator * (const c2_function<float_type> &rhs) const { 844 return binary_operator(rhs, new c2_product<float_type>()); } 845 /// \brief produce a newly resampled interpolating_function which is the specified ratio. 1542 /// \return a new interpolating_function_p 1543 interpolating_function_p <float_type> & multiply_pointwise (const c2_function<float_type> &rhs) const { 1544 return binary_operator(rhs, new c2_product_p<float_type>()); } 1545 /// \brief produce a newly resampled interpolating_function_p which is the specified ratio. 846 1546 /// \param rhs the function to divide, pointwise 847 /// \return a new interpolating_function 848 /// \note 849 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 850 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 851 /// can be upcast back to a c2_function to produce unprocessed binaries. 852 interpolating_function <float_type> & operator / (const c2_function<float_type> &rhs) const { 853 return binary_operator(rhs, new c2_ratio<float_type>()); } 854 /// \brief produce a newly resampled interpolating_function which is the specified sum. 855 /// \param rhs a constant to add, pointwise 856 /// \return a new interpolating_function 857 /// \note 858 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 859 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 860 /// can be upcast back to a c2_function to produce unprocessed binaries. 861 interpolating_function <float_type> & operator + (float_type rhs) const { return (*this)+c2_constant<float_type>(rhs); } 862 /// \brief produce a newly resampled interpolating_function which is the specified difference. 863 /// \param rhs a constant to subtract, pointwise 864 /// \return a new interpolating_function 865 /// \note 866 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 867 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 868 /// can be upcast back to a c2_function to produce unprocessed binaries. 869 interpolating_function <float_type> & operator - (float_type rhs) const { return (*this)-c2_constant<float_type>(rhs); } 870 /// \brief produce a newly resampled interpolating_function which is the specified product. 871 /// \param rhs a constant to multiply, pointwise 872 /// \return a new interpolating_function 873 /// \note 874 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 875 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 876 /// can be upcast back to a c2_function to produce unprocessed binaries. 877 interpolating_function <float_type> & operator * (float_type rhs) const { return (*this)*c2_constant<float_type>(rhs); } 878 /// \brief produce a newly resampled interpolating_function which is the specified ratio. 879 /// \param rhs a constant to divide, pointwise 880 /// \return a new interpolating_function 881 /// \note 882 /// InterpolatingFunctions override the c2_function operators, since they explicitly re-generate the interpolation table 883 /// when they are applied. If this is not desired, these operators are not virtual, so the interpolating_function 884 /// can be upcast back to a c2_function to produce unprocessed binaries. 885 interpolating_function <float_type> & operator / (float_type rhs) const { return (*this)/c2_constant<float_type>(rhs); } 886 887 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception); 888 889 /// \brief move value & derivatives into our internal coordinates (use splint to go the other way!) 890 /// \note why? 891 void localize_derivatives(float_type xraw, float_type y, float_type yprime, float_type yprime2, float_type *y0, float_type *yp0, float_type *ypp0) const; 892 893 protected: 894 895 interpolating_function() : c2_function<float_type>() { } // default constructor is never used, prevent accidents by protecting it. 896 897 /// \brief do the dirty work of constructing the spline. See interpolating_function constructor for details. 898 void init(const std::vector<float_type> &, const std::vector<float_type> &, 1547 /// \return a new interpolating_function_p 1548 interpolating_function_p <float_type> & divide_pointwise (const c2_function<float_type> &rhs) const { 1549 return binary_operator(rhs, new c2_ratio_p<float_type>()); } 1550 /// \brief copy data from another interpolating function. This only makes sense if the source 1551 /// function has the same transforms as the destination. 1552 /// \param rhs interpolating_function_p to copy from 1553 void clone_data(const interpolating_function_p <float_type> &rhs) { 1554 Xraw=rhs.Xraw; X=rhs.X; F=rhs.F; y2=rhs.y2; 1555 set_sampling_grid_pointer(Xraw); 1556 } 1557 1558 const c2_function_transformation<float_type> &fTransform; 1559 1560 protected: 1561 /// \brief create the spline coefficients 1562 void spline( 899 1563 bool lowerSlopeNatural, float_type lowerSlope, 900 bool upperSlopeNatural, float_type upperSlope, 901 float_type (*inputXConversion)(float_type)=0, 902 float_type (*inputXConversionPrime)(float_type)=0, 903 float_type (*inputXConversionDPrime)(float_type)=0, 904 float_type (*inputYConversion)(float_type)=0, 905 float_type (*inputYConversionPrime)(float_type)=0, 906 float_type (*inputYConversionDPrime)(float_type)=0, 907 float_type (*outputYConversion)(float_type)=0 908 ) throw(c2_exception) ; 1564 bool upperSlopeNatural, float_type upperSlope 1565 ) throw(c2_exception); 1566 1567 // This is for sorting the data. It must be static if it's going to be a class member. 1568 static bool comp_pair(std::pair<float_type,float_type> const &i, std::pair<float_type,float_type> const &j) {return i.first<j.first;} 909 1569 910 1570 std::vector<float_type> Xraw, X, F, y2; 911 912 float_type (*fXin)(float_type), (*fYin)(float_type), (*fYout)(float_type); 913 float_type (*fXinPrime)(float_type), (*fYinPrime)(float_type); 914 float_type (*fXinDPrime)(float_type), (*fYinDPrime)(float_type); 915 916 int xInverted; 917 mutable int lastKLow; 918 }; 919 920 /// \brief An interpolatingFunction with X transformed into log space. 921 /// 1571 c2_const_ptr<float_type> sampler_function; 1572 bool xInverted; 1573 mutable size_t lastKLow; 1574 }; 1575 1576 /// \brief A spline with X transformed into log space. 1577 /// \ingroup interpolators 922 1578 /// Most useful for functions looking like y=log(x) or any other function with a huge X dynamic range, 923 1579 /// and a slowly varying Y. 924 template <typename float_type=double> class log_lin_interpolating_function : public interpolating_function <float_type> { 925 public: 926 /// \brief Construct the function. 927 /// \param x the list of abscissas. Must be either strictly increasing or strictly decreasing. 928 /// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid. 929 /// \param f the list of function values. 930 /// \param lowerSlopeNatural if true, set y''(first point)=0 in LogLin space, otherwise compute it from \a lowerSope 931 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 932 /// \param upperSlopeNatural if true, set y''(last point)=0 in LogLin space, otherwise compute it from \a upperSope 933 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 934 log_lin_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 935 bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 936 bool upperSlopeNatural=true, float_type upperSlope=0.0); 937 protected: 938 log_lin_interpolating_function() {} // do not allow naked construction... it is usually an accident. 939 }; 940 941 942 /// \brief An interpolatingFunction with Y transformed into log space. 943 /// 1580 /// 1581 /// The factory function c2_factory::log_lin_interpolating_function() creates *new log_lin_interpolating_function_p() 1582 template <typename float_type=double> class log_lin_interpolating_function_p : public interpolating_function_p <float_type> { 1583 public: 1584 /// \brief an empty log-linear cubic-spline interpolating_function_p 1585 /// 1586 log_lin_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_log_lin_function_transformation<float_type>) 1587 { } 1588 /// \brief create a new, empty interpolating function of this type (virtual constructor) 1589 virtual interpolating_function_p<float_type> &clone() const throw(c2_exception) 1590 { return *new log_lin_interpolating_function_p<float_type>(); } 1591 }; 1592 1593 1594 /// \brief A spline with Y transformed into log space. 1595 /// \ingroup interpolators 944 1596 /// Most useful for functions looking like y=exp(x) 945 template <typename float_type=double> class lin_log_interpolating_function : public interpolating_function <float_type> { 946 public: 947 /// \brief Construct the function. 948 /// \param x the list of abscissas. Must be either strictly increasing or strictly decreasing. 949 /// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid. 950 /// \param f the list of function values. 951 /// \param lowerSlopeNatural if true, set y''(first point)=0 in LinLog space, otherwise compute it from \a lowerSope 952 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 953 /// \param upperSlopeNatural if true, set y''(last point)=0 in LinLog space, otherwise compute it from \a upperSope 954 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 955 lin_log_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 956 bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 957 bool upperSlopeNatural=true, float_type upperSlope=0.0); 958 protected: 959 lin_log_interpolating_function() {} // do not allow naked construction... it is usually an accident. 960 }; 961 962 963 /// \brief An interpolatingFunction with X and Y transformed into log space. 964 /// 1597 /// 1598 /// The factory function c2_factory::lin_log_interpolating_function() creates *new lin_log_interpolating_function_p() 1599 template <typename float_type=double> class lin_log_interpolating_function_p : public interpolating_function_p <float_type> { 1600 public: 1601 /// \brief an empty linear-log cubic-spline interpolating_function_p 1602 /// 1603 lin_log_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_lin_log_function_transformation<float_type>) 1604 { } 1605 /// \brief create a new, empty interpolating function of this type (virtual constructor) 1606 virtual interpolating_function_p<float_type> &clone() const throw(c2_exception) 1607 { return *new lin_log_interpolating_function_p<float_type>(); } 1608 }; 1609 1610 1611 /// \brief A spline with X and Y transformed into log space. 1612 /// \ingroup interpolators 965 1613 /// Most useful for functions looking like y=x^n or any other function with a huge X and Y dynamic range. 966 template <typename float_type=double> class log_log_interpolating_function : public interpolating_function <float_type> { 967 public: 968 /// \brief Construct the function. 969 /// \param x the list of abscissas. Must be either strictly increasing or strictly decreasing. 970 /// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid. 971 /// \param f the list of function values. 972 /// \param lowerSlopeNatural if true, set y''(first point)=0 in LogLog space, otherwise compute it from \a lowerSope 973 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 974 /// \param upperSlopeNatural if true, set y''(last point)=0 in LogLog space, otherwise compute it from \a upperSope 975 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 976 log_log_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 977 bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 978 bool upperSlopeNatural=true, float_type upperSlope=0.0); 979 protected: 980 log_log_interpolating_function() {} // do not allow naked construction... it is usually an accident. 981 }; 982 983 984 /// \brief An interpolating_function with X in reciprocal space and Y transformed in log space. 985 /// 1614 /// 1615 /// The factory function c2_factory::log_log_interpolating_function() creates *new log_log_interpolating_function_p() 1616 template <typename float_type=double> class log_log_interpolating_function_p : public interpolating_function_p <float_type> { 1617 public: 1618 /// \brief an empty log-log cubic-spline interpolating_function_p 1619 /// 1620 log_log_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_log_log_function_transformation<float_type>) 1621 { } 1622 /// \brief create a new, empty interpolating function of this type (virtual constructor) 1623 virtual interpolating_function_p<float_type> &clone() const throw(c2_exception) 1624 { return *new log_log_interpolating_function_p<float_type>(); } 1625 }; 1626 1627 1628 /// \brief A spline with X in reciprocal space and Y transformed in log space. 1629 /// \ingroup interpolators 986 1630 /// Most useful for thermodynamic types of data where Y is roughly A*exp(-B/x). 987 1631 /// Typical examples are reaction rate data, and thermistor calibration data. 988 template <typename float_type=double> class arrhenius_interpolating_function : public interpolating_function <float_type> { 989 public: 990 /// \brief Construct the function. 991 /// \param x the list of abscissas. Must be either strictly increasing or strictly decreasing. 992 /// Strictly increasing is preferred, as less memory is used since a copy is not required for the sampling grid. 993 /// \param f the list of function values. 994 /// \param lowerSlopeNatural if true, set y''(first point)=0 in Arrhenius space, otherwise compute it from \a lowerSope 995 /// \param lowerSlope derivative of the function at the lower bound, used only if \a lowerSlopeNatural is false 996 /// \param upperSlopeNatural if true, set y''(last point)=0 in Arrhenius space, otherwise compute it from \a upperSope 997 /// \param upperSlope derivative of the function at the upper bound, used only if \a upperSlopeNatural is false 998 arrhenius_interpolating_function(const std::vector<float_type> &x, const std::vector<float_type> &f, 999 bool lowerSlopeNatural=true, float_type lowerSlope=0.0, 1000 bool upperSlopeNatural=true, float_type upperSlope=0.0); 1001 protected: 1002 arrhenius_interpolating_function() {} // do not allow naked construction... it is usually an accident. 1003 }; 1004 1005 /** 1006 \brief create a linear-linear interpolating grid with both x & y set to 1007 (xmin, xmin+dx, ... xmin + (count-1)*dx ) 1008 1009 very useful for transformaiton with other functions e.g. 1010 \code 1011 f=c2_sin<double>::sin(LinearInterpolatingGrid(-0.1,0.1, 65)) 1012 \endcode 1013 creates a spline table of sin(x) slightly beyond the first period 1014 \param xmin the starting point for the grid 1015 \param dx the step size for the grid 1016 \param count the number of points in the grid 1017 \return an identity interpolating_function with the requested grid 1018 */ 1019 template <typename float_type> interpolating_function <float_type> &linear_interpolating_grid(float_type xmin, float_type dx, int count) { 1020 std::vector<float_type> x(count); 1021 for(int i=0; i<count; i++) x[i]=xmin + i * dx; 1022 return *new interpolating_function <float_type>(x,x); 1023 } 1024 1025 /** 1026 \brief create a log-log interpolating grid with both x & y set to 1027 (xmin, xmin*dx, ... xmin * dx^(count-1) ) 1028 1029 very useful for transformaiton with other functions e.g. 1030 \code 1031 f=c2_log<double>::log(LogLogInterpolatingGrid(2, 1.1, 65)) 1032 \endcode 1033 creates a spline table of log(x) 1034 \param xmin the starting point for the grid 1035 \param dx the ratio between points 1036 \param count the number of points in the grid 1037 \return an identity log_log_interpolating_function with the requested grid 1038 */ 1039 template <typename float_type> log_log_interpolating_function <float_type> &log_log_interpolating_grid(float_type xmin, float_type dx, int count) { 1040 std::vector<float_type> x(count); 1041 x[0]=xmin; 1042 for(int i=1; i<count; i++) x[i]=dx*x[i-1]; 1043 return *new log_log_interpolating_function<float_type>(x,x); 1044 } 1632 /// 1633 /// The factory function c2_factory::arrhenius_interpolating_function() creates *new arrhenius_interpolating_function_p() 1634 template <typename float_type=double> class arrhenius_interpolating_function_p : public interpolating_function_p <float_type> { 1635 public: 1636 /// \brief an empty arrhenius cubic-spline interpolating_function_p 1637 /// 1638 arrhenius_interpolating_function_p() : interpolating_function_p<float_type>(*new c2_arrhenius_function_transformation<float_type>) 1639 { } 1640 /// \brief create a new, empty interpolating function of this type (virtual constructor) 1641 virtual interpolating_function_p<float_type> &clone() const throw(c2_exception) 1642 { return *new arrhenius_interpolating_function_p<float_type>(); } 1643 }; 1045 1644 1046 1645 /// \brief compute sin(x) with its derivatives. 1047 /// 1048 /// Creates a singleton instance c2_sin::sin of itself for convenient access. 1049 template <typename float_type=double> class c2_sin : public c2_function<float_type> { 1050 public: 1051 /// \brief constructor. There is alread a singleton c2_sin::sin, which usually suffices. 1052 c2_sin() {} 1646 /// \ingroup math_functions 1647 /// 1648 /// The factory function c2_factory::sin() creates *new c2_sin_p 1649 template <typename float_type=double> class c2_sin_p : public c2_function<float_type> { 1650 public: 1651 /// \brief constructor. 1652 c2_sin_p() : c2_function<float_type>() {} 1053 1653 1054 1654 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) … … 1058 1658 /// \param xmin the lower bound for the grid 1059 1659 /// \param xmax upper bound for the grid 1060 /// \return a new sampling grid. 1061 virtual std::vector<float_type> &get_sampling_grid(float_type xmin, float_type xmax); 1062 /// \brief the static singleton 1063 static const c2_sin sin; 1064 }; 1660 /// \param [in, out] grid the sampling grid. 1661 virtual void get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const; 1662 }; 1663 1065 1664 /// \brief compute cos(x) with its derivatives. 1066 /// 1067 /// Creates a singleton instance c2_cos::cos of itself for convenient access. 1068 template <typename float_type=double> class c2_cos : public c2_sin<float_type> { 1069 public: 1070 /// \brief constructor. There is already a singleton c2_cos::cos, which usually suffices. 1071 c2_cos() {} 1665 /// \ingroup math_functions 1666 /// 1667 /// The factory function c2_factory::cos() creates *new c2_cos_p 1668 template <typename float_type=double> class c2_cos_p : public c2_sin_p<float_type> { 1669 public: 1670 /// \brief constructor. 1671 c2_cos_p() : c2_sin_p<float_type>() {} 1072 1672 1073 1673 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 1074 1674 { float_type q=std::cos(x); if(yprime) *yprime=-std::sin(x); if(yprime2) *yprime2=-q; return q; } 1075 /// \brief the static singleton 1076 static const c2_cos cos; 1077 }; 1675 }; 1676 1078 1677 /// \brief compute tan(x) with its derivatives. 1079 /// 1080 /// Creates a singleton instance c2_tan::tan of itself for convenient access. 1081 template <typename float_type=double> class c2_tan : public c2_function<float_type> { 1082 public: 1083 /// \brief constructor. There is already a singleton c2_tan::tan, which usually suffices. 1084 c2_tan() {} 1678 /// \ingroup math_functions 1679 /// 1680 /// The factory function c2_factory::tan() creates *new c2_tan_p 1681 template <typename float_type=double> class c2_tan_p : public c2_function<float_type> { 1682 public: 1683 /// \brief constructor. 1684 c2_tan_p() : c2_function<float_type>() {} 1085 1685 1086 1686 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) … … 1092 1692 return t; 1093 1693 } 1094 /// \brief the static singleton 1095 static const c2_tan tan; 1096 }; 1694 }; 1695 1097 1696 /// \brief compute log(x) with its derivatives. 1098 /// 1099 /// Creates a singleton instance c2_log::log of itself for convenient access. 1100 template <typename float_type=double> class c2_log : public c2_function<float_type> { 1101 public: 1102 /// \brief constructor. There is already a singleton c2_log::log, which usually suffices. 1103 c2_log() {} 1697 /// \ingroup math_functions 1698 /// 1699 /// The factory function c2_factory::log() creates *new c2_log_p 1700 template <typename float_type=double> class c2_log_p : public c2_function<float_type> { 1701 public: 1702 /// \brief constructor. 1703 c2_log_p() : c2_function<float_type>() {} 1104 1704 1105 1705 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 1106 1706 { if(yprime) *yprime=1.0/x; if(yprime2) *yprime2=-1.0/(x*x); return std::log(x); } 1107 /// \brief the static singleton 1108 static const c2_log log; 1109 }; 1707 }; 1708 1110 1709 /// \brief compute exp(x) with its derivatives. 1111 /// 1112 /// Creates a singleton instance c2_exp::exp of itself for convenient access. 1113 template <typename float_type=double> class c2_exp : public c2_function<float_type> { 1114 public: 1115 /// \brief constructor. There is already a singleton c2_exp::exp, which usually suffices. 1116 c2_exp() {} 1710 /// \ingroup math_functions 1711 /// 1712 /// The factory function c2_factory::exp() creates *new c2_exp_p 1713 template <typename float_type=double> class c2_exp_p : public c2_function<float_type> { 1714 public: 1715 /// \brief constructor. 1716 c2_exp_p() : c2_function<float_type>() {} 1117 1717 1118 1718 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 1119 1719 { float_type q=std::exp(x); if(yprime) *yprime=q; if(yprime2) *yprime2=q; return q; } 1120 /// \ brief the static singleton 1121 static const c2_exp exp; 1122 }; 1720 }; 1721 1123 1722 /// \brief compute sqrt(x) with its derivatives. 1124 /// 1125 /// Creates a singleton instance c2_sqrt::sqrt of itself for convenient access. 1126 template <typename float_type=double> class c2_sqrt : public c2_function<float_type> { 1127 public: 1128 /// \brief constructor. There is already a singleton c2_sqrt::sqrt, which usually suffices. 1129 c2_sqrt() {} 1723 /// \ingroup math_functions 1724 /// 1725 /// The factory function c2_factory::sqrt() creates *new c2_sqrt_p() 1726 template <typename float_type=double> class c2_sqrt_p : public c2_function<float_type> { 1727 public: 1728 /// \brief constructor. 1729 c2_sqrt_p() : c2_function<float_type>() {} 1130 1730 1131 1731 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 1132 1732 { float_type q=std::sqrt(x); if(yprime) *yprime=0.5/q; if(yprime2) *yprime2=-0.25/(x*q); return q; } 1133 /// \brief the static singleton 1134 static const c2_sqrt sqrt; 1135 }; 1733 }; 1734 1136 1735 /// \brief compute scale/x with its derivatives. 1137 /// 1138 /// Creates a singleton instance c2_recip:recip of itself for convenient access. 1139 template <typename float_type=double> class c2_recip : public c2_function<float_type> { 1140 public: 1141 /// \brief constructor. There is already a singleton c2_recip::recip, which usually suffices. 1142 c2_recip(float_type scale) : rscale(scale) {} 1736 /// \ingroup parametric_functions 1737 /// 1738 /// The factory function c2_factory::recip() creates *new c2_recip_p 1739 template <typename float_type=double> class c2_recip_p : public c2_function<float_type> { 1740 public: 1741 /// \brief constructor. 1742 c2_recip_p(float_type scale) : c2_function<float_type>(), rscale(scale) {} 1143 1743 1144 1744 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) … … 1153 1753 /// \param scale the new numerator 1154 1754 void reset(float_type scale) { rscale=scale; } 1155 /// \brief the static singleton1156 static const c2_recip recip;1157 1755 private: 1158 1756 float_type rscale; 1159 1757 }; 1758 1160 1759 /// \brief compute x with its derivatives. 1161 /// 1162 /// Creates a singleton instance c2_identity::identity of itself for convenient access. 1163 template <typename float_type=double> class c2_identity : public c2_function<float_type> { 1164 public: 1165 /// \brief constructor. There is already a singleton c2_identity::identity, which usually suffices. 1166 c2_identity() {} 1760 /// \ingroup math_functions 1761 /// 1762 /// The factory function c2_factory::identity() creates *new c2_identity_p 1763 template <typename float_type=double> class c2_identity_p : public c2_function<float_type> { 1764 public: 1765 /// \brief constructor. 1766 c2_identity_p() : c2_function<float_type>() {} 1167 1767 1168 1768 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 1169 1769 { if(yprime) *yprime=1.0; if(yprime2) *yprime2=0; return x; } 1170 /// \brief the static singleton1171 static const c2_identity identity;1172 1770 }; 1173 1771 1174 1772 /** 1175 1773 \brief create a linear mapping of another function 1176 1774 \ingroup parametric_functions 1177 1775 for example, given a c2_function \a f 1178 1776 \code 1179 c2_linear<double> L(1.2, 2.0, 3.0); 1180 c2_composed_function<double> &F=L(f); 1777 c2_function<double> &F=c2_linear<double>(1.2, 2.0, 3.0)(f); 1181 1778 \endcode 1182 1779 produces a new c2_function F=2.0+3.0*(\a f - 1.2) 1780 1781 The factory function c2_factory::linear() creates *new c2_linear_p 1183 1782 */ 1184 template <typename float_type=double> class c2_linear : public c2_function<float_type> {1783 template <typename float_type=double> class c2_linear_p : public c2_function<float_type> { 1185 1784 public: 1186 1785 /// \brief Construct the operator f=y0 + slope * (x-x0) … … 1188 1787 /// \param y0 the y-intercept i.e. f(x0) 1189 1788 /// \param slope the slope of the mapping 1190 c2_linear(float_type x0, float_type y0, float_type slope) : xint(x0), intercept(y0), m(slope) {} 1789 c2_linear_p(float_type x0, float_type y0, float_type slope) : 1790 c2_function<float_type>(), xint(x0), intercept(y0), m(slope) {} 1191 1791 /// \brief Change the slope and intercepts after construction. 1192 1792 /// \param x0 the x offset … … 1200 1800 float_type xint, intercept, m; 1201 1801 protected: 1202 c2_linear () {} // do not allow naked construction... it is usually an accident.1802 c2_linear_p() {} // do not allow naked construction... it is usually an accident. 1203 1803 }; 1204 1804 1205 1805 /** 1206 1806 \brief create a quadratic mapping of another function 1207 1807 \ingroup parametric_functions 1208 1808 for example, given a c2_function \a f 1209 1809 \code 1210 c2_quadratic<double> Q(1.2, 2.0, 3.0, 4.0); 1211 c2_composed_function<double> &F=Q(f); 1810 c2_function<double> &F=c2_quadratic<double>(1.2, 2.0, 3.0, 4.0)(f); 1212 1811 \endcode 1213 1812 produces a new c2_function F=2.0 + 3.0*(f-1.2) + 4.0*(f-1.2)^2 … … 1215 1814 note that the parameters are overdetermined, but allows the flexibility of two different representations 1216 1815 1816 The factory function c2_factory::quadratic() creates *new c2_quadratic_p 1217 1817 */ 1218 template <typename float_type=double> class c2_quadratic : public c2_function<float_type> {1818 template <typename float_type=double> class c2_quadratic_p : public c2_function<float_type> { 1219 1819 public: 1220 1820 /// \brief Construct the operator … … 1223 1823 /// \param xcoef the scale on the (\a x - \a x0) term 1224 1824 /// \param x2coef the scale on the (\a x - \a x0)^2 term 1225 c2_quadratic(float_type x0, float_type y0, float_type xcoef, float_type x2coef) : intercept(y0), center(x0), a(x2coef), b(xcoef) {} 1226 /// Modify the mapping after construction 1825 c2_quadratic_p(float_type x0, float_type y0, float_type xcoef, float_type x2coef) : 1826 c2_function<float_type>(), intercept(y0), center(x0), a(x2coef), b(xcoef) {} 1827 /// \brief Modify the coefficients after construction 1227 1828 /// \param x0 the new center around which the powers are computed 1228 1829 /// \param y0 the new value of the function at \a x = \a x0 … … 1236 1837 float_type intercept, center, a, b; 1237 1838 protected: 1238 c2_quadratic () {} // do not allow naked construction... it is usually an accident.1839 c2_quadratic_p() {} // do not allow naked construction... it is usually an accident. 1239 1840 }; 1240 1841 1241 1842 /** 1242 1843 \brief create a power law mapping of another function 1243 1844 \ingroup parametric_functions 1244 1845 for example, given a c2_function \a f 1245 1846 \code 1246 c2_power_law <double> PLaw(1.2, 2.5);1247 c2_composed_function <double> &F=PLaw(f);1847 c2_power_law_p<double> PLaw(1.2, 2.5); 1848 c2_composed_function_p<double> &F=PLaw(f); 1248 1849 \endcode 1249 1850 produces a new c2_function F=1.2 * f^2.5 1250 1851 1852 The factory function c2_factory::power_law() creates *new c2_power_law_p 1251 1853 */ 1252 template <typename float_type=double> class c2_power_law : public c2_function<float_type> {1854 template <typename float_type=double> class c2_power_law_p : public c2_function<float_type> { 1253 1855 public: 1254 1856 /// \brief Construct the operator 1255 1857 /// \param scale the multipler 1256 1858 /// \param power the exponent 1257 c2_power_law(float_type scale, float_type power) : a(scale), b(power) {} 1859 c2_power_law_p(float_type scale, float_type power) : 1860 c2_function<float_type>(), a(scale), b(power) {} 1258 1861 /// \brief Modify the mapping after construction 1259 1862 /// \param scale the new multipler … … 1266 1869 float_type a, b; 1267 1870 protected: 1268 c2_power_law () {} // do not allow naked construction... it is usually an accident.1871 c2_power_law_p() {} // do not allow naked construction... it is usually an accident. 1269 1872 }; 1270 1873 1271 1874 /** 1272 1875 \brief create the formal inverse function of another function 1273 1876 \ingroup containers 1274 1877 for example, given a c2_function \a f 1275 1878 \code … … 1282 1885 derivatives, too, unlike the case of a simple root-finding inverse. This means 1283 1886 it can be integrated (for example) quite efficiently. 1284 1285 Note that it is a subclass of c2_scaled_function only to manage ownership of another c2_function. 1286 */ 1287 template <typename float_type=double> class c2_inverse_function : public c2_plugin_function<float_type> { 1887 1888 \see \ref combined_inversion_hinting_sampling 1889 1890 The factory function c2_factory::inverse_function() creates *new c2_inverse_function_p 1891 */ 1892 template <typename float_type=double> class c2_inverse_function_p : public c2_function<float_type> { 1288 1893 public: 1289 1894 /// \brief Construct the operator 1290 1895 /// \param source the function to be inverted 1291 c2_inverse_function (const c2_function<float_type> &source);1896 c2_inverse_function_p(const c2_function<float_type> &source); 1292 1897 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception); 1293 1898 … … 1301 1906 /// It is used in value_with_derivatives() to guess where to start the root finder. 1302 1907 /// \param x the abscissa for which an estimate is needed 1303 virtual float_type get_start_hint(float_type x) const { return start_hint; } 1304 1908 virtual float_type get_start_hint(float_type x) const 1909 { return hinting_function.valid()? hinting_function(x) : start_hint; } 1910 1911 /// \brief set or unset the approximate function used to start the root finder 1912 /// \anchor set_hinting_function_discussion 1913 /// A hinting function is mostly useful if the evaluation of this inverse is 1914 /// going to be carried out in very non-local order, so the root finder has to start over 1915 /// for each step. If most evaluations are going to be made in fairly localized clusters (scanning 1916 /// through the function, for example), the default mechanism used (which just remembers the last point) 1917 /// is almost certainly faster. 1918 /// 1919 /// Typically, the hinting function is likely to be set up by creating the inverse function, 1920 /// and then adaptively sampling an interpolating function from it, and then using the result 1921 /// to hint it. Another way, if the parent function is already an interpolating function, is just to create 1922 /// a version of the parent with the x & y coordinates reversed. 1923 /// 1924 /// \see \ref combined_inversion_hinting_sampling 1925 /// 1926 /// \param hint_func the function that is an approximate inverse of the parent of this inverse_function 1927 void set_hinting_function(const c2_function<float_type> *hint_func) 1928 { hinting_function.set_function(hint_func); } 1929 /// \brief set the hinting function from a pointer. 1930 /// 1931 /// See \ref set_hinting_function_discussion "discussion" 1932 /// \param hint_func the container holding the function 1933 void set_hinting_function(const c2_const_ptr<float_type> hint_func) 1934 { hinting_function=hint_func; } 1935 1305 1936 protected: 1306 c2_inverse_function() {} // do not allow naked construction... it is usually an accident. 1307 mutable float_type start_hint; 1937 c2_inverse_function_p() {} // do not allow naked construction... it is usually an accident. 1938 mutable float_type start_hint; 1939 const c2_const_ptr<float_type> func; 1940 c2_const_ptr<float_type> hinting_function; 1308 1941 }; 1309 1942 1310 1943 /** 1311 1944 \brief 1312 An interpolating_function which is the cumulative integral of a histogram.1313 1945 An interpolating_function_p which is the cumulative integral of a histogram. 1946 \ingroup interpolators 1314 1947 Note than binedges should be one element longer than binheights, since the lower & upper edges are specified. 1315 1948 Note that this is a malformed spline, since the second derivatives are all zero, so it has less continuity. … … 1318 1951 */ 1319 1952 1320 template <typename float_type=double> class accumulated_histogram : public interpolating_function <float_type> {1953 template <typename float_type=double> class accumulated_histogram : public interpolating_function_p <float_type> { 1321 1954 public: 1322 1955 /// \brief Construct the integrated histogram … … 1332 1965 1333 1966 /** 1334 \brief Construct a function useful for generation of random numbers from the given distribution 1335 1336 inverse_integrated_density<InterpolatingFunctionFlavor>() starts with a probability density c2_function, generates the integral, 1337 and generates an interpolating_function which, when evaluated using a uniform random on [0,1] returns values 1338 with a density distribution equal to the input distribution 1339 If the data are passed in reverse order (large X first), the integral is carried out from the big end. 1967 \anchor inverse_integrated_density_bins 1968 \brief construct from a grid of points and an std::vector of probability densities (un-normalized) 1969 \see \ref random_subsec "Arbitrary random generation" 1970 \ingroup interpolators 1971 inverse_integrated_density starts with a probability density std::vector, generates the integral, 1972 and generates an interpolating_function_p of the inverse function which, when evaluated using a uniform random on [0,1] returns values 1973 with a density distribution equal to the input distribution 1974 If the data are passed in reverse order (large X first), the integral is carried out from the big end. 1975 1976 \param bins if \a bins .size()==\a binheights .size(), the centers of the bins. \n 1977 if \a bins .size()==\a binheights .size()+1, the edges of the bins 1978 \param binheights a vector which describes the density of the random number distribution to be produced. 1979 Note density... the numbers in the bins are not counts, but counts/unit bin width. 1980 \return an interpolating_function_p of the type requested in the template which, 1981 if evaluated randomly with a uniform variate on [0,1] produces numbers 1982 distributed according to \a binheights 1983 */ 1984 1985 template <typename float_type, typename Final> 1986 interpolating_function_p<float_type> & inverse_integrated_density_bins( 1987 const std::vector<float_type> &bins, const std::vector<float_type> &binheights) 1988 throw(c2_exception); 1989 1990 /** 1991 \anchor inverse_integrated_density_function 1992 \brief construct from a grid of points and a c2_function of probability densities (un-normalized) 1993 \see \ref random_subsec "Arbitrary random generation" 1994 \ingroup interpolators 1995 inverse_integrated_density starts with a probability density std::vector, generates the integral, 1996 and generates an interpolating_function_p of the inverse function which, when evaluated using a uniform random on [0,1] returns values 1997 with a density distribution equal to the input distribution 1998 If the data are passed in reverse order (large X first), the integral is carried out from the big end. 1340 1999 1341 \sa template <typename Intermediate, typename Final> Final inverse_integrated_density(const std::vector, c2_function &) 1342 1343 \param bincenters points at which to sample the c2_function \a binheights 1344 \param binheights a c2_function which describes the random number distribution to be produced. 1345 \return an interpolating_function of the type requested in the template which, 1346 if evaluated randomly with a uniform variate on [0,1) produces numbers 1347 distributed according to \a binheights 1348 */ 1349 1350 template <typename float_type, typename Final > 1351 Final &inverse_integrated_density(const std::vector<float_type> &bincenters, c2_function<float_type> &binheights) 1352 { 1353 std::vector<float_type> integral; 1354 1355 // integrate from first to last bin in original order, leaving results in integral 1356 // ask for relative error of 1e-6 on each bin, with absolute error set to 0 (since we don't know the data scale). 1357 float_type sum=binheights.partial_integrals(bincenters, &integral, 0.0, 1e-6); 1358 // the integral vector now has partial integrals... it must be accumulated by summing 1359 integral.insert(integral.begin(), 0.0); // integral from start to start is 0 1360 float_type scale=1.0/sum; 1361 for(size_t i=1; i<integral.size(); i++) integral[i]=integral[i]*scale + integral[i-1]; 1362 integral.back()=1.0; // force exact value on boundary 1363 1364 return *new Final(integral, bincenters, 1365 false, 1.0/(scale*binheights(bincenters.front() )), 1366 false, 1.0/(scale*binheights(bincenters.back() )) 1367 ); // use integral as x axis in inverse function 1368 } 1369 1370 /** 1371 \brief Construct a function useful for generation of random numbers from the given distribution 1372 1373 \code 1374 template <typename Intermediate, typename Final> 1375 Final & inverse_integrated_density(const std::vector &bincenters, const std::vector &binheights) 1376 \endcode 1377 is a variant of \code 1378 template <typename Final> 1379 Final & inverse_integrated_density(const std::vector &bincenters, c2_function &binheights) 1380 \endcode 1381 which takes two std::vectors and generates the intermediate interpolating_function required for 1382 inverse_integrated_density(), and then calls it. 1383 1384 \param bincenters points at which \a binheights are defined 1385 \param binheights an std::vector which describes the random number distribution to be produced. 1386 \return an interpolating_function of the type requested in the template which, 1387 if evaluated randomly with a uniform variate on [0,1) produces numbers 1388 distributed according to \a binheights 1389 */ 1390 1391 template <typename float_type, typename Intermediate, typename Final> Final 1392 &inverse_integrated_density(const std::vector<float_type> &bincenters, const std::vector<float_type> &binheights) 1393 { 1394 std::vector<float_type> be(bincenters), bh(binheights); 1395 1396 if(be[1] < be[0]) { // reverse data for interpolator if x axis passed in backwards 1397 std::reverse(be.begin(), be.end()); 1398 std::reverse(bh.begin(), bh.end()); 1399 } 1400 1401 Intermediate temp(be, bh); // create a temporary interpolating_function to integrate 1402 Final &result=inverse_integrated_density<Final>(bincenters, temp); 1403 1404 return result; 1405 } 2000 \param bincenters the centers of the bins. 2001 \param binheights a c2_function which describes the density of the random number distribution to be produced. 2002 \return an interpolating_function_p of the type requested in the template which, 2003 if evaluated randomly with a uniform variate on [0,1] produces numbers 2004 distributed according to \a binheights 2005 */ 2006 template <typename float_type, typename Final> 2007 interpolating_function_p<float_type> & inverse_integrated_density_function( 2008 const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights) 2009 throw(c2_exception); 1406 2010 1407 2011 /// \brief create a c2_function which smoothly connects two other c2_functions. 1408 /// 2012 /// \ingroup parametric_functions 1409 2013 /// This takes two points and generates a polynomial which matches two c2_function arguments 1410 2014 /// at those two points, with two derivatives at each point, and an arbitrary value at the center of the … … 1414 2018 /// of order 5. If \a auto_center is false, the value \a y1 is used at the midpoint, resulting in a 1415 2019 /// polynomial of order 6. 1416 template <typename float_type=double> class c2_connector_function : public c2_function<float_type> { 2020 /// 2021 /// This is usually used in conjunction with c2_piecewise_function_p to assemble an apparently seamless 2022 /// function from a series of segments. 2023 /// \see \ref piecewise_applications_subsec "Sample Applications" and \ref c2_function::adaptively_sample() "Adaptive sampling" 2024 /// 2025 /// The factory function c2_factory::connector_function() creates *new c2_connector_function_p 2026 template <typename float_type=double> class c2_connector_function_p : public c2_function<float_type> { 1417 2027 public: 1418 /// \brief construct the container 1419 /// \param f1 the function on the left side to be connected 2028 /// \brief construct the container from two functions 2029 /// \param x0 the point at which to match \a f1 and its derivatives 2030 /// \param f0 the function on the left side to be connected 2031 /// \param x2 the point at which to match \a f2 and its derivatives 1420 2032 /// \param f2 the function on the right side to be connected 1421 /// \param x0 the point at which to match \a f1 and its derivatives1422 /// \param x2 the point at which to match \a f2 and its derivatives1423 2033 /// \param auto_center if true, no midpoint value is specified. If false, match the value \a y1 at the midpoint 1424 2034 /// \param y1 the value to match at the midpoint, if \a auto_center is false 1425 /// \return a c2_function with domain (\a x0,\a x2) which smoothly connects \a f 1 and \a f21426 c2_connector_function (const c2_function<float_type> &f1, const c2_function<float_type> &f2, float_type x0, float_type x2,2035 /// \return a c2_function with domain (\a x0,\a x2) which smoothly connects \a f0(x0) and \a f2(x2) 2036 c2_connector_function_p(float_type x0, const c2_function<float_type> &f0, float_type x2, const c2_function<float_type> &f2, 1427 2037 bool auto_center, float_type y1); 2038 /// \brief construct the container from numerical values 2039 /// \param x0 the position of the left edge 2040 /// \param y0 the function derivative on the left boundary 2041 /// \param yp0 the function second derivative on the left boundary 2042 /// \param ypp0 the function value on the left boundary 2043 /// \param x2 the position of the right edge 2044 /// \param y2 the function derivative on the right boundary 2045 /// \param yp2 the function second derivative on the right boundary 2046 /// \param ypp2 the function value on the right boundary 2047 /// \param auto_center if true, no midpoint value is specified. If false, match the value \a y1 at the midpoint 2048 /// \param y1 the value to match at the midpoint, if \a auto_center is false 2049 /// \return a c2_function with domain (\a x0,\a x2) which smoothly connects the points described 2050 /// \anchor c2_connector_raw_init_docs 2051 c2_connector_function_p( 2052 float_type x0, float_type y0, float_type yp0, float_type ypp0, 2053 float_type x2, float_type y2, float_type yp2, float_type ypp2, 2054 bool auto_center, float_type y1); 2055 /// \brief construct the container from c2_fblock<float_type> objects 2056 /// \param fb0 the left edge 2057 /// \param fb2 the right edge 2058 /// \param auto_center if true, no midpoint value is specified. If false, match the value \a y1 at the midpoint 2059 /// \param y1 the value to match at the midpoint, if \a auto_center is false 2060 /// \return a c2_function with domain (\a fb0.x,\a fb2.x) which smoothly connects \a fb0 and \a fb2 2061 c2_connector_function_p( 2062 const c2_fblock<float_type> &fb0, 2063 const c2_fblock<float_type> &fb2, 2064 bool auto_center, float_type y1); 2065 1428 2066 /// \brief destructor 1429 virtual ~c2_connector_function ();2067 virtual ~c2_connector_function_p(); 1430 2068 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception); 1431 2069 protected: 1432 float_type fx1, fhinv, fdx, fy1, fa, fb, fc, fd, fe, ff; 1433 }; 1434 1435 2070 /// \brief fill container numerically 2071 void init( 2072 const c2_fblock<float_type> &fb0, 2073 const c2_fblock<float_type> &fb2, 2074 bool auto_center, float_type y1); 2075 2076 float_type fhinv, fy1, fa, fb, fc, fd, fe, ff; 2077 }; 1436 2078 1437 2079 /// \brief create a c2_function which is a piecewise assembly of other c2_functions. 1438 /// 2080 /// \ingroup containers 1439 2081 /// The functions must have increasing, non-overlapping domains. Any empty space 1440 2082 /// between functions will be filled with a linear interpolation. 2083 /// 2084 /// \note If you want a smooth connection, instead of the default linear interpolation, 2085 /// create a c2_connector_function_p to bridge the gap. The linear interpolation is intended 2086 /// to be a barely intelligent bridge, and may never get used by anyone. 2087 /// 1441 2088 /// \note The creation of the container results in the creation of an explicit sampling grid. 1442 2089 /// If this is used with functions with a large domain, or which generate very dense sampling grids, 1443 2090 /// it could eat a lot of memory. Do not abuse this by using functions which can generate gigantic grids. 1444 2091 /// 1445 /// See c2_plugin_function for a discussion of how this might be used. 1446 template <typename float_type=double> class c2_piecewise_function : public c2_function<float_type> { 2092 /// \see \ref piecewise_applications_subsec "Sample Applications" \n 2093 /// c2_plugin_function_p page \n 2094 /// c2_connector_function_p page \n 2095 /// \ref c2_function::adaptively_sample() "Adaptive sampling" 2096 /// 2097 /// The factory function c2_factory::piecewise_function() creates *new c2_piecewise_function_p 2098 template <typename float_type=double> class c2_piecewise_function_p : public c2_function<float_type> { 1447 2099 public: 1448 2100 /// \brief construct the container 1449 c2_piecewise_function ();2101 c2_piecewise_function_p(); 1450 2102 /// \brief destructor 1451 virtual ~c2_piecewise_function ();2103 virtual ~c2_piecewise_function_p(); 1452 2104 virtual float_type value_with_derivatives(float_type x, float_type *yprime, float_type *yprime2) const throw (c2_exception); 1453 2105 /// \brief append a new function to the sequence … … 1457 2109 /// the final function. If the domain exactly abuts the domain of the previous function, it 1458 2110 /// will be directly attached. If there is a gap, the gap will be filled in by linear interpolation. 1459 /// If the function being appended is to be deleted automatically when this container is deleted, set the pass_ownership flag.1460 2111 /// \param func a c2_function with a defined domain to be appended to the collection 1461 /// \param pass_ownership if set, \a func will be deleted when the container is destroyed 1462 void append_function(c2_function<float_type> &func, bool pass_ownership) throw (c2_exception); 2112 void append_function(const c2_function<float_type> &func) throw (c2_exception); 1463 2113 protected: 1464 std::vector<c2_function<float_type> *> functions; 1465 std::vector<bool> owns; 2114 std::vector<c2_const_ptr<float_type> > functions; 1466 2115 mutable int lastKLow; 1467 2116 }; -
trunk/examples/extended/electromagnetic/TestEm7/include/c2_function.icc
r807 r1230 1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // 1 27 /** 2 28 * \file … … 7 33 * \author Copyright 2005 __Vanderbilt University__. All rights reserved. 8 34 * 9 * \version c2_function.cc,v 1. 43 2007/11/12 20:22:54marcus Exp35 * \version c2_function.cc,v 1.169 2008/05/22 12:45:19 marcus Exp 10 36 */ 11 37 … … 22 48 23 49 template <typename float_type> const std::string c2_function<float_type>::cvs_file_vers() const 24 { return "c2_function.cc,v 1. 43 2007/11/12 20:22:54marcus Exp"; }50 { return "c2_function.cc,v 1.169 2008/05/22 12:45:19 marcus Exp"; } 25 51 26 52 // find a pre-bracketed root of a c2_function, which is a MUCH easier job than general root finding … … 33 59 // find f(x)=value within the brackets, using the guarantees of smoothness associated with a c2_function 34 60 // can use local f(x)=a*x**2 + b*x + c and solve quadratic to find root, then iterate 35 reset_evaluations();36 61 37 62 float_type yp, yp2; // we will make unused pointers point here, to save null checks later … … 47 72 float_type c, b; 48 73 74 if(!root_info) { 75 root_info=new struct c2_root_info; 76 root_info->inited=false; 77 } 49 78 // this new logic is to keep track of where we were before, and lower the number of 50 79 // function evaluations if we are searching inside the same bracket as before. 51 80 // Since this root finder has, very often, the bracket of the entire domain of the function, 52 81 // this makes a big difference, especially to c2_inverse_function 53 if(!rootInitialized || upper_bracket != lastRootUpperX || lower_bracket != lastRootLowerX) { 54 lastRootUpperY=value_with_derivatives(upper_bracket, final_yprime, final_yprime2); 55 increment_evaluations(); 56 lastRootUpperX=upper_bracket; 57 58 lastRootLowerY=value_with_derivatives(lower_bracket, final_yprime, final_yprime2); 59 increment_evaluations(); 60 lastRootLowerX=lower_bracket; 61 rootInitialized=true; 62 } 63 64 float_type clower=lastRootLowerY-value; 65 float_type cupper=lastRootUpperY-value; 66 if(clower*cupper >0) { 82 if(!root_info->inited || upper_bracket != root_info->upper.x || lower_bracket != root_info->lower.x) { 83 root_info->upper.x=upper_bracket; 84 fill_fblock(root_info->upper); 85 root_info->lower.x=lower_bracket; 86 fill_fblock(root_info->lower); 87 root_info->inited=true; 88 } 89 90 float_type clower=root_info->lower.y-value; 91 if(!clower) { 92 *final_yprime=root_info->lower.yp; 93 *final_yprime2=root_info->lower.ypp; 94 return lower_bracket; 95 } 96 97 float_type cupper=root_info->upper.y-value; 98 if(!cupper) { 99 *final_yprime=root_info->upper.yp; 100 *final_yprime2=root_info->upper.ypp; 101 return upper_bracket; 102 } 103 const float_type lower_sign = (clower < 0) ? -1 : 1; 104 105 if(lower_sign*cupper >0) { 67 106 // argh, no sign change in here! 68 107 if(error) { *error=1; return 0.0; } … … 104 143 } 105 144 c=value_with_derivatives(root, final_yprime, final_yprime2)-value; // compute initial values 145 if(c2_isnan(c)) { 146 bad_x_point=root; 147 return c; // return the nan if a computation failed 148 } 106 149 b=*final_yprime; // make a local copy for readability 107 150 increment_evaluations(); 108 151 109 152 // now, close in bracket on whichever side this still brackets 110 if(c* clower< 0.0) {153 if(c*lower_sign < 0.0) { 111 154 cupper=c; 112 155 upper_bracket=root; … … 131 174 132 175 // the recursive part of the integrator is agressively designed to minimize copying of data... lots of pointers 133 template <typename float_type> float_type c2_function<float_type>::integrate_step(c2_integrate_recur &rb) const 134 { 135 struct c2_integrate_fblock *fbl[3]={rb.f0, rb.f1, rb.f2}; 136 struct c2_integrate_fblock f1; // will hold new middle values 137 float_type retvals[2]={0.0,0.0}; 138 float_type lr[2]; 139 140 // std::cout << "entering with " << rb.f0->x << " " << rb.f1->x << " " << rb.f2->x << std::endl; 141 142 int depth=rb.depth; // save this from the recursion block 143 float_type abs_tol=rb.abs_tol; // this is the value we will pass down 144 float_type *rblr=rb.lr; // save pointer to our parent's lr[2] array since it will get trampled in recursion 145 146 if(!depth) { 176 template <typename float_type> float_type c2_function<float_type>::integrate_step(c2_integrate_recur &rb) const throw(c2_exception) 177 { 178 std::vector< recur_item > &rb_stack=*rb.rb_stack; // heap-based stack of data for recursion 179 rb_stack.clear(); 180 181 recur_item top; 182 top.depth=0; top.done=false; top.f0index=0; top.f2index=0; top.step_sum=0; 183 184 // push storage for our initial elements 185 rb_stack.push_back(top); 186 rb_stack.back().f1=*rb.f0; 187 rb_stack.back().done=true; // this element will never be evaluated further 188 189 rb_stack.push_back(top); 190 rb_stack.back().f1=*rb.f1; 191 rb_stack.back().done=true; // this element will never be evaluated further 192 193 if(!rb.inited) { 147 194 switch(rb.derivs) { 148 195 case 0: … … 157 204 158 205 rb.extrap2=1.0/(rb.extrap_coef-1.0); 159 } 160 161 for (int i=0; i<(depth==0?1:2); i++) { // handle left and right intervals, but only left one for depth=0 162 struct c2_integrate_fblock *f0=fbl[i], *f2=fbl[i+1]; 163 f1.x=0.5*(f0->x + f2->x); // center of interval 164 float_type dx=f2->x - f0->x; 165 float_type dx2 = 0.5*dx; 166 float_type total; 167 168 f1.y=value_with_derivatives(f1.x, &(f1.yp), &(f1.ypp)); 169 increment_evaluations(); 170 206 rb.dx_tolerance=10.0*std::numeric_limits<float_type>::epsilon(); 207 rb.abs_tol_min=10.0*std::numeric_limits<float_type>::min(); 208 rb.inited=true; 209 } 210 211 // now, push our first real element 212 top.f0index=0; // left element is stack[0] 213 top.f2index=1; // right element is stack[1] 214 top.abs_tol=rb.abs_tol; 215 rb_stack.push_back(top); 216 217 while(rb_stack.size() > 2) { 218 recur_item &back=rb_stack.back(); 219 if(back.done) { 220 float_type sum=back.step_sum; 221 rb_stack.pop_back(); 222 rb_stack.back().step_sum+=sum; // bump our sum up to the parent 223 continue; 224 } 225 back.done=true; 226 227 c2_fblock<float_type> &f0=rb_stack[back.f0index].f1, &f2=rb_stack[back.f2index].f1; 228 c2_fblock<float_type> &f1=back.f1; // will hold new middle values 229 size_t f1index=rb_stack.size()-1; // our current offset 230 float_type abs_tol=back.abs_tol; 231 232 f1.x=0.5*(f0.x + f2.x); // center of interval 233 float_type dx2=0.5*(f2.x - f0.x); 234 171 235 // check for underflow on step size, which prevents us from achieving specified accuracy. 172 if(std::abs(dx ) < std::abs(f1.x)*rb.rel_tol) {236 if(std::abs(dx2) < std::abs(f1.x)*rb.dx_tolerance || std::abs(dx2) < rb.abs_tol_min) { 173 237 std::ostringstream outstr; 174 outstr << "Step size underflow in adaptive_partial_integrals at depth=" << depth << ", x= " << f1.x;238 outstr << "Step size underflow in adaptive_partial_integrals at depth=" << back.depth << ", x= " << f1.x; 175 239 throw c2_exception(outstr.str().c_str()); 176 240 } 177 241 178 if(!depth) { // top level, total has not been initialized yet 179 switch(rb.derivs) { // create estimate of next lower order for first try 242 fill_fblock(f1); 243 if(c2_isnan(f1.y)) { 244 bad_x_point=f1.x; 245 return f1.y; // can't go any further if a nan has appeared 246 } 247 248 bool yptrouble=f0.ypbad || f2.ypbad || f1.ypbad; 249 bool ypptrouble=f0.yppbad || f2.yppbad || f1.yppbad; 250 251 // select the real derivative count based on whether we are at a point where derivatives exist 252 int derivs = std::min(rb.derivs, (yptrouble||ypptrouble)?(yptrouble?0:1):2); 253 254 if(!back.depth) { // top level, total has not been initialized yet 255 switch(derivs) { // create estimate of next lower order for first try 180 256 case 0: 181 total=0.5*(f0->y+f2->y)*dx; break;257 back.previous_estimate=(f0.y+f2.y)*dx2; break; 182 258 case 1: 183 total=(f0->y+4.0*f1.y+f2->y)*dx/6.0; break;259 back.previous_estimate=(f0.y+4.0*f1.y+f2.y)*dx2/3.0; break; 184 260 case 2: 185 total=( (14*f0->y + 32*f1.y + 14*f2->y) + dx * (f0->yp - f2->yp) ) * dx /60.; break;261 back.previous_estimate=( (14*f0.y + 32*f1.y + 14*f2.y) + 2*dx2 * (f0.yp - f2.yp) ) * dx2 /30.; break; 186 262 default: 187 total=0.0; // just to suppress missing default warnings263 back.previous_estimate=0.0; // just to suppress missing default warnings 188 264 } 189 } else total=rblr[i]; // otherwise, get it from previous level265 } 190 266 191 267 float_type left, right; 192 268 193 switch(rb.derivs) { 269 // pre-compute constants so all multiplies use a small dynamic range 270 // constants for 0 derivative integrator 271 static const float_type c0c1=5./12., c0c2=8./12., c0c3=-1./12.; 272 // constants for 1 derivative integrator 273 static const float_type c1c1=101./240., c1c2=128./240., c1c3=11./240., 274 c1c4=13./240., c1c5=-40./240., c1c6=-3./240.; 275 // constants for 2 derivative integrator 276 static const float_type c2c1=169./40320., c2c2=1024./ 40320., c2c3=-41./40320., 277 c2c4=2727./40320., c2c5=-5040./40320., c2c6=423./40320., 278 c2c7=17007./40320., c2c8=24576./40320., c2c9=-1263./40320.; 279 280 switch(derivs) { 194 281 case 2: 195 282 // use ninth-order estimates for each side, from full set of all values (!) (Thanks, Mathematica!) 196 left= ( ( ( 169*f0->ypp + 1024*f1.ypp - 41*f2->ypp)*dx2 +197 ( 2727*f0->yp - 5040*f1.yp + 423*f2->yp) )*dx2 +198 ( 17007*f0->y + 24576*f1.y - 1263*f2->y) )* (dx2/40320.0);199 right= ( ( ( 169*f2->ypp + 1024*f1.ypp - 41*f0->ypp)*dx2 -200 ( 2727*f2->yp - 5040*f1.yp + 423*f0->yp) )*dx2 +201 ( 17007*f2->y + 24576*f1.y - 1263*f0->y) )* (dx2/40320.0);202 // std::cout << f0 ->x << " " << f1.x << " " << f2->x << std::endl ;203 // std::cout << f0 ->y << " " << f1.y << " " << f2->y << " " << left << " " << right << " " << total << std::endl ;283 left= ( ( (c2c1*f0.ypp + c2c2*f1.ypp + c2c3*f2.ypp)*dx2 + 284 (c2c4*f0.yp + c2c5*f1.yp + c2c6*f2.yp) )*dx2 + 285 (c2c7*f0.y + c2c8*f1.y + c2c9*f2.y) )* dx2; 286 right= ( ( (c2c1*f2.ypp + c2c2*f1.ypp + c2c3*f0.ypp)*dx2 - 287 (c2c4*f2.yp + c2c5*f1.yp + c2c6*f0.yp) )*dx2 + 288 (c2c7*f2.y + c2c8*f1.y + c2c9*f0.y) )* dx2; 289 // std::cout << f0.x << " " << f1.x << " " << f2.x << std::endl ; 290 // std::cout << f0.y << " " << f1.y << " " << f2.y << " " << left << " " << right << " " << total << std::endl ; 204 291 break; 205 292 case 1: 206 left= ( ( 202*f0->y + 256*f1.y + 22*f2->y) + dx*(13*f0->yp - 40*f1.yp - 3*f2->yp) ) * dx /960.;207 right= ( ( 202*f2->y + 256*f1.y + 22*f0->y) - dx*(13*f2->yp - 40*f1.yp - 3*f0->yp) ) * dx /960.;293 left= ( (c1c1*f0.y + c1c2*f1.y + c1c3*f2.y) + dx2*(c1c4*f0.yp + c1c5*f1.yp + c1c6*f2.yp) ) * dx2 ; 294 right= ( (c1c1*f2.y + c1c2*f1.y + c1c3*f0.y) - dx2*(c1c4*f2.yp + c1c5*f1.yp + c1c6*f0.yp) ) * dx2 ; 208 295 break; 209 296 case 0: 210 left= ( 5*f0->y + 8*f1.y - f2->y)*dx/24.;211 right= ( 5*f2->y + 8*f1.y - f0->y)*dx/24.;297 left= (c0c1*f0.y + c0c2*f1.y + c0c3*f2.y)*dx2; 298 right= (c0c1*f2.y + c0c2*f1.y + c0c3*f0.y)*dx2; 212 299 break; 213 300 default: … … 216 303 } 217 304 218 lr[0]= left; // left interval219 lr[1]= right; // right interval220 305 float_type lrsum=left+right; 221 306 222 float_type eps=std::abs(total-lrsum)*rb.eps_scale; 223 if(rb.extrapolate) eps*=rb.eps_scale; 224 225 if(!rb.adapt || eps < abs_tol || eps < std::abs(total)*rb.rel_tol) { 226 if(depth==0 || !rb.extrapolate) retvals[i]=lrsum; 227 else { 228 retvals[i]=(rb.extrap_coef*lrsum - total)*rb.extrap2; 229 // std::cout << "extrapolating " << lrsum << " " << total << " " << retvals[i] << std::endl; 230 231 } 307 bool extrapolate=back.depth && rb.extrapolate && (derivs==rb.derivs); // only extrapolate if no trouble with derivs 308 float_type eps=std::abs(back.previous_estimate-lrsum)*rb.eps_scale; 309 if(extrapolate) eps*=rb.eps_scale; 310 311 if(rb.adapt && eps > abs_tol && eps > std::abs(lrsum)*rb.rel_tol) { 312 // tolerance not met, subdivide & recur 313 if(abs_tol > rb.abs_tol_min) abs_tol=abs_tol*0.5; // each half has half the error budget 314 top.abs_tol=abs_tol; 315 top.depth=back.depth+1; 316 317 // save the last things we need from back before a push happens, in case 318 // the push causes a reallocation and moves the whole stack. 319 size_t f0index=back.f0index, f2index=back.f2index; 320 321 top.f0index=f1index; top.f2index=f2index; // insert pointers to right side data into our recursion block 322 top.previous_estimate=right; 323 rb_stack.push_back(top); 324 325 top.f0index=f0index; top.f2index=f1index; // insert pointers to left side data into our recursion block 326 top.previous_estimate=left; 327 rb_stack.push_back(top); 328 329 } else if(extrapolate) { 330 // extrapolation only happens on leaf nodes, where the tolerance was met. 331 back.step_sum+=(rb.extrap_coef*lrsum - back.previous_estimate)*rb.extrap2; 232 332 } else { 233 rb.depth=depth+1; // increment depth counter 234 rb.lr=lr; // point to our left-right values array for recursion 235 rb.abs_tol=abs_tol*0.5; // each half has half the error budget 236 rb.f0=f0; rb.f1=&f1; rb.f2=f2; // insert pointers to data into our recursion block 237 // std::cout << "recurring with " << f0->x << " " << f1.x << " " << f2->x << std::endl ; 238 retvals[i]=integrate_step(rb); // and recur 239 } 240 } 241 return retvals[0]+retvals[1]; 333 back.step_sum+=lrsum; 334 } 335 } 336 return rb_stack.back().step_sum; // last element on the stack holds the sum 242 337 } 243 338 244 339 template <typename float_type> bool c2_function<float_type>::check_monotonicity( 245 const std::vector<float_type> &data, const char message[]) throw(c2_exception)340 const std::vector<float_type> &data, const char message[]) const throw(c2_exception) 246 341 { 247 342 size_t np=data.size(); … … 269 364 } 270 365 271 template <typename float_type> std::vector<float_type> &c2_function<float_type>::get_sampling_grid(float_type xmin, float_type xmax) const 272 { 273 std::vector<float_type> *result=new std::vector<float_type>; 366 template <typename float_type> void c2_function<float_type>:: 367 get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const 368 { 369 std::vector<float_type> *result=&grid; 370 result->clear(); 274 371 275 372 if( !(sampling_grid) || !(sampling_grid->size()) || (xmax <= sampling_grid->front()) || (xmin >= sampling_grid->back()) ) { … … 313 410 std::copy(sg.begin()+firstindex, sg.begin()+lastindex+1, result->begin()+initsize); 314 411 result->back()=xmax; 315 412 316 413 // this is the unrefined sampling grid... now check for very close points on front & back and fix if needed. 317 414 preen_sampling_grid(result); 318 415 } 319 return *result;320 416 } 321 417 … … 351 447 } 352 448 353 template <typename float_type> std::vector<float_type> &c2_function<float_type>::354 refine_sampling_grid( conststd::vector<float_type> &grid, size_t refinement) const449 template <typename float_type> void c2_function<float_type>:: 450 refine_sampling_grid(std::vector<float_type> &grid, size_t refinement) const 355 451 { 356 452 size_t np=grid.size(); … … 358 454 float_type dxscale=1.0/refinement; 359 455 360 std::vector<float_type> *result=new std::vector<float_type>(count);456 std::vector<float_type> result(count); 361 457 362 458 for(size_t i=0; i<(np-1); i++) { 363 459 float_type x=grid[i]; 364 460 float_type dx=(grid[i+1]-x)*dxscale; 365 for(size_t j=0; j<refinement; j++, x+=dx) (*result)[i*refinement+j]=x;366 } 367 (*result)[count-1]=grid.back();368 return *result;461 for(size_t j=0; j<refinement; j++, x+=dx) result[i*refinement+j]=x; 462 } 463 result.back()=grid.back(); 464 grid=result; // copy the expanded grid back to the input 369 465 } 370 466 371 467 template <typename float_type> float_type c2_function<float_type>::integral(float_type xmin, float_type xmax, std::vector<float_type> *partials, 372 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const 373 { 374 std::vector<float_type> &grid=get_sampling_grid(xmin, xmax); 375 float_type intg=partial_integrals(grid, partials, abs_tol, rel_tol, adapt, extrapolate); 376 delete &grid; 468 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const throw(c2_exception) 469 { 470 if(xmin==xmax) { 471 if(partials) partials->clear(); 472 return 0.0; 473 } 474 std::vector<float_type> grid; 475 get_sampling_grid(xmin, xmax, grid); 476 float_type intg=partial_integrals(grid, partials, abs_tol, rel_tol, derivs, adapt, extrapolate); 377 477 return intg; 378 478 } 379 479 380 480 template <typename float_type> c2_function<float_type> &c2_function<float_type>::normalized_function(float_type xmin, float_type xmax, float_type norm) 481 const throw(c2_exception) 381 482 { 382 483 float_type intg=integral(xmin, xmax); 383 return *new c2_scaled_function<float_type>(*this, norm/intg); 384 } 385 386 template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function(float_type xmin, float_type xmax, float_type norm) 387 { 388 c2_quadratic<float_type> q(0., 0., 0., 1.); 389 c2_composed_function<float_type> mesquared(q,*this); 390 391 std::vector<float_type> grid(get_sampling_grid(xmin, xmax)); 392 float_type intg=mesquared.partial_integrals(grid); 393 394 return *new c2_scaled_function<float_type>(*this, std::sqrt(norm/intg)); 484 return *new c2_scaled_function_p<float_type>(*this, norm/intg); 485 } 486 487 template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function(float_type xmin, float_type xmax, float_type norm) 488 const throw(c2_exception) 489 { 490 c2_ptr<float_type> mesquared((*new c2_quadratic_p<float_type>(0., 0., 0., 1.))(*this)); 491 492 std::vector<float_type> grid; 493 get_sampling_grid(xmin, xmax, grid); 494 float_type intg=mesquared->partial_integrals(grid); 495 496 return *new c2_scaled_function_p<float_type>(*this, std::sqrt(norm/intg)); 395 497 } 396 498 397 499 template <typename float_type> c2_function<float_type> &c2_function<float_type>::square_normalized_function( 398 500 float_type xmin, float_type xmax, const c2_function<float_type> &weight, float_type norm) 399 { 400 c2_quadratic<float_type> q(0., 0., 0., 1.); 401 c2_ composed_function<float_type> mesquared(q,*this);402 c2_product<float_type> weighted(mesquared, weight); 403 404 std::vector<float_type> grid(get_sampling_grid(xmin, xmax));405 float_type intg=weighted .partial_integrals(grid);406 407 return *new c2_scaled_function <float_type>(*this, std::sqrt(norm/intg));501 const throw(c2_exception) 502 { 503 c2_ptr<float_type> weighted((*new c2_quadratic_p<float_type>(0., 0., 0., 1.))(*this) * weight); 504 505 std::vector<float_type> grid; 506 get_sampling_grid(xmin, xmax, grid); 507 float_type intg=weighted->partial_integrals(grid); 508 509 return *new c2_scaled_function_p<float_type>(*this, std::sqrt(norm/intg)); 408 510 } 409 511 410 512 template <typename float_type> float_type c2_function<float_type>::partial_integrals( 411 513 std::vector<float_type> xgrid, std::vector<float_type> *partials, 412 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) const 514 float_type abs_tol, float_type rel_tol, int derivs, bool adapt, bool extrapolate) 515 const throw(c2_exception) 413 516 { 414 517 int np=xgrid.size(); 415 518 416 struct c2_integrate_fblockf0, f2;519 c2_fblock<float_type> f0, f2; 417 520 struct c2_integrate_recur rb; 418 521 rb.rel_tol=rel_tol; … … 420 523 rb.adapt=adapt; 421 524 rb.derivs=derivs; 422 423 reset_evaluations(); // counter returns with total evaluations needed for this integral 525 std::vector< recur_item > rb_stack; 526 rb_stack.reserve(20); // enough for most operations 527 rb.rb_stack=&rb_stack; 528 rb.inited=false; 529 float_type dx_inv=1.0/std::abs(xgrid.back()-xgrid.front()); 424 530 425 531 if(partials) partials->resize(np-1); … … 428 534 429 535 f2.x=xgrid[0]; 430 f2.y=value_with_derivatives(f2.x, &f2.yp, &f2.ypp); 431 increment_evaluations(); 536 fill_fblock(f2); 537 if(c2_isnan(f2.y)) { 538 bad_x_point=f2.x; 539 return f2.y; // can't go any further if a nan has appeared 540 } 432 541 433 542 for(int i=0; i<np-1; i++) { … … 435 544 436 545 f2.x=xgrid[i+1]; 437 f2.y=value_with_derivatives(f2.x, &f2.yp, &f2.ypp); 438 increment_evaluations(); 439 440 rb.depth=0; 441 rb.abs_tol=abs_tol; 442 rb.f0=&f0; rb.f1=&f2; rb.f2=&f2; // we are really only using the left half for the top level 443 rb.lr=0; // pointer is meaningless; will be filled in in recursion 546 fill_fblock(f2); 547 if(c2_isnan(f2.y)) { 548 bad_x_point=f2.x; 549 return f2.y; // can't go any further if a nan has appeared 550 } 551 552 rb.abs_tol=abs_tol*std::abs(f2.x-f0.x)*dx_inv; // distribute error tolerance over whole domain 553 rb.f0=&f0; rb.f1=&f2; 444 554 float_type ps=integrate_step(rb); 445 555 sum+=ps; 446 556 if(partials) (*partials)[i]=ps; 557 if(c2_isnan(ps)) break; // NaN stops integration 447 558 } 448 559 return sum; 449 560 } 450 451 // declare singleton functions for most common c2_function instances452 #define c2_singleton(X) template <typename float_type> const c2_##X<float_type> c2_##X<float_type>::X=c2_##X();453 c2_singleton(sin)454 c2_singleton(cos)455 c2_singleton(tan)456 c2_singleton(log)457 c2_singleton(exp)458 c2_singleton(sqrt)459 c2_singleton(identity)460 461 // reciprocal is actually parametric (a/x), but make singleton 1/x462 template <typename float_type> const c2_recip<float_type> c2_recip<float_type>::recip=c2_recip(1.0);463 464 #undef c2_singleton465 561 466 562 // generate a sampling grid at points separated by dx=5, which is intentionally 467 563 // incommensurate with pi and 2*pi so grid errors are somewhat randomized 468 template <typename float_type> std::vector<float_type> &c2_sin<float_type>::get_sampling_grid(float_type xmin, float_type xmax) 469 { 470 std::vector<float_type> *result=new std::vector<float_type>; 471 472 for(; xmin < xmax; xmin+=5.0) result->push_back(xmin); 473 result->push_back(xmax); 474 this->preen_sampling_grid(result); 475 return *result; 476 } 477 478 template <typename float_type> float_type Identity(float_type x) { return x; } // a useful function 479 template <typename float_type> float_type f_one(float_type) { return 1.0; } // the first derivative of identity 480 template <typename float_type> float_type f_zero(float_type) { return 0.0; } // the second derivative of identity 564 template <typename float_type> void c2_sin_p<float_type>:: 565 get_sampling_grid(float_type xmin, float_type xmax, std::vector<float_type> &grid) const 566 { 567 grid.clear(); 568 for(; xmin < xmax; xmin+=5.0) grid.push_back(xmin); 569 grid.push_back(xmax); 570 this->preen_sampling_grid(&grid); 571 } 572 573 template <typename float_type> float_type c2_function_transformation<float_type>::evaluate( 574 float_type xraw, 575 float_type y, float_type yp0, float_type ypp0, 576 float_type *yprime, float_type *yprime2) const 577 { 578 y=Y.fHasStaticTransforms ? Y.pOut(y) : Y.fOut(y); 579 580 if(yprime || yprime2) { 581 582 float_type yp, yp2; 583 if(X.fHasStaticTransforms && Y.fHasStaticTransforms) { 584 float_type fpi=1.0/Y.pInPrime(y); 585 float_type gp=X.pInPrime(xraw); 586 // from Mathematica Dt[InverseFunction[f][y[g[x]]], x] 587 yp=gp*yp0*fpi; // transformed derivative 588 yp2=(gp*gp*ypp0 + X.pInDPrime(xraw)*yp0 - Y.pInDPrime(y)*yp*yp )*fpi; 589 } else { 590 float_type fpi=1.0/Y.fInPrime(y); 591 float_type gp=X.fInPrime(xraw); 592 // from Mathematica Dt[InverseFunction[f][y[g[x]]], x] 593 yp=gp*yp0*fpi; // transformed derivative 594 yp2=(gp*gp*ypp0 + X.fInDPrime(xraw)*yp0 - Y.fInDPrime(y)*yp*yp )*fpi; 595 } 596 if(yprime) *yprime=yp; 597 if(yprime2) *yprime2=yp2; 598 } 599 return y; 600 } 481 601 482 602 // The constructor 483 template <typename float_type> void interpolating_function<float_type>::init(603 template <typename float_type> interpolating_function_p<float_type> & interpolating_function_p<float_type>::load( 484 604 const std::vector<float_type> &x, const std::vector<float_type> &f, 485 605 bool lowerSlopeNatural, float_type lowerSlope, 486 606 bool upperSlopeNatural, float_type upperSlope, 487 float_type (*inputXConversion)(float_type), 488 float_type (*inputXConversionPrime)(float_type), 489 float_type (*inputXConversionDPrime)(float_type), 490 float_type (*inputYConversion)(float_type), 491 float_type (*inputYConversionPrime)(float_type), 492 float_type (*inputYConversionDPrime)(float_type), 493 float_type (*outputYConversion)(float_type) 494 ) throw(c2_exception) 495 { 607 bool splined 608 ) throw(c2_exception) 609 { 610 c2_ptr<float_type> keepme(*this); 496 611 X= x; 497 612 F= f; … … 501 616 502 617 set_domain(std::min(Xraw.front(), Xraw.back()),std::max(Xraw.front(), Xraw.back())); 503 504 fXin=inputXConversion; 505 fXinPrime=inputXConversionPrime; 506 fXinDPrime=inputXConversionDPrime; 507 fYin=inputYConversion; 508 fYinPrime=inputYConversionPrime; 509 fYinDPrime=inputYConversionDPrime; 510 fYout=outputYConversion; 511 618 512 619 if(x.size() != f.size()) { 513 620 throw c2_exception("interpolating_function::init() -- x & y inputs are of different size"); … … 529 636 } 530 637 531 if(fXin) { // check if X scale is nonlinear, and if so, do transform 532 if(!lowerSlopeNatural) lowerSlope /= fXinPrime(X[0]); 533 if(!upperSlopeNatural) upperSlope /= fXinPrime(X[np-1]); 534 for(size_t i=0; i<np; i++) X[i]=fXin(X[i]); 535 } else { 536 fXin=Identity<float_type>; 537 fXinPrime=f_one<float_type>; 538 fXinDPrime=f_zero<float_type>; 539 } 540 541 if(inputYConversion) { // check if Y scale is nonlinear, and if so, do transform 542 if(!lowerSlopeNatural) lowerSlope *= fYinPrime(F[0]); 543 if(!upperSlopeNatural) upperSlope *= fYinPrime(F[np-1]); 544 for(size_t i=0; i<np; i++) F[i]=inputYConversion(F[i]); 545 } else { 546 fYin=Identity<float_type>; 547 fYinPrime=f_one<float_type>; 548 fYinDPrime=f_zero<float_type>; 549 fYout=Identity<float_type>; 638 if(fTransform.X.fTransformed) { // check if X scale is nonlinear, and if so, do transform 639 if(!lowerSlopeNatural) lowerSlope /= fTransform.X.fInPrime(X[0]); 640 if(!upperSlopeNatural) upperSlope /= fTransform.X.fInPrime(X[np-1]); 641 for(size_t i=0; i<np; i++) X[i]=fTransform.X.fIn(X[i]); 642 } 643 if(fTransform.Y.fTransformed) { // check if Y scale is nonlinear, and if so, do transform 644 if(!lowerSlopeNatural) lowerSlope *= fTransform.Y.fInPrime(F[0]); 645 if(!upperSlopeNatural) upperSlope *= fTransform.Y.fInPrime(F[np-1]); 646 for(size_t i=0; i<np; i++) F[i]=fTransform.Y.fIn(F[i]); 550 647 } 551 648 … … 553 650 "interpolating_function::init() non-monotonic transformed x input"); 554 651 555 // construct spline tables here. 652 if(splined) spline(lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope); 653 else y2.assign(np,0.0); 654 655 lastKLow=0; 656 keepme.release_for_return(); 657 return *this; 658 } 659 660 /* 661 // The constructor 662 template <typename float_type> interpolating_function_p<float_type> & interpolating_function_p<float_type>::load_pairs( 663 std::vector<std::pair<float_type, float_type> > &data, 664 bool lowerSlopeNatural, float_type lowerSlope, 665 bool upperSlopeNatural, float_type upperSlope, 666 bool splined 667 ) throw(c2_exception) 668 { 669 c2_ptr<float_type> keepme(*this); 670 671 size_t np=data.size(); 672 if(np < 2) { 673 throw c2_exception("interpolating_function::init() -- input < 2 elements "); 674 } 675 676 // sort into ascending order 677 std::sort(data.begin(), data.end(), comp_pair); 678 679 std::vector<float_type> xtmp, ytmp; 680 xtmp.reserve(np); 681 ytmp.reserve(np); 682 for (size_t i=0; i<np; i++) { 683 xtmp.push_back(data[i].first); 684 ytmp.push_back(data[i].second); 685 } 686 this->load(xtmp, ytmp, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, splined); 687 688 keepme.release_for_return(); 689 return *this; 690 } 691 692 template <typename float_type> interpolating_function_p<float_type> & 693 interpolating_function_p<float_type>::load_random_generator_function( 694 const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights) 695 throw(c2_exception) 696 { 697 c2_ptr<float_type> keepme(*this); 698 699 std::vector<float_type> integral; 700 c2_const_ptr<float_type> keepit(binheights); // manage function... not really needed here, but always safe. 701 // integrate from first to last bin in original order, leaving results in integral 702 // ask for relative error of 1e-6 on each bin, with absolute error set to 0 (since we don't know the data scale). 703 float_type sum=binheights.partial_integrals(bincenters, &integral, 0.0, 1e-6); 704 // the integral vector now has partial integrals... it must be accumulated by summing 705 integral.insert(integral.begin(), 0.0); // integral from start to start is 0 706 float_type scale=1.0/sum; 707 for(size_t i=1; i<integral.size(); i++) integral[i]=integral[i]*scale + integral[i-1]; 708 integral.back()=1.0; // force exact value on boundary 709 710 this->load(integral, bincenters, 711 false, 1.0/(scale*binheights(bincenters.front() )), 712 false, 1.0/(scale*binheights(bincenters.back() )) 713 ); // use integral as x axis in inverse function 714 keepme.release_for_return(); 715 return *this; 716 } 717 718 template <typename float_type> interpolating_function_p<float_type> & 719 interpolating_function_p<float_type>::load_random_generator_bins( 720 const std::vector<float_type> &bins, const std::vector<float_type> &binheights) 721 throw(c2_exception) 722 { 723 c2_ptr<float_type> keepme(*this); 724 725 size_t np=binheights.size(); 726 std::vector<float_type> integral(np+1), bin_edges(np+1); 727 728 // compute the integral based on estimates of the bin edges from the given bin centers... 729 // except for bin 0 & final bin, the edge of a bin is halfway between then center of the 730 // bin and the center of the previous/next bin. 731 // This gives width[n] = (center[n+1]+center[n])/2 - (center[n]+center[n-1])/2 = (center[n+1]-center[n-1])/2 732 // for the edges, assume a bin of width (center[1]-center[0]) or (center[np-1]-center[np-2]) 733 // be careful that absolute values are used in case data are reversed. 734 735 if(bins.size() == binheights.size()+1) { 736 bin_edges=bins; // edges array was passed in 737 } else if (bins.size() == binheights.size()) { 738 bin_edges.front()=bins[0] - (bins[1]-bins[0])*0.5; // edge bin 739 for(size_t i=1; i<np; i++) { 740 bin_edges[i]=(bins[i]+bins[i-1])*0.5; 741 } 742 bin_edges.back()=bins[np-1] + (bins[np-1]-bins[np-2])*0.5; // edge bin 743 } else { 744 throw c2_exception("inconsistent bin vectors passed to load_random_generator_bins"); 745 } 746 747 float_type running_sum=0.0; 748 for(size_t i=0; i<np; i++) { 749 integral[i]=running_sum; 750 if(!binheights[i]) throw c2_exception("empty bin passed to load_random_generator_bins"); 751 running_sum+=binheights[i]*std::abs(bin_edges[i+1]-bin_edges[i]); 752 } 753 float_type scale=1.0/running_sum; 754 for(size_t i=0; i<np; i++) integral[i]*=scale; 755 integral.back()=1.0; // force exactly correct value on boundary 756 this->load(integral, bin_edges, 757 false, 1.0/(scale*binheights.front()), 758 false, 1.0/(scale*binheights.back()) 759 ); // use integral as x axis in inverse function 760 keepme.release_for_return(); 761 return *this; 762 } 763 */ 764 765 // The spline table generator 766 template <typename float_type> void interpolating_function_p<float_type>::spline( 767 bool lowerSlopeNatural, float_type lowerSlope, 768 bool upperSlopeNatural, float_type upperSlope 769 ) throw(c2_exception) 770 { 771 // construct spline tables here. 556 772 // this code is a re-translation of the pythonlabtools spline algorithm from pythonlabtools.sourceforge.net 557 773 size_t np=X.size(); 558 774 std::vector<float_type> u(np), dy(np-1), dx(np-1), dxi(np-1), dx2i(np-2), siga(np-2), dydx(np-1); 559 775 … … 596 812 y2[np-1]=(un-qn*u[np-2])/(qn*y2[np-2]+1.0); 597 813 for (size_t k=np-1; k != 0; k--) y2[k-1]=y2[k-1]*y2[k]+u[k-1]; 598 599 lastKLow=-1; // flag new X search required for next evaluation 814 } 815 816 template <typename float_type> interpolating_function_p<float_type> &interpolating_function_p<float_type>::sample_function( 817 const c2_function<float_type> &func, 818 float_type xmin, float_type xmax, float_type abs_tol, float_type rel_tol, 819 bool lowerSlopeNatural, float_type lowerSlope, 820 bool upperSlopeNatural, float_type upperSlope 821 ) throw(c2_exception) 822 { 823 c2_ptr<float_type> keepme(*this); 824 825 const c2_transformation<float_type> &XX=fTransform.X, &YY=fTransform.Y; // shortcuts 826 827 // set up our params to look like the samplng function for now 828 sampler_function=func; 829 std::vector<float_type> grid; 830 func.get_sampling_grid(xmin, xmax, grid); 831 size_t gsize=grid.size(); 832 if(XX.fTransformed) for(size_t i=0; i<gsize; i++) grid[i]=XX.fIn(grid[i]); 833 set_sampling_grid_pointer(grid); 834 835 // float_type xmin1=fXin(xmin), xmax1=fXin(xmax); // bounds in transformed space 836 // get a list of points needed in transformed space, directly into our tables 837 this->adaptively_sample(grid.front(), grid.back(), 8*abs_tol, 8*rel_tol, 0, &X, &F); 838 // clear the sampler function now, since otherwise our value_with_derivatives is broken 839 sampler_function.unset_function(); 840 841 xInverted=check_monotonicity(X, 842 "interpolating_function::init() non-monotonic transformed x input"); 843 844 size_t np=X.size(); 845 846 // Xraw is useful in some of the arithmetic operations between interpolating functions 847 if(!XX.fTransformed) Xraw=X; 848 else { 849 Xraw.resize(np); 850 for (size_t i=1; i<np-1; i++) Xraw[i]=XX.fOut(X[i]); 851 Xraw.front()=xmin; 852 Xraw.back()=xmax; 853 } 854 855 bool xraw_rev=check_monotonicity(Xraw, 856 "interpolating_function::init() non-monotonic raw x input"); 857 // which way does raw X point? sampling grid MUST be increasing 858 859 if(!xraw_rev) { // we can use pointer to raw X values if they are in the right order 860 set_sampling_grid_pointer(Xraw); 861 // our intial grid of x values is certainly a good guess for 'interesting' points 862 } else { 863 set_sampling_grid(Xraw); // make a copy of it, and assure it is in right order 864 } 865 866 if(XX.fTransformed) { // check if X scale is nonlinear, and if so, do transform 867 if(!lowerSlopeNatural) lowerSlope /= XX.fInPrime(xmin); 868 if(!upperSlopeNatural) upperSlope /= XX.fInPrime(xmax); 869 } 870 if(YY.fTransformed) { // check if Y scale is nonlinear, and if so, do transform 871 if(!lowerSlopeNatural) lowerSlope *= YY.fInPrime(func(xmin)); 872 if(!upperSlopeNatural) upperSlope *= YY.fInPrime(func(xmax)); 873 } 874 // note that each of ends has 3 points with two equal gaps, since they were obtained by bisection 875 // so the step sizes are easy to get 876 // the 'natural slope' option for sampled functions has a different meaning than 877 // for normal splines. In this case, the derivative is adjusted to make the 878 // second derivative constant on the last two points at each end 879 // which is consistent with the error sampling technique we used to get here 880 if(lowerSlopeNatural) { 881 float_type hlower=X[1]-X[0]; 882 lowerSlope=0.5*(-F[2]-3*F[0]+4*F[1])/hlower; 883 lowerSlopeNatural=false; // it's not the usual meaning of natural any more 884 } 885 if(upperSlopeNatural) { 886 float_type hupper=X[np-1]-X[np-2]; 887 upperSlope=0.5*(F[np-3]+3*F[np-1]-4*F[np-2])/hupper; 888 upperSlopeNatural=false; // it's not the usual meaning of natural any more 889 } 890 this->set_domain(xmin, xmax); 891 892 spline(lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope); 893 lastKLow=0; 894 keepme.release_for_return(); 895 return *this; 600 896 } 601 897 602 898 // This function is the reason for this class to exist 603 899 // it computes the interpolated function, and (if requested) its proper first and second derivatives including all coordinate transforms 604 template <typename float_type> float_type interpolating_function <float_type>::value_with_derivatives(900 template <typename float_type> float_type interpolating_function_p<float_type>::value_with_derivatives( 605 901 float_type x, float_type *yprime, float_type *yprime2) const throw(c2_exception) 606 902 { 903 if(sampler_function.valid()) { 904 // if this is non-null, we are sampling data for later, so just return raw function 905 // however, transform it into our sampling space, first. 906 if(yprime) *yprime=0; 907 if(yprime2) *yprime2=0; 908 sampler_function->increment_evaluations(); 909 return fTransform.Y.fIn(sampler_function(fTransform.X.fOut(x))); // derivatives are completely undefined 910 } 911 607 912 if(x < this->xmin() || x > this->xmax()) { 608 913 std::ostringstream outstr; … … 613 918 float_type xraw=x; 614 919 615 // template here is impossible! if(fXin && fXin != (Identity<float_type>) )616 x=fXin(x); // save time by explicitly testing for identity function here920 if(fTransform.X.fTransformed) x=fTransform.X.fHasStaticTransforms? 921 fTransform.X.pIn(x) : fTransform.X.fIn(x); // save time by explicitly testing for identity function here 617 922 618 923 int klo=0, khi=X.size()-1; 924 925 if(khi < 0) throw c2_exception("Uninitialized interpolating function being evaluated"); 926 927 const float_type *XX=&X[lastKLow]; // make all fast checks short offsets from here 619 928 620 929 if(!xInverted) { // select search depending on whether transformed X is increasing or decreasing 621 if( lastKLow >=0 && (X[lastKLow] <= x) && (X[lastKLow+1] >= x) ) { // already bracketed930 if((XX[0] <= x) && (XX[1] >= x) ) { // already bracketed 622 931 klo=lastKLow; 623 } else if( lastKLow >=0 && (X[lastKLow+1] <= x) && (X[lastKLow+2] >x)) { // in next bracket to the right932 } else if((XX[1] <= x) && (XX[2] >= x)) { // in next bracket to the right 624 933 klo=lastKLow+1; 625 } else if(lastKLow > 0 && (X [lastKLow-1] <= x) && (X[lastKLow] >x)) { // in next bracket to the left934 } else if(lastKLow > 0 && (XX[-1] <= x) && (XX[0] >= x)) { // in next bracket to the left 626 935 klo=lastKLow-1; 627 936 } else { // not bracketed, not close, start over … … 634 943 } 635 944 } else { 636 if( lastKLow >=0 && (X[lastKLow] >= x) && (X[lastKLow+1] <= x) ) { // already bracketed945 if((XX[0] >= x) && (XX[1] <= x) ) { // already bracketed 637 946 klo=lastKLow; 638 } else if( lastKLow >=0 && (X[lastKLow+1] >= x) && (X[lastKLow+2] <x)) { // in next bracket to the right947 } else if((XX[1] >= x) && (XX[2] <= x)) { // in next bracket to the right 639 948 klo=lastKLow+1; 640 } else if(lastKLow > 0 && (X [lastKLow-1] >= x) && (X[lastKLow] <x)) { // in next bracket to the left949 } else if(lastKLow > 0 && (XX[-1] >= x) && (XX[0] <= x)) { // in next bracket to the left 641 950 klo=lastKLow-1; 642 951 } else { // not bracketed, not close, start over … … 659 968 float_type ylo=F[klo], yhi=F[khi], y2lo=y2[klo], y2hi=y2[khi]; 660 969 float_type y=a*ylo+b*yhi+((a*a*a-a)*y2lo+(b*b*b-b)*y2hi)*(h*h)/6.0; 661 662 // template here is impossible! if(fYin && fYin != Identity)663 y=fYout(y); // save time by explicitly testing for identity function here970 971 float_type yp0=0; // the derivative in interpolating table coordinates 972 float_type ypp0=0; // second derivative 664 973 665 974 if(yprime || yprime2) { 666 float_type fpi=1.0/fYinPrime(y); 667 float_type gp=fXinPrime(xraw); 668 float_type yp0=(yhi-ylo)/h+((3*b*b-1)*y2hi-(3*a*a-1)*y2lo)*h/6.0; // the derivative in interpolating table coordinates 669 670 // from Mathematica Dt[InverseFunction[f][y[g[x]]], x] 671 if(yprime) *yprime=gp*yp0*fpi; // the real derivative of the inverse transformed output 672 if(yprime2) { 673 float_type ypp0=b*y2hi+a*y2lo; 674 float_type fpp=fYinDPrime(y); 675 float_type gpp=fXinDPrime(xraw); 676 // also from Mathematica Dt[InverseFunction[f][y[g[x]]], {x,2}] 677 if(yprime2) *yprime2=(gp*gp*ypp0 + yp0*gpp - gp*gp*yp0*yp0*fpp*fpi*fpi)*fpi; 678 } 679 } 680 681 return y; 682 } 683 684 template <typename float_type> void interpolating_function<float_type>::set_lower_extrapolation(float_type bound) 975 yp0=(yhi-ylo)/h+((3*b*b-1)*y2hi-(3*a*a-1)*y2lo)*h/6.0; // the derivative in interpolating table coordinates 976 ypp0=b*y2hi+a*y2lo; // second derivative 977 } 978 979 if(fTransform.isIdentity) { 980 if(yprime) *yprime=yp0; 981 if(yprime2) *yprime2=ypp0; 982 return y; 983 } else return fTransform.evaluate(xraw, y, yp0, ypp0, yprime, yprime2); 984 } 985 986 template <typename float_type> void interpolating_function_p<float_type>::set_lower_extrapolation(float_type bound) 685 987 { 686 988 int kl = 0 ; 687 989 int kh=kl+1; 688 float_type xx=f Xin(bound);990 float_type xx=fTransform.X.fIn(bound); 689 991 float_type h0=X[kh]-X[kl]; 690 992 float_type h1=xx-X[kl]; … … 702 1004 } 703 1005 704 template <typename float_type> void interpolating_function <float_type>::set_upper_extrapolation(float_type bound)1006 template <typename float_type> void interpolating_function_p<float_type>::set_upper_extrapolation(float_type bound) 705 1007 { 706 1008 int kl = X.size()-2 ; 707 1009 int kh=kl+1; 708 float_type xx=f Xin(bound);1010 float_type xx=fTransform.X.fIn(bound); 709 1011 float_type h0=X[kh]-X[kl]; 710 1012 float_type h1=xx-X[kl]; … … 721 1023 } 722 1024 723 // move derivatives into our internal coordinates (use splint to go the other way!)724 template <typename float_type> void interpolating_function<float_type>::localize_derivatives(725 float_type xraw, float_type y, float_type yp, float_type ypp, float_type *y0, float_type *yprime, float_type *yprime2) const726 {727 float_type fp=fYinPrime(y);728 float_type gp=fXinPrime(xraw);729 float_type fpp=fYinDPrime(y);730 float_type gpp=fXinDPrime(xraw);731 732 if(y0) *y0=fYin(y);733 if(yprime) *yprime=yp*fp/gp; // Mathematica Dt[f[y[InverseFunction[g][x]]], x]734 if(yprime2) *yprime2=( yp*yp*fpp - fp*yp*gpp/gp + fp*ypp )/(gp*gp) ; // Mathematica Dt[f[y[InverseFunction[g][x]]], {x,2}]735 }736 737 1025 // return a new interpolating_function which is the unary function of an existing interpolating_function 738 1026 // can also be used to generate a resampling of another c2_function on a different grid … … 740 1028 // and doing b=a.unary_operator(c) where c is a c2_function (probably another interpolating_function) 741 1029 742 template <typename float_type> interpolating_function <float_type>&743 interpolating_function <float_type>::unary_operator(const c2_function<float_type> &source) const1030 template <typename float_type> interpolating_function_p<float_type>& 1031 interpolating_function_p<float_type>::unary_operator(const c2_function<float_type> &source) const 744 1032 { 745 1033 size_t np=X.size(); 746 1034 std::vector<float_type>yv(np); 747 c2_ composed_function<float_type> comp(source, *this);1035 c2_ptr<float_type> comp(source(*this)); 748 1036 float_type yp0, yp1, ypp; 749 1037 750 for(size_t i=0; i<np; i++) { 751 yv[i]=source(fYout(F[i])); // copy pointwise the function of our data values 752 } 753 754 comp(Xraw.front(), &yp0, &ypp); // get derivative at front 755 comp(Xraw.back(), &yp1, &ypp); // get derivative at back 756 757 return *new interpolating_function(Xraw, yv, false, yp0, false, yp1, 758 fXin, fXinPrime, fXinDPrime, 759 fYin, fYinPrime, fYinDPrime, fYout); 1038 for(size_t i=1; i<np-1; i++) { 1039 yv[i]=source(fTransform.Y.fOut(F[i])); // copy pointwise the function of our data values 1040 } 1041 1042 yv.front()=comp(Xraw.front(), &yp0, &ypp); // get derivative at front 1043 yv.back()= comp(Xraw.back(), &yp1, &ypp); // get derivative at back 1044 1045 interpolating_function_p ©=clone(); 1046 copy.load(this->Xraw, yv, false, yp0, false, yp1); 1047 1048 return copy; 760 1049 } 761 1050 762 1051 template <typename float_type> void 763 interpolating_function <float_type>::get_data(std::vector<float_type> &xvals, std::vector<float_type> &yvals) const throw()1052 interpolating_function_p<float_type>::get_data(std::vector<float_type> &xvals, std::vector<float_type> &yvals) const throw() 764 1053 { 765 1054 … … 767 1056 yvals.resize(F.size()); 768 1057 769 for(size_t i=0; i<F.size(); i++) yvals[i]=f Yout(F[i]);770 } 771 772 template <typename float_type> interpolating_function <float_type> &773 interpolating_function <float_type>::binary_operator(const c2_function<float_type> &rhs,774 c 2_binary_function<float_type> *combining_stub) const1058 for(size_t i=0; i<F.size(); i++) yvals[i]=fTransform.Y.fOut(F[i]); 1059 } 1060 1061 template <typename float_type> interpolating_function_p<float_type> & 1062 interpolating_function_p<float_type>::binary_operator(const c2_function<float_type> &rhs, 1063 const c2_binary_function<float_type> *combining_stub) const 775 1064 { 776 1065 size_t np=X.size(); 777 1066 std::vector<float_type> yv(np); 778 c2_constant<float_type> fval; 779 c2_constant<float_type> yval; 1067 c2_constant_p<float_type> fval(0); 780 1068 float_type yp0, yp1, ypp; 781 1069 782 for(size_t i=0; i<np; i++) { 783 fval.reset(fYout(F[i])); // update the constant function pointwise 784 yval.reset(rhs(Xraw[i])); 785 yv[i]=(*combining_stub).combine(fval, yval, Xraw[i], (float_type *)0, (float_type *)0); // compute rhs & combine without derivatives 786 } 787 788 (*combining_stub).combine(*this, rhs, Xraw.front(), &yp0, &ypp); // get derivative at front 789 (*combining_stub).combine(*this, rhs, Xraw.back(), &yp1, &ypp); // get derivative at back 790 791 delete combining_stub; 792 793 return *new interpolating_function(Xraw, yv, false, yp0, false, yp1, 794 fXin, fXinPrime, fXinDPrime, 795 fYin, fYinPrime, fYinDPrime, fYout); 796 } 797 798 template <typename float_type> float_type c2_f_logprime(float_type x) { return 1.0/x; } // the derivative of log(x) 799 template <typename float_type> float_type c2_f_logprime2(float_type x) { return -1.0/(x*x); } // the second derivative of log(x) 800 801 template <typename float_type> log_lin_interpolating_function<float_type>::log_lin_interpolating_function( 802 const std::vector<float_type> &x, const std::vector<float_type> &f, 803 bool lowerSlopeNatural, float_type lowerSlope, 804 bool upperSlopeNatural, float_type upperSlope) 805 : interpolating_function<float_type>() 806 { 807 init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 808 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 0, 0, 0, 0); 809 } 810 811 template <typename float_type> lin_log_interpolating_function<float_type>::lin_log_interpolating_function( 812 const std::vector<float_type> &x, const std::vector<float_type> &f, 813 bool lowerSlopeNatural, float_type lowerSlope, 814 bool upperSlopeNatural, float_type upperSlope) 815 : interpolating_function<float_type>() 816 { 817 init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 818 0, 0, 0, 819 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 820 (float_type (*)(float_type)) (std::exp) ); 821 } 822 823 template <typename float_type> log_log_interpolating_function<float_type>::log_log_interpolating_function( 824 const std::vector<float_type> &x, const std::vector<float_type> &f, 825 bool lowerSlopeNatural, float_type lowerSlope, 826 bool upperSlopeNatural, float_type upperSlope) 827 : interpolating_function<float_type>() 828 { 829 init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 830 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 831 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 832 (float_type (*)(float_type)) (std::exp) ); 833 } 834 835 template <typename float_type> float_type c2_f_recip(float_type x) { return 1.0/x; } 836 template <typename float_type> float_type c2_f_recipprime(float_type x) { return -1.0/(x*x); } // the derivative of 1/x 837 template <typename float_type> float_type c2_f_recipprime2(float_type x) { return 2.0/(x*x*x); } // the second derivative of 1/x 838 839 template <typename float_type> arrhenius_interpolating_function<float_type>::arrhenius_interpolating_function( 840 const std::vector<float_type> &x, const std::vector<float_type> &f, 841 bool lowerSlopeNatural, float_type lowerSlope, 842 bool upperSlopeNatural, float_type upperSlope) 843 : interpolating_function<float_type>() 844 { 845 init(x, f, lowerSlopeNatural, lowerSlope, upperSlopeNatural, upperSlope, 846 c2_f_recip, c2_f_recipprime, c2_f_recipprime2, 847 (float_type (*)(float_type)) (std::log), c2_f_logprime, c2_f_logprime2, 848 (float_type (*)(float_type)) (std::exp) ); 849 } 850 851 template <typename float_type> c2_inverse_function<float_type>::c2_inverse_function(const c2_function<float_type> &source) 852 : c2_plugin_function<float_type>(source) 1070 c2_const_ptr<float_type> stub(*combining_stub); // manage ownership 1071 1072 for(size_t i=1; i<np-1; i++) { 1073 fval.reset(fTransform.Y.fOut(F[i])); // update the constant function pointwise 1074 yv[i]=combining_stub->combine(fval, rhs, Xraw[i], (float_type *)0, (float_type *)0); // compute rhs & combine without derivatives 1075 } 1076 1077 yv.front()=combining_stub->combine(*this, rhs, Xraw.front(), &yp0, &ypp); // get derivative at front 1078 yv.back()= combining_stub->combine(*this, rhs, Xraw.back(), &yp1, &ypp); // get derivative at back 1079 1080 interpolating_function_p ©=clone(); 1081 copy.load(this->Xraw, yv, false, yp0, false, yp1); 1082 1083 return copy; 1084 } 1085 1086 template <typename float_type> c2_inverse_function_p<float_type>::c2_inverse_function_p(const c2_function<float_type> &source) 1087 : c2_function<float_type>(), func(source) 853 1088 { 854 1089 float_type l=source.xmin(); … … 864 1099 } 865 1100 866 template <typename float_type> float_type c2_inverse_function <float_type>::value_with_derivatives(1101 template <typename float_type> float_type c2_inverse_function_p<float_type>::value_with_derivatives( 867 1102 float_type x, float_type *yprime, float_type *yprime2 868 1103 ) const throw(c2_exception) … … 927 1162 for(int i=0; i<=np; i++) cum[i]*=m; 928 1163 } 929 if(inverse_function) interpolating_function <float_type>(cum, be); // use cum as x axis in inverse function930 else interpolating_function <float_type>(be, cum); // else use lower bin edge as x axis1164 if(inverse_function) interpolating_function_p<float_type>(cum, be); // use cum as x axis in inverse function 1165 else interpolating_function_p<float_type>(be, cum); // else use lower bin edge as x axis 931 1166 std::fill(this->y2.begin(), this->y2.end(), 0.0); // clear second derivatives, to we are piecewise linear 932 1167 } 933 1168 934 template <typename float_type> c2_piecewise_function <float_type>::c2_piecewise_function()1169 template <typename float_type> c2_piecewise_function_p<float_type>::c2_piecewise_function_p() 935 1170 : c2_function<float_type>(), lastKLow(-1) 936 1171 { … … 938 1173 } 939 1174 940 template <typename float_type> c2_piecewise_function<float_type>::~c2_piecewise_function() 941 { 942 size_t np=functions.size(); 943 for(size_t i=0; i<np; i++) if(owns[i]) delete functions[i]; 944 } 945 946 template <typename float_type> float_type c2_piecewise_function<float_type>::value_with_derivatives( 1175 template <typename float_type> c2_piecewise_function_p<float_type>::~c2_piecewise_function_p() 1176 { 1177 } 1178 1179 template <typename float_type> float_type c2_piecewise_function_p<float_type>::value_with_derivatives( 947 1180 float_type x, float_type *yprime, float_type *yprime2 948 1181 ) const throw(c2_exception) … … 974 1207 } 975 1208 976 template <typename float_type> void c2_piecewise_function<float_type>::append_function( 977 c2_function<float_type> &func, bool pass_ownership) throw(c2_exception) 978 { 1209 template <typename float_type> void c2_piecewise_function_p<float_type>::append_function( 1210 const c2_function<float_type> &func) throw(c2_exception) 1211 { 1212 c2_const_ptr<float_type> keepfunc(func); // manage function before we can throw any exceptions 979 1213 if(functions.size()) { // check whether there are any gaps to fill, etc. 980 c 2_function<float_type> &tail=*(functions.back());1214 const c2_function<float_type> &tail=functions.back(); 981 1215 float_type x0=tail.xmax(); 982 1216 float_type x1=func.xmin(); … … 985 1219 float_type y0=tail(x0); 986 1220 float_type y1=func(x1); 987 c2_function<float_type> *connector=new c2_linear<float_type>(x0, y0, (y1-y0)/(x1-x0)); 988 connector->set_domain(x0,x1); 989 functions.push_back(connector); 990 owns.push_back(true); 1221 c2_function<float_type> &connector=*new c2_linear_p<float_type>(x0, y0, (y1-y0)/(x1-x0)); 1222 connector.set_domain(x0,x1); 1223 functions.push_back(c2_const_ptr<float_type>(connector)); 991 1224 this->sampling_grid->push_back(x1); 992 1225 } else if(x0>x1) throw c2_exception("function domains not increasing in c2_piecewise_function"); 993 1226 } 994 functions.push_back(&func); 995 owns.push_back(pass_ownership); 1227 functions.push_back(keepfunc); 996 1228 // extend our domain to include all known functions 997 1229 this->set_domain(functions.front()->xmin(), functions.back()->xmax()); 998 1230 // extend our sampling grid with the new function's grid, with the first point dropped to avoid duplicates 999 std::vector<float_type> &newgrid=func.get_sampling_grid(func.xmin(), func.xmax()); 1231 std::vector<float_type> newgrid; 1232 func.get_sampling_grid(func.xmin(), func.xmax(), newgrid); 1000 1233 this->sampling_grid->insert(this->sampling_grid->end(), newgrid.begin()+1, newgrid.end()); 1001 delete &newgrid; 1002 } 1003 1004 template <typename float_type> c2_connector_function<float_type>::c2_connector_function( 1005 const c2_function<float_type> &f1, const c2_function<float_type> &f2, float_type x0, float_type x2, 1234 } 1235 1236 template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p( 1237 float_type x0, const c2_function<float_type> &f0, float_type x2, const c2_function<float_type> &f2, 1006 1238 bool auto_center, float_type y1) 1007 1008 : c2_function<float_type>() 1009 { 1010 float_type y0, yp0, ypp0, y2, yp2, ypp2; 1011 fdx=(x2-x0)/2.0; 1012 fhinv=1.0/fdx; 1013 fx1=(x0+x2)/2.0; 1014 1015 y0=f1.value_with_derivatives(x0, &yp0, &ypp0); // get left wall values from conventional computation 1016 y2=f2.value_with_derivatives(x2, &yp2, &ypp2); // get right wall values from conventional computation 1239 : c2_function<float_type>() 1240 { 1241 c2_const_ptr<float_type> left(f0), right(f2); // make sure if these are unowned, they get deleted 1242 c2_fblock<float_type> fb0, fb2; 1243 fb0.x=x0; 1244 f0.fill_fblock(fb0); 1245 fb2.x=x2; 1246 f2.fill_fblock(fb2); 1247 init(fb0, fb2, auto_center, y1); 1248 } 1249 1250 template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p( 1251 float_type x0, float_type y0, float_type yp0, float_type ypp0, 1252 float_type x2, float_type y2, float_type yp2, float_type ypp2, 1253 bool auto_center, float_type y1) 1254 : c2_function<float_type>() 1255 { 1256 c2_fblock<float_type> fb0, fb2; 1257 fb0.x=x0; fb0.y=y0; fb0.yp=yp0; fb0.ypp=ypp0; 1258 fb2.x=x2; fb2.y=y2; fb2.yp=yp2; fb2.ypp=ypp2; 1259 init(fb0, fb2, auto_center, y1); 1260 } 1261 1262 template <typename float_type> c2_connector_function_p<float_type>::c2_connector_function_p( 1263 const c2_fblock<float_type> &fb0, 1264 const c2_fblock<float_type> &fb2, 1265 bool auto_center, float_type y1) 1266 : c2_function<float_type>() 1267 { 1268 init(fb0, fb2, auto_center, y1); 1269 } 1270 1271 template <typename float_type> void c2_connector_function_p<float_type>::init( 1272 const c2_fblock<float_type> &fb0, 1273 const c2_fblock<float_type> &fb2, 1274 bool auto_center, float_type y1) 1275 { 1276 float_type dx=(fb2.x-fb0.x)/2.0; 1277 fhinv=1.0/dx; 1017 1278 1018 1279 // scale derivs to put function on [-1,1] since mma solution is done this way 1019 yp0*=fdx;1020 yp2*=fdx;1021 ypp0*=fdx*fdx;1022 ypp2*=fdx*fdx;1023 1024 float_type ff0=(8*( y0 + y2) + 5*(yp0 - yp2) + ypp0 + ypp2)/16.0;1280 float_type yp0=fb0.yp*dx; 1281 float_type yp2=fb2.yp*dx; 1282 float_type ypp0=fb0.ypp*dx*dx; 1283 float_type ypp2=fb2.ypp*dx*dx; 1284 1285 float_type ff0=(8*(fb0.y + fb2.y) + 5*(yp0 - yp2) + ypp0 + ypp2)*0.0625; 1025 1286 if(auto_center) y1=ff0; // forces ff to be 0 if we are auto-centering 1026 1287 1027 // y[x_] = y1 + x (a + b x) + (x-1) x (x+1) (c + d x + e x^2 + f x^3) 1288 // y[x_] = y1 + x (a + b x) + x [(x-1) (x+1)] (c + d x) + x (x-1)^2 (x+1)^2 (e + f x) 1289 // y' = a + 2 b x + d x [(x+1)(x-1)] + (c + d x)(3x^2-1) + f x [(x+1)(x-1)]^2 + (e + f x)[(x+1)(x-1)](5x^2-1) 1290 // y'' = 2 b + 6x(c + d x) + 2d(3x^2-1) + 4x(e + f x)(5x^2-3) + 2f(x^2-1)(5x^2-1) 1028 1291 fy1=y1; 1029 fa= -(y0 - y2)/2.;1030 fb=( y0 - 2*y1 + y2)/2.;1031 fc=( 7*(y0 - y2 + yp0 + yp2) + ypp0 - ypp2)/16.;1032 fd=( 32*y1 - 16*(y2 + y0) + 9*(yp2 - yp0) - ypp0 - ypp2)/16.;1033 fe=( 3*(y2 - y0 - yp0 - yp2) - ypp0 + ypp2)/16.;1292 fa=(fb2.y - fb0.y)*0.5; 1293 fb=(fb0.y + fb2.y)*0.5 - y1; 1294 fc=(yp2+yp0-2.*fa)*0.25; 1295 fd=(yp2-yp0-4.*fb)*0.25; 1296 fe=(ypp2-ypp0-12.*fc)*0.0625; 1034 1297 ff=(ff0 - y1); 1035 // y'[x] = a + 2 b x + (3x^2 - 1) (c + d x + e x^2 + f x^3) + (x-1) x (x+1) (d + 2 e x + 3 f x^2 ) 1036 // y''[x] = 2b + (x-1) x (x+1) (2 e + 6 f x) + 2 (3 x^2 -1) (d + 2 e x + 3 f x^2 ) + 6 x (c + d x + e x^2 + f x^3) 1037 this->set_domain(x0,x2); // this is where the function is valid 1038 } 1039 1040 template <typename float_type> c2_connector_function<float_type>::~c2_connector_function() 1041 { 1042 } 1043 1044 template <typename float_type> float_type c2_connector_function<float_type>::value_with_derivatives( 1298 this->set_domain(fb0.x, fb2.x); // this is where the function is valid 1299 } 1300 1301 template <typename float_type> c2_connector_function_p<float_type>::~c2_connector_function_p() 1302 { 1303 } 1304 1305 template <typename float_type> float_type c2_connector_function_p<float_type>::value_with_derivatives( 1045 1306 float_type x, float_type *yprime, float_type *yprime2 1046 1307 ) const throw(c2_exception) 1047 1308 { 1048 1049 float_type dx=(x-fx1)*fhinv; 1050 float_type q1=fc + dx*(fd + dx*(fe + dx*ff)); 1051 float_type xp1=(dx-1)*(dx+1)*dx; 1052 1053 float_type y= fy1 + dx*(fa+fb*dx) + xp1*q1; 1309 float_type x0=this->xmin(), x2=this->xmax(); 1310 float_type dx=(x-(x0+x2)*0.5)*fhinv; 1311 float_type q1=(x-x0)*(x-x2)*fhinv*fhinv; // exactly vanish all bits at both ends 1312 float_type q2=dx*q1; 1313 1314 float_type r1=fa+fb*dx; 1315 float_type r2=fc+fd*dx; 1316 float_type r3=fe+ff*dx; 1317 1318 float_type y=fy1+dx*r1+q2*r2+q1*q2*r3; 1319 1054 1320 if(yprime || yprime2) { 1055 float_type q2 =fd + dx*(2*fe + dx*3*ff); 1056 float_type q3=2*fe+6*ff*dx; 1057 float_type xp2=(3*dx*dx-1); 1058 if(yprime) *yprime=(fa + 2*fb*dx + xp2*q1 + xp1*q2)*fhinv; 1059 if(yprime2) *yprime2=(2*fb+xp1*q3+2*xp2*q2+6*dx*q1)*fhinv*fhinv; 1321 float_type q3=3*q1+2; 1322 float_type q4=5*q1+4; 1323 if(yprime) *yprime=(fa+2*fb*dx+fd*q2+r2*q3+ff*q1*q2+q1*q4*r3)*fhinv; 1324 if(yprime2) *yprime2=2*(fb+fd*q3+3*dx*r2+ff*q1*q4+r3*(2*dx*(5*q1+2)))*fhinv*fhinv; 1060 1325 } 1061 1326 return y; 1062 1327 } 1328 1329 // the recursive part of the sampler is agressively designed to minimize copying of data... lots of pointers 1330 template <typename float_type> void c2_function<float_type>::sample_step(c2_sample_recur &rb) const throw(c2_exception) 1331 { 1332 std::vector< recur_item > &rb_stack=*rb.rb_stack; // heap-based stack of data for recursion 1333 rb_stack.clear(); 1334 1335 recur_item top; 1336 top.depth=0; top.done=false; top.f0index=0; top.f2index=0; 1337 1338 // push storage for our initial elements 1339 rb_stack.push_back(top); 1340 rb_stack.back().f1=*rb.f0; 1341 rb_stack.back().done=true; 1342 1343 rb_stack.push_back(top); 1344 rb_stack.back().f1=*rb.f1; 1345 rb_stack.back().done=true; 1346 1347 if(!rb.inited) { 1348 rb.dx_tolerance=10.0*std::numeric_limits<float_type>::epsilon(); 1349 rb.abs_tol_min=10.0*std::numeric_limits<float_type>::min(); 1350 rb.inited=true; 1351 } 1352 1353 // now, push our first real element 1354 top.f0index=0; // left element is stack[0] 1355 top.f2index=1; // right element is stack[1] 1356 rb_stack.push_back(top); 1357 1358 while(rb_stack.size() > 2) { 1359 recur_item &back=rb_stack.back(); 1360 if(back.done) { 1361 rb_stack.pop_back(); 1362 continue; 1363 } 1364 back.done=true; 1365 1366 c2_fblock<float_type> &f0=rb_stack[back.f0index].f1, &f2=rb_stack[back.f2index].f1; 1367 c2_fblock<float_type> &f1=back.f1; // will hold new middle values 1368 size_t f1index=rb_stack.size()-1; // our current offset 1369 1370 // std::cout << "processing: " << rb_stack.size() << " " << 1371 // (&back-&rb_stack.front()) << " " << back.depth << " " << f0.x << " " << f2.x << std::endl; 1372 1373 f1.x=0.5*(f0.x + f2.x); // center of interval 1374 float_type dx2=0.5*(f2.x - f0.x); 1375 1376 // check for underflow on step size, which prevents us from achieving specified accuracy. 1377 if(std::abs(dx2) < std::abs(f1.x)*rb.dx_tolerance || std::abs(dx2) < rb.abs_tol_min) { 1378 std::ostringstream outstr; 1379 outstr << "Step size underflow in adaptive_sampling at depth=" << back.depth << ", x= " << f1.x; 1380 throw c2_exception(outstr.str().c_str()); 1381 } 1382 1383 fill_fblock(f1); 1384 1385 if(c2_isnan(f1.y) || f1.ypbad || f1.yppbad) { 1386 // can't go any further if a nan has appeared 1387 bad_x_point=f1.x; 1388 throw c2_exception("NaN encountered while sampling function"); 1389 } 1390 1391 float_type eps; 1392 if(rb.derivs==2) { 1393 // this is code from connector_function to compute the value at the midpoint 1394 // it is re-included here to avoid constructing a complete c2connector 1395 // just to find out if we are close enough 1396 float_type ff0=(8*(f0.y + f2.y) + 5*(f0.yp - f2.yp)*dx2 + (f0.ypp+f2.ypp)*dx2*dx2)*0.0625; 1397 // we are converging as at least x**5 and bisecting, so real error on final step is smaller 1398 eps=std::abs(ff0-f1.y)/32.0; 1399 } else { 1400 // there are two tolerances to meet... the shift in the estimate of the actual point, 1401 // and the difference between the current points and the extremum 1402 // build all the coefficients needed to construct the local parabola 1403 float_type ypcenter, ypp; 1404 if (rb.derivs==1) { 1405 // linear extrapolation error using exact derivs 1406 eps = (std::abs(f0.y+f0.yp*dx2-f1.y)+std::abs(f2.y-f2.yp*dx2-f1.y))*0.125; 1407 ypcenter=2*f1.yp*dx2; // first deriv scaled so this interval is on [-1,1] 1408 ypp=2*(f2.yp-f0.yp)*dx2*dx2; // second deriv estimate scaled so this interval is on [-1,1] 1409 } else { 1410 // linear interpolation error without derivs if we are at top level 1411 // or 3-point parabolic interpolation estimates from previous level, if available 1412 ypcenter=(f2.y-f0.y)*0.5; // derivative estimate at center 1413 ypp=(f2.y+f0.y-2*f1.y); // second deriv estimate 1414 if(back.depth==0) eps=std::abs((f0.y+f2.y)*0.5 - f1.y)*2; // penalize first step 1415 else eps=std::abs(f1.y-back.previous_estimate)*0.25; 1416 } 1417 float_type ypleft=ypcenter-ypp; // derivative at left edge 1418 float_type ypright=ypcenter+ypp; // derivative at right edge 1419 float_type extremum_eps=0; 1420 if((ypleft*ypright) <=0) // y' changes sign if we have an extremum 1421 { 1422 // compute position and value of the extremum this way 1423 float_type xext=-ypcenter/ypp; 1424 float_type yext=f1.y + xext*ypcenter + 0.5*xext*xext*ypp; 1425 // and then find the the smallest offset of it from a point, looking in the left or right side 1426 if(xext <=0) extremum_eps=std::min(std::abs(f0.y-yext), std::abs(f1.y-yext)); 1427 else extremum_eps=std::min(std::abs(f2.y-yext), std::abs(f1.y-yext)); 1428 } 1429 eps=std::max(eps, extremum_eps); // if previous shot was really bad, keep trying 1430 } 1431 1432 if(eps < rb.abs_tol || eps < std::abs(f1.y)*rb.rel_tol) { 1433 if(rb.out) { 1434 // we've met the tolerance, and are building a function, append two connectors 1435 rb.out->append_function( 1436 *new c2_connector_function_p<float_type>(f0, f1, true, 0.0) 1437 ); 1438 rb.out->append_function( 1439 *new c2_connector_function_p<float_type>(f1, f2, true, 0.0) 1440 ); 1441 } 1442 if(rb.xvals && rb.yvals) { 1443 rb.xvals->push_back(f0.x); 1444 rb.xvals->push_back(f1.x); 1445 rb.yvals->push_back(f0.y); 1446 rb.yvals->push_back(f1.y); 1447 // the value at f2 will get pushed in the next segment... it is not forgotten 1448 } 1449 } else { 1450 top.depth=back.depth+1; // increment depth counter 1451 1452 // save the last things we need from back before a push happens, in case 1453 // the push causes a reallocation and moves the whole stack. 1454 size_t f0index=back.f0index, f2index=back.f2index; 1455 float_type left=0, right=0; 1456 if(rb.derivs==0) { 1457 // compute three-point parabolic interpolation estimate of right-hand and left-hand midpoint 1458 left=(6*f1.y + 3*f0.y - f2.y) * 0.125; 1459 right=(6*f1.y + 3*f2.y - f0.y) * 0.125; 1460 } 1461 1462 top.f0index=f1index; top.f2index=f2index; // insert pointers to right side data into our recursion block 1463 top.previous_estimate=right; 1464 rb_stack.push_back(top); 1465 1466 top.f0index=f0index; top.f2index=f1index; // insert pointers to left side data into our recursion block 1467 top.previous_estimate=left; 1468 rb_stack.push_back(top); 1469 } 1470 } 1471 } 1472 1473 template <typename float_type> c2_piecewise_function_p<float_type> * 1474 c2_function<float_type>::adaptively_sample( 1475 float_type xmin, float_type xmax, 1476 float_type abs_tol, float_type rel_tol, 1477 int derivs, std::vector<float_type> *xvals, std::vector<float_type> *yvals) const throw(c2_exception) 1478 { 1479 c2_fblock<float_type> f0, f2; 1480 c2_sample_recur rb; 1481 std::vector< recur_item > rb_stack; 1482 rb_stack.reserve(20); // enough for most operations 1483 rb.rb_stack=&rb_stack; 1484 rb.out=0; 1485 if(derivs==2) rb.out=new c2_piecewise_function_p<float_type>(); 1486 c2_ptr<float_type> pieces(*rb.out); // manage this function, if any, so it deletes on an exception 1487 rb.rel_tol=rel_tol; 1488 rb.abs_tol=abs_tol; 1489 rb.xvals=xvals; 1490 rb.yvals=yvals; 1491 rb.derivs=derivs; 1492 rb.inited=false; 1493 1494 if(xvals && yvals) { 1495 xvals->clear(); 1496 yvals->clear(); 1497 } 1498 1499 // create xgrid as a automatic-variable copy of the sampling grid so the exception handler correctly 1500 // disposes of it. 1501 std::vector<float_type> xgrid; 1502 get_sampling_grid(xmin, xmax, xgrid); 1503 int np=xgrid.size(); 1504 1505 f2.x=xgrid[0]; 1506 fill_fblock(f2); 1507 if(c2_isnan(f2.y) || f2.ypbad || f2.yppbad) { 1508 // can't go any further if a nan has appeared 1509 bad_x_point=f2.x; 1510 throw c2_exception("NaN encountered while sampling function"); 1511 } 1512 1513 for(int i=0; i<np-1; i++) { 1514 f0=f2; // copy upper bound to lower before computing new upper bound 1515 1516 f2.x=xgrid[i+1]; 1517 fill_fblock(f2); 1518 if(c2_isnan(f2.y) || f2.ypbad || f2.yppbad) { 1519 // can't go any further if a nan has appeared 1520 bad_x_point=f2.x; 1521 throw c2_exception("NaN encountered while sampling function"); 1522 } 1523 1524 rb.f0=&f0; rb.f1=&f2; 1525 sample_step(rb); 1526 } 1527 if(xvals && yvals) { // push final point in vector 1528 xvals->push_back(f2.x); 1529 yvals->push_back(f2.y); 1530 } 1531 1532 if(rb.out) rb.out->set_sampling_grid(xgrid); // reflect old sampling grid, which still should be right 1533 pieces.release_for_return(); // unmanage the piecewise_function so we can return it 1534 return rb.out; 1535 } 1536 1537 template <typename float_type, typename Final> 1538 interpolating_function_p<float_type> & inverse_integrated_density_function( 1539 const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights) 1540 throw(c2_exception) 1541 { 1542 return (new Final())->load_random_generator_function(bincenters, binheights); 1543 } 1544 1545 template <typename float_type, typename Final> 1546 interpolating_function_p<float_type> & inverse_integrated_density_bins( 1547 const std::vector<float_type> &bins, const std::vector<float_type> &binheights) 1548 throw(c2_exception) 1549 { 1550 return (new Final())->load_random_generator_bins(bins, binheights); 1551 } -
trunk/examples/extended/electromagnetic/TestEm7/ionC12.mac
r807 r1230 1 # $Id: ionC12.mac,v 1. 19 2007/11/07 19:41:32 vnivanchExp $1 # $Id: ionC12.mac,v 1.22 2008/10/24 15:36:24 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm7.cc" … … 7 7 /control/verbose 2 8 8 /run/verbose 2 9 /tracking/verbose 19 /tracking/verbose 0 10 10 # 11 /testem/det/setMat Water11 /testem/det/setMat G4_WATER 12 12 /testem/det/setSizeX 20 cm 13 13 /testem/det/setSizeYZ 20 cm 14 14 # 15 /testem/det/tallyMat Water15 /testem/det/tallyMat G4_WATER 16 16 /testem/det/tallySize 2. 2. 2. mm 17 17 /testem/det/tallyPosition -9.9 0. 0. cm … … 20 20 /testem/det/tallyPosition 5. 0. 0. cm 21 21 # 22 /testem/phys/addPhysics standardNR23 #/testem/phys/addPhysics emstandard24 #/testem/phys/addPhysics standard_opt222 #/testem/phys/addPhysics standardNR 23 /testem/phys/addPhysics emstandard 24 #/testem/phys/addPhysics emstandard_opt2 25 25 # 26 26 /run/initialize … … 29 29 /gun/ion 6 12 6 30 30 #/gun/ion 6 12 1 31 /gun/energy 3.5GeV31 /gun/energy 2.4 GeV 32 32 # 33 33 # beam size 34 /testem/gun/rndm 2 mm34 #/testem/gun/rndm 2 mm 35 35 # 36 36 # step limit 37 /testem/stepMax 1 mm 37 /testem/phys/setCuts 0.5 mm 38 #/testem/stepMax 0.1 mm 38 39 # 39 40 /testem/event/printModulo 1000 40 41 # 42 /testem/histo/fileName c12 43 /testem/histo/fileType root 44 /testem/histo/setHisto 1 100 80 90 45 /testem/histo/setHisto 2 100 80 90 46 # 41 47 /run/beamOn 1000 -
trunk/examples/extended/electromagnetic/TestEm7/proton.mac
r807 r1230 1 # $Id: proton.mac,v 1.1 0 2007/07/28 16:39:31 vnivanchExp $1 # $Id: proton.mac,v 1.17 2008/10/24 15:36:24 maire Exp $ 2 2 # 3 3 # Macro file for "TestEm7.cc" … … 8 8 /run/verbose 2 9 9 # 10 /testem/det/setMat Water10 /testem/det/setMat G4_WATER 11 11 /testem/det/setSizeX 10 cm 12 12 /testem/det/setSizeYZ 10 cm 13 /testem/det/tallyMat G4_WATER 13 14 # 14 /testem/phys/addPhysics standard #em physics 15 #/testem/phys/addPhysics standard 16 /testem/phys/addPhysics emstandard_opt3 15 17 # 16 18 /run/initialize … … 20 22 # 21 23 # step limit 22 /testem/stepMax 0.5 mm 24 #/testem/phys/setCuts 0.5 mm 25 /testem/phys/setCuts 1 mm 26 #/testem/stepMax 0.5 mm 23 27 # 24 28 /testem/event/printModulo 1000 25 29 # 30 /testem/histo/fileName p100opt3cut1 31 /testem/histo/fileType root 32 /testem/histo/setHisto 1 100 70 80 33 /testem/histo/setHisto 2 100 70 80 34 # 26 35 /run/beamOn 10000 36 # -
trunk/examples/extended/electromagnetic/TestEm7/snr.mac
r807 r1230 1 # $Id: snr.mac,v 1. 1 2007/12/19 19:21:41vnivanch Exp $1 # $Id: snr.mac,v 1.3 2008/05/08 11:20:50 vnivanch Exp $ 2 2 # 3 3 # Macro file for "TestEm7.cc" … … 19 19 /testem/det/tallyPosition 5. 0. 0. cm 20 20 # 21 /testem/phys/addPhysics standardNR # use screened nuclear recoil 22 ###/testem/phys/addPhysics binary # hadronic physics 21 #/testem/phys/addPhysics emstandard 22 #/testem/phys/addPhysics emstandard_opt2 23 #/testem/phys/addPhysics emstandard_opt3 24 /testem/phys/addPhysics standardNR 25 #/testem/phys/addPhysics standardIG 26 ###/testem/phys/addPhysics binary 23 27 # 24 28 /run/initialize … … 40 44 /run/beamOn 1000 41 45 # 42 /testem/det/setMat G4_Cu43 /testem/det/update44 /gun/particle kaon+45 /gun/energy 100 MeV46 /run/beamOn 1000 -
trunk/examples/extended/electromagnetic/TestEm7/src/DetectorConstruction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1. 8 2007/01/11 15:41:46vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: DetectorConstruction.cc,v 1.10 2008/04/21 13:13:30 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 45 45 46 46 #include "G4NistManager.hh" 47 48 47 #include "G4UnitsTable.hh" 48 49 #include "G4FieldManager.hh" 50 #include "G4TransportationManager.hh" 51 #include "G4RunManager.hh" 49 52 50 53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 117 120 Air->AddElement(N, fractionmass=0.7); 118 121 Air->AddElement(O, fractionmass=0.3); 122 123 density = 1.e-5*g/cm3; 124 pressure = 2.e-2*bar; 125 temperature = STP_Temperature; // From PhysicalConstants.h . 126 G4Material* vac = new G4Material( "TechVacuum", density, 1, 127 kStateGas, temperature, pressure ); 128 vac->AddMaterial( Air, 1. ); 119 129 120 130 density = universe_mean_density; //from PhysicalConstants.h … … 235 245 { 236 246 absorSizeX = value; worldSizeX = 1.2*absorSizeX; 247 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 237 248 } 238 249 … … 243 254 absorSizeYZ = value; 244 255 worldSizeYZ = 1.2*absorSizeYZ; 256 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 245 257 } 246 258 … … 252 264 G4Material* pttoMaterial = 253 265 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 254 if (pttoMaterial) absorMaterial = pttoMaterial; 255 } 256 257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 258 259 #include "G4FieldManager.hh" 260 #include "G4TransportationManager.hh" 266 if (pttoMaterial) { 267 absorMaterial = pttoMaterial; 268 if(lAbsor) { 269 lAbsor->SetMaterial(absorMaterial); 270 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 271 } 272 } 273 } 274 275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 261 276 262 277 void DetectorConstruction::SetMagField(G4double fieldValue) … … 285 300 { 286 301 tallySize = value; 302 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 287 303 } 288 304 … … 294 310 G4Material* pttoMaterial = 295 311 G4NistManager::Instance()->FindOrBuildMaterial(materialChoice); 296 if (pttoMaterial) tallyMaterial = pttoMaterial; 312 if (pttoMaterial) { 313 tallyMaterial = pttoMaterial; 314 if(lTally) { 315 lTally->SetMaterial(tallyMaterial); 316 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 317 } 318 } 297 319 } 298 320 … … 305 327 tallyNumber++; 306 328 } 329 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 307 330 } 308 331 309 332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 310 311 #include "G4RunManager.hh"312 333 313 334 void DetectorConstruction::UpdateGeometry() 314 335 { 315 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); 316 } 317 318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 336 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 337 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); 338 } 339 340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/DetectorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 16:58:13 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.4 2006/06/29 16:58:15 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.4 2006/06/29 16:58:17 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/G4ScreenedNuclearRecoil.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: G4ScreenedNuclearRecoil.cc,v 1.5 2008/01/14 12:11:39 vnivanch Exp $28 // GEANT4 tag $Name: $27 // G4ScreenedNuclearRecoil.cc,v 1.57 2008/05/07 11:51:26 marcus Exp 28 // GEANT4 tag 29 29 // 30 30 // … … 84 84 #include "G4ScreenedNuclearRecoil.hh" 85 85 86 const char* G4ScreenedCoulombCrossSectionInfo::CVSFileVers() { return 87 "G4ScreenedNuclearRecoil.cc,v 1.57 2008/05/07 11:51:26 marcus Exp GEANT4 tag "; 88 } 89 86 90 #include "G4ParticleTypes.hh" 87 91 #include "G4ParticleTable.hh" 88 92 #include "G4VParticleChange.hh" 89 #include "G4ParticleChange .hh"93 #include "G4ParticleChangeForLoss.hh" 90 94 #include "G4DataVector.hh" 91 95 #include "G4Track.hh" … … 99 103 #include "G4IsotopeVector.hh" 100 104 105 #include "G4EmProcessSubType.hh" 106 101 107 #include "G4RangeTest.hh" 102 108 #include "G4ParticleDefinition.hh" … … 104 110 #include "G4ProcessManager.hh" 105 111 #include "G4StableIsotopes.hh" 112 #include "G4LindhardPartition.hh" 106 113 107 114 #include "Randomize.hh" … … 112 119 #include <iomanip> 113 120 121 #include "c2_factory.hh" 122 static c2_factory<G4double> c2; // this makes a lot of notation shorter 123 typedef c2_ptr<G4double> c2p; 124 114 125 G4ScreenedCoulombCrossSection::~G4ScreenedCoulombCrossSection() 115 126 { 116 ScreeningMap::iterator tables=screeningData.begin();117 for (;tables != screeningData.end(); tables++) {118 delete (*tables).second.EMphiData;119 }120 127 screeningData.clear(); 121 122 std::map<G4int, c2_function<G4double> *>::iterator mfpit=MFPTables.begin(); 123 for (;mfpit != MFPTables.end(); mfpit++) { 124 delete (*mfpit).second; 125 } 126 MFPTables.clear(); 127 128 MFPTables.clear(); 128 129 } 129 130 … … 248 249 element=elementVector[kel]; 249 250 G4int Z=(G4int)std::floor(element->GetZ()+0.5); 250 c 2_function<G4double> &ifunc=*sigmaMap[Z];251 const G4_c2_function &ifunc=sigmaMap[Z]; 251 252 if(!kel || ifunc.xmin() > emin) emin=ifunc.xmin(); 252 253 if(!kel || ifunc.xmax() < emax) emax=ifunc.xmax(); … … 268 269 element=elementVector[kel]; 269 270 G4int Z=(G4int)std::floor(element->GetZ()+0.5); 270 c 2_function<G4double> &sigma=*sigmaMap[Z];271 const G4_c2_function &sigma=sigmaMap[Z]; 271 272 G4double ndens = atomDensities[kel]; // compute atom fraction for this element in this material 272 273 … … 281 282 } 282 283 // and make a new interpolating function out of the sum 283 MFPTables[matidx] = static_cast<c2_function<G4double> *>(new log_log_interpolating_function<G4double>( 284 evals, mfpvals)); 284 MFPTables[matidx] = c2.log_log_interpolating_function().load(evals, mfpvals,true,0,true,0); 285 285 } 286 287 #ifdef DEBUG288 for (G4int matidx=0; matidx < nMaterials; matidx++) {289 const G4Material* material= (*materialTable)[matidx];290 G4cout << "***** MFP (1MeV) ***** " << material->GetName() << " " << (*MFPTables[matidx])(1.0) << G4endl;291 }292 #endif293 294 286 } 295 287 … … 304 296 recoilCutoff(RecoilCutoff), physicsCutoff(PhysicsCutoff), 305 297 hardeningFraction(0.0), hardeningFactor(1.0), 306 externalCrossSectionConstructor(0) 307 { 298 externalCrossSectionConstructor(0), 299 NIELPartitionFunction(new G4LindhardRobinsonPartition) 300 { 301 // for now, point to class instance of this. Doing it by creating a new one fails 302 // to correctly update NIEL 303 // not even this is needed... done in G4VProcess(). 304 // pParticleChange=&aParticleChange; 305 processMaxEnergy=50000.0*MeV; 308 306 highEnergyLimit=100.0*MeV; 309 307 lowEnergyLimit=physicsCutoff; … … 313 311 AddStage(new G4ScreenedCoulombClassicalKinematics); 314 312 AddStage(new G4SingleScatter); 313 SetProcessSubType(fCoulombScattering); 315 314 } 316 315 317 316 void G4ScreenedNuclearRecoil::ResetTables() 318 317 { 319 std::map<G4int, c2_function<G4double>*>::iterator xh=meanFreePathTables.begin();320 for(;xh != meanFreePathTables.end(); xh++) {321 delete (*xh).second;322 }323 meanFreePathTables.clear();324 318 325 319 std::map<G4int, G4ScreenedCoulombCrossSection*>::iterator xt=crossSectionHandlers.begin(); … … 338 332 339 333 collisionStages.clear(); 334 } 335 336 void G4ScreenedNuclearRecoil::SetNIELPartitionFunction(const G4VNIELPartition *part) 337 { 338 if(NIELPartitionFunction) delete NIELPartitionFunction; 339 NIELPartitionFunction=part; 340 } 341 342 void G4ScreenedNuclearRecoil::DepositEnergy(G4int z1, G4double a1, const G4Material *material, G4double energy) 343 { 344 if(!NIELPartitionFunction) { 345 IonizingLoss+=energy; 346 } else { 347 G4double part=NIELPartitionFunction->PartitionNIEL(z1, a1, material, energy); 348 IonizingLoss+=energy*(1-part); 349 NIEL += energy*part; 350 } 340 351 } 341 352 … … 363 374 G4double G4ScreenedNuclearRecoil::GetMeanFreePath(const G4Track& track, 364 375 G4double, 365 G4ForceCondition* )376 G4ForceCondition* cond) 366 377 { 367 378 const G4DynamicParticle* incoming = track.GetDynamicParticle(); … … 370 381 371 382 G4double meanFreePath; 372 373 if (energy < lowEnergyLimit || energy < recoilCutoff) return 1.0*nanometer; /* stop slow particles! */ 374 else if (energy > highEnergyLimit*a1) energy=highEnergyLimit*a1; /* constant MFP at high energy */ 383 *cond=NotForced; 384 385 if (energy < lowEnergyLimit || energy < recoilCutoff*a1) { 386 *cond=Forced; 387 return 1.0*nm; /* catch and stop slow particles to collect their NIEL! */ 388 } else if (energy > processMaxEnergy*a1) { 389 return DBL_MAX; // infinite mean free path 390 } else if (energy > highEnergyLimit*a1) energy=highEnergyLimit*a1; /* constant MFP at high energy */ 375 391 376 392 G4double fz1=incoming->GetDefinition()->GetPDGCharge(); … … 390 406 size_t materialIndex = materialCouple->GetMaterial()->GetIndex(); 391 407 392 c 2_function<G4double>&mfp=*(*xs)[materialIndex];408 const G4_c2_function &mfp=*(*xs)[materialIndex]; 393 409 394 410 // make absolutely certain we don't get an out-of-range energy … … 403 419 { 404 420 validCollision=1; 405 aParticleChange.Initialize(aTrack);421 pParticleChange->Initialize(aTrack); 406 422 NIEL=0.0; // default is no NIEL deposited 423 IonizingLoss=0.0; 407 424 408 425 // do universal setup … … 413 430 G4double fz1=baseParticle->GetPDGCharge()/eplus; 414 431 G4int z1=(G4int)(fz1+0.5); 432 G4double a1=baseParticle->GetPDGMass()/amu_c2; 415 433 G4double incidentEnergy = incidentParticle->GetKineticEnergy(); 416 434 … … 418 436 const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple(); 419 437 420 if(incidentEnergy < GetRecoilCutoff()) { // check energy sanity on entry 421 if(!baseParticle->GetProcessManager()-> 422 GetAtRestProcessVector()->size()) 423 aParticleChange.ProposeTrackStatus(fStopAndKill); 424 else 425 aParticleChange.ProposeTrackStatus(fStopButAlive); 426 427 AddToNIEL(incidentEnergy); 428 aParticleChange.ProposeEnergy(0.0); 438 const G4Material* mat = couple->GetMaterial(); 439 440 G4double P=0.0; // the impact parameter of this collision 441 442 if(incidentEnergy < GetRecoilCutoff()*a1) { // check energy sanity on entry 443 DepositEnergy(z1, baseParticle->GetPDGMass()/amu_c2, mat, incidentEnergy); 444 GetParticleChange().ProposeEnergy(0.0); 429 445 // stop the particle and bail out 430 446 validCollision=0; 431 }432 433 const G4Material* mat = couple->GetMaterial();434 G4double numberDensity=mat->GetTotNbOfAtomsPerVolume();435 G4double lattice=0.5/std::pow(numberDensity,1.0/3.0); // typical lattice half-spacing436 G4double length=GetCurrentInteractionLength();437 G4double sigopi=1.0/(CLHEP::pi*numberDensity*length); // this is sigma0/pi438 439 // compute the impact parameter very early, so if is rejected as too far away, little effort is wasted440 // this is the TRIM method for determining an impact parameter based on the flight path441 // this gives a cumulative distribution of N(P)= 1-exp(-pi P^2 n l)442 // which says the probability of NOT hitting a disk of area sigma= pi P^2 =exp(-sigma N l)443 // which may be reasonable444 G4double P;445 if(sigopi < lattice*lattice) {446 // normal long-flight approximation447 P = std::sqrt(-std::log(G4UniformRand()) *sigopi);448 447 } else { 449 // short-flight limit 450 P = std::sqrt(G4UniformRand())*lattice; 451 } 452 453 G4double fraction=GetHardeningFraction(); 454 if(fraction && G4UniformRand() < fraction) { 455 // pick out some events, and increase the central cross section 456 // by reducing the impact parameter 457 P /= std::sqrt(GetHardeningFactor()); 458 } 459 460 461 // check if we are far enough away that the energy transfer must be below cutoff, 462 // and leave everything alone if so, saving a lot of time. 463 if(P*P > sigopi) { 464 if(GetVerboseLevel() > 1) 465 printf("ScreenedNuclear impact reject: length=%.3f P=%.4f limit=%.4f\n", 466 length/angstrom, P/angstrom,std::sqrt(sigopi)/angstrom); 467 // no collision, don't follow up with anything 468 validCollision=0; 448 449 G4double numberDensity=mat->GetTotNbOfAtomsPerVolume(); 450 G4double lattice=0.5/std::pow(numberDensity,1.0/3.0); // typical lattice half-spacing 451 G4double length=GetCurrentInteractionLength(); 452 G4double sigopi=1.0/(CLHEP::pi*numberDensity*length); // this is sigma0/pi 453 454 // compute the impact parameter very early, so if is rejected as too far away, little effort is wasted 455 // this is the TRIM method for determining an impact parameter based on the flight path 456 // this gives a cumulative distribution of N(P)= 1-exp(-pi P^2 n l) 457 // which says the probability of NOT hitting a disk of area sigma= pi P^2 =exp(-sigma N l) 458 // which may be reasonable 459 if(sigopi < lattice*lattice) { 460 // normal long-flight approximation 461 P = std::sqrt(-std::log(G4UniformRand()) *sigopi); 462 } else { 463 // short-flight limit 464 P = std::sqrt(G4UniformRand())*lattice; 465 } 466 467 G4double fraction=GetHardeningFraction(); 468 if(fraction && G4UniformRand() < fraction) { 469 // pick out some events, and increase the central cross section 470 // by reducing the impact parameter 471 P /= std::sqrt(GetHardeningFactor()); 472 } 473 474 475 // check if we are far enough away that the energy transfer must be below cutoff, 476 // and leave everything alone if so, saving a lot of time. 477 if(P*P > sigopi) { 478 if(GetVerboseLevel() > 1) 479 printf("ScreenedNuclear impact reject: length=%.3f P=%.4f limit=%.4f\n", 480 length/angstrom, P/angstrom,std::sqrt(sigopi)/angstrom); 481 // no collision, don't follow up with anything 482 validCollision=0; 483 } 469 484 } 470 485 471 486 // find out what we hit, and record it in our kinematics block. 487 kinematics.targetMaterial=mat; 488 kinematics.a1=a1; 489 472 490 if(validCollision) { 473 491 G4ScreenedCoulombCrossSection *xsect=GetCrossSectionHandlers()[z1]; … … 477 495 kinematics.recoilIon=recoilIon; 478 496 kinematics.impactParameter=P; 479 kinematics.a1=baseParticle->GetPDGMass()/amu_c2;480 497 kinematics.a2=recoilIon->GetPDGMass()/amu_c2; 481 498 } else { 482 499 kinematics.recoilIon=0; 483 500 kinematics.impactParameter=0; 484 kinematics.a1=baseParticle->GetPDGMass()/amu_c2;485 501 kinematics.a2=0; 486 502 } … … 492 508 493 509 if(registerDepositedEnergy) { 494 aParticleChange.ProposeLocalEnergyDeposit(NIEL); 495 aParticleChange.ProposeNonIonizingEnergyDeposit(NIEL); 496 } 510 pParticleChange->ProposeLocalEnergyDeposit(IonizingLoss+NIEL); 511 pParticleChange->ProposeNonIonizingEnergyDeposit(NIEL); 512 //MHM G4cout << "depositing energy, total = " << IonizingLoss+NIEL << " NIEL = " << NIEL << G4endl; 513 } 514 497 515 return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep ); 516 } 517 518 G4ScreenedCoulombClassicalKinematics::G4ScreenedCoulombClassicalKinematics() : 519 // instantiate all the needed functions statically, so no allocation is done at run time 520 // we will be solving x^2 - x phi(x*au)/eps - beta^2 == 0.0 521 // or, for easier scaling, x'^2 - x' au phi(x')/eps - beta^2 au^2 522 // note that only the last of these gets deleted, since it owns the rest 523 phifunc(c2.const_plugin_function()), 524 xovereps(c2.linear(0., 0., 0.)), // will fill this in with the right slope at run time 525 diff(c2.quadratic(0., 0., 0., 1.)-xovereps*phifunc) 526 { 498 527 } 499 528 … … 520 549 } 521 550 522 c2_function<G4double> &phiData=*(screen->EMphiData);523 // instantiate all the needed functions statically, so no allocation is done at run time524 551 // we will be solving x^2 - x phi(x*au)/eps - beta^2 == 0.0 525 552 // or, for easier scaling, x'^2 - x' au phi(x')/eps - beta^2 au^2 526 static c2_plugin_function<G4double> phifunc;527 static c2_quadratic<G4double> xsq(0., 0., 0., 1.); // x^2528 static c2_linear<G4double> xovereps(0., 0., 0.); // will fill this in with the right slope at run time529 static c2_function<G4double> &xphi=xovereps*phifunc;530 static c2_function<G4double> &diff=xsq-xphi;531 532 553 xovereps.reset(0., 0.0, au/eps); // slope of x*au/eps term 533 phifunc.set_function(phiData); // install interpolating table 534 554 phifunc.set_function(&(screen->EMphiData.get())); // install interpolating table 535 555 G4double xx1, phip, phip2; 536 G4int root_error; 537 538 xx1=diff.find_root(phiData.xmin(), std::min(10*xx0*au,phiData.xmax()), 539 std::min(xx0*au, phiData.xmax()), beta*beta*au*au, &root_error, &phip, &phip2)/au; 556 G4int root_error; 557 xx1=diff->find_root(phifunc.xmin(), std::min(10*xx0*au,phifunc.xmax()), 558 std::min(xx0*au, phifunc.xmax()), beta*beta*au*au, &root_error, &phip, &phip2)/au; 540 559 541 560 if(root_error) { 542 561 G4cout << "Screened Coulomb Root Finder Error" << G4endl; 543 562 G4cout << "au " << au << " A " << A << " a1 " << a1 << " xx1 " << xx1 << " eps " << eps << " beta " << beta << G4endl; 544 G4cout << " xmin " << phi Data.xmin() << " xmax " << std::min(10*xx0*au,phiData.xmax()) ;545 G4cout << " f(xmin) " << phifunc(phi Data.xmin()) << " f(xmax) " << phifunc(std::min(10*xx0*au,phiData.xmax())) ;546 G4cout << " xstart " << std::min(xx0*au, phi Data.xmax()) << " target " << beta*beta*au*au ;563 G4cout << " xmin " << phifunc.xmin() << " xmax " << std::min(10*xx0*au,phifunc.xmax()) ; 564 G4cout << " f(xmin) " << phifunc(phifunc.xmin()) << " f(xmax) " << phifunc(std::min(10*xx0*au,phifunc.xmax())) ; 565 G4cout << " xstart " << std::min(xx0*au, phifunc.xmax()) << " target " << beta*beta*au*au ; 547 566 G4cout << G4endl; 548 567 throw c2_exception("Failed root find"); 549 568 } 550 569 551 phifunc.unset_function(); // throws an exception if used without setting again 552 // phiprime is scaled by one factor of au because phi is evaluated at (xx0*au), 570 // phiprime is scaled by one factor of au because phi is evaluated at (xx0*au), 553 571 G4double phiprime=phip*au; 554 572 … … 564 582 G4double x, ff; 565 583 x=xx1/xvals[k]; 566 ff=1.0/std::sqrt(1.0-phi Data(x*au)/(x*eps)-beta*beta/(x*x));584 ff=1.0/std::sqrt(1.0-phifunc(x*au)/(x*eps)-beta*beta/(x*x)); 567 585 alpha+=weights[k]*ff; 568 586 } 569 587 588 phifunc.unset_function(); // throws an exception if used without setting again 589 570 590 G4double thetac1=CLHEP::pi*beta*alpha/xx1; // complement of CM scattering angle 571 591 G4double sintheta=std::sin(thetac1); //note sin(pi-theta)=sin(theta) … … 626 646 kin.eRecoil=eRecoil; 627 647 628 if(incidentEnergy-eRecoil < master->GetRecoilCutoff()) { 629 if(!baseParticle->GetProcessManager()-> 630 GetAtRestProcessVector()->size()) 631 aParticleChange.ProposeTrackStatus(fStopAndKill); 632 else 633 aParticleChange.ProposeTrackStatus(fStopButAlive); 648 if(incidentEnergy-eRecoil < master->GetRecoilCutoff()*a1) { 634 649 aParticleChange.ProposeEnergy(0.0); 635 master-> AddToNIEL(incidentEnergy-eRecoil);650 master->DepositEnergy(int(screen->z1), a1, kin.targetMaterial, incidentEnergy-eRecoil); 636 651 } 637 652 638 if(master->GetEnableRecoils() && eRecoil > master->GetRecoilCutoff() ) {653 if(master->GetEnableRecoils() && eRecoil > master->GetRecoilCutoff() * kin.a2) { 639 654 kin.recoilIon=recoilIon; 640 655 } else { 641 656 kin.recoilIon=0; // this flags no recoil to be generated 642 master-> AddToNIEL(eRecoil) ;657 master->DepositEnergy(Z, A, kin.targetMaterial, eRecoil) ; 643 658 } 644 659 } … … 706 721 #include <vector> 707 722 708 static c2_function<G4double>&ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)723 G4_c2_function &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval) 709 724 { 710 725 static const size_t ncoef=4; … … 729 744 730 745 *auval=au; 731 return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, phiprime0));732 } 733 734 static c2_function<G4double>&MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)746 return c2.lin_log_interpolating_function().load(r, phi, false, phiprime0,true,0); 747 } 748 749 G4_c2_function &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval) 735 750 { 736 751 static const size_t ncoef=3; … … 755 770 756 771 *auval=au; 757 return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, phiprime0));758 } 759 760 static c2_function<G4double>&LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval)772 return c2.lin_log_interpolating_function().load(r, phi, false, phiprime0,true,0); 773 } 774 775 G4_c2_function &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval) 761 776 { 762 777 //from Loftager, Besenbacher, Jensen & Sorensen … … 781 796 782 797 *auval=au; 783 return *static_cast<c2_function<G4double> *>(new lin_log_interpolating_function<G4double>(r, phi, false, logphiprime0*phi[0])); 798 return c2.lin_log_interpolating_function().load(r, phi, false, logphiprime0*phi[0],true,0); 799 } 800 801 G4_c2_function &LJZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval) 802 { 803 // hybrid of LJ and ZBL, uses LJ if x < 0.25*auniv, ZBL if x > 1.5*auniv, and 804 /// connector in between. These numbers are selected so the switchover 805 // is very near the point where the functions naturally cross. 806 G4double auzbl, aulj; 807 808 c2p zbl=ZBLScreening(z1, z2, npoints, rMax, &auzbl); 809 c2p lj=LJScreening(z1, z2, npoints, rMax, &aulj); 810 811 G4double au=(auzbl+aulj)*0.5; 812 lj->set_domain(lj->xmin(), 0.25*au); 813 zbl->set_domain(1.5*au,zbl->xmax()); 814 815 c2p conn=c2.connector_function(lj->xmax(), lj, zbl->xmin(), zbl, true,0); 816 c2_piecewise_function_p<G4double> &pw=c2.piecewise_function(); 817 c2p keepit(pw); 818 pw.append_function(lj); 819 pw.append_function(conn); 820 pw.append_function(zbl); 821 822 *auval=au; 823 keepit.release_for_return(); 824 return pw; 784 825 } 785 826 … … 791 832 AddScreeningFunction("lj", LJScreening); 792 833 AddScreeningFunction("mol", MoliereScreening); 834 AddScreeningFunction("ljzbl", LJZBLScreening); 793 835 } 794 836 … … 855 897 856 898 G4double au; 857 c2_function<G4double> &screen=sfunc(z1, Z, 200, 50.0*angstrom, &au); // generate the screening data 858 899 G4_c2_ptr screen=sfunc(z1, Z, 200, 50.0*angstrom, &au); // generate the screening data 859 900 G4ScreeningTables st; 860 st.EMphiData=&screen; // this is our phi table 901 902 st.EMphiData=screen; //save our phi table 861 903 st.z1=z1; st.m1=a1; st.z2=Z; st.m2=a2; st.emin=recoilCutoff; 862 904 st.au=au; … … 869 911 //this rearranges to phi(x0)/(x0*eps) = 2*theta/pi - theta^2/pi^2 870 912 871 c2_linear<G4double> c2au(0.0, 0.0, au); 872 c2_composed_function<G4double> phiau(screen, c2au); // build phi(x*au) for dimensionless phi 873 c2_linear<G4double> c2eps(0.0, 0.0, 0.0); // will store an appropriate eps inside this in loop 874 c2_ratio<G4double> x0func(phiau, c2eps); // this will be phi(x)/(x*eps) when c2eps is correctly set 913 c2_linear_p<G4double> &c2eps=c2.linear(0.0, 0.0, 0.0); // will store an appropriate eps inside this in loop 914 G4_c2_ptr phiau=screen(c2.linear(0.0, 0.0, au)); 915 G4_c2_ptr x0func(phiau/c2eps); // this will be phi(x)/(x*eps) when c2eps is correctly set 916 x0func->set_domain(1e-6*angstrom/au, 0.9999*screen->xmax()/au); // needed for inverse function 917 // use the c2_inverse_function interface for the root finder... it is more efficient for an ordered 918 // computation of values. 919 G4_c2_ptr x0_solution(c2.inverse_function(x0func)); 875 920 876 921 G4double m1c2=a1*amu_c2; … … 897 942 G4double q=theta/pi; 898 943 // G4cout << ee << " " << m1c2 << " " << gamma << " " << eps << " " << theta << " " << q << G4endl; 899 G4double x0= x0func.find_root(1e-6*angstrom/au, 0.9999*screen.xmax()/au, 1.0, 2*q-q*q); 944 // old way using root finder 945 // G4double x0= x0func->find_root(1e-6*angstrom/au, 0.9999*screen.xmax()/au, 1.0, 2*q-q*q); 946 // new way using c2_inverse_function which caches useful information so should be a bit faster 947 // since we are scanning this in strict order. 948 G4double x0=0; 949 try { 950 x0=x0_solution(2*q-q*q); 951 } catch(c2_exception e) { 952 G4Exception( 953 G4String("G4ScreenedNuclearRecoil: failure in inverse solution to generate MFP Tables: ")+e.what() 954 ); 955 } 900 956 G4double betasquared=x0*x0 - x0*phiau(x0)/eps; 901 957 G4double sigma=pi*betasquared*au*au; … … 903 959 data[idx]=sigma; 904 960 } 905 906 961 screeningData[Z]=st; 907 sigmaMap[Z] = static_cast<c2_function<G4double> *>(new log_log_interpolating_function<G4double>( 908 energies, data)); 962 sigmaMap[Z] = c2.log_log_interpolating_function().load(energies, data, true,0,true,0); 909 963 } 910 964 } -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmLivermore.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmLivermore.cc,v 1.2 2006/12/11 20:13:53 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmPenelope.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmPenelope.cc,v 1.1 2006/11/22 18:56:21 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandard.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: PhysListEmStandard.cc,v 1.11 2008/01/14 12:11:39 vnivanch Exp $ 28 // GEANT4 tag $Name: $ 26 // $Id: PhysListEmStandard.cc,v 1.19 2008/11/20 20:34:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 28 // 30 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 38 #include "G4PhotoElectricEffect.hh" 40 39 41 #include "G4 MultipleScattering.hh"40 #include "G4eMultipleScattering.hh" 42 41 #include "G4hMultipleScattering.hh" 43 42 … … 51 50 52 51 #include "G4hIonisation.hh" 52 #include "G4hBremsstrahlung.hh" 53 #include "G4hPairProduction.hh" 54 53 55 #include "G4ionIonisation.hh" 54 56 55 57 #include "G4EmProcessOptions.hh" 58 #include "G4MscStepLimitType.hh" 56 59 57 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 86 89 } else if (particleName == "e-") { 87 90 //electron 88 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);89 pmanager->AddProcess(new G4eIonisation, -1, 2,2);90 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);91 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 92 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 91 94 92 95 } else if (particleName == "e+") { 93 96 //positron 94 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);95 pmanager->AddProcess(new G4eIonisation, -1, 2,2);96 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);97 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);97 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation, -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 100 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 98 101 99 102 } else if( particleName == "mu+" || 100 103 particleName == "mu-" ) { 101 104 //muon 102 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 103 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 104 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 105 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 105 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 106 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 109 110 } else if( particleName == "proton" || 111 particleName == "pi-" || 112 particleName == "pi+" ) { 113 //proton 114 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 115 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 116 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 117 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 106 118 107 } else if( particleName == "alpha" || particleName == "GenericIon" ) { 108 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1); 109 pmanager->AddProcess(new G4ionIonisation, -1, 2,2); 119 } else if( particleName == "alpha" || 120 particleName == "He3" || 121 particleName == "GenericIon" ) { 122 //Ions 123 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 124 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 110 125 111 126 } else if ((!particle->IsShortLived()) && … … 113 128 (particle->GetParticleName() != "chargedgeantino")) { 114 129 //all others charged particles except geantino 115 pmanager->AddProcess(new G4hMultipleScattering, -1,1,1);116 pmanager->AddProcess(new G4hIonisation, -1,2,2);130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 117 132 } 118 133 } 119 G4EmProcessOptions opt;120 opt.SetStepFunction(0.2, 10*um);121 // opt.SetSkin(1.);122 opt.SetMinEnergy(0.1*keV);123 opt.SetMaxEnergy(100.*GeV);124 opt.SetDEDXBinning(360);125 opt.SetLambdaBinning(360);126 opt.SetLinearLossLimit(1.e-6);127 134 } 128 135 -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardNR.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandardNR.cc,v 1. 1 2008/01/14 12:11:39 vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandardNR.cc,v 1.3 2008/05/09 08:30:59 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 56 56 #include "G4CoulombScattering.hh" 57 57 58 #include "G4DummyModel.hh" 59 58 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 59 61 … … 74 76 75 77 G4ScreenedNuclearRecoil* nucr = new G4ScreenedNuclearRecoil(); 78 G4double energyLimit = 100.*MeV; 79 nucr->SetMaxEnergyForScattering(energyLimit); 76 80 77 81 theParticleIterator->reset(); … … 109 113 110 114 } else if (particleName == "alpha" || particleName == "He3") { 115 G4hMultipleScattering* msc = new G4hMultipleScattering(); 116 G4DummyModel* dm = new G4DummyModel(); 117 dm->SetLowEnergyLimit(0.0); 118 dm->SetHighEnergyLimit(energyLimit); 119 msc->AddEmModel(0, dm); 120 pmanager->AddProcess(msc, -1, 1,1); 121 111 122 G4ionIonisation* ion = new G4ionIonisation(); 112 123 ion->ActivateNuclearStopping(false); 113 pmanager->AddProcess(ion, -1, 1, 1); 124 pmanager->AddProcess(ion, -1, 2, 2); 125 114 126 pmanager->AddDiscreteProcess(nucr); 115 127 116 128 } else if (particleName == "GenericIon" ) { 129 G4hMultipleScattering* msc = new G4hMultipleScattering(); 130 G4DummyModel* dm = new G4DummyModel(); 131 dm->SetLowEnergyLimit(0.0); 132 dm->SetHighEnergyLimit(energyLimit); 133 msc->AddEmModel(0, dm); 134 pmanager->AddProcess(msc, -1, 1,1); 135 117 136 G4ionIonisation* ion = new G4ionIonisation(); 118 137 ion->ActivateNuclearStopping(false); 119 138 ion->SetStepFunction(0.1, um); 120 pmanager->AddProcess(ion, -1, 1, 1); 139 pmanager->AddProcess(ion, -1, 2, 2); 140 121 141 pmanager->AddDiscreteProcess(nucr); 122 142 … … 124 144 particleName == "deuteron" || 125 145 particleName == "triton") { 146 G4hMultipleScattering* msc = new G4hMultipleScattering(); 147 G4DummyModel* dm = new G4DummyModel(); 148 dm->SetLowEnergyLimit(0.0); 149 dm->SetHighEnergyLimit(energyLimit); 150 msc->AddEmModel(0, dm); 151 pmanager->AddProcess(msc, -1, 1,1); 152 126 153 G4hIonisation* hion = new G4hIonisation(); 127 154 hion->SetFluctModel(new G4IonFluctuations()); 128 155 hion->SetStepFunction(0.1, 10.*um); 129 156 hion->ActivateNuclearStopping(false); 130 pmanager->AddProcess(hion, -1, 1,1); 157 pmanager->AddProcess(hion, -1, 2, 2); 158 131 159 pmanager->AddDiscreteProcess(nucr); 132 160 -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysListEmStandardSS.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysListEmStandardSS.cc,v 1. 5 2008/01/14 12:11:39 vnivanchExp $27 // GEANT4 tag $Name: $26 // $Id: PhysListEmStandardSS.cc,v 1.8 2008/11/16 19:17:39 maire Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 38 38 #include "G4PhotoElectricEffect.hh" 39 39 40 #include "G4 MultipleScattering.hh"40 #include "G4CoulombScattering.hh" 41 41 42 42 #include "G4eIonisation.hh" … … 50 50 #include "G4hIonisation.hh" 51 51 #include "G4ionIonisation.hh" 52 #include "G4ionGasIonisation.hh" 53 #include "G4IonFluctuations.hh" 54 #include "G4CoulombScattering.hh" 52 53 #include "G4EmProcessOptions.hh" 55 54 56 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 85 84 } else if (particleName == "e-") { 86 85 //electron 87 pmanager->AddProcess(new G4eIonisation, -1, 1,1);88 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);89 86 pmanager->AddDiscreteProcess(new G4CoulombScattering); 87 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 88 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 90 89 91 90 } else if (particleName == "e+") { 92 91 //positron 93 pmanager->AddProcess(new G4eIonisation, -1, 1,1);94 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);95 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,3);96 92 pmanager->AddDiscreteProcess(new G4CoulombScattering); 93 pmanager->AddProcess(new G4eIonisation, -1, 1, 1); 94 pmanager->AddProcess(new G4eBremsstrahlung, -1, 2, 2); 95 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 3); 97 96 98 97 } else if (particleName == "mu+" || 99 98 particleName == "mu-" ) { 100 //muon 101 pmanager->Add Process(new G4MuIonisation, -1, 1,1);102 pmanager->AddProcess(new G4Mu Bremsstrahlung, -1, 2,2);103 pmanager->AddProcess(new G4Mu PairProduction, -1, 3,3);104 pmanager->Add DiscreteProcess(new G4CoulombScattering);99 //muon 100 pmanager->AddDiscreteProcess(new G4CoulombScattering); 101 pmanager->AddProcess(new G4MuIonisation, -1, 1, 1); 102 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2, 2); 103 pmanager->AddProcess(new G4MuPairProduction, -1, 3, 3); 105 104 106 } else if (particleName == "alpha" || particleName == "He3") { 107 G4ionIonisation* ion = new G4ionIonisation(); 108 ion->SetStepFunction(0.1, um); 109 ion->ActivateNuclearStopping(false); 110 pmanager->AddProcess(ion, -1, 1,1); 111 pmanager->AddDiscreteProcess(new G4CoulombScattering); 112 113 } else if (particleName == "GenericIon" ) { 114 G4ionGasIonisation* ion = new G4ionGasIonisation(); 115 ion->ActivateNuclearStopping(false); 116 ion->SetStepFunction(0.1, um); 117 pmanager->AddProcess(ion, -1, 1,1); 118 G4CoulombScattering* cs = new G4CoulombScattering(); 119 cs->SetBuildTableFlag(false); 120 pmanager->AddDiscreteProcess(cs); 121 105 } else if (particleName == "alpha" || 106 particleName == "He3" || 107 particleName == "GenericIon") { 108 pmanager->AddDiscreteProcess(new G4CoulombScattering); 109 pmanager->AddProcess(new G4ionIonisation, -1, 1, 1); 110 122 111 } else if ((!particle->IsShortLived()) && 123 112 (particle->GetPDGCharge() != 0.0) && 124 113 (particle->GetParticleName() != "chargedgeantino")) { 125 114 //all others charged particles except geantino 126 G4hIonisation* hion = new G4hIonisation();127 hion->SetStepFunction(0.1, 10.*um);128 hion->ActivateNuclearStopping(false);129 pmanager->AddProcess(hion, -1,1,1);130 115 pmanager->AddDiscreteProcess(new G4CoulombScattering); 116 pmanager->AddProcess(new G4hIonisation, -1, 1, 1); 131 117 } 132 118 } 119 120 // Em options 121 // 122 // Main options and setting parameters are shown here. 123 // Several of them have default values. 124 // 125 G4EmProcessOptions emOptions; 126 127 //physics tables 128 // 129 emOptions.SetMinEnergy(100*eV); //default 130 emOptions.SetMaxEnergy(100*TeV); //default 131 emOptions.SetDEDXBinning(12*20); //default=12*7 132 emOptions.SetLambdaBinning(12*20); //default=12*7 133 emOptions.SetSplineFlag(true); //default 134 135 //energy loss 136 // 137 emOptions.SetStepFunction(0.2,50*um); //default=(0.2, 1*mm) 138 emOptions.SetLinearLossLimit(1.e-2); //default 139 140 //ionization 141 // 142 emOptions.SetSubCutoff(false); //default 133 143 } 134 144 -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 28 2008/01/14 12:11:39vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysicsList.cc,v 1.36 2008/11/21 12:53:13 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 #include "PhysListEmStandard.hh" 36 36 #include "PhysListEmStandardSS.hh" 37 #include "PhysListEmStandardIG.hh"38 37 #include "PhysListEmStandardNR.hh" 39 38 #include "PhysListEmLivermore.hh" … … 42 41 #include "G4EmStandardPhysics_option1.hh" 43 42 #include "G4EmStandardPhysics_option2.hh" 43 #include "G4EmStandardPhysics_option3.hh" 44 45 #include "G4DecayPhysics.hh" 44 46 45 47 #include "G4HadronElasticPhysics.hh" … … 50 52 #include "G4IonBinaryCascadePhysics.hh" 51 53 52 #include "G4EmProcessOptions.hh"53 54 54 #include "G4LossTableManager.hh" 55 55 #include "G4UnitsTable.hh" … … 57 57 #include "G4ProcessManager.hh" 58 58 #include "G4Decay.hh" 59 60 #include "StepMax.hh" 61 62 #include "G4IonFluctuations.hh" 63 #include "G4IonParametrisedLossModel.hh" 59 64 60 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 79 84 80 85 // EM physics 81 emPhysicsList = new PhysListEmStandard(emName = "standard"); 82 86 emPhysicsList = new G4EmStandardPhysics(1); 87 emName = G4String("emstandard"); 88 89 // Deacy physics and all particles 90 decPhysicsList = new G4DecayPhysics(); 83 91 } 84 92 … … 89 97 delete pMessenger; 90 98 delete emPhysicsList; 91 for(size_t i=0; i<hadronPhys.size(); i++) delete hadronPhys[i]; 92 } 93 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 95 96 // Bosons 97 #include "G4ChargedGeantino.hh" 98 #include "G4Geantino.hh" 99 #include "G4Gamma.hh" 100 101 // leptons 102 #include "G4MuonPlus.hh" 103 #include "G4MuonMinus.hh" 104 #include "G4NeutrinoMu.hh" 105 #include "G4AntiNeutrinoMu.hh" 106 107 #include "G4Electron.hh" 108 #include "G4Positron.hh" 109 #include "G4NeutrinoE.hh" 110 #include "G4AntiNeutrinoE.hh" 111 112 // Hadrons 113 #include "G4MesonConstructor.hh" 114 #include "G4BaryonConstructor.hh" 115 #include "G4IonConstructor.hh" 99 delete decPhysicsList; 100 for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];} 101 } 116 102 117 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 119 105 void PhysicsList::ConstructParticle() 120 106 { 121 // pseudo-particles 122 G4Geantino::GeantinoDefinition(); 123 G4ChargedGeantino::ChargedGeantinoDefinition(); 124 125 // gamma 126 G4Gamma::GammaDefinition(); 127 128 // leptons 129 G4Electron::ElectronDefinition(); 130 G4Positron::PositronDefinition(); 131 G4MuonPlus::MuonPlusDefinition(); 132 G4MuonMinus::MuonMinusDefinition(); 133 134 G4NeutrinoE::NeutrinoEDefinition(); 135 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); 136 G4NeutrinoMu::NeutrinoMuDefinition(); 137 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 138 139 // mesons 140 G4MesonConstructor mConstructor; 141 mConstructor.ConstructParticle(); 142 143 // barions 144 G4BaryonConstructor bConstructor; 145 bConstructor.ConstructParticle(); 146 147 // ions 148 G4IonConstructor iConstructor; 149 iConstructor.ConstructParticle(); 150 } 151 152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 107 decPhysicsList->ConstructParticle(); 108 } 109 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 111 153 112 void PhysicsList::ConstructProcess() 154 113 { … … 160 119 // 161 120 emPhysicsList->ConstructProcess(); 121 em_config.AddModels(); 122 123 // decay physics list 124 // 125 decPhysicsList->ConstructProcess(); 162 126 163 127 // hadronic physics lists 164 for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess(); 165 166 // decay process 167 // 168 G4Decay* fDecayProcess = new G4Decay(); 169 170 theParticleIterator->reset(); 171 while( (*theParticleIterator)() ){ 172 G4ParticleDefinition* particle = theParticleIterator->value(); 173 G4ProcessManager* pmanager = particle->GetProcessManager(); 174 175 if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { 176 177 pmanager ->AddProcess(fDecayProcess); 178 179 // set ordering for PostStepDoIt and AtRestDoIt 180 pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep); 181 pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest); 182 183 } 128 for(size_t i=0; i<hadronPhys.size(); i++) { 129 hadronPhys[i]->ConstructProcess(); 184 130 } 185 131 186 132 // step limitation (as a full process) 187 133 // 188 AddStepMax(); 189 190 G4EmProcessOptions opt; 191 opt.SetDEDXBinning(480); 134 AddStepMax(); 192 135 } 193 136 … … 196 139 void PhysicsList::AddPhysicsList(const G4String& name) 197 140 { 198 if (verboseLevel> -1) {141 if (verboseLevel>1) { 199 142 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 200 143 } … … 202 145 if (name == emName) return; 203 146 204 if (name == "standard ") {147 if (name == "standard_local") { 205 148 206 149 emName = name; … … 212 155 emName = name; 213 156 delete emPhysicsList; 214 emPhysicsList = new G4EmStandardPhysics( );157 emPhysicsList = new G4EmStandardPhysics(1); 215 158 216 159 } else if (name == "emstandard_opt1") { … … 225 168 delete emPhysicsList; 226 169 emPhysicsList = new G4EmStandardPhysics_option2(); 170 171 } else if (name == "emstandard_opt3") { 172 173 emName = name; 174 delete emPhysicsList; 175 emPhysicsList = new G4EmStandardPhysics_option3(); 227 176 228 177 } else if (name == "standardSS") { … … 238 187 emPhysicsList = new PhysListEmStandardNR(name); 239 188 240 } else if (name == "standardIG") { 241 242 emName = name; 243 delete emPhysicsList; 244 emPhysicsList = new PhysListEmStandardIG(name); 189 } else if (name == "standardICRU73") { 190 191 emName = name; 192 delete emPhysicsList; 193 emPhysicsList = new PhysListEmStandard(name); 194 em_config.SetExtraEmModel("GenericIon","ionIoni", 195 new G4IonParametrisedLossModel(), 196 "",0.0, 100.0*TeV, 197 new G4IonFluctuations()); 198 G4cout << "standardICRU73" << G4endl; 245 199 246 200 } else if (name == "livermore") { … … 288 242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 289 243 290 #include "StepMax.hh"291 292 244 void PhysicsList::AddStepMax() 293 245 { … … 297 249 theParticleIterator->reset(); 298 250 while ((*theParticleIterator)()){ 299 G4ParticleDefinition* particle = theParticleIterator->value();300 G4ProcessManager* pmanager = particle->GetProcessManager();301 302 if (stepMaxProcess->IsApplicable(*particle) && pmanager)303 {304 pmanager ->AddDiscreteProcess(stepMaxProcess);305 }251 G4ParticleDefinition* particle = theParticleIterator->value(); 252 G4ProcessManager* pmanager = particle->GetProcessManager(); 253 254 if (stepMaxProcess->IsApplicable(*particle) && pmanager) 255 { 256 pmanager ->AddDiscreteProcess(stepMaxProcess); 257 } 306 258 } 307 259 } -
trunk/examples/extended/electromagnetic/TestEm7/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 16:58:37 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorAction.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2006/06/29 16:58:39 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/PrimaryGeneratorMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.3 2006/06/29 16:58:41 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/RunAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1.2 1 2008/01/14 12:11:39vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: RunAction.cc,v 1.24 2008/08/22 18:30:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 42 42 43 43 #include "Randomize.hh" 44 45 #ifdef G4ANALYSIS_USE 46 #include "AIDA/AIDA.h" 47 #endif 44 #include "Histo.hh" 48 45 49 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 51 48 RunAction::RunAction(DetectorConstruction* det, PhysicsList* phys, 52 49 PrimaryGeneratorAction* kin) 53 :detector(det), physics(phys), kinematic(kin) , af(0), tree(0)50 :detector(det), physics(phys), kinematic(kin) 54 51 { 55 52 tallyEdep = new G4double[MaxTally]; 56 53 binLength = offsetX = 0.; 57 histo[0] = 0; 58 59 #ifdef G4ANALYSIS_USE 60 // Creating the analysis factory 61 af = AIDA_createAnalysisFactory(); 62 if(!af) { 63 G4cout << "RunAction::RunAction() :" 64 << " problem creating the AIDA analysis factory." 65 << G4endl; 66 } 67 #endif 54 histo = new Histo(); 55 histo->setFileName("testem7"); 56 histo->add1D("1","Edep (MeV/mm) along absorber (mm)", 100, 0, 100); 57 histo->add1D("2","Edep (MeV/mm) along absorber zoomed (mm)", 100, 0, 100); 58 histo->add1D("3","Projectile range (mm)", 100, 0, 100); 68 59 } 69 60 … … 73 64 { 74 65 delete [] tallyEdep; 75 76 #ifdef G4ANALYSIS_USE 77 delete af; 78 #endif 79 } 80 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 82 83 void RunAction::bookHisto() 84 { 85 length = detector->GetAbsorSizeX(); 86 G4double stepMax = physics->GetStepMaxProcess()->GetMaxStep(); 87 const G4int nbmin = 100; 88 G4int nbBins = (int)(0.5 + length/stepMax); 89 if (nbBins < nbmin) nbBins = nbmin; 90 binLength = length/nbBins; 91 offsetX = 0.5*length; 92 93 #ifdef G4ANALYSIS_USE 94 if (!af) return; 95 96 // Create a tree mapped to an hbook file. 97 G4bool readOnly = false; 98 G4bool createNew = true; 99 G4String options = "--noErrors uncompress"; 100 AIDA::ITreeFactory* tf = af->createTreeFactory(); 101 tree = tf->create("testem7.hbook","hbook", readOnly, createNew, options); 102 //tree = tf->create("testem7.root", "root",readOnly, createNew, options); 103 //tree = tf->create("testem7.XML" , "XML" ,readOnly, createNew, options); 104 delete tf; 105 if (!tree) { 106 G4cout << "RunAction::bookHisto()" << G4endl; 107 return; 108 } 109 110 // Create a histogram factory, whose histograms will be handled by the tree 111 AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree); 112 113 // Create histogram 114 histo[0] = hf->createHistogram1D("1","Edep (MeV/mm) along absorber (mm)", 115 nbBins, 0, length/mm); 116 117 delete hf; 118 G4cout << "\n----> Histogram Tree opened" << G4endl; 119 #endif 120 } 121 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 123 124 void RunAction::cleanHisto() 125 { 126 #ifdef G4ANALYSIS_USE 127 tree->commit(); // Writing the histograms to the file 128 tree->close(); // and closing the tree (and the file) 129 delete tree; 130 tree = 0; 131 132 G4cout << "\n----> Histogram Tree saved" << G4endl; 133 #endif 66 delete histo; 134 67 } 135 68 … … 138 71 void RunAction::FillHisto(G4int ih, G4double x, G4double weight) 139 72 { 140 #ifdef G4ANALYSIS_USE 141 if(histo[ih]) histo[ih]->fill(x, weight); 142 #endif 73 histo->fill(ih, x, weight); 143 74 } 144 75 … … 156 87 // 157 88 nPrimarySteps = 0; 89 nRange = 0; 158 90 projRange = projRange2 = 0.; 159 91 edeptot = eniel = 0.; 160 92 for (G4int j=0; j<MaxTally; j++) tallyEdep[j] = 0.; 161 93 kinematic->ResetEbeamCumul(); 162 bookHisto(); 94 95 // define "1" histogram binning 96 length = detector->GetAbsorSizeX(); 97 G4double stepMax = physics->GetStepMaxProcess()->GetMaxStep(); 98 const G4int nbmin = 100; 99 G4int nbBins = (G4int)(0.5 + length/stepMax); 100 if (nbBins < nbmin) nbBins = nbmin; 101 binLength = length/nbBins; 102 offsetX = 0.5*length; 103 104 // histogram "1" is defined by the length of the target 105 // zoomed histograms are defined by UI command 106 histo->setHisto1D(0, nbBins, 0, length, mm); 107 108 histo->book(); 163 109 } 164 110 … … 186 132 //compute projected range and straggling 187 133 // 188 projRange /= NbofEvents; projRange2 /= NbofEvents; 134 if(nRange > 0) { 135 projRange /= nRange; 136 projRange2 /= nRange; 137 } 189 138 G4double rms = projRange2 - projRange*projRange; 190 139 if (rms>0.) rms = std::sqrt(rms); else rms = 0.; … … 227 176 } 228 177 229 #ifdef G4ANALYSIS_USE230 178 // normalize histogram 231 179 G4double fac = (mm/MeV)/(NbofEvents * binLength); 232 histo[0]->scale(fac); 233 #endif 234 180 for (G4int j=0; j<3; j++) {histo->scale(j, fac);} 235 181 236 182 // save and clean histo 237 cleanHisto();183 histo->save(); 238 184 239 185 // show Rndm status -
trunk/examples/extended/electromagnetic/TestEm7/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.5 2006/06/29 16:58:45 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:58:47 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1.1 2 2008/01/14 12:11:39vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: SteppingAction.cc,v 1.14 2008/08/22 18:30:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 51 51 void SteppingAction::UserSteppingAction(const G4Step* aStep) 52 52 { 53 G4double edep = aStep->GetTotalEnergyDeposit();54 if (edep <= 0.) return;53 G4double edep = aStep->GetTotalEnergyDeposit(); 54 if (edep <= 0.) return; 55 55 56 // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl;56 // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl; 57 57 58 runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit());58 runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit()); 59 59 60 if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep();60 if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep(); 61 61 62 //Bragg curve63 //64 G4StepPoint* prePoint = aStep->GetPreStepPoint();65 G4StepPoint* postPoint = aStep->GetPostStepPoint();62 //Bragg curve 63 // 64 G4StepPoint* prePoint = aStep->GetPreStepPoint(); 65 G4StepPoint* postPoint = aStep->GetPostStepPoint(); 66 66 67 G4double x1 = prePoint->GetPosition().x(), x2 = postPoint->GetPosition().x(); 68 G4double x = runAction->GetOffsetX() + x1 + G4UniformRand()*(x2-x1); 69 runAction->FillHisto(0, x/mm , edep); 67 G4double x1 = prePoint->GetPosition().x(), x2 = postPoint->GetPosition().x(); 68 G4double x = runAction->GetOffsetX() + x1 + G4UniformRand()*(x2-x1); 69 runAction->FillHisto(0, x/mm , edep); 70 runAction->FillHisto(1, x/mm , edep); 70 71 71 //fill tallies72 //73 G4TouchableHandle touchable = prePoint->GetTouchableHandle();74 G4LogicalVolume* lVolume = touchable->GetVolume()->GetLogicalVolume();75 if (lVolume == detector->GetLogicalTally())76 runAction->FillTallyEdep(touchable->GetCopyNumber(), edep);72 //fill tallies 73 // 74 G4TouchableHandle touchable = prePoint->GetTouchableHandle(); 75 G4LogicalVolume* lVolume = touchable->GetVolume()->GetLogicalVolume(); 76 if (lVolume == detector->GetLogicalTally()) 77 runAction->FillTallyEdep(touchable->GetCopyNumber(), edep); 77 78 } 78 79 -
trunk/examples/extended/electromagnetic/TestEm7/src/SteppingVerbose.cc
r807 r1230 25 25 // 26 26 // $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:58:51 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm7/src/TrackingAction.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: TrackingAction.cc,v 1. 3 2006/11/22 17:58:11vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: TrackingAction.cc,v 1.5 2008/08/22 18:30:27 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 50 50 G4double x = aTrack->GetPosition().x() + runAction->GetOffsetX(); 51 51 if(x > runAction->GetLength()) x = runAction->GetLength(); 52 runAction->AddProjRange(x); 52 //G4cout << " range= " << x << " x= " << aTrack->GetPosition().x() 53 // << " ofset= " << runAction->GetOffsetX() << G4endl; 54 if(x > 0.0) runAction->AddProjRange(x); 55 runAction->FillHisto(2, x/mm, 1.0); 53 56 } 54 57 } -
trunk/examples/extended/electromagnetic/TestEm8/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 7 2006/10/26 16:20:33maire Exp $1 # $Id: GNUmakefile,v 1.8 2008/06/11 22:27:45 maire Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. … … 15 15 all: lib bin 16 16 17 ifdef G4ANALYSIS_USE 18 CPPFLAGS += -DG4ANALYSIS_USE 19 endif 17 #### G4ANALYSIS_USE := true 20 18 21 19 include $(G4INSTALL)/config/architecture.gmk 22 20 23 ifdef G4ANALYSIS_USE24 # for the aida-config command see the README file25 CPPFLAGS += `aida-config --include`26 LOADLIBS += `aida-config --lib`27 endif28 29 21 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm8/TestEm8.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm8.cc,v 1.8 2007/07/27 15:29:38 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorHit.hh
r807 r1230 26 26 // 27 27 // $Id: Em8CalorHit.hh,v 1.4 2006/06/29 16:58:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8CalorimeterSD.hh
r807 r1230 26 26 // 27 27 // $Id: Em8CalorimeterSD.hh,v 1.4 2006/06/29 16:59:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: Em8DetectorConstruction.hh,v 1.9 2007/10/02 10:12:47 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8DetectorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em8DetectorMessenger.hh,v 1.6 2007/10/02 10:12:47 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em8EventAction.hh,v 1.4 2006/06/29 16:59:08 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8EventActionMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em8EventActionMessenger.hh,v 1.4 2006/06/29 16:59:10 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em8PrimaryGeneratorAction.hh,v 1.4 2006/06/29 16:59:12 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8PrimaryGeneratorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: Em8PrimaryGeneratorMessenger.hh,v 1.4 2006/06/29 16:59:14 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em8RunAction.hh,v 1.8 2006/06/29 16:59:16 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8RunMessenger.hh
r807 r1230 27 27 // 28 28 // $Id: Em8RunMessenger.hh,v 1.4 2006/06/29 16:59:18 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingAction.hh
r807 r1230 26 26 // 27 27 // $Id: Em8SteppingAction.hh,v 1.5 2006/06/29 16:59:20 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/Em8SteppingVerbose.hh
r807 r1230 26 26 // 27 27 // $Id: Em8SteppingVerbose.hh,v 1.4 2006/06/29 16:59:22 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsList.hh
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.hh,v 1. 2 2006/06/29 16:59:46 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.hh,v 1.3 2008/11/21 12:39:24 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 40 40 #include "G4VModularPhysicsList.hh" 41 41 #include "globals.hh" 42 #include "G4EmConfigurator.hh" 42 43 43 44 class G4VPhysicsConstructor; … … 49 50 class PhysicsList: public G4VModularPhysicsList 50 51 { 51 public:52 PhysicsList();53 ~PhysicsList();52 public: 53 PhysicsList(); 54 virtual ~PhysicsList(); 54 55 55 void ConstructParticle();56 void ConstructParticle(); 56 57 57 void SetCuts();58 void SetCutForGamma(G4double);59 void SetCutForElectron(G4double);60 void SetCutForPositron(G4double);58 void SetCuts(); 59 void SetCutForGamma(G4double); 60 void SetCutForElectron(G4double); 61 void SetCutForPositron(G4double); 61 62 62 void AddPhysicsList(const G4String& name);63 void ConstructProcess();63 void AddPhysicsList(const G4String& name); 64 void ConstructProcess(); 64 65 65 void AddStepMax();66 StepMax* GetStepMaxProcess() {return stepMaxProcess;};66 void AddStepMax(); 67 //StepMax* GetStepMaxProcess() {return stepMaxProcess;}; 67 68 68 private: 69 G4double cutForGamma; 70 G4double cutForElectron; 71 G4double cutForPositron; 69 private: 72 70 73 G4VPhysicsConstructor* emPhysicsList; 74 G4VPhysicsConstructor* generalPhysicsList; 75 G4VPhysicsConstructor* particleList; 76 std::vector<G4VPhysicsConstructor*> hadronPhys; 77 G4String emName; 71 void AddPAIModel(const G4String&); 72 void NewPAIModel(const G4ParticleDefinition*, const G4String& modname, 73 const G4String& procname); 74 75 G4EmConfigurator em_config; 76 77 G4double cutForGamma; 78 G4double cutForElectron; 79 G4double cutForPositron; 80 81 G4VPhysicsConstructor* emPhysicsList; 82 G4VPhysicsConstructor* generalPhysicsList; 83 G4VPhysicsConstructor* particleList; 84 std::vector<G4VPhysicsConstructor*> hadronPhys; 85 G4String emName; 78 86 79 StepMax* stepMaxProcess;87 StepMax* stepMaxProcess; 80 88 81 PhysicsListMessenger* pMessenger; 89 PhysicsListMessenger* pMessenger; 90 91 G4VEmModel* em_model; 92 G4VEmFluctuationModel* fm_model; 93 82 94 }; 83 95 -
trunk/examples/extended/electromagnetic/TestEm8/include/PhysicsListMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsListMessenger.hh,v 1.2 2006/06/29 16:59:49 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.2 2006/06/29 16:59:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm8/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:59:55 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm8/include/TRTDetectorConstruction.hh
r807 r1230 26 26 // 27 27 // $Id: TRTDetectorConstruction.hh,v 1.4 2006/06/29 16:59:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/include/TRTMaterials.hh
r807 r1230 26 26 // 27 27 // $Id: TRTMaterials.hh,v 1.4 2006/06/29 17:00:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorHit.cc
r807 r1230 26 26 // 27 27 // $Id: Em8CalorHit.cc,v 1.5 2006/06/29 17:00:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8CalorimeterSD.cc
r807 r1230 26 26 // 27 27 // $Id: Em8CalorimeterSD.cc,v 1.7 2006/06/29 17:00:05 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorConstruction.cc
r807 r1230 26 26 // 27 27 // $Id: Em8DetectorConstruction.cc,v 1.21 2007/10/02 10:12:47 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8DetectorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em8DetectorMessenger.cc,v 1.8 2007/10/02 10:12:47 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em8EventAction.cc,v 1.10 2007/11/12 10:54:49 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8EventActionMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em8EventActionMessenger.cc,v 1.5 2006/06/29 17:00:15 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em8PrimaryGeneratorAction.cc,v 1.7 2006/06/29 17:00:18 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8PrimaryGeneratorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em8PrimaryGeneratorMessenger.cc,v 1.5 2006/06/29 17:00:21 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em8RunAction.cc,v 1.15 2007/11/12 10:54:49 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8RunMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: Em8RunMessenger.cc,v 1.7 2006/06/29 17:00:25 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingAction.cc
r807 r1230 26 26 // 27 27 // $Id: Em8SteppingAction.cc,v 1.10 2007/11/12 10:54:49 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/Em8SteppingVerbose.cc
r807 r1230 26 26 // 27 27 // $Id: Em8SteppingVerbose.cc,v 1.8 2006/06/29 17:00:29 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsList.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsList.cc,v 1.1 4 2007/09/26 10:23:17vnivanch Exp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsList.cc,v 1.16 2008/12/05 17:46:12 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 … … 36 36 37 37 #include "G4EmStandardPhysics.hh" 38 #include "G4EmStandardPhysics_option1.hh" 39 #include "G4EmStandardPhysics_option2.hh" 40 #include "G4EmStandardPhysics_option3.hh" 38 41 #include "G4DecayPhysics.hh" 39 42 40 #include "PhysListEmModelPai.hh" 41 #include "PhysListEmPaiPhoton.hh" 42 #include "PhysListEmPAI.hh" 43 #include "G4PAIModel.hh" 44 #include "G4PAIPhotonModel.hh" 43 45 44 46 #include "G4Gamma.hh" … … 69 71 pMessenger = new PhysicsListMessenger(this); 70 72 71 SetVerboseLevel(1);72 73 73 // Decay Physics is always defined 74 74 generalPhysicsList = new G4DecayPhysics(); … … 76 76 // EM physics 77 77 emName = G4String("emstandard"); 78 emPhysicsList = new G4EmStandardPhysics(); 79 78 emPhysicsList = new G4EmStandardPhysics(1); 79 80 SetVerboseLevel(1); 80 81 } 81 82 … … 104 105 AddTransportation(); 105 106 emPhysicsList->ConstructProcess(); 107 em_config.AddModels(); 106 108 generalPhysicsList->ConstructProcess(); 107 109 for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess(); … … 113 115 void PhysicsList::AddPhysicsList(const G4String& name) 114 116 { 115 if (verboseLevel> -1) {117 if (verboseLevel>1) { 116 118 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 117 119 } 118 120 119 if (name == emName) return; 120 121 if (name == "pai") 122 { 121 if (name == emName) { 122 return; 123 124 } else if (name == "emstandard_opt1") { 125 123 126 emName = name; 124 127 delete emPhysicsList; 125 emPhysicsList = new PhysListEmModelPai(name); 126 G4cout<<"PhysListEmModelPai is called"<<G4endl; 127 } 128 else if (name == "pai_photon") 129 { 128 emPhysicsList = new G4EmStandardPhysics_option1(); 129 130 } else if (name == "emstandard_opt2") { 131 130 132 emName = name; 131 133 delete emPhysicsList; 132 emPhysicsList = new PhysListEmPaiPhoton(name); 133 G4cout<<"PhysListEmModelPaiPhoton is called"<<G4endl; 134 } 135 else if (name == "pai_brem") 136 { 134 emPhysicsList = new G4EmStandardPhysics_option2(); 135 136 } else if (name == "emstandard_opt3") { 137 137 138 emName = name; 138 139 delete emPhysicsList; 139 emPhysicsList = new PhysListEmPAI(name); 140 G4cout<<"PhysListEmPAI is called (bremsstrahlung dedx added)"<<G4endl; 141 } 142 else 143 { 140 emPhysicsList = new G4EmStandardPhysics_option3(); 141 142 } else if (name == "pai") { 143 144 emName = name; 145 AddPAIModel(name); 146 147 } else if (name == "pai_photon") { 148 149 emName = name; 150 AddPAIModel(name); 151 152 } else { 153 144 154 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 145 155 << " is not defined" … … 156 166 157 167 theParticleIterator->reset(); 158 159 168 while ((*theParticleIterator)()) 160 169 { … … 216 225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 217 226 227 void PhysicsList::AddPAIModel(const G4String& modname) 228 { 229 theParticleIterator->reset(); 230 while ((*theParticleIterator)()) 231 { 232 G4ParticleDefinition* particle = theParticleIterator->value(); 233 G4String partname = particle->GetParticleName(); 234 if(partname == "e-" || partname == "e+") { 235 NewPAIModel(particle, modname, "eIoni"); 236 237 } else if(partname == "mu-" || partname == "mu+") { 238 NewPAIModel(particle, modname, "muIoni"); 239 240 } else if(partname == "proton" || 241 partname == "pi+" || 242 partname == "pi-" 243 ) { 244 NewPAIModel(particle, modname, "hIoni"); 245 } 246 } 247 } 248 249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 250 251 void PhysicsList::NewPAIModel(const G4ParticleDefinition* part, 252 const G4String& modname, 253 const G4String& procname) 254 { 255 G4String partname = part->GetParticleName(); 256 if(modname == "pai") { 257 G4PAIModel* pai = new G4PAIModel(part,"PAIModel"); 258 em_config.SetExtraEmModel(partname,procname,pai,"VertexDetector", 259 0.0,100.*TeV,pai); 260 } else if(modname == "pai_photon") { 261 G4PAIPhotonModel* pai = new G4PAIPhotonModel(part,"PAIPhotModel"); 262 em_config.SetExtraEmModel(partname,procname,pai,"VertexDetector", 263 0.0,100.*TeV,pai); 264 } 265 } 266 267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 268 -
trunk/examples/extended/electromagnetic/TestEm8/src/PhysicsListMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: PhysicsListMessenger.cc,v 1.2 2006/06/29 17:00:47 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm8/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.3 2006/06/29 17:00:49 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm8/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 17:00:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/GNUmakefile
r807 r1230 1 # $Id: GNUmakefile,v 1. 8 2006/10/26 15:50:35 maire Exp $2 # GEANT4 tag $Name: $1 # $Id: GNUmakefile,v 1.9 2008/06/11 22:31:05 maire Exp $ 2 # GEANT4 tag $Name: geant4-09-03-cand-01 $ 3 3 # -------------------------------------------------------------- 4 4 # GNUmakefile for examples module with AIDA interface … … 16 16 all: lib bin 17 17 18 ifdef G4ANALYSIS_USE 19 CPPFLAGS += -DG4ANALYSIS_USE 20 endif 18 #### G4ANALYSIS_USE := true 21 19 22 20 include $(G4INSTALL)/config/architecture.gmk 23 24 # for the aida-config command see the README file25 ifdef G4ANALYSIS_USE26 CPPFLAGS += `aida-config --include`27 LOADLIBS += `aida-config --lib`28 endif29 21 30 22 include $(G4INSTALL)/config/binmake.gmk -
trunk/examples/extended/electromagnetic/TestEm9/TestEm9.cc
r807 r1230 26 26 // 27 27 // $Id: TestEm9.cc,v 1.8 2006/11/17 17:45:05 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/cms10gev.mac
r807 r1230 1 # $Id: cms10gev.mac,v 1. 2 2006/10/26 15:50:35 maireExp $1 # $Id: cms10gev.mac,v 1.5 2008/09/24 10:38:46 vnivanch Exp $ 2 2 # 3 3 # Macro file for "TestEm9.cc" … … 10 10 # 11 11 /testem/det/CalMat G4_PbWO4 12 /testem/de l/EcalLength 230 mm12 /testem/det/EcalLength 230 mm 13 13 /testem/det/EcalWidth 22 mm 14 14 # 15 /testem/phys/addPhysics standard 15 #/testem/phys/addPhysics emstandard_opt2 16 /testem/phys/addPhysics standardLPM 16 17 # 18 /testem/phys/setCuts 1 mm 17 19 /testem/phys/VertexCuts 0.01 mm 18 20 /testem/phys/MuonCuts 10.0 mm 19 /testem/stepMax 10 mm21 #/testem/stepMax 10 mm 20 22 # 21 23 # … … 31 33 #/random/resetEngineFrom first.rndm 32 34 /testem/event/printModulo 1000 33 /testem/histo/fileName cms.paw 34 /testem/histo/setHisto 0 75 7000 8500 MeV 35 /testem/histo/setHisto 1 100 9000 10000 MeV 36 /testem/histo/setHisto 2 100 9500 10000 MeV 37 #/testem/histo/fileType hbook 38 /testem/ 35 /testem/histo/fileName cms10gev1mm 36 /testem/histo/fileType root 37 /testem/histo/setHisto 0 250 0.60 0.85 38 /testem/histo/setHisto 1 200 0.80 1.00 39 /testem/histo/setHisto 2 100 0.90 1.00 40 /testem/histo/setHisto 10 80 0.80 0.88 41 /testem/histo/setHisto 11 100 0.75 0.85 42 /testem/histo/setHisto 12 40 0.94 0.98 43 /run/initialize 44 /run/beamOn 10000 39 45 # 40 /testem/phys/setCuts 1mm41 / run/initialize42 /run/beamOn 1000 46 /testem/phys/setCuts 3 mm 47 /testem/histo/fileName cms10gev3mm 48 /run/beamOn 10000 43 49 # 44 # -
trunk/examples/extended/electromagnetic/TestEm9/csi.mac
r807 r1230 1 1 # $Id: csi.mac,v 1.4 2006/10/26 15:50:35 maire Exp $ 2 # GEANT4 tag $Name: $2 # GEANT4 tag $Name: geant4-09-03-cand-01 $ 3 3 # 4 4 # Macro file for TestEm9 - Crystal Calorimeter -
trunk/examples/extended/electromagnetic/TestEm9/include/DetectorConstruction.hh
r807 r1230 25 25 // 26 26 // 27 // $Id: DetectorConstruction.hh,v 1. 5 2006/06/29 17:00:56 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: DetectorConstruction.hh,v 1.7 2008/04/07 18:09:05 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 57 57 class DetectorMessenger; 58 58 class G4Region; 59 class G4ProductionCuts; 59 60 60 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 65 66 66 67 DetectorConstruction(); 67 ~DetectorConstruction();68 virtual ~DetectorConstruction(); 68 69 69 70 public: … … 71 72 void SetEcalMaterial(const G4String&); 72 73 void SetAbsMaterial(const G4String&); 73 void SetEcalLength (G4double val) {ecalLength = val;};74 void SetEcalWidth (G4double val) {ecalWidth = val;};75 void SetVertexLength (G4double val) {vertexLength = val;};76 void SetPadLength (G4double val) {padLength = val;};77 void SetPadWidth (G4double val) {padWidth = val;};78 void SetAbsLength(G4double val) {absLength = val;};74 void SetEcalLength(G4double val); 75 void SetEcalWidth(G4double val); 76 void SetVertexLength(G4double val); 77 void SetPadLength(G4double val); 78 void SetPadWidth(G4double val); 79 void SetAbsLength(G4double val); 79 80 80 81 G4VPhysicalVolume* Construct(); … … 82 83 void UpdateGeometry(); 83 84 84 G4double GetWorldSizeZ() {return worldZ;}85 G4double GetWorldSizeZ() {return worldZ;} 85 86 86 87 private: … … 106 107 G4Material* yorkMaterial; 107 108 108 G4LogicalVolume* logicC; 109 G4LogicalVolume* logicWorld; 110 G4LogicalVolume* logicECal; 111 G4LogicalVolume* logicCal; 109 112 G4LogicalVolume* logicA1; 110 113 G4LogicalVolume* logicA2; 111 114 G4LogicalVolume* logicA3; 112 115 G4LogicalVolume* logicA4; 116 G4LogicalVolume* logicYV; 117 G4LogicalVolume* logicY; 118 G4LogicalVolume* logicVV; 119 G4LogicalVolume* logicVD; 120 G4LogicalVolume* logicV; 113 121 114 122 G4Region* vertexRegion; 115 123 G4Region* muonRegion; 124 G4ProductionCuts* vertexDetectorCuts; 125 G4ProductionCuts* muonDetectorCuts; 116 126 117 127 DetectorMessenger* detectorMessenger; //pointer to the Messenger -
trunk/examples/extended/electromagnetic/TestEm9/include/DetectorMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: DetectorMessenger.hh,v 1.4 2006/06/29 17:00:58 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/include/EmAcceptance.hh
r807 r1230 26 26 // 27 27 // $Id: EmAcceptance.hh,v 1.2 2006/06/29 17:01:00 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/include/EventAction.hh
r807 r1230 28 28 29 29 // $Id: EventAction.hh,v 1.3 2006/06/29 17:01:02 gunter Exp $ 30 // GEANT4 tag $Name: $30 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 31 31 32 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/examples/extended/electromagnetic/TestEm9/include/EventActionMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.hh,v 1.3 2006/06/29 17:01:04 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/Histo.hh
r807 r1230 25 25 // 26 26 // $Id: Histo.hh,v 1.5 2007/05/24 13:17:41 vnivanch Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 29 29 #ifndef Histo_h -
trunk/examples/extended/electromagnetic/TestEm9/include/HistoManager.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HistoManager.hh,v 1. 8 2007/04/24 14:20:04vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: HistoManager.hh,v 1.11 2008/09/24 10:38:46 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 29 29 #ifndef HistoManager_h … … 110 110 void SetThresholdEnergy(G4double val) {thKinE = val;}; 111 111 void SetThresholdZ(G4double val) {thPosZ = val;}; 112 void AddStep() {n_step ++;};112 void AddStep() {n_step += 1.0;}; 113 113 114 114 // Acceptance parameters … … 133 133 134 134 G4double trackLength; 135 G4double n_step; 136 G4double n_step_target; 135 137 G4bool trackAbs; // Track is in absorber 136 138 G4int n_evt; … … 138 140 G4int n_posit; 139 141 G4int n_gam; 140 G4int n_step;141 142 G4int n_gamph; 142 143 G4int n_gam_tar; 143 G4int n_ step_target;144 G4int n_lowe; 144 145 G4int nBinsE, nBinsEA, nBinsED; 145 146 G4bool nTuple; … … 153 154 G4double rmstrue[3]; 154 155 G4double limittrue[3]; 155 G4double edep[ 3];156 G4double erms[ 3];157 G4double edeptr[ 3];158 G4double ermstr[ 3];159 G4int stat[ 3];156 G4double edep[6]; 157 G4double erms[6]; 158 G4double edeptr[6]; 159 G4double ermstr[6]; 160 G4int stat[6]; 160 161 G4int nmax; 161 162 -
trunk/examples/extended/electromagnetic/TestEm9/include/HistoMessenger.hh
r807 r1230 27 27 // 28 28 // $Id: HistoMessenger.hh,v 1.3 2006/06/29 17:01:11 gunter Exp $ 29 // GEANT4 tag $Name: $29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // -
trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmLivermore.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmLivermore.hh,v 1.1 2006/11/17 17:45:57 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmPenelope.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmPenelope.hh,v 1.1 2006/11/17 17:45:57 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/PhysListEmStandard.hh
r807 r1230 26 26 // 27 27 // $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 17:02:17 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsList.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.hh,v 1. 5 2006/11/17 17:03:26vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: PhysicsList.hh,v 1.7 2008/04/07 18:09:05 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 61 61 public: 62 62 PhysicsList(); 63 ~PhysicsList();63 virtual ~PhysicsList(); 64 64 65 65 void ConstructParticle(); … … 69 69 void SetCutForElectron(G4double); 70 70 void SetCutForPositron(G4double); 71 void SetMscStepLimit(G4bool val);72 71 73 72 void AddPhysicsList(const G4String& name); … … 89 88 G4double cutForElectron; 90 89 G4double cutForPositron; 90 G4double cutForVertexDetector; 91 G4double cutForMuonDetector; 91 92 92 93 G4VPhysicsConstructor* emPhysicsList; … … 102 103 G4ProductionCuts* muonDetectorCuts; 103 104 104 G4bool mscStepLimit;105 105 G4bool helIsRegisted; 106 106 G4bool bicIsRegisted; -
trunk/examples/extended/electromagnetic/TestEm9/include/PhysicsListMessenger.hh
r807 r1230 26 26 // 27 27 // $Id: PhysicsListMessenger.hh,v 1.4 2006/06/29 17:02:32 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/include/PrimaryGeneratorAction.hh
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 17:02:35 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/include/StepMax.hh
r807 r1230 25 25 // 26 26 // $Id: StepMax.hh,v 1.3 2006/06/29 17:02:40 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/StepMaxMessenger.hh
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.hh,v 1.3 2006/06/29 17:02:42 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/include/SteppingAction.hh
r807 r1230 26 26 // 27 27 // $Id: SteppingAction.hh,v 1.3 2006/06/29 17:02:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/src/DetectorConstruction.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: DetectorConstruction.cc,v 1. 9 2006/06/29 17:02:59 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: DetectorConstruction.cc,v 1.11 2008/04/07 18:09:05 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 58 58 #include "G4Region.hh" 59 59 #include "G4RegionStore.hh" 60 #include "G4ProductionCuts.hh" 60 61 #include "G4PhysicalVolumeStore.hh" 61 62 #include "G4LogicalVolumeStore.hh" … … 72 73 73 74 DetectorConstruction::DetectorConstruction() 74 : logicC(0),logicA1(0),logicA2(0)75 : G4VUserDetectorConstruction() 75 76 { 76 77 detectorMessenger = new DetectorMessenger(this); … … 84 85 vertexRegion = 0; 85 86 muonRegion = 0; 87 logicWorld = 0; 88 logicCal = 0; 89 logicA1 = 0; 86 90 DefineMaterials(); 91 vertexDetectorCuts = new G4ProductionCuts(); 92 muonDetectorCuts = new G4ProductionCuts(); 87 93 } 88 94 … … 90 96 91 97 DetectorConstruction::~DetectorConstruction() 92 { delete detectorMessenger;} 98 { 99 delete detectorMessenger; 100 delete vertexDetectorCuts; 101 delete muonDetectorCuts; 102 } 93 103 94 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 106 116 107 117 G4NistManager* man = G4NistManager::Instance(); 108 man->SetVerbose(1);118 // man->SetVerbose(1); 109 119 worldMaterial = man->FindOrBuildMaterial("G4_AIR"); 110 120 absMaterial = man->FindOrBuildMaterial("G4_Al"); … … 118 128 G4VPhysicalVolume* DetectorConstruction::ConstructVolumes() 119 129 { 120 G4cout << *(G4Material::GetMaterialTable()) << G4endl;121 122 130 // Cleanup old geometry 123 131 124 132 G4GeometryManager::GetInstance()->OpenGeometry(); 133 134 if(G4NistManager::Instance()->GetVerbose() > 0) 135 G4cout << *(G4Material::GetMaterialTable()) << G4endl; 136 137 if(vertexRegion) { 138 delete vertexRegion; 139 delete muonRegion; 140 } 141 vertexRegion = new G4Region("VertexDetector"); 142 vertexRegion->SetProductionCuts(vertexDetectorCuts); 143 144 muonRegion = new G4Region("MuonDetector"); 145 muonRegion->SetProductionCuts(muonDetectorCuts); 146 147 G4SolidStore::GetInstance()->Clean(); 148 G4LogicalVolumeStore::GetInstance()->Clean(); 125 149 G4PhysicalVolumeStore::GetInstance()->Clean(); 126 G4LogicalVolumeStore::GetInstance()->Clean();127 G4SolidStore::GetInstance()->Clean();128 129 if(vertexRegion) delete vertexRegion;130 if(muonRegion) delete muonRegion;131 vertexRegion = new G4Region("VertexDetector");132 muonRegion = new G4Region("MuonDetector");133 150 134 151 if(vertexLength < padLength*5.0) vertexLength = padLength*5.0; … … 137 154 G4double york = 10.*cm; 138 155 139 worldZ = 2.*vertexLength + 3.*absLength + 0.5*(ecalLength + york) + biggap*2.; 156 worldZ = 2.*vertexLength + 3.*absLength + 0.5*(ecalLength + york) + biggap*2.; 157 140 158 G4double worldX = ecalWidth*3.0; 141 159 G4double vertexZ= -worldZ + vertexLength*2.0 + absLength + biggap; 142 160 G4double absZ2 = -worldZ + vertexLength*4.0 + absLength*3.5 + biggap; 143 G4double ecalZ = -worldZ + vertexLength*4.0 + absLength*4.0 + ecalLength*0.5 + 2.*biggap; 161 G4double ecalZ = -worldZ + vertexLength*4.0 + absLength*4.0 + ecalLength*0.5 162 + 2.*biggap; 144 163 G4double yorkZ = -worldZ + vertexLength*4.0 + absLength*5.0 + ecalLength 145 + york*0.5 + 3.*biggap;164 + york*0.5 + 3.*biggap; 146 165 147 166 // … … 149 168 // 150 169 G4Box* solidW = new G4Box("World",worldX,worldX,worldZ); 151 G4LogicalVolume* logicW = new G4LogicalVolume( solidW,worldMaterial, 152 "World"); 170 logicWorld = new G4LogicalVolume( solidW,worldMaterial,"World"); 153 171 G4VPhysicalVolume* world = new G4PVPlacement(0,G4ThreeVector(), 154 "World",logicW,0,false,0);172 "World",logicWorld,0,false,0); 155 173 156 174 // … … 158 176 // 159 177 G4Box* solidE = new G4Box("VolE",worldX,worldX,ecalLength*0.5 + gap); 160 G4LogicalVolume* logicE = new G4LogicalVolume( solidE,worldMaterial, 161 "VolE"); 178 logicECal = new G4LogicalVolume( solidE,worldMaterial,"VolE"); 162 179 G4VPhysicalVolume* physE = new G4PVPlacement(0,G4ThreeVector(0.,0.,ecalZ), 163 "VolE",logicE,world,false,0);180 "VolE",logicECal,world,false,0); 164 181 165 182 G4Box* solidC = new G4Box("Ecal",ecalWidth*0.5,ecalWidth*0.5,ecalLength*0.5); 166 logicC = new G4LogicalVolume( solidC,calMaterial,"Ecal");183 logicCal = new G4LogicalVolume( solidC,calMaterial,"Ecal"); 167 184 168 185 G4cout << "Ecal is " << G4BestUnit(ecalLength,"Length") 169 << " of " << calMaterial->GetName() << G4endl;186 << " of " << calMaterial->GetName() << G4endl; 170 187 171 188 // Crystals … … 182 199 for (j=0; j<5; j++) { 183 200 184 pv = new G4PVPlacement(0,G4ThreeVector(x,y,0.),"Ecal",logicC ,201 pv = new G4PVPlacement(0,G4ThreeVector(x,y,0.),"Ecal",logicCal, 185 202 physE,false,k); 186 203 k++; … … 195 212 logicA2 = new G4LogicalVolume( solidA,absMaterial,"Abs2"); 196 213 pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,absZ2), 197 "Abs2",logicA2,world,false,0);214 "Abs2",logicA2,world,false,0); 198 215 199 216 G4cout << "Absorber is " << G4BestUnit(absLength,"Length") 200 << " of " << absMaterial->GetName() << G4endl;217 << " of " << absMaterial->GetName() << G4endl; 201 218 202 219 //York 203 220 204 221 G4Box* solidYV = new G4Box("VolY",worldX,worldX,york*0.5+absLength); 205 G4LogicalVolume*logicYV = new G4LogicalVolume( solidYV,yorkMaterial,"VolY");222 logicYV = new G4LogicalVolume( solidYV,yorkMaterial,"VolY"); 206 223 G4VPhysicalVolume* physYV = new G4PVPlacement(0,G4ThreeVector(0.,0.,yorkZ), 207 "VolY",logicYV,world,false,0);224 "VolY",logicYV,world,false,0); 208 225 209 226 G4Box* solidY = new G4Box("York",worldX,worldX,york*0.5); 210 G4LogicalVolume*logicY = new G4LogicalVolume( solidY,yorkMaterial,"York");227 logicY = new G4LogicalVolume( solidY,yorkMaterial,"York"); 211 228 pv = new G4PVPlacement(0,G4ThreeVector(), 212 "York",logicY,physYV,false,0);229 "York",logicY,physYV,false,0); 213 230 214 231 logicA3 = new G4LogicalVolume( solidA,absMaterial,"Abs3"); 215 232 logicA4 = new G4LogicalVolume( solidA,absMaterial,"Abs4"); 233 216 234 pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,-(york+absLength)*0.5), 217 "Abs3",logicA3,physYV,false,0);235 "Abs3",logicA3,physYV,false,0); 218 236 pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,(york+absLength)*0.5), 219 "Abs4",logicA4,physYV,false,0);237 "Abs4",logicA4,physYV,false,0); 220 238 221 239 //Vertex volume 222 223 240 G4Box* solidVV = new G4Box("VolV",worldX,worldX,vertexLength*2.+absLength+gap); 224 G4LogicalVolume*logicVV = new G4LogicalVolume( solidVV,worldMaterial,"VolV");241 logicVV = new G4LogicalVolume( solidVV,worldMaterial,"VolV"); 225 242 G4VPhysicalVolume* physVV = new G4PVPlacement(0,G4ThreeVector(0.,0.,vertexZ), 226 "VolV",logicVV,world,false,0);243 "VolV",logicVV,world,false,0); 227 244 228 245 //Absorber 229 230 246 logicA1 = new G4LogicalVolume( solidA,absMaterial,"Abs1"); 231 247 pv = new G4PVPlacement(0,G4ThreeVector(0.,0.,vertexLength*2.-absLength*0.5), 232 "Abs1",logicA1,physVV,false,0);248 "Abs1",logicA1,physVV,false,0); 233 249 234 250 //Vertex 235 236 251 G4double vertWidth = ecalWidth/5.; 237 252 G4int npads = (G4int)(vertWidth/padWidth); … … 242 257 243 258 G4Box* solidVD = new G4Box("VertDet",x1,ecalWidth*0.5+gap,padLength*0.5); 244 G4LogicalVolume* logicVD = new G4LogicalVolume( solidVD,vertMaterial,"VertDet"); 259 logicVD = new G4LogicalVolume( solidVD,vertMaterial,"VertDet"); 260 logicVD->SetSolid(solidVD); 245 261 246 262 G4Box* solidV = new G4Box("Vert",padWidth*0.5,ecalWidth*0.5,padLength*0.5); 247 G4LogicalVolume*logicV = new G4LogicalVolume( solidV,vertMaterial,"Vert");263 logicV = new G4LogicalVolume( solidV,vertMaterial,"Vert"); 248 264 249 265 for (i=0; i<3; i++) { … … 267 283 268 284 // Define region for the vertex detector 269 270 285 vertexRegion->AddRootLogicalVolume(logicVV); 271 286 vertexRegion->AddRootLogicalVolume(logicA3); 272 287 273 288 // Define region for the muon detector 274 275 289 muonRegion->AddRootLogicalVolume(logicYV); 276 290 277 291 // color regions 278 279 292 logicVV-> SetVisAttributes(G4VisAttributes::Invisible); 280 293 logicV-> SetVisAttributes(G4VisAttributes::Invisible); 281 logicE -> SetVisAttributes(G4VisAttributes::Invisible);294 logicECal-> SetVisAttributes(G4VisAttributes::Invisible); 282 295 logicYV-> SetVisAttributes(G4VisAttributes::Invisible); 283 296 284 297 G4VisAttributes* regWcolor = new G4VisAttributes(G4Colour(0.3, 0.3, 0.3)); 285 logicW ->SetVisAttributes(regWcolor);298 logicWorld->SetVisAttributes(regWcolor); 286 299 287 300 G4VisAttributes* regVcolor = new G4VisAttributes(G4Colour(0., 0.3, 0.7)); … … 289 302 290 303 G4VisAttributes* regCcolor = new G4VisAttributes(G4Colour(0., 0.7, 0.3)); 291 logicC ->SetVisAttributes(regCcolor);304 logicCal->SetVisAttributes(regCcolor); 292 305 293 306 G4VisAttributes* regAcolor = new G4VisAttributes(G4Colour(1., 0.5, 0.5)); … … 302 315 // always return world 303 316 G4cout << "### New geometry is constructed" << G4endl; 304 317 305 318 return world; 306 319 } … … 313 326 G4Material* pttoMaterial = 314 327 G4NistManager::Instance()->FindOrBuildMaterial(mat, false); 315 if (pttoMaterial) calMaterial = pttoMaterial; 328 if (pttoMaterial) { 329 calMaterial = pttoMaterial; 330 if(logicCal) { 331 logicCal->SetMaterial(calMaterial); 332 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 333 } 334 } 316 335 } 317 336 … … 323 342 G4Material* pttoMaterial = 324 343 G4NistManager::Instance()->FindOrBuildMaterial(mat, false); 325 if (pttoMaterial) absMaterial = pttoMaterial; 344 if (pttoMaterial) { 345 absMaterial = pttoMaterial; 346 if(logicA1) { 347 logicA1->SetMaterial(absMaterial); 348 logicA2->SetMaterial(absMaterial); 349 logicA3->SetMaterial(absMaterial); 350 logicA4->SetMaterial(absMaterial); 351 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 352 } 353 } 326 354 } 327 355 … … 330 358 void DetectorConstruction::UpdateGeometry() 331 359 { 360 G4RunManager::GetRunManager()->PhysicsHasBeenModified(); 332 361 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); 333 362 } 334 363 335 364 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 365 366 void DetectorConstruction::SetEcalLength (G4double val) 367 { 368 if(val > 0.0) { 369 ecalLength = val; 370 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 371 } 372 } 373 374 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 375 376 void DetectorConstruction::SetEcalWidth (G4double val) 377 { 378 if(val > 0.0) { 379 ecalWidth = val; 380 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 381 } 382 } 383 384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 385 386 void DetectorConstruction::SetVertexLength (G4double val) 387 { 388 if(val > 0.0) { 389 vertexLength = val; 390 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 391 } 392 } 393 394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 395 396 void DetectorConstruction::SetPadLength (G4double val) 397 { 398 if(val > 0.0) { 399 padLength = val; 400 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 401 } 402 } 403 404 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 405 406 void DetectorConstruction::SetPadWidth (G4double val) 407 { 408 if(val > 0.0) { 409 padWidth = val; 410 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 411 } 412 } 413 414 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 415 416 void DetectorConstruction::SetAbsLength(G4double val) 417 { 418 if(val > 0.0) { 419 absLength = val; 420 G4RunManager::GetRunManager()->GeometryHasBeenModified(); 421 } 422 } 423 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/DetectorMessenger.cc
r807 r1230 26 26 // 27 27 // $Id: DetectorMessenger.cc,v 1.3 2006/06/29 17:03:01 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/src/EmAcceptance.cc
r807 r1230 26 26 // 27 27 // $Id: EmAcceptance.cc,v 1.4 2006/06/29 17:03:03 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/src/EventAction.cc
r807 r1230 25 25 // 26 26 // $Id: EventAction.cc,v 1.4 2006/06/29 17:03:06 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/examples/extended/electromagnetic/TestEm9/src/EventActionMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.3 2006/06/29 17:03:08 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/Histo.cc
r807 r1230 53 53 verbose = 0; 54 54 histName = "testem9"; 55 histType = " hbook";55 histType = "root"; 56 56 nHisto = 0; 57 57 defaultAct = 1; … … 93 93 94 94 G4String nam = histName + "." + histType; 95 96 tree = tf->create(nam,histType,false,true,"uncompress"); 95 G4String options = "--noErrors export=root uncompress"; 96 97 tree = tf->create(nam,histType,false,true,options); 97 98 delete tf; 98 99 if(tree) { … … 107 108 // Creating an 1-dimensional histograms in the root directory of the tree 108 109 for(G4int i=0; i<nHisto; i++) { 109 if(active[i]) 110 histo[i] = hf->createHistogram1D(ids[i], titles[i], bins[i], xmin[i], xmax[i]); 110 if(active[i]) { 111 G4String ss = ids[i]; 112 if(histType == "root") ss = "h" + ids[i]; 113 histo[i] = hf->createHistogram1D(ss, titles[i], bins[i], xmin[i], xmax[i]); 114 } 111 115 } 112 116 delete hf; -
trunk/examples/extended/electromagnetic/TestEm9/src/HistoManager.cc
r807 r1230 87 87 nBinsED= 100; 88 88 nTuple = false; 89 nHisto = 1 0;89 nHisto = 13; 90 90 91 91 // initialise acceptance … … 97 97 98 98 histo->add1D("10", 99 "E nergy deposit (MeV) in central crystal",nBinsED,0.0,beamEnergy,MeV);99 "Evis/E0 in central crystal",nBinsED,0.0,1,1.0); 100 100 101 101 histo->add1D("11", 102 "E nergy deposit (MeV) in 3x3",nBinsED,0.0,beamEnergy,MeV);102 "Evis/E0 in 3x3",nBinsED,0.0,1.0,1.0); 103 103 104 104 histo->add1D("12", 105 "E nergy deposit (MeV) in 5x5",nBinsED,0.0,beamEnergy,MeV);105 "Evis/E0 in 5x5",nBinsED,0.0,1.0,1.0); 106 106 107 107 histo->add1D("13", … … 125 125 histo->add1D("19", 126 126 "Number of vertex hits",20,-0.5,19.5,1.0); 127 128 histo->add1D("20", 129 "E1/E9 Ratio",nBinsED,0.0,1,1.0); 130 131 histo->add1D("21", 132 "E1/25 Ratio",nBinsED,0.0,1.0,1.0); 133 134 histo->add1D("22", 135 "E9/E25 Ratio",nBinsED,0.0,1.0,1.0); 127 136 128 137 if(nTuple) { … … 141 150 n_gam = 0; 142 151 n_step = 0; 143 144 for(G4int i=0; i<nmax; i++) { 152 n_lowe = 0; 153 154 for(G4int i=0; i<6; i++) { 145 155 stat[i] = 0; 146 156 edep[i] = 0.0; 147 157 erms[i] = 0.0; 148 edeptr[i] = 0.0; 149 ermstr[i] = 0.0; 158 if(i < 3) { 159 edeptr[i] = 0.0; 160 ermstr[i] = 0.0; 161 } 150 162 } 151 163 … … 164 176 165 177 G4cout << "HistoManager: End of run actions are started" << G4endl; 166 G4String nam[ 3] = {"1x1", "3x3", "5x5"};178 G4String nam[6] = {"1x1", "3x3", "5x5", "E1/E9 ", "E1/E25", "E9/E25"}; 167 179 168 180 // average … … 175 187 176 188 // total mean 177 edep[j] *= x /beamEnergy;178 G4double y = erms[j]*x /(beamEnergy*beamEnergy)- edep[j]*edep[j];189 edep[j] *= x; 190 G4double y = erms[j]*x - edep[j]*edep[j]; 179 191 if(y < 0.0) y = 0.0; 180 192 erms[j] = std::sqrt(y); … … 183 195 G4double xx = G4double(stat[j]); 184 196 if(xx > 0.0) xx = 1.0/xx; 185 edeptr[j] *= xx /beamEnergy;186 y = ermstr[j]*xx /(beamEnergy*beamEnergy)- edeptr[j]*edeptr[j];197 edeptr[j] *= xx; 198 y = ermstr[j]*xx - edeptr[j]*edeptr[j]; 187 199 if(y < 0.0) y = 0.0; 188 200 ermstr[j] = std::sqrt(y); … … 191 203 G4double xg = x*(G4double)n_gam; 192 204 G4double xp = x*(G4double)n_posit; 193 G4double xs = x* (G4double)n_step;205 G4double xs = x*n_step; 194 206 195 207 G4double f = 100.*std::sqrt(beamEnergy/GeV); … … 201 213 G4cout << std::setprecision(4) << "Average number of steps " << xs << G4endl; 202 214 203 for(j=0; j< nmax; j++) {215 for(j=0; j<3; j++) { 204 216 G4double e = edeptr[j]; 205 217 G4double s = ermstr[j]; 206 G4double r = s*std::sqrt(x); 218 G4double xx= G4double(stat[j]); 219 if(xx > 0.0) xx = 1.0/xx; 220 G4double r = s*std::sqrt(xx); 207 221 G4cout << std::setprecision(4) << "Edep " << nam[j] << " = " << e 208 222 << " +- " << r; … … 222 236 } 223 237 } 238 G4cout<<"=========== Ratios without trancating ==========================="<<G4endl; 239 for(j=3; j<6; j++) { 240 G4double e = edep[j]; 241 G4double xx= G4double(stat[j]); 242 if(xx > 0.0) xx = 1.0/xx; 243 e *= xx; 244 G4double y = erms[j]*xx - e*e; 245 G4double r = 0.0; 246 if(y > 0.0) r = std::sqrt(y*xx); 247 G4cout << " " << nam[j] << " = " << e 248 << " +- " << r; 249 G4cout << G4endl; 250 } 251 G4cout << std::setprecision(4) << "Beam Energy " << beamEnergy/GeV 252 << " GeV" << G4endl; 253 if(n_lowe > 0) G4cout << "Number of events E/E0<0.8 " << n_lowe << G4endl; 224 254 G4cout<<"=================================================================="<<G4endl; 225 255 G4cout<<G4endl; … … 264 294 Evertex.clear(); 265 295 Nvertex.clear(); 266 for ( int i=0; i<25; i++) {296 for (G4int i=0; i<25; i++) { 267 297 E[i] = 0.0; 268 298 } … … 275 305 G4double e9 = 0.0; 276 306 G4double e25= 0.0; 277 for (int i=0; i<25; i++) { 307 for (G4int i=0; i<25; i++) { 308 E[i] /= beamEnergy; 278 309 e25 += E[i]; 279 310 if( ( 6<=i && 8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += E[i]; 280 311 } 281 histo->fill(0,E[12],1.0); 312 313 if(e25 < 0.8) { 314 n_lowe++; 315 G4cout << "### in the event# " << n_evt << " E25= " << e25 << G4endl; 316 } 317 318 // compute ratios 319 G4double e0 = E[12]; 320 G4double e19 = 0.0; 321 G4double e125 = 0.0; 322 G4double e925 = 0.0; 323 if(e9 > 0.0) { 324 e19 = e0/e9; 325 e125 = e0/e25; 326 e925 = e9/e25; 327 edep[3] += e19; 328 erms[3] += e19*e19; 329 edep[4] += e125; 330 erms[4] += e125*e125; 331 edep[5] += e925; 332 erms[5] += e925*e925; 333 stat[3] += 1; 334 stat[4] += 1; 335 stat[5] += 1; 336 } 337 338 // fill histo 339 histo->fill(0,e0,1.0); 282 340 histo->fill(1,e9,1.0); 283 341 histo->fill(2,e25,1.0); … … 286 344 histo->fill(7,Eabs3,1.0); 287 345 histo->fill(8,Eabs4,1.0); 288 float nn = (double)(Nvertex.size()); 289 histo->fill(9,nn,1.0); 290 291 G4double e0 = E[12]; 292 346 histo->fill(9,G4double(Nvertex.size()),1.0); 347 histo->fill(10,e19,1.0); 348 histo->fill(11,e125,1.0); 349 histo->fill(12,e925,1.0); 350 351 // compute sums 293 352 edep[0] += e0; 294 353 erms[0] += e0*e0; … … 299 358 300 359 // trancated mean 301 if(limittrue[0] == DBL_MAX || std::abs(e0 /beamEnergy-edeptrue[0])<rmstrue[0]*limittrue[0]) {360 if(limittrue[0] == DBL_MAX || std::abs(e0-edeptrue[0])<rmstrue[0]*limittrue[0]) { 302 361 stat[0] += 1; 303 362 edeptr[0] += e0; 304 363 ermstr[0] += e0*e0; 305 364 } 306 if(limittrue[1] == DBL_MAX || std::abs(e9 /beamEnergy-edeptrue[1])<rmstrue[1]*limittrue[1]) {365 if(limittrue[1] == DBL_MAX || std::abs(e9-edeptrue[1])<rmstrue[1]*limittrue[1]) { 307 366 stat[1] += 1; 308 367 edeptr[1] += e9; 309 368 ermstr[1] += e9*e9; 310 369 } 311 if(limittrue[2] == DBL_MAX || std::abs(e25 /beamEnergy-edeptrue[2])<rmstrue[2]*limittrue[2]) {370 if(limittrue[2] == DBL_MAX || std::abs(e25-edeptrue[2])<rmstrue[2]*limittrue[2]) { 312 371 stat[2] += 1; 313 372 edeptr[2] += e25; … … 333 392 if(0 == pid) { 334 393 394 beamEnergy = kinE; 335 395 histo->fillTuple("TKIN", kinE/MeV); 336 396 -
trunk/examples/extended/electromagnetic/TestEm9/src/HistoMessenger.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: HistoMessenger.cc,v 1. 6 2006/06/29 17:03:16 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: HistoMessenger.cc,v 1.7 2008/08/22 14:11:53 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 60 60 // 61 61 G4UIparameter* ih = new G4UIparameter("ih",'i',false); 62 ih->SetGuidance("histo number : from 1 to MaxHisto");62 ih->SetGuidance("histo number : from 0 to MaxHisto-1"); 63 63 histoCmd->SetParameter(ih); 64 64 // … … 110 110 G4String unit = unts; 111 111 G4double vUnit = 1. ; 112 if (unit != "none") vUnit = G4UIcommand::ValueOf(unit); 112 if(unit != "none") vUnit = G4UIcommand::ValueOf(unit); 113 if(vUnit <= 0.0) vUnit = 1.; 113 114 histo->setHisto1D(ih,nbBins,vmin,vmax,vUnit); 114 115 } -
trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmLivermore.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmLivermore.cc,v 1.2 2007/01/08 16:29:42 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmPenelope.cc
r807 r1230 26 26 // 27 27 // $Id: PhysListEmPenelope.cc,v 1.1 2006/11/17 17:45:57 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/PhysListEmStandard.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysListEmStandard.cc,v 1. 8 2006/11/22 19:09:12 vnivanchExp $28 // GEANT4 tag $Name: $27 // $Id: PhysListEmStandard.cc,v 1.13 2008/11/16 21:01:10 maire Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 39 39 #include "G4PhotoElectricEffect.hh" 40 40 41 #include "G4MultipleScattering.hh" 41 #include "G4eMultipleScattering.hh" 42 #include "G4hMultipleScattering.hh" 42 43 43 44 #include "G4eIonisation.hh" … … 48 49 #include "G4MuBremsstrahlung.hh" 49 50 #include "G4MuPairProduction.hh" 51 #include "G4hBremsstrahlung.hh" 52 #include "G4hPairProduction.hh" 50 53 51 54 #include "G4hIonisation.hh" 52 55 #include "G4ionIonisation.hh" 56 57 #include "G4EmProcessOptions.hh" 58 #include "G4MscStepLimitType.hh" 53 59 54 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 83 89 } else if (particleName == "e-") { 84 90 85 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);86 pmanager->AddProcess(new G4eIonisation(), -1, 2,2);87 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);91 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 92 pmanager->AddProcess(new G4eIonisation(), -1, 2, 2); 93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 88 94 89 95 } else if (particleName == "e+") { 90 96 91 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);92 pmanager->AddProcess(new G4eIonisation(), -1, 2,2);93 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);94 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);97 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1); 98 pmanager->AddProcess(new G4eIonisation(), -1, 2, 2); 99 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); 100 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); 95 101 96 102 } else if (particleName == "mu+" || 97 103 particleName == "mu-" ) { 98 104 99 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); 100 pmanager->AddProcess(new G4MuIonisation, -1, 2,2); 101 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3); 102 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4); 105 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 106 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); 107 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); 108 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); 109 110 } else if (particleName == "proton" || 111 particleName == "pi-" || 112 particleName == "pi+") { 113 114 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 115 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 116 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); 117 pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); 103 118 104 119 } else if (particleName == "alpha" || … … 106 121 particleName == "GenericIon") { 107 122 108 pmanager->AddProcess(new G4 MultipleScattering, -1, 1,1);109 pmanager->AddProcess(new G4ionIonisation, -1, 2,2);123 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 124 pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); 110 125 111 126 } else if ((!particle->IsShortLived()) && … … 113 128 (particle->GetParticleName() != "chargedgeantino")) { 114 129 115 pmanager->AddProcess(new G4 MultipleScattering,-1,1,1);116 pmanager->AddProcess(new G4hIonisation, -1,2,2);130 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); 131 pmanager->AddProcess(new G4hIonisation, -1, 2, 2); 117 132 } 118 133 } 134 135 // Em options 136 // 137 // Main options and setting parameters are shown here. 138 // Several of them have default values. 139 // 140 G4EmProcessOptions emOptions; 141 142 //physics tables 143 // 144 emOptions.SetMinEnergy(100*eV); //default 145 emOptions.SetMaxEnergy(100*TeV); //default 146 emOptions.SetDEDXBinning(12*20); //default=12*7 147 emOptions.SetLambdaBinning(12*20); //default=12*7 148 emOptions.SetSplineFlag(true); //default 149 150 //coulomb scattering 151 // 152 emOptions.SetMscStepLimitation(fUseDistanceToBoundary); //default=fUseSafety 153 emOptions.SetMscRangeFactor(0.04); //default 154 emOptions.SetMscGeomFactor (2.5); //default 155 emOptions.SetSkin(3.); //default 156 157 //energy loss 158 // 159 emOptions.SetStepFunction(0.2, 100*um); //default=(0.2, 1*mm) 160 emOptions.SetLinearLossLimit(1.e-2); //default 161 162 //ionization 163 // 164 emOptions.SetSubCutoff(true); //default=false 119 165 } 120 166 -
trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsList.cc
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: PhysicsList.cc,v 1. 19 2007/11/13 14:44:26vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02$26 // $Id: PhysicsList.cc,v 1.24 2008/10/16 11:48:58 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //--------------------------------------------------------------------------- … … 46 46 47 47 #include "PhysListEmStandard.hh" 48 #include "PhysListEmStandardIG.hh"49 48 #include "G4EmStandardPhysics.hh" 50 49 #include "G4EmStandardPhysics_option1.hh" 51 50 #include "G4EmStandardPhysics_option2.hh" 51 #include "G4EmStandardPhysics_option3.hh" 52 52 #include "PhysListEmLivermore.hh" 53 53 #include "PhysListEmPenelope.hh" … … 85 85 cutForElectron = defaultCutValue; 86 86 cutForPositron = defaultCutValue; 87 cutForVertexDetector = defaultCutValue; 88 cutForMuonDetector = defaultCutValue; 87 89 88 90 vertexDetectorCuts = 0; … … 96 98 SetVerboseLevel(1); 97 99 98 mscStepLimit = true;99 100 helIsRegisted = false; 100 101 bicIsRegisted = false; … … 106 107 107 108 // EM physics 108 emName = G4String(" standard");109 emPhysicsList = new PhysListEmStandard(emName);109 emName = G4String("emstandard"); 110 emPhysicsList = new G4EmStandardPhysics(); 110 111 } 111 112 … … 173 174 G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl; 174 175 175 } else if (name == "standard") { 176 } else if (name == "emstandard_opt3") { 177 emName = name; 178 delete emPhysicsList; 179 emPhysicsList = new G4EmStandardPhysics_option3(); 180 if (verboseLevel > 0) 181 G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl; 182 183 } else if (name == "emstandard_local") { 176 184 emName = name; 177 185 delete emPhysicsList; … … 179 187 if (verboseLevel > 0) 180 188 G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl; 181 182 } else if (name == "standardIG") {183 emName = name;184 delete emPhysicsList;185 emPhysicsList = new PhysListEmStandardIG();186 if (verboseLevel > 0)187 G4cout << "PhysicsList::Set StandardIG EM physics" << G4endl;188 189 189 190 } else if (name == "livermore") { … … 255 256 void PhysicsList::SetCuts() 256 257 { 257 258 258 SetCutValue(cutForGamma, "gamma", "DefaultRegionForTheWorld"); 259 259 SetCutValue(cutForElectron, "e-", "DefaultRegionForTheWorld"); 260 260 SetCutValue(cutForPositron, "e+", "DefaultRegionForTheWorld"); 261 G4cout << "PhysicsList: world cuts are set cutG= " << cutForGamma/mm 262 << " mm cutE= " << cutForElectron/mm << " mm " << G4endl; 263 264 if( !vertexDetectorCuts ) SetVertexCut(cutForElectron); 261 // G4cout << "PhysicsList: world cuts are set cutG= " << cutForGamma/mm 262 // << " mm cutE= " << cutForElectron/mm << " mm " << G4endl; 263 264 //G4cout << " cutV= " << cutForVertexDetector 265 // << " cutM= " << cutForMuonDetector<<G4endl; 266 265 267 G4Region* region = (G4RegionStore::GetInstance())->GetRegion("VertexDetector"); 266 region->SetProductionCuts(vertexDetectorCuts);267 G4cout << "Vertex cuts are set" << G4endl;268 269 if( !muonDetectorCuts ) SetMuonCut(cutForElectron);268 vertexDetectorCuts = region->GetProductionCuts(); 269 SetVertexCut(cutForVertexDetector); 270 // G4cout << "Vertex cuts are set" << G4endl; 271 270 272 region = (G4RegionStore::GetInstance())->GetRegion("MuonDetector"); 271 region->SetProductionCuts(muonDetectorCuts); 272 G4cout << "Muon cuts are set" << G4endl; 273 273 muonDetectorCuts = region->GetProductionCuts(); 274 SetMuonCut(cutForMuonDetector); 275 //G4cout << "Muon cuts are set " <<muonRegion << " " << muonDetectorCuts << G4endl; 276 274 277 if (verboseLevel>0) DumpCutValuesTable(); 275 278 } … … 303 306 void PhysicsList::SetVertexCut(G4double cut) 304 307 { 305 if( !vertexDetectorCuts ) vertexDetectorCuts = new G4ProductionCuts(); 306 307 vertexDetectorCuts->SetProductionCut(cut, idxG4GammaCut); 308 vertexDetectorCuts->SetProductionCut(cut, idxG4ElectronCut); 309 vertexDetectorCuts->SetProductionCut(cut, idxG4PositronCut); 310 308 cutForVertexDetector = cut; 309 310 if( vertexDetectorCuts ) { 311 vertexDetectorCuts->SetProductionCut(cut, idxG4GammaCut); 312 vertexDetectorCuts->SetProductionCut(cut, idxG4ElectronCut); 313 vertexDetectorCuts->SetProductionCut(cut, idxG4PositronCut); 314 } 311 315 } 312 316 … … 315 319 void PhysicsList::SetMuonCut(G4double cut) 316 320 { 317 if( !muonDetectorCuts ) muonDetectorCuts = new G4ProductionCuts(); 318 319 muonDetectorCuts->SetProductionCut(cut, idxG4GammaCut); 320 muonDetectorCuts->SetProductionCut(cut, idxG4ElectronCut); 321 muonDetectorCuts->SetProductionCut(cut, idxG4PositronCut); 322 } 323 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 325 326 void PhysicsList::SetMscStepLimit(G4bool val) 327 { 328 mscStepLimit = val; 329 } 330 331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 332 321 cutForMuonDetector = cut; 322 323 if( muonDetectorCuts ) { 324 muonDetectorCuts->SetProductionCut(cut, idxG4GammaCut); 325 muonDetectorCuts->SetProductionCut(cut, idxG4ElectronCut); 326 muonDetectorCuts->SetProductionCut(cut, idxG4PositronCut); 327 } 328 } 329 330 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 331 -
trunk/examples/extended/electromagnetic/TestEm9/src/PhysicsListMessenger.cc
r807 r1230 25 25 // 26 26 // 27 // $Id: PhysicsListMessenger.cc,v 1. 3 2006/06/29 17:03:43 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: PhysicsListMessenger.cc,v 1.4 2008/04/03 15:07:55 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // … … 143 143 { pPhysicsList->AddPhysicsList(newValue);} 144 144 145 if( command == mscCmd )146 { pPhysicsList->SetMscStepLimit(mscCmd->GetNewBoolValue(newValue));}145 // if( command == mscCmd ) 146 // { pPhysicsList->SetMscStepLimit(mscCmd->GetNewBoolValue(newValue));} 147 147 } 148 148 -
trunk/examples/extended/electromagnetic/TestEm9/src/PrimaryGeneratorAction.cc
r807 r1230 26 26 // 27 27 // $Id: PrimaryGeneratorAction.cc,v 1.3 2006/06/29 17:03:46 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/examples/extended/electromagnetic/TestEm9/src/StepMax.cc
r807 r1230 25 25 // 26 26 // $Id: StepMax.cc,v 1.3 2006/06/29 17:03:52 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/StepMaxMessenger.cc
r807 r1230 25 25 // 26 26 // $Id: StepMaxMessenger.cc,v 1.2 2006/06/29 17:03:54 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/electromagnetic/TestEm9/src/SteppingAction.cc
r807 r1230 26 26 // 27 27 // $Id: SteppingAction.cc,v 1.2 2006/06/29 17:03:57 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //
Note:
See TracChangeset
for help on using the changeset viewer.
