/[PAMELA software]/yoda/techmodel/CalibCalPulse2Reader.cpp
ViewVC logotype

Diff of /yoda/techmodel/CalibCalPulse2Reader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.1 by kusanagi, Fri Dec 3 22:08:00 2004 UTC revision 6.1 by kusanagi, Tue May 30 19:10:01 2006 UTC
# Line 2  Line 2 
2  // Implementation of the CalibCalPulse2Reader class.  // Implementation of the CalibCalPulse2Reader class.
3    
4    
 #define UINT unsigned int  
 #define BYTE  unsigned char  
 #include <string>  
 #include <log4cxx/logger.h>  
   
5  extern "C" {  extern "C" {
6  #include "CRC.h"    #include "CRC.h"  
7      //Struct per il passaggio di dati da e verso la chiamata fortran      //Struct per il passaggio di dati da e verso la chiamata fortran
# Line 20  extern struct { Line 15  extern struct {
15      //external declaration of the Fortran function      //external declaration of the Fortran function
16      void calpulse_(char*, long int*, int*);      void calpulse_(char*, long int*, int*);
17  }  }
 #include <fstream>  
 #include "stdio.h"  
18  #include "ReaderAlgorithms.h"  #include "ReaderAlgorithms.h"
19    
 #include "event/CalibCalPulse2Event.h"  
   
 using namespace pamela;  
20  using namespace pamela::techmodel;  using namespace pamela::techmodel;
21    
22  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibCalPulse2Reader"));  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibCalPulse2Reader"));
# Line 45  CalibCalPulse2Reader::CalibCalPulse2Read Line 35  CalibCalPulse2Reader::CalibCalPulse2Read
35   */   */
36  std::string CalibCalPulse2Reader::GetVersionInfo(void) const {  std::string CalibCalPulse2Reader::GetVersionInfo(void) const {
37    return    return
38      "$Header: /home/cvsmanager/yoda/techmodel/CalibCalPulse2Reader.cpp,v 2.0 2004/09/21 20:50:54 kusanagi Exp $\n";      "$Header: /home/cvsmanager/yoda/techmodel/CalibCalPulse2Reader.cpp,v 6.0 2006/02/07 17:11:09 kusanagi Exp $\n";
39  }  }
40    
41  /**  /**
# Line 66  void CalibCalPulse2Reader::RunEvent(int Line 56  void CalibCalPulse2Reader::RunEvent(int
56      char        packetData[dataLength];      char        packetData[dataLength];
57      int         ERROR;      int         ERROR;
58      InputFile->read(packetData, sizeof(packetData));      InputFile->read(packetData, sizeof(packetData));
59    
60      calpulse_(packetData, &dataLength, &ERROR);      calpulse_(packetData, &dataLength, &ERROR);
61    
62        calibCalPulse2->unpackError = ERROR;
63    
64      if (ERROR != 0) {      if (ERROR != 0) {
65          char *errmsg;          char *errmsg;
66          switch (ERROR){          switch (ERROR){
# Line 74  void CalibCalPulse2Reader::RunEvent(int Line 68  void CalibCalPulse2Reader::RunEvent(int
68          }          }
69          oss.str("");          oss.str("");
70          oss << "Fortran77 function calpulse error code = " << ERROR          oss << "Fortran77 function calpulse error code = " << ERROR
71              <<  "\n" <<errmsg;              <<  " " << errmsg;
72          logger->warn(oss.str().c_str());          logger->warn(oss.str().c_str());
73      } else {      } //else {
74         //Store the unpacked data         //Store the unpacked data
75          calibCalPulse2->iev = calpul_.iev;          calibCalPulse2->iev = calpul_.iev;
76          memcpy(calibCalPulse2->pstwerr, calpul_.pstwerr, sizeof(calibCalPulse2->pstwerr));          memcpy(calibCalPulse2->pstwerr, calpul_.pstwerr, sizeof(calibCalPulse2->pstwerr));
# Line 92  void CalibCalPulse2Reader::RunEvent(int Line 86  void CalibCalPulse2Reader::RunEvent(int
86              }              }
87          }          }
88     //-----------------------------------------------------------------------------------------     //-----------------------------------------------------------------------------------------
89      }      //}
90  }  }
91    

Legend:
Removed from v.2.1  
changed lines
  Added in v.6.1

  ViewVC Help
Powered by ViewVC 1.1.23