|Message: segmentation fault converting from one physical volume to nested parameterisation||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I am pretty sure this is just a mistake I am making, but I am having difficulty converting from one large physical volume into many small voxels in a nested parameterisation. Any help with this problem would be much appreciated.
I am basing my code on the example examples/extended/runAndEvent/RE02 but the example is using scorers and, if possible, I would like to continue using a sensitive detector.
I slowly incorporated the different replica levels and was always assigning the lowest one in the hierarchy to the sensitive detector, but when I introduce the NestedParameterisation I get a segmentation fault after the beginning of the first event. So BeginOfEventAction gets called, but EndOfEventAction does not, but I can't track down the problem. I have put print statements into my TrackerSD.cc at various places and the same for SteppingActions and I see them all printed.
I am defining my NestedParameterisation like this (as I say, I am trying to debug and am keeping it as close to the example as possible)
// Use parameterisation for the Z axis ------- // Z Slice G4String zVoxName("phantomSens"); G4VSolid* solVoxel = new G4Box(zVoxName,sensSize.x()/2.,sensSize.y()/2.,sensSize.z()/2.); G4LogicalVolume* logicPhantomSens = new G4LogicalVolume(solVoxel,realBrain,zVoxName);
std::vector<G4Material*> realBrainVec(1,realBrain); NestedPhantomParameterisation *nestedParam = new NestedPhantomParameterisation(sensSize/2.,nzCells,realBrainVec); // (1) vector size // (2) number of cells along axis // (3) material .... material must be given as vector
G4VPhysicalVolume * physiPhantomSens = new G4PVParameterised("PhantomSens", // their name logicPhantomSens, // their logical volume logXRep, // Mother logical volume kUndefined, // Are placed along this axis nzCells, // Number of cells nestedParam); // Parameterisation.
Then I understood that lowest hierarchial volume...which is now logicPhantomSens, needs to be made sensitive. So like this..
// Make sensitive ------- G4SDManager* SDman = G4SDManager::GetSDMpointer(); G4Region* aRegion = new G4Region("testlog"); logicPhantomSens -> SetRegion(aRegion); aRegion -> AddRootLogicalVolume(logicPhantomSens);
G4String SmartPET1 = "ExN01/SmartPET1"; aSenDet1 = new ExN01TrackerSD(SmartPET1,"SmartPET1"); SDman->AddNewDetector(aSenDet1); logicPhantomSens->SetSensitiveDetector(aSenDet1);
I have actually commented everything out in my EndOfEventAction function to just try and get it to run (unsuccessfully) so there seems little point in posting that.
In the physicsList I refer back to the region as follows...
G4String regionName = "testlog"; G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName); G4ProductionCuts* cuts = new G4ProductionCuts ; G4double regionCut = 10*um;
I think there must be something I am not seeing, unless the NestedParameterisation has to be used with a scorer. Could somebody confirm that it can be used with a sensitive detector ?
Thanks in advance for any advice as I seem to be a bit stuck here.
(I am guessing I will need to share more code. I am happy to do so, but I thought it may be easier to do that directly, rather than posting an entire tar file to the forum).
|Inline Depth:||Outline Depth:||Add message:|