Changeset 1337 for trunk/examples/extended/exoticphysics/monopole/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/exoticphysics/monopole/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: DetectorConstruction.cc,v 1. 1 2007/08/16 10:32:04vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: DetectorConstruction.cc,v 1.2 2010/06/04 19:03:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 48 48 #include "G4NistManager.hh" 49 49 50 #include "G4MonopoleFieldSetup.hh" 51 #include "G4FieldManager.hh" 52 #include "G4TransportationManager.hh" 53 50 54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 51 55 … … 60 64 magField = 0; 61 65 lAbsor = 0; 66 fMFieldSetup = 0; 62 67 63 68 DefineMaterials(); … … 68 73 } 69 74 70 71 72 75 DetectorConstruction::~DetectorConstruction() 73 {delete detectorMessenger;} 74 76 { 77 delete detectorMessenger; 78 } 75 79 76 80 G4VPhysicalVolume* DetectorConstruction::Construct() 77 { return ConstructVolumes();} 78 81 { 82 return ConstructVolumes(); 83 } 79 84 80 85 void DetectorConstruction::DefineMaterials() … … 116 121 G4LogicalVolumeStore::GetInstance()->Clean(); 117 122 G4SolidStore::GetInstance()->Clean(); 118 119 120 123 121 124 /**************************** World *****************************/ … … 199 202 200 203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 201 #include "G4FieldManager.hh"202 #include "G4TransportationManager.hh"203 204 204 205 void DetectorConstruction::SetMagField(G4double fieldValue) 205 206 { 206 207 //apply a global uniform magnetic field along Z axis 207 G4FieldManager * fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager(); 208 G4FieldManager * fieldMgr = 209 G4TransportationManager::GetTransportationManager()->GetFieldManager(); 208 210 209 if (magField) delete magField; //delete the existing magn field 211 if (magField) { delete magField; } //delete the existing magn field 212 213 //fMFieldSetup = G4MonopoleFieldSetup::GetMonopoleFieldSetup(); // create the field 214 210 215 211 216 if (fieldValue != 0.) // create a new one if non nul … … 222 227 } 223 228 224 225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 230 226 231 void DetectorConstruction::SetMaxStepSize(G4double step_) 227 232 { -
trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: DetectorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: EventAction.cc,v 1. 1 2007/08/16 10:32:04 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: EventAction.cc,v 1.3 2010/06/07 05:40:46 perl Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 35 35 36 36 #include "G4Event.hh" 37 #include "G4TrajectoryContainer.hh"38 #include "G4Trajectory.hh"39 #include "G4VVisManager.hh"40 37 41 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 66 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 67 64 68 void EventAction::EndOfEventAction(const G4Event* evt)65 void EventAction::EndOfEventAction(const G4Event*) 69 66 { 70 if (G4VVisManager::GetConcreteInstance())71 {72 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();73 G4int n_trajectories = 0;74 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();75 for(G4int i=0; i<n_trajectories; i++)76 {77 G4Trajectory* trj = (G4Trajectory*) ((*(evt->GetTrajectoryContainer()))[i]);78 if (drawFlag == "all")79 trj->DrawTrajectory(1000);80 else81 if ((drawFlag == "charged") && (trj->GetCharge() != 0.))82 trj->DrawTrajectory(1000);83 }84 }85 67 } 86 68 -
trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: EventActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc
r1230 r1337 106 106 G4Monopole* G4Monopole::Monopole() 107 107 { 108 if(!theMonopole) theMonopole = MonopoleDefinition();108 if(!theMonopole) { theMonopole = MonopoleDefinition(); } 109 109 return theMonopole; 110 110 } … … 112 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 113 114 G4double G4Monopole::MagneticCharge() const 115 { 116 return magCharge; 117 } 118 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 120 -
trunk/examples/extended/exoticphysics/monopole/src/G4MonopolePhysics.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4MonopolePhysics.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 26 // $Id: G4MonopolePhysics.cc,v 1.5 2010/06/04 19:03:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 28 // 30 29 //--------------------------------------------------------------------------- … … 51 50 #include "G4StepLimiter.hh" 52 51 #include "G4Transportation.hh" 53 #include "G4MultipleScattering.hh" 52 #include "G4MonopoleTransportation.hh" 53 #include "G4hMultipleScattering.hh" 54 54 #include "G4mplIonisation.hh" 55 55 #include "G4hhIonisation.hh" … … 73 73 void G4MonopolePhysics::ConstructParticle() 74 74 { 75 G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);75 mpl = G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge); 76 76 } 77 77 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......79 78 void G4MonopolePhysics::ConstructProcess() 80 79 { … … 82 81 G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl; 83 82 } 84 G4Monopole* mpl = G4Monopole::Monopole();85 83 86 84 G4ProcessManager* pmanager = new G4ProcessManager(mpl); … … 101 99 nbin *= 10; 102 100 103 pmanager->AddProcess( new G4Transportation(), -1, 0, 0); 101 if(magn == 0.0) { 102 pmanager->AddProcess( new G4Transportation(), -1, 0, 0); 103 } else { 104 pmanager->AddProcess( new G4MonopoleTransportation(mpl), -1, 0, 0); 105 } 106 107 G4int idx = 1; 108 if(mpl->GetPDGCharge() != 0.0) { 109 //G4hMultipleScattering* hmsc = new G4hMultipleScattering(); 110 //pmanager->AddProcess(hmsc, -1, idx, idx); 111 //++idx; 112 G4hhIonisation* hhioni = new G4hhIonisation(); 113 hhioni->SetDEDXBinning(nbin); 114 hhioni->SetMinKinEnergy(emin); 115 hhioni->SetMaxKinEnergy(emax); 116 pmanager->AddProcess(hhioni, -1, idx, idx); 117 ++idx; 118 } 104 119 if(magn != 0.0) { 105 120 G4mplIonisation* mplioni = new G4mplIonisation(magn); … … 107 122 mplioni->SetMinKinEnergy(emin); 108 123 mplioni->SetMaxKinEnergy(emax); 109 pmanager->AddProcess(mplioni, -1, 1, 1); 124 pmanager->AddProcess(mplioni, -1, idx, idx); 125 ++idx; 110 126 } 111 if(mpl->GetPDGCharge() != 0.0) { 112 G4hhIonisation* hhioni = new G4hhIonisation(); 113 hhioni->SetDEDXBinning(nbin); 114 hhioni->SetMinKinEnergy(emin); 115 hhioni->SetMaxKinEnergy(emax); 116 pmanager->AddProcess(hhioni, -1, 2, 2); 117 } 118 pmanager->AddProcess( new G4StepLimiter(), -1, -1, 3); 127 pmanager->AddProcess( new G4StepLimiter(), -1, -1, idx); 119 128 120 129 } -
trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: PrimaryGeneratorAction.cc,v 1. 2 2009/07/15 10:19:47vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: PrimaryGeneratorAction.cc,v 1.3 2010/03/23 14:12:08 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 47 47 { 48 48 particleGun = new G4ParticleGun(1); 49 G4ParticleDefinition* particle =50 G4ParticleTable::GetParticleTable()->FindParticle("monopole");51 particleGun->SetParticleDefinition(particle);49 //G4ParticleDefinition* particle = 50 // G4ParticleTable::GetParticleTable()->FindParticle("monopole"); 51 //particleGun->SetParticleDefinition(particle); 52 52 particleGun->SetParticleEnergy(100 * GeV); 53 53 particleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.)); -
trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: PrimaryGeneratorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc
r1230 r1337 24 24 // ******************************************************************** 25 25 // 26 // $Id: RunAction.cc,v 1. 2 2008/06/11 14:34:19vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $26 // $Id: RunAction.cc,v 1.4 2010/06/04 19:03:36 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 50 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 51 51 52 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin):detector(det), kinematic(kin), af(0), tree(0) 52 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin) 53 :detector(det), kinematic(kin), af(0), tree(0) 53 54 { 54 verboseLevel = 0;55 verboseLevel = 1; 55 56 binLength = offsetX = 0.; 56 57 histo[0] = 0; … … 60 61 // Creating the analysis factory 61 62 af = AIDA_createAnalysisFactory(); 62 ftype = "hbook";63 ftype = "root"; 63 64 fname = "monopole"; 64 65 #endif … … 68 69 } 69 70 70 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 72 73 RunAction::~RunAction() 73 74 { … … 77 78 } 78 79 79 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 81 81 82 void RunAction::bookHisto() 82 83 { 83 84 G4double length = detector->GetAbsorSizeX(); 84 if(!binLength) binLength = 5 * mm; 85 if(binLength > detector->GetMaxStepSize()) binLength = detector->GetMaxStepSize(); 85 if(!binLength) { binLength = 5 * mm; } 86 if(binLength > detector->GetMaxStepSize()) { 87 binLength = detector->GetMaxStepSize(); 88 } 86 89 offsetX = 0.5 * length; 87 90 88 91 #ifdef G4ANALYSIS_USE 89 if(GetVerbose() > 0) G4cout << "\n----> Histogram Tree opened" << G4endl;90 91 G4int nbBins = ( int)(0.5 + length / binLength);92 if(GetVerbose() > 0) { G4cout << "\n----> Histogram Tree opened" << G4endl; } 93 94 G4int nbBins = (G4int)(0.5 + length / binLength); 92 95 93 96 // Create the tree factory … … 120 123 } 121 124 122 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 126 124 127 void RunAction::saveHisto() 125 128 { … … 133 136 } 134 137 135 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 139 137 140 void RunAction::SetBinSize(G4double size) 138 141 { … … 180 183 G4Material* material = detector->GetAbsorMaterial(); 181 184 G4double density = material->GetDensity(); 182 183 G4String particle = kinematic->GetParticleGun()->GetParticleDefinition()->GetParticleName(); 185 const G4ParticleDefinition* part = 186 kinematic->GetParticleGun()->GetParticleDefinition(); 187 G4String particle = part->GetParticleName(); 184 188 G4double energy = kinematic->GetParticleGun()->GetParticleEnergy(); 185 189 … … 209 213 calc.SetVerbose(0); 210 214 G4int i; 211 for(i = 0; i < 100; i++) {215 for(i = 0; i < 100; ++i) { 212 216 ekin[i] = std::pow(10., 0.1*G4double(i)) * keV; 213 217 dedxproton[i] = calc.ComputeElectronicDEDX(ekin[i], "proton", material->GetName()); … … 215 219 } 216 220 217 if(GetVerbose() > 1){221 if(GetVerbose() > 0){ 218 222 G4cout << "### Stopping Powers" << G4endl; 219 223 for(i=0; i<100; i++) { … … 223 227 } 224 228 }; 225 229 G4cout << "### End of stopping power table" << G4endl; 226 230 #ifdef G4ANALYSIS_USE 227 231 // normalize histogram … … 234 238 }; 235 239 236 237 for(i=0; i<100; i++) { 240 for(i=0; i<100; ++i) { 238 241 G4double e = std::log10(ekin[i] / MeV) + 0.05; 239 242 histo[1]->fill(e, dedxproton[i]); -
trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc
r1230 r1337 25 25 // 26 26 // $Id: RunActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc
r1230 r1337 25 25 // 26 26 // $Id: SteppingAction.cc,v 1.2 2007/12/10 16:28:17 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc
r1230 r1337 25 25 // 26 26 // $Id: TrackingAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $27 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset
for help on using the changeset viewer.