Ignore:
Timestamp:
Sep 30, 2010, 2:47:17 PM (14 years ago)
Author:
garnier
Message:

tag geant4.9.4 beta 1 + modifs locales

Location:
trunk/examples/extended/exoticphysics/monopole/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/exoticphysics/monopole/src/DetectorConstruction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: DetectorConstruction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-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 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4848#include "G4NistManager.hh"
    4949
     50#include "G4MonopoleFieldSetup.hh"
     51#include "G4FieldManager.hh"
     52#include "G4TransportationManager.hh"
     53
    5054//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5155
     
    6064  magField = 0;
    6165  lAbsor   = 0;
     66  fMFieldSetup = 0;
    6267
    6368  DefineMaterials();
     
    6873}
    6974
    70 
    71 
    7275DetectorConstruction::~DetectorConstruction()
    73 {delete detectorMessenger;}
    74 
     76{
     77  delete detectorMessenger;
     78}
    7579
    7680G4VPhysicalVolume* DetectorConstruction::Construct()
    77 { return ConstructVolumes();}
    78 
     81{
     82  return ConstructVolumes();
     83}
    7984
    8085void DetectorConstruction::DefineMaterials()
     
    116121  G4LogicalVolumeStore::GetInstance()->Clean();
    117122  G4SolidStore::GetInstance()->Clean();
    118 
    119 
    120123
    121124  /****************************    World   *****************************/
     
    199202
    200203//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    201 #include "G4FieldManager.hh"
    202 #include "G4TransportationManager.hh"
    203204
    204205void DetectorConstruction::SetMagField(G4double fieldValue)
    205206{
    206207  //apply a global uniform magnetic field along Z axis
    207   G4FieldManager * fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
     208  G4FieldManager * fieldMgr =
     209    G4TransportationManager::GetTransportationManager()->GetFieldManager();
    208210   
    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
    210215 
    211216  if (fieldValue != 0.)                 // create a new one if non nul
     
    222227}
    223228
    224 
    225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     229//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     230
    226231void DetectorConstruction::SetMaxStepSize(G4double step_)
    227232{
  • trunk/examples/extended/exoticphysics/monopole/src/DetectorMessenger.cc

    r1230 r1337  
    2525//
    2626// $Id: DetectorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/exoticphysics/monopole/src/EventAction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: EventAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-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 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3535
    3636#include "G4Event.hh"
    37 #include "G4TrajectoryContainer.hh"
    38 #include "G4Trajectory.hh"
    39 #include "G4VVisManager.hh"
    4037
    4138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    6663//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    6764
    68 void EventAction::EndOfEventAction(const G4Event* evt)
     65void EventAction::EndOfEventAction(const G4Event*)
    6966{
    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         else
    81           if ((drawFlag == "charged") && (trj->GetCharge() != 0.))
    82             trj->DrawTrajectory(1000);
    83       }
    84   }
    8567}
    8668
  • trunk/examples/extended/exoticphysics/monopole/src/EventActionMessenger.cc

    r1230 r1337  
    2525//
    2626// $Id: EventActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/exoticphysics/monopole/src/G4Monopole.cc

    r1230 r1337  
    106106G4Monopole* G4Monopole::Monopole()
    107107{   
    108   if(!theMonopole) theMonopole = MonopoleDefinition();
     108  if(!theMonopole) { theMonopole = MonopoleDefinition(); }
    109109  return theMonopole;
    110110}
     
    112112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    113113
     114G4double 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  
    2424// ********************************************************************
    2525//
    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 $
    2928//
    3029//---------------------------------------------------------------------------
     
    5150#include "G4StepLimiter.hh"
    5251#include "G4Transportation.hh"
    53 #include "G4MultipleScattering.hh"
     52#include "G4MonopoleTransportation.hh"
     53#include "G4hMultipleScattering.hh"
    5454#include "G4mplIonisation.hh"
    5555#include "G4hhIonisation.hh"
     
    7373void G4MonopolePhysics::ConstructParticle()
    7474{
    75   G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
     75  mpl = G4Monopole::MonopoleDefinition(monopoleMass, magCharge, elCharge);
    7676}
    7777
    78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7978void G4MonopolePhysics::ConstructProcess()
    8079{
     
    8281    G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
    8382  }
    84   G4Monopole* mpl = G4Monopole::Monopole();
    8583 
    8684  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
     
    10199  nbin *= 10;
    102100 
    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  }
    104119  if(magn != 0.0) {
    105120    G4mplIonisation* mplioni = new G4mplIonisation(magn);
     
    107122    mplioni->SetMinKinEnergy(emin);
    108123    mplioni->SetMaxKinEnergy(emax);
    109     pmanager->AddProcess(mplioni, -1, 1, 1);
     124    pmanager->AddProcess(mplioni, -1, idx, idx);
     125    ++idx;
    110126  }
    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);
    119128
    120129}
  • trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorAction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: PrimaryGeneratorAction.cc,v 1.2 2009/07/15 10:19:47 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-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 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    4747{
    4848  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);
    5252  particleGun->SetParticleEnergy(100 * GeV);
    5353  particleGun->SetParticleMomentumDirection(G4ThreeVector(1., 0., 0.));
  • trunk/examples/extended/exoticphysics/monopole/src/PrimaryGeneratorMessenger.cc

    r1230 r1337  
    2525//
    2626// $Id: PrimaryGeneratorMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/exoticphysics/monopole/src/RunAction.cc

    r1230 r1337  
    2424// ********************************************************************
    2525//
    26 // $Id: RunAction.cc,v 1.2 2008/06/11 14:34:19 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-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 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    5050//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5151
    52 RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin):detector(det), kinematic(kin), af(0), tree(0)
     52RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* kin)
     53  :detector(det), kinematic(kin), af(0), tree(0)
    5354{
    54   verboseLevel = 0;
     55  verboseLevel = 1;
    5556  binLength = offsetX = 0.;
    5657  histo[0] = 0;
     
    6061  // Creating the analysis factory
    6162  af = AIDA_createAnalysisFactory();
    62         ftype   = "hbook";
     63  ftype   = "root";
    6364  fname   = "monopole";
    6465#endif
     
    6869}
    6970
    70 
    71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     72
    7273RunAction::~RunAction()
    7374{
     
    7778}
    7879
    79 
    80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     81
    8182void RunAction::bookHisto()
    8283{
    8384  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  }
    8689  offsetX   = 0.5 * length;
    8790 
    8891#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);
    9295
    9396  // Create the tree factory
     
    120123}
    121124
    122 
    123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     126
    124127void RunAction::saveHisto()
    125128{
     
    133136}
    134137
    135 
    136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     139
    137140void RunAction::SetBinSize(G4double size)
    138141{
     
    180183  G4Material* material = detector->GetAbsorMaterial();
    181184  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();   
    184188  G4double energy = kinematic->GetParticleGun()->GetParticleEnergy();
    185189
     
    209213  calc.SetVerbose(0);
    210214  G4int i;
    211   for(i = 0; i < 100; i++) {
     215  for(i = 0; i < 100; ++i) {
    212216    ekin[i] = std::pow(10., 0.1*G4double(i)) * keV;
    213217    dedxproton[i] = calc.ComputeElectronicDEDX(ekin[i], "proton",  material->GetName());
     
    215219  }
    216220
    217   if(GetVerbose() > 1){
     221  if(GetVerbose() > 0){
    218222    G4cout << "### Stopping Powers" << G4endl;
    219223    for(i=0; i<100; i++) {
     
    223227    }
    224228  };
    225 
     229  G4cout << "### End of stopping power table" << G4endl;
    226230#ifdef G4ANALYSIS_USE
    227231  // normalize histogram
     
    234238        };
    235239
    236 
    237   for(i=0; i<100; i++) {
     240  for(i=0; i<100; ++i) {
    238241    G4double e = std::log10(ekin[i] / MeV) + 0.05;
    239242    histo[1]->fill(e, dedxproton[i]);
  • trunk/examples/extended/exoticphysics/monopole/src/RunActionMessenger.cc

    r1230 r1337  
    2525//
    2626// $Id: RunActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/exoticphysics/monopole/src/SteppingAction.cc

    r1230 r1337  
    2525//
    2626// $Id: SteppingAction.cc,v 1.2 2007/12/10 16:28:17 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/examples/extended/exoticphysics/monopole/src/TrackingAction.cc

    r1230 r1337  
    2525//
    2626// $Id: TrackingAction.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     27// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset for help on using the changeset viewer.