Message: Sensitive detector with G4PSCylinderSurfaceFlux Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Sensitive detector with G4PSCylinderSurfaceFlux 

Forum: Biasing and Scoring
Date: 31 Dec, 2014
From: Andrea Conti <Andrea Conti>

I have a cylindrical container having the radioactive source inside and I implemented a ring around it, in order to measure the flux with G4PSCylinderSurfaceFlux. The ring is 20cm high and 10mm (radially) thick.

The detector has been implemented this way:

G4VPhysicalVolume* DetectorConstruction::Construct()
{
 .
 .
 G4Tubs*
  solidDetector = new G4Tubs("Detector", 600*mm,610*mm,100*mm,0*deg,360*deg);
  G4LogicalVolume*
  logicDetector = new G4LogicalVolume(solidDetector,Air,"Detector");
  G4VPhysicalVolume*
  physiDetector = new G4PVPlacement(0,
                                G4ThreeVector(),
  								logicDetector,
  								"Detector",
  								logicWorld,
  							    false,
  								0);

  G4String filterName, particleName;
  G4SDParticleFilter* gammaFilter = 
    new G4SDParticleFilter(filterName="gammaFilter",particleName="gamma");
  G4MultiFunctionalDetector* det = new G4MultiFunctionalDetector("Detector");
  primitive = new G4PSCylinderSurfaceFlux("eDep",0,0);
  primitive->SetFilter(gammaFilter);
  det->RegisterPrimitive(primitive);
  G4SDManager::GetSDMpointer()->AddNewDetector(det);
  logicDetector->SetSensitiveDetector(det);
.
}

And then, to retrieve the information, I have:

void EventAction::EndOfEventAction(const G4Event* evt)
{
.
G4SDManager* SDMan= G4SDManager::GetSDMpointer();
 colID = SDMan->GetCollectionID("Detector/eDep");
 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
 G4THitsMap<G4double>* evtMap = (G4THitsMap<G4double>*)(HCE->GetHC(colID));
 std::map<G4int,G4double*>::iterator itr = evtMap->GetMap()->begin();
 G4int key = (itr->first);
 G4double val = *(itr->second);

 G4cout << "key = " << key;

}

But I never get anything, also when I see through visualization that some photons effectively go through the detector belt. The variable "key" always results to be = 0. I am afraid I did something wrong in the construction of the sensitive detector. I always activate the detector through the command line: "/hits/activate Detector". By the way, if I give the command "/hits/activate Detector/eDep" then I get the error message "Detector/ is not found in /".

Have I correctly associated the surface detector to my ring ? I am afraid not.

Andrea

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

1 None: Re: Sensitive detector with G4PSCylinderSurfaceFlux   (Tsukasa Aso - 31 Dec, 2014)
(_ Ok: Re: Sensitive detector with G4PSCylinderSurfaceFlux   (Andrea Conti - 01 Jan, 2015)
 Add Message Add Message
to: "Sensitive detector with G4PSCylinderSurfaceFlux"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews