[mcstas-users] monitor_nD renormalization
Santiago Gómez
sgomez at cab.cnea.gov.ar
Thu Jun 1 18:13:04 CEST 2017
Dear Emmanuel,
thank for your reply, I will try to implement that. Anyway, I have to
renormalize all my monitor (about 10 or more), so I think the post
processing option mentioned by Andrew is also good, I will explore which
solution is most favorable for the way I am doing the different
simulations.
Best Regards
Santiago
On 2017-06-01 05:44, Emmanuel FARHI wrote:
> Hello all,
>
> there is a way. Detector values are stored into a structure of type
> MCDETECTOR defined in _lib/share/mccode-r.h_, which can be retrieved
> e.g. in an instrument SAVE section. Then you can assemble an other
> data set to be exported as a 'normal' new monitor.
>
> TRACE
>
> COMPONENT BLAH = Monitor_nD(...)
>
> ...
>
> SAVE %{
>
> /* get the detector structure */
>
> MCDETECTOR det = MC_GETPAR(BLAH, detector);
>
> _/* then use any of: det.(field)_
>
> _ double xmin,xmax; /* min max of axes */_
> _ double ymin,ymax;_
> _ double zmin,zmax;_
> _ double intensity; /* integrated values for data
> block */_
> _ double error;_
> _ double events;_
> _ double min; /* statistics for data block */_
> _ double max;_
> _ double mean;_
> _ double centerX; /* statistics for axes */_
> _ double halfwidthX;_
> _ double centerY;_
> _ double halfwidthY;_
> _ int rank; /* dimensionaly of monitor, e.g.
> 0 1 2 3 */_
>
> _ long m,n,p; /* dimensions of data block and
> along axes */_
>
> _ double *p0, *p1, *p2; /* pointers to saved data, NULL
> when freed */_
>
> _*/_
>
> double NEW_ARRAY = malloc(sizeof(double)*det.m*det.n); _/* do not free
> the array as it will be wrtten to disk */_
>
> double factor = 10;
>
> for (i=0; i<det.n*det.m; i++) {
>
> NEW_ARRAY[i] = det.p1[i] * factor; /* in this example we just
> multiply by factor=10 */
>
> }
>
> /* generate new detector, with only the intensity, no sigma nor ncount
> per pixel */
>
> DETECTOR_OUT_1D(title,xlabel,ylabel,
>
> "new_signal",det.xmin,det.xmax,det.m,
>
> NULL,&NEW_ARRAY[0],NULL,"filename");
>
> DETECTOR_OUT_2D(title,xlabel,ylabel,
>
> det.xmin,det.xmax,det.ymin,det.ymax,det.m,det.n,
>
> NULL,&NEW_ARRAY[0],NULL,"filename");
>
> %}
>
> END
>
> Emmanuel.
>
> On 06/01/2017 09:39 AM, Andrew Jackson wrote:
>
> Is there any simple way t
>
> --
> Emmanuel FARHI,www.ill.eu/computing/people/emmanuel-farhi [1] |/ ____
> |/
> CS-Group ILL4/221, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO -@~
> 71 av des Martyrs,CS 20156,38042 Grenoble Cedex 9,France /_( __/ )_
> Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 __U_/
>
>
>
> Links:
> ------
> [1] http://www.ill.eu/computing/people/emmanuel-farhi
--
Santiago Miguel Gómez
Departamento de Física de Reactores y Radiaciones
Centro Atómico Bariloche
Int.: 5971
"Si queremos un mundo de paz y de justicia hay que poner decididamente
la
inteligencia al servicio del amor." Antoine de Saint-Exupery
More information about the mcstas-users
mailing list