Message: Remove daughters geometry Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Remove daughters geometry 

Forum: Geometry
Date: 05 Nov, 2014
From: Lukasz Fulek <Lukasz Fulek>

Hello,
I'm trying to remove all daughters from a G4VPhysicalVolume. I don't want to remove whole world and build it again. 
First I define the logical and solid then I'm doing in for loop (logh is mother's logical volume and BeamLine its physical volume):
pVvect.push_back(new G4PVPlacement(rot, G4ThreeVector((*mag)->x()*m,(*mag)->y()*m,(cutZ+((*mag)->length()/2+(*mag)->z()-cutZ)/2)*m),
								DriftLogicalPipe, steel,
								logh, false, 0,true));

Next I'm trying to remove all the daughters:
 for(G4int i=0;i<logh->GetNoDaughters();i++){
   logh->RemoveDaughter(logh->GetDaughter(i));
   G4LogicalVolumeStore::DeRegister(logh->GetDaughter(i)->GetLogicalVolume());
   G4PhysicalVolumeStore::DeRegister(logh->GetDaughter(i));   
 }
  logh->ClearDaughters();

  for(std::vector<G4VPhysicalVolume*>::size_type k=0;k<pVvect.size();k++){
   if(pVvect.at(k)) delete pVvect.at(k); 
   pVvect.at(k)=NULL;
  }
  pVvect.clear();
  constructPlaneChange(year);
  constructMagnets(year);
  G4RunManager::GetRunManager()->GeometryHasBeenModified();

Next when I'm trying to rebuild the geometry (in for loop pVvect.push_back(new G4PVPlacement...) and putting some new volumes in old volume's space I have warning about overlap. Do you have any idea how can definitely remove all the daughters without rebuilding the mother volume?

 Add Message Add Message
to: "Remove daughters geometry"

 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 ]