Author Topic: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics  (Read 11897 times)

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2227
  • Other duties as assigned...
    • Probe Software
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #15 on: December 03, 2016, 06:11:31 pm »
In v. 11.7.2 of CalcZAF (and Standard) I added three new parameter fields to the Penepma GUI. These are for the minimum and maximum energy range and the number of energy channels.  This required a re-compile of the Penepma.f to allow for more than 1000 energy channels.



The reason for doing this is also to allow me to synthesize WDS spectra for "demo" as described here:

http://probesoftware.com/smf/index.php?topic=837.0

where we will require some 10,000 to 20,000 energy channels for simulating WDS spectral resolution...
john

PS if you specify more than 1000 energy channels in the Penpma GUI, the software will remind you that you will need to utilize the CalcZAF Help | Update CalcZAF menu as seen here:



to update your Penepma distribution.
« Last Edit: December 03, 2016, 06:18:21 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #16 on: May 13, 2017, 09:26:23 am »
Cesc Salvat gave me the Java app that his son developed for creating Penepma geometry (*.geo) files for Penepma calculations. See attached ZIP file below (remember to login to see attachments).

I tried to run it on my laptop but didn't have Java installed.  Apparently if you have the Firefox web browser you will already have Java installed.  Nicholas Ritchie says if you do download the Java installer from Oracle, you need to:

Quote
Either double click on the jar file or "javaw -jar salvats.jar" from the cmd window having "cd”d to the jar path. You will have to complete some paths to get this to work.

Again I haven't tried this yet but wanted to get it out there ASAP for people who want to create specialized geometries that aren't included in the CalcZAF/Standard distribution.

Of course please feel free to post any .geo files you have created if you think they might be useful to the general community. 
john
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #17 on: May 29, 2017, 03:31:01 pm »
After I saw Xavier's poster on optimizing the "interaction forcing factors" in the Penepma input, I had him help me modify the default forcing factors in the input files in the Penepma12.zip distribution. Use the Update Penepma12.zip option in the CalcZAF (or PFE) Help menu to get these new forcing factor input files. 

As an example here are the forcing factors in the original input file for characteristic x-ray production:

       >>>>>>>> Interaction forcing.
IFORCE 1 1 4 -10    0.1 1.0           [KB,KPAR,ICOL,FORCER,WLOW,WHIG]
IFORCE 1 1 5 -400   0.1 1.0           [KB,KPAR,ICOL,FORCER,WLOW,WHIG]

And here are the new forcing factors that Xavier implemented:

       >>>>>>>> Interaction forcing.
IFORCE 1 1 4 -10     0.9 1.0           [KB,KPAR,ICOL,FORCER,WLOW,WHIG]
IFORCE 1 1 5 -100    0.9 1.0           [KB,KPAR,ICOL,FORCER,WLOW,WHIG]

One should be able to get better precision in less time with these new parameters.
« Last Edit: May 29, 2017, 04:40:25 pm by Probeman »
The only stupid question is the one not asked!

Ben Buse

  • Professor
  • ****
  • Posts: 356
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #18 on: May 21, 2018, 06:31:28 am »
Does anyone have a feel as to whether the number of elements slows down simulations. If I include trace elements do I reduce the precision on the majors for a given time.

Ben

Nabil

  • Graduate
  • **
  • Posts: 5
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #19 on: July 11, 2018, 03:09:51 pm »
Please, I am on the PENEPMA code and I would like to calculate the efficiency of the detector.

Is there information about the efficiency in the output file and how to extract them?
« Last Edit: July 11, 2018, 04:12:02 pm by John Donovan »

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #20 on: July 13, 2018, 12:21:31 pm »
Please, I am on the PENEPMA code and I would like to calculate the efficiency of the detector.

Is there information about the efficiency in the output file and how to extract them?

Hi Nabil,
I am not sure I understand the question.

Are you refering to the efficiency of a real detector or the efficiency of the simulated detector?  Or are you asking about the geometric efficiency of the simulated detector (subtended angle)?

I asked Xavier Llovet about your question and he responded with this which he asked me to post for him:

Quote
PENEPMA detectors are assumed to have an intrinsic efficiency of 100% (i.e. all photons crossing the detector surface are counted) and there's no need to worry about the geometric efficiency because X-ray intensities are given in units of photons/sr/electron, so the detector size is already accounted for.

Does this answer your question?
The only stupid question is the one not asked!

Nabil

  • Graduate
  • **
  • Posts: 5
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #21 on: July 28, 2018, 10:10:19 am »
Thank you Probeman.

No my question is for the intrinsic detection efficiency, ie the number of events detected per those emitted.
« Last Edit: July 28, 2018, 10:19:14 am by Nabil »

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #22 on: July 28, 2018, 10:41:20 am »
Thank you Probeman.

No my question is for the intrinsic detection efficiency, ie the number of events detected per those emitted.

Ah.

So the answer to that is simply the geometric efficiency of the specified detector geometry. The default in the Standard GUI for Penepma is an annular detector (360 degrees).   This is specified in this line of the .in (input) file:

