/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/include/parser/CalibHR2Parser.hh

Go to the documentation of this file.
00001 /* @version $Revision: 1328 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-03 17:04:17 +0200 (Mon, 03 Oct 2011) $ */
00002 #ifndef CALIBHR2_HH
00003 #define CALIBHR2_HH
00004 
00005 //////////////////////////////////////////////////////////////////////////
00006 //                                                                      //
00007 // Centaure  for MICROMEGAS READOUT                                     //
00008 //                                                                      //
00009 //////////////////////////////////////////////////////////////////////////
00010 
00011 
00012 #define MOTIFNB 64
00013 
00014 #include "mTypes.h"
00015 #include "AcquisitionParser.hh"
00016 #include <stdlib.h>
00017 
00018 #define CALIBHR2 "calibHR2"
00019 
00020 #include <string>
00021 class Event;
00022 class Detector;
00023 
00024 //////////////////////////////////////////////////////////////////////////
00025 ///     CLASS DATAREADER                                                //
00026 //////////////////////////////////////////////////////////////////////////
00027 class CalibHR2Parser : public AcquisitionParser {
00028 
00029 
00030 public:
00031   CalibHR2Parser(Run& aRun, FILE *aFile,ui32 firstEventId);
00032   virtual ~CalibHR2Parser() ;  // Un destucteur virtuel permet d'apple le destructeur de la classe derivee
00033   static const char *type() { return CALIBHR2; }
00034   int getNextEvent(Event& eventToFill);
00035 //  inline void setHRType(ui32 _type ){ hrVersion = _type; } ;
00036 
00037 //------ methods --------//
00038 
00039 private:
00040    unsigned int getData(FILE* inputFile, const int nBytes);
00041    unsigned int getDecimalData(FILE* inputFile, const int nBytes) ;
00042    unsigned int checkData(FILE* inputFile, const int nBytes) ;  // return data AND replace file pointer
00043    int getLine ( FILE*file, std::string &line );
00044    int getDacValue(std::string line);
00045    void setMotifValue(std::string line);
00046    void initParsing(FILE* inputFile);
00047    unsigned int grayToBinary(unsigned int gray) ;
00048    int newHit(Event& event, const Detector &detector, int data, const int chNum, const int chipId, const int difId); //, int* dac) ;
00049    std::string binaire(unsigned int nombre);
00050    void reset();
00051    bool checkNextLine(FILE* inputFile, std::string target );
00052 
00053 
00054    bool init ;
00055    bool motif[MOTIFNB];
00056    bool newCalibration ;
00057    bool newDif;
00058    bool newHR;
00059    int difId ;
00060    int dac[3];
00061   // unsigned int hrVersion;
00062 // ------ data member -------//
00063 protected:
00064 };
00065 
00066 #endif
00067 
00068 

Generated on Mon Jan 7 13:15:20 2013 for MicromegasFramework by  doxygen 1.4.7