Dear Ehsan 

With this solution now it works. Thanks a lot ! ...

ehsan.tajik.mansoury wrote:

> ---------- Forwarded message ----------
> From: ehsan.tajik.mansoury <m.tajik.mansoury@gmail.com>
> Date: Sun, Dec 5, 2010 at 5:16 PM
> Subject: Fwd: solution of lmf (y/n) question1
> To: Gate-users@lists.opengatecollaboration.org
> 
> 
> 
> *answer:*
> *1-you can change that C code "hardget.c" with this code:*
> *change have red color*
> *#include <stdio.h>
> #include <stdlib.h>
> #include <string.h>*
> *#include "lmf.h"*
> *i16 hardgeti16(i16 min, i16 max)
> {
> i16 good;
> i8 buffer[80];
> i16 a = 0, b, value;
> #define TRUE 1
> #define FALSE 0
> good = FALSE;*
> * for (a = 0; a < 80; a++)
> buffer[a] = 0;*
> * while (!good) {
> printf(" ( %d - %d ) : ", min, max);
> if(fgets(buffer, sizeof(buffer), stdin))
> sscanf(buffer, "%hd", &value);
> for (b = min; b <= max; b++) {
> if (value == b) {
> a = b;
> good = TRUE;
> return (a);
> }
> }
> printf("%s, **** ERROR !!! TRY AGAIN ****\n", buffer);
> }
> return (0);
> }*
> *
> 
> i16 hardgetyesno()
> {
> i16 good;
> char buffer[80];
> i16 a = 0;
> #define TRUE 1
> #define FALSE 0
> good = FALSE;
> 
> // for (i = 0; i < 80; i++)
> // buffer[i] = 0;
> 
> while (!good) {
> printf(" (yes / no) : ");
> gets(buffer);
> 
> if (strcmp(buffer,"yes")==0) {
> a = 1;
> good = TRUE;
> return (a);
> } else if (strcmp(buffer,"no")==0) {
> a = 0;
> good = TRUE;
> return (a);
> } else
> printf("**** ERROR !!! TRY AGAIN ****\n");
> 
> }
> return (0);
> }
> 
> 
> or
> 2-copy attached file in directory " lmf/src"
> *
> **
> 
> **
> **
> **
> **
> **
> **
> **
> **
> * *
> 
> 
> 
> ---------- Forwarded message ----------
> From: <nazarparvar@aut.ac.ir>
> Date: Sun, Dec 5, 2010 at 4:13 PM
> Subject: [Gate-users] lmf y/n error
> To: Gate-users@lists.opengatecollaboration.org
> 
> 
> 
> Dear Gaters
> 
> I think we have a error in lmf reader,for example when run the EXE.01 you
> can see :
> what do you want to store?
> 1: event record
> (y/n):y
> ****ERROR !!! TRY AGAIN ****
> (y/n):n
> ****ERROR !!! TRY AGAIN ****
> 
> 
> or when run EXE.04 you can see :
> 
> ****************************************
> EXEMPLE 4
> ****************************************
> 
> lmf.cch lmf.ccs test1_ex1.cch test.cch test.ccs
> You must choose an input file: lmf
> in time manager value=1.000 ps
> <ENTER> to continue
> 
> 
> 
> Menu :
> 1. Count records in a .ccs file
> 2. Dump a .ccs file
> 3. Sort coincidences in a .ccs file
> 4. Copy and treat .ccs file
> 5. Extract xyz coord. of event records of a .ccs file
> 6. Apply an energy window
> 7. Sort chronologically a singles file
> 8. Analyse coincidences (for coinci. file only)
> 9. Output in Ascii file
> 10. Output in a ROOT file
> 11. Delay time for event comming from a choosen Rsector in a .ccs file
> 12. Associate Gantry positions coming from a binary file writeCnt.bin of a
> .ccs file
> 13. Mix the event coming from different block
> 14. Keep events only from specified geometric position
> 15. Correct DAQ time
> 16. Sort multiple coincidences in a .ccs file
> 17. Set a fixed axial shift
> 18. Add angular shift
> 19. Modelized the DAQ buffer comportement
> 20. Follow count rates by gaussian distrib or min
> 0. Exit
> 
> ( 0 - 20 ) : 1
> 
> 
> ---- LMF READER ----
> 
> LMFreader for lmf.ccs in mode = countRecords Open ok...
> size E 13 size gate digi =9
> pattern read ok ...
> *****************************
> * COUNT THE LMF BINARY FILE *
> *****************************
> ****** HEAD *******
> 
> ****** BODY ********
> Loop LMFreader over...
> 
> 
> 
> ***************************************************
> All the file have been read :
> Number of records = 9443985
> Number of event records = 9443985
> Singles : 9443985
> lay 0: 6708091
> lay 1: 2735894
> Number of singles non chronologically sorted = 344056
> Number of count rate records : 0
> ***************************************************
> 
> File lmf.ccs read, processed and closed by the LMFreader...
> <ENTER> to continue
> 
> 
> 
> Menu :
> 1. Count records in a .ccs file
> 2. Dump a .ccs file
> 3. Sort coincidences in a .ccs file
> 4. Copy and treat .ccs file
> 5. Extract xyz coord. of event records of a .ccs file
> 6. Apply an energy window
> 7. Sort chronologically a singles file
> 8. Analyse coincidences (for coinci. file only)
> 9. Output in Ascii file
> 10. Output in a ROOT file
> 11. Delay time for event comming from a choosen Rsector in a .ccs file
> 12. Associate Gantry positions coming from a binary file writeCnt.bin of a
> .ccs file
> 13. Mix the event coming from different block
> 14. Keep events only from specified geometric position
> 15. Correct DAQ time
> 16. Sort multiple coincidences in a .ccs file
> 17. Set a fixed axial shift
> 18. Add angular shift
> 19. Modelized the DAQ buffer comportement
> 20. Follow count rates by gaussian distrib or min
> 0. Exit
> 
> ( 0 - 20 ) : 3
> 
> 
> ---- LMF READER ----
> 
> LMFreader for lmf.ccs in mode = sortCoincidence Open ok...
> size E 13 size gate digi =9
> pattern read ok ...
> Enter verbose level for coincidence sorter : (0 recommanded)
> ( 0 - 9 ) : 0
> verbose level = 0
> Enter coincidence window (nanoseconds, ex : 10) : 10
> coincidence window = 10000 picoseconds
> Enter stack cut time (microseconds) ( 10 to 50 recommanded and 0 for help) :
> 10
> stack cut time = 10000000 picoseconds (10 microseconds)
> Choose searching mode to locate elements in list (recursive mode
> recommanded) :
> 1 Recursive mode 2 Iterative mode
> ( 1 - 2 ) : 1
> Do you want to save multiples ? (no recommanded) : (y / n) : y
> **** ERROR !!! TRY AGAIN ****
> (y / n) : n
> **** ERROR !!! TRY AGAIN ****
> (y / n) :
> 
> I read this files on lmf/examples &lmf/src:
> exemplemain_01c,exemplemain_04.c,oneListcoincidenceSorter.c,multiplecoincidencesorter.c,generatecC.c,generateCRH.c,generateEH.c,generateCRR.c
> generateEncoh.c,generateER.c,generateGDH.c,generateGDR.c
> 
> I guess that we have a error in y/n questions and actually in alphabet
> input and I think the error is in the generateEncoh.c and finally in
> exemaplemain_01-4.o files that generate with make command.
> so, how can I run the lmf reader ?
> 
> best regards
> babak
> 
> 
> _______________________________________________
> Gate-users mailing list
> Gate-users@lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
> 
> 
> 
> 
> 
> --
> Mr. Mohammad Ali Tajik Mansoury
> Ph.D Student of Medical Physics
> Tarbiat Modares University
> Tehran.Iran
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> Mr. Mohammad Ali Tajik Mansoury
> Ph.D Student of Medical Physics
> Tarbiat Modares University
> Tehran.Iran
> 