Message: segmentation fault(core dumped) when G4PVReplica is used Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question segmentation fault(core dumped) when G4PVReplica is used 

Forum: Hits, Digitization and Pileup
Date: 17 Feb, 2014
From: Julien Zhu <Julien Zhu>

Hi all,
    I am trying to replicate some detectors in a tube and then record which detector is passed for each particle. The geometry looks ok and but when I run it, it always show segmentation fault(core dumped). Could you help me to check the problem? many thanks.
I pasted the geometry part and voxelscoring code in below:
geometry code
G4int num_detectors = (int)(40/0.2);
G4double interval=0.2*deg;

G4double innerSD=100.*cm;
G4double outerSD=101.*cm;
  G4double highSD=5*cm;;
  G4double startangleSD=-20.*deg;
  G4double spanningangleSD=40.*deg;

G4Tubs* SD_CT
=new G4Tubs("SD_CT",
            innerSD,
	    outerSD,
 	    highSD,
	    startangleSD,
	    spanningangleSD);

G4LogicalVolume* SDlog = new G4LogicalVolume(SD_CT, 
														air, 
														"SD_l", 
														0,
														0,
														0);

  G4VPhysicalVolume *SDPhysical=new G4PVPlacement (0,
                      				 G4ThreeVector (-50*cm,0,5.*cm),
						SDlog,
	                                          "SD_phy",
						 labLogical,
                     				  false,
                     				  0);

 G4VisAttributes* SDVIS = new G4VisAttributes(G4Colour(0.9,0.9,0.0));
  SDVIS->SetForceWireframe(true);
  SDlog->SetVisAttributes(SDVIS);
// divide it into many small intervals
//G4int interval=0.2*deg;

G4Tubs* detector
=new G4Tubs("detector",
            innerSD,
	    outerSD,
            highSD,
	    -20.*deg,
            0.2*deg);

G4LogicalVolume* detector_log=new G4LogicalVolume (detector,
 						   air,
						   "detector_l",
						   0,
						   0,
						   0);

G4VPhysicalVolume* detector_phy= new G4PVReplica("detector_phy",
						detector_log,
						SDlog,
						kPhi,
						(num_detectors-1),
						interval);

  //
  // Pass the voxel to the sensitive manager
  //
 G4SDManager *sensitiveManager = G4SDManager::GetSDMpointer();

  VoxelScoring *voxelScoring = new VoxelScoring( "voxelScoring" );
  sensitiveManager->AddNewDetector(voxelScoring);
 detector_log->SetSensitiveDetector(voxelScoring);

and the voxelscoring code:
G4bool VoxelScoring::ProcessHits( G4Step *step, G4TouchableHistory *ROhist)
 G4int which=ROhist->GetReplicaNumber();

Many thanks.

Julien

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

1 None: Re: segmentation fault(core dumped) when G4PVReplica is used   (Tsukasa Aso - 18 Feb, 2014)
 Add Message Add Message
to: "segmentation fault(core dumped) when G4PVReplica is used"

 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 ]