Message: Re: Changing geometry but removing solid Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: Changing geometry but removing solid 

Forum: Geometry
Re: Question Changing geometry but removing solid (C Mos)
Re: More Re: Changing geometry but removing solid (Gabriele Cosmo)
Date: 24 Oct, 2012
From: C Mos <C Mos>

//Creating target inside physical container pLogCC

pSolidTarget =new G4Box("SolidTarget",depthTarget,widthTarget,heightTarget);

pLogTarget =new G4LogicalVolume( pSolidTarget,materialTarget,"LogTarget",0,0,0);

pPhysTarget =new G4PVPlacement( 0,G4ThreeVector(posTargetx, posTargety, posTargetz), pLogTarget, "PhysTarget", pLogCC, 0, 0);

////////////////////////////////////////////////////////////////

//Adding sensitive detector to target volume

G4SDManager* SDman = G4SDManager::GetSDMpointer();

G4String strSDname;

APIdrdcSpatialSD* universeSD = new APIdrdcSpatialSD( strSDname="UniverseSD" );

SDman->AddNewDetector( universeSD );

pLogTarget->SetSensitiveDetector( universeSD );

//*********||||||||||||||||||||||****************

(...) //Simulation of scenario

//*********||||||||||||||||||||||****************

//Solid removal procedures. Which one is more appropriate[?]

//MODE1

pLogTarget->ClearDaughters(); //In case target volume has any daughters

pLogCC->RemoveDaughter(pPhysTarget); //is this enough to rm volume?

delete pPhysTarget;

delete pLogTarget;

delete pSolidTarget;

////////////////////////////////////////////////////////////////

//MODE2

#include "G4PhysicalVolumeStore.hh"

#include "G4LogicalVolumeStore.hh"

G4LogicalVolumeStore* storeLog = GetInstance();

storePhy->DeRegister(pPhysTarget);

storeLog->DeRegister(pLogTarget);

delete pPhysTarget;

delete pLogTarget;

delete pSolidTarget;

////////////////////////////////////////////////////////////////

Also, how do I take care of the sensitive detector? Should I remove it too? I did not see any methods in the G4SDManager class.

Thank you!

 Add Message Add Message
to: "Re: Changing geometry but removing solid"

 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 ]