PDANGL 45.0 55.0 0.0 360.0 0           [Angular window, in deg, IPSF]
The only stupid question is the one not asked!

Nabil

  • Graduate
  • **
  • Posts: 5
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #23 on: July 28, 2018, 11:47:27 am »
Good evening.
My work on this code is to calculate the intrinsic efficiency of a detector, the problem is that this detector needs at least four materials but the standard.exe interface gives the possibility to use two materials only.
Can you help me ?

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #24 on: July 28, 2018, 12:29:20 pm »
Good evening.
My work on this code is to calculate the intrinsic efficiency of a detector, the problem is that this detector needs at least four materials but the standard.exe interface gives the possibility to use two materials only.
Can you help me ?

Maybe.  But can you explain what you mean by "intrinsic efficiency"?   Every photon that hits the specified Penepma detector geometry is counted, so to me that means that the "intrinsic efficiency" of the Penepma detector is 100%.  Of course since the Penepma detector is not a sphere (though one could define it as such!), some emitted photons will miss the detector. Again, as Xavier previously stated the output intensities are normalized to area so this really should not matter.

As for more than utilizing more than two materials, Standard is designed for the most common situations of a bulk material, a couple (boundary) with two materials or a thin film on a substrate. If you want to utilize more than two materials you will have to edit the Penepma .in file using a text editor.  Here is an example for using three materials in Penepma:

http://probesoftware.com/smf/index.php?topic=57.msg478#msg478

You will need to add a 4th material in your case, again using any text editor on the .in file.
« Last Edit: July 28, 2018, 12:32:02 pm by Probeman »
The only stupid question is the one not asked!

jrminter

  • Professor
  • ****
  • Posts: 43
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #25 on: July 28, 2018, 05:47:58 pm »
Probeman,

I appreciate the source code for the penepma-16 release. I noticed that this version is limited to 1000 energy bins. The penepma-12 version happily computes 4096. I'm guessing you modified the code. I noticed many of the variables were limited to 1000 channels. I'd be interested in  knowing what changes you made... I have the -16 release running on my Win 7 box and my macbook. Given the large code base of simulations with the -12 release, I'd like to get that to run on my mac. It is the fastest box I have... I have learned a lot getting into the code over the last few days...

Best regards,
John

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #26 on: July 28, 2018, 06:48:34 pm »
Hi John,
I have not touched the 2016 FORTRAN code I sent you- it came directly from Xavier.

The default number of bins in Penepma was 1000. I changed the 2012 code to 4096. It was originally intended for EDS simulations in my Standard app. In fact in the simulation mode in Probe for EPMA the default is 1 EV per channel just so I can synthesize WDS scans!

I'm pretty sure I added comments where ever I made a change in the 2012 FORTRAN.  Most of my changes were in the Fanal code to get output of more parameters for the calculations of secondary fluorescence from boundaries.
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #27 on: July 28, 2018, 08:03:08 pm »
I should also mention that Xavier asked me not to distribute any modified FORTRAN code.  That is why the Penepma FORTRAN files are not found in the CalcZAF Github site.

But below I've attached my batch files for compiling the FORTRAN using GNU.
The only stupid question is the one not asked!

jrminter

  • Professor
  • ****
  • Posts: 43
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #28 on: July 28, 2018, 08:13:13 pm »
Thanks. I did a search and replace and changed the limits in penepma16 to permit 4096 channel spectra. It compiled as expected and I just started a run. I took a peek at the first pe-spect-01.dat file and I am indeed getting 4096 channels. Woo. Hoo!  It is late here in Rochester, so I will let this run tonight and see what I get in the morning.

The advantage of the penepma2012 code is that all the users of CalcZaf can use it. Maybe I should standardize on that and consider building the 2012 code on the mac. If you zip and send the unmodified source I will make the changes for 4096 channels and build it on the mac. I would offer to send the binaries back to you, but given Xavier's wishes, I understand why I should not send them back...

Best regards,
John

Probeman

  • Emeritus
  • *****
  • Posts: 1606
  • Never sleeps...
    • John Donovan
Re: Penelope/Penepma/Penfluor/Fanal Monte-Carlo Software and Physics
« Reply #29 on: July 29, 2018, 08:19:57 am »
Thanks. I did a search and replace and changed the limits in penepma16 to permit 4096 channel spectra. It compiled as expected and I just started a run. I took a peek at the first pe-spect-01.dat file and I am indeed getting 4096 channels. Woo. Hoo!  It is late here in Rochester, so I will let this run tonight and see what I get in the morning.

The advantage of the penepma2012 code is that all the users of CalcZaf can use it. Maybe I should standardize on that and consider building the 2012 code on the mac. If you zip and send the unmodified source I will make the changes for 4096 channels and build it on the mac. I would offer to send the binaries back to you, but given Xavier's wishes, I understand why I should not send them back...

Best regards,
John

Hi John,
I don't think Xavier cares if I send you the modified FORTRAN codes, just that I don't generally distribute them publicly.  I will send them as ZIP files to your email, and hopefully they won't get rejected by your mail server.
john
The only stupid question is the one not asked!