Message: Counting No. of Photons Arriving at Specific volume. Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Counting No. of Photons Arriving at Specific volume. 

Forum: Processes Involving Optical Photons
Date: Feb 19, 03:33
From: Mayur Paunipagar <Mayur Paunipagar>

Dear all,

I am doing some simulations by modifying the OpNovice Example. I made a cone with water as a material and covered a cone with Teflon(reflector) coating. I wanna detect the no. of photons coming out of the cone. See the attached image for proper understanding.

See below, this is my code, which I modified in G4SteppingAction.cc (examples/extended/OpNovice/src)

G4StepPoint* point = step->GetPostStepPoint();
	G4StepPoint* point2 = step->GetPreStepPoint();
	G4VPhysicalVolume* thePostPV = point->GetPhysicalVolume();
	G4VPhysicalVolume* thePrePV = point2->GetPhysicalVolume();

	if(point->GetStepStatus() == fGeomBoundary && thePostPV->GetName() == "Disc_detector"){
		finDetectionCounter++;
	 }
	if(point->GetStepStatus() == fGeomBoundary && thePrePV->GetName() == "Disc_detector"){
		foutDetectionCounter++;
	 }

	    G4cout << "No of photons detected (Inside) = " << finDetectionCounter << G4endl;
		G4cout << "No of photons detected (Outside) = " << foutDetectionCounter << G4endl;	

Disc_detector is the name of the volume where photons are arriving/or at which I wanna detect photons. I am able to count it for less no. of photons but as the no. of photons increased the program is unable to count and the core dumps.

the No. of messages printed on terminal because of G4cout is so high that the core dumps.

how should I do it, any suggestions will be greatly appreciated, thanks in advance,

with regards, Mayur

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2019/02/19/03.32-64515-detector.png

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

1 None: Re: Counting No. of Photons Arriving at Specific volume.   (Daren Sawkey - Feb 19, 11:45)
1 Ok: Re: Counting No. of Photons Arriving at Specific volume.   (Mayur Paunipagar - Feb 19, 19:19)
2 Ok: Re: Counting No. of Photons Arriving at Specific volume.   (Mayur Paunipagar - Feb 19, 19:19)
1 Question: Used another approach   (Mayur Paunipagar - Feb 20, 16:27)
... 1 Message(s)
 Add Message Add Message
to: "Counting No. of Photons Arriving at Specific volume."

 Subscribe Subscribe

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