Message: changes in novice examples Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question changes in novice examples 

Keywords: changes novice examples detector construction and exampleN01.cc
Forum: Run Management
Date: 07 Feb, 2006
From: ozkansahin <ozkansahin>

i am new on geant4.7.1 to use it correctly.i changed exampleN01.cc  like this


#include "G4RunManager.hh"
#include "G4UImanager.hh"

#include "ExN01DetectorConstruction.hh"
#include "ExN01PhysicsList.hh"
#include "ExN01PrimaryGeneratorAction.hh"

#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
int main(int argc,char** argv) {
  // Construct the default run manager
  G4RunManager* runManager = new G4RunManager;

  // set mandatory initialization classes
  runManager->SetUserInitialization(new ExN01DetectorConstruction);
  runManager->SetUserInitialization(new ExN01PhysicsList);


#ifdef G4VIS_USE
  // Visualization, if you choose to have it!
  G4VisManager* visManager = new G4VisExecutive;
  visManager->Initialize();
#endif


  // set mandatory user action class
  runManager->SetUserAction(new ExN01PrimaryGeneratorAction);

  // Initialize G4 kernel
  runManager->Initialize();

  // get the pointer to the UI manager and set verbosities
  G4UImanager* UI = G4UImanager::GetUIpointer();
  if(argc==1)
  // Define (G)UI terminal for interactive mode
  {
    // G4UIterminal is a (dumb) terminal.
    G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
      session = new G4UIterminal(new G4UItcsh);
#else
      session = new G4UIterminal();
#endif

    UI->ApplyCommand("/control/execute vis.mac");
    session->SessionStart();
    delete session;
  }
  else
  // Batch mode
  {
    G4String command = "/control/execute ";
    G4String fileName = argv[1];
    UI->ApplyCommand(command+fileName);
  }

#ifdef G4VIS_USE
  delete visManager;
#endif
  delete runManager;

  return 0;
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

and detector construction to improve myself 
                                                                                                         
#include "ExN01DetectorConstruction.hh"

#include "G4Material.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "globals.hh"

ExN01DetectorConstruction::ExN01DetectorConstruction()
 :  experimentalHall_log(0), tracker_log(0),
    experimentalHall_phys(0), tracker_phys(0)
{;}

ExN01DetectorConstruction::~ExN01DetectorConstruction()
{
}
G4VPhysicalVolume* ExN01DetectorConstruction::Construct()
{

 //------------------------------------------------------ materials

  G4double a;  // atomic mass
  G4double z;  // atomic number
  G4double density;

  G4Material* Ar =
  new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3);

  G4Material* Al =
  new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3);

  G4Material* Pb =
  new G4Material("Lead", z= 82., a= 207.19*g/mole, density= 11.35*g/cm3);

  //------------------------------------------------------ volumes

  //------------------------------ experimental hall (world volume)
  //------------------------------ beam line along z axis

  G4double innerRadiusOfTheTube = 125.*mm;// 13.tower
  G4double outerRadiusOfTheTube = 169.*mm;
  G4double hightOfTheTube = 830.*mm;
  G4double startAngleOfTheTube = 350.*deg;
  G4double spanningAngleOfTheTube =20.*deg;
  G4Tubs* experimentalHall_tube1= new G4Tubs("expHall_tube",innerRadiusOfTheTube,
                                          outerRadiusOfTheTube,hightOfTheTube,
                                          startAngleOfTheTube,spanningAngleOfTheTube);
  experimentalHall_log = new G4LogicalVolume(experimentalHall_tube1,
                                             Ar,"expHall_log",0,0,0);
  experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
                                      experimentalHall_log,"expHall",0,false,0);


  //------------------------------ a tracker tube

    G4Tubs* tracker_tube =new  G4Tubs("tracker_tube",0.3*mm,0.4*mm,825.*mm,0.*deg,360.*deg);
    tracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0);


//for(G4int i=0;i<16;i=i+5) // loop for 19 layers
//{
  G4double trackerPos_x =150.*mm;
  //G4double trackerPos_x = *100.*cm;
  G4double trackerPos_y = 2.*mm;
  G4double trackerPos_z = -175.*mm;
  tracker_phys = new G4PVPlacement(0,G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z),
  tracker_log,"tracker",experimentalHall_log,false,0);

//}




  //------------------------------------------------------------------

 return experimentalHall_phys;
}
 1 but i havent got any dawn file or particle trajectory.it just opened with openglx.
 2 after that i returned  original files at the beginning .
 unfortunately when i run the program i dint see the detector scheme 
in the beginning what i missed i dont know.

could anyone help me please???????

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: changes in novice examples   (Ryan Romero - 25 Jul, 2006)
(_ None: Re: changes in novice examples   (Eleni - 26 Jul, 2006)
 Add Message Add Message
to: "changes in novice examples"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]