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

Go to the documentation of this file.
00001 /* @version $Revision: 1332 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-04 10:21:33 +0200 (Tue, 04 Oct 2011) $ */
00002 #ifndef CALIBMICRORC_HH
00003 #define CALIBMICRORC_HH
00004 
00005 //////////////////////////////////////////////////////////////////////////
00006 //                                                                      //
00007 // Centaure  for MICROMEGAS READOUT                                     //
00008 //                                                                      //
00009 //////////////////////////////////////////////////////////////////////////
00010 
00011 
00012 
00013 #include "AcquisitionParser.hh"
00014 #include "CrcCheck.hh"
00015 
00016 #include <stdlib.h>
00017 #include "mTypes.h"
00018 #include <string>
00019 
00020 
00021 #define CALIBMICRORC "calibMicroroc"
00022 #define MOTIFNB 64
00023 
00024 
00025 class Event;
00026 class Detector;
00027 class MicrorocSCReader;
00028 
00029 //////////////////////////////////////////////////////////////////////////
00030 ///     CLASS DATAREADER                                                //
00031 //////////////////////////////////////////////////////////////////////////
00032 class CalibMicrorocParser : public AcquisitionParser {
00033 
00034 
00035 public:
00036   CalibMicrorocParser(Run& aRun, FILE *aFile,ui32 firstEventId, bool _testMicroroc = false);
00037   virtual ~CalibMicrorocParser() ;  // Un destucteur virtuel permet d'apple le destructeur de la classe derivee
00038   static const char *type() { return CALIBMICRORC; }
00039   int getNextEvent(Event& eventToFill);
00040 //  inline void setHRType(ui32 _type ){ hrVersion = _type; } ;
00041 
00042 //------ methods --------//
00043 
00044 
00045   private:
00046    unsigned int getData(FILE* inputFile, const int nBytes,bool computeCRC=true);
00047    unsigned int getDecimalData(FILE* inputFile, const int nBytes) ;
00048    unsigned int checkData(FILE* inputFile, const int nBytes) ;  // return data AND replace file pointer
00049    int getDacValue(std::string line);
00050    void setMotifValue(std::string line);
00051   void setChargeValue(std::string line);
00052    unsigned int grayToBinary(unsigned int gray) ;
00053    int newHit(Event& event, const Detector &detector, int data, const int chNum, const int chipId, const int difId); //, int* dac) ;
00054    std::string binaire(unsigned int nombre);
00055    void reset();
00056    void initParsing(FILE* inputFile);
00057    bool checkNextLine(FILE* inputFile, std::string target );
00058    virtual std::string  getCtestString(void) {return "motif Ctest";} ;
00059 
00060 
00061 
00062    MicrorocSCReader *scReader;
00063    bool init ;
00064    bool motif[MOTIFNB];
00065    float charge;
00066    bool newCalibration ;
00067    bool newDif;
00068    bool newHR;
00069    int difId ;
00070    int dac[3];
00071    char shaper[2];
00072    bool testMicroroc  ; // used this flag to indicated the used of "carte de test" avec un firmware dif special et fonc des données differente
00073   // unsigned int hrVersion;
00074 // ------ data member -------//
00075 protected:
00076    int getLine ( FILE*file, std::string &line );
00077 };
00078 
00079 #endif
00080 
00081 

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