Problem 651 - Transportation process returns 0 length step in replicated volume on phi direction only.
Summary: Transportation process returns 0 length step in replicated volume on phi dire...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/volumes (show other problems)
Version: 6.2
Hardware: PC Linux
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2004-07-19 22:58 CEST by yuany
Modified: 2004-11-24 07:16 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description yuany 2004-07-19 22:58:04 CEST
Our program fall into infinite loop and we find it is because a gamma returns 0
length step. A minimum example can be obtained by follow steps below.
Begin from examples/novice/N02.
Add #include "G4Tubs.hh" in  ExN02DetectorConstruction.cc.
Change ExN02DetectorConstruction::Construct() to
G4VPhysicalVolume* ExN02DetectorConstruction::Construct()
{
//--------- Material definition ---------
  G4double a, z;
  G4double density, temperature, pressure;
  G4int nel;

  //Air
  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);

  G4Material* Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
  Air->AddElement(N, 70*perCent);
  Air->AddElement(O, 30*perCent);

//--------- Sizes of the principal geometrical components (solids)  ---------
    fWorldLength= 2*m;

//--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
  //------------------------------
  // World
  //------------------------------
 G4double HalfWorldLength = 0.5*fWorldLength;

 solidWorld= new G4Box
("world",HalfWorldLength,HalfWorldLength,HalfWorldLength);
 logicWorld= new G4LogicalVolume( solidWorld, Air, "World", 0, 0, 0);

  //  Must place the World Physical volume unrotated at (0,0,0).
  //
  physiWorld = new G4PVPlacement(0,               // no rotation
                                 G4ThreeVector(), // at (0,0,0)
				 "World",         // its name
                                 logicWorld,      // its logical volume
                                 0,               // its mother  volume
                                 false,           // no boolean operations
                                 0);              // no field specific to
volume

  //------------------------------------------------
  // Sensitive detectors
  //------------------------------------------------

  G4SDManager* SDman = G4SDManager::GetSDMpointer();

  G4String trackerChamberSDname = "ExN02/TrackerChamberSD";
  ExN02TrackerSD* aTrackerSD = new ExN02TrackerSD( trackerChamberSDname );
  SDman->AddNewDetector( aTrackerSD );

  G4double outR, innerR, length;
  G4double startAngle, spanAngle;
  G4double posX, posY, posZ;
  G4VisAttributes* visAtt;

    innerR=253.695;
    outR=270.145;

    length=731;
    startAngle=0.*deg;
    spanAngle=360.*deg;
    posX  = 0.*m;
    posY  = 0.*m;
    posZ  = 0.*m;

    G4Tubs* straightLayer_tube=new G4Tubs
("straightLayer",innerR,outR,length,startAngle,spanAngle);
    G4LogicalVolume* straightLayer_log=new G4LogicalVolume(straightLayer_tube,
Air,"straightLayer_log",0,0,0);
    straightLayer_log->SetVisAttributes(G4VisAttributes::Invisible);

    G4VPhysicalVolume* straightLayer_phys;
    straightLayer_phys=new G4PVPlacement(0,0,straightLayer_log,

	 "straightLayer_phys",logicWorld,false,0);

    G4int replicaNo=100;
    spanAngle=360./replicaNo*deg;
    G4double offset=0.0174533;
    G4Tubs* replica_tube=new G4Tubs
("replica",innerR,outR,length,startAngle,spanAngle);
    G4LogicalVolume* replica_log=new G4LogicalVolume
(replica_tube,Air,"replica_log",0,0,0);

        replica_log->SetSensitiveDetector( aTrackerSD );
    visAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
    replica_log->SetVisAttributes(visAtt);

    G4VPhysicalVolume* replica_phys;
    replica_phys=new G4PVReplica("replica_phys", replica_log,
				 straightLayer_log, kPhi, replicaNo,
				 spanAngle, offset);

  return physiWorld;
}

In ExN02PrimaryGeneratorAction change particle type from "proton" to "gamma",
change GeneratePrimaries() to
void ExN02PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
 particleGun->SetParticleMomentumDirection(G4ThreeVector(-0.00029827559,-
6.2541522e-06,-8.0801441e-05));
  particleGun->SetParticlePosition(G4ThreeVector(366.7834,6.7225917,-
149.28295));
  particleGun->GeneratePrimaryVertex(anEvent);
}

Nothing need to change else. make and run, problem is repeated.
Comment 1 John Apostolakis 2004-07-21 11:04:59 CEST
Thanks for your problem report.

As this problem concerns a part Navigation that I no longer tend, I am
transfering it to the responsible.
Comment 2 Gabriele Cosmo 2004-07-23 04:38:59 CEST
Thanks for providing the specific test-case.
The problem is under investigation.
Comment 3 Gabriele Cosmo 2004-11-24 07:16:59 CET
The problem has been fixed in the development tag "geomnav-V06-02-07"
and will be available in the next December release of Geant4.