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

Diff of /yoda/techmodel/CalibTrk2Reader.cpp

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

revision 1.5 by kusanagi, Tue Aug 24 16:01:57 2004 UTC revision 1.6 by kusanagi, Tue Sep 21 20:24:33 2004 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Source: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v $   * $Source: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v $
3   * $Id: CalibTrk2Reader.cpp,v 1.4 2004/08/19 15:24:46 kusanagi Exp $   * $Id: CalibTrk2Reader.cpp,v 1.5 2004/08/24 16:01:57 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the LogReader class.   * Implementation of the LogReader class.
# Line 11  Line 11 
11  #define UINT unsigned int  #define UINT unsigned int
12  #define BYTE  unsigned char  #define BYTE  unsigned char
13  #include <string>  #include <string>
14  #include <log4cpp/Category.hh>  #include <log4cxx/logger.h>
15  extern "C" {  extern "C" {
16      #include "CRC.h"      #include "CRC.h"
17      //Passo il path verso la il file temporaneo      //Passo il path verso la il file temporaneo
# Line 51  extern "C" { Line 51  extern "C" {
51  using namespace pamela;  using namespace pamela;
52  using namespace pamela::techmodel;  using namespace pamela::techmodel;
53    
54  static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.CalibTrk2Reader");    static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTrk2Reader"));
55    
56  /**  /**
57   * Constructor.   * Constructor.
58   */   */
59  CalibTrk2Reader::CalibTrk2Reader(void):  CalibTrk2Reader::CalibTrk2Reader(void):
60    TechmodelAlgorithm(PacketType::CalibTrk2, "TechmodelCalibTrk2Reader") {    TechmodelAlgorithm(PacketType::CalibTrk2, "TechmodelCalibTrk2Reader") {
61    cat <<  log4cpp::Priority::DEBUG    logger->debug(_T("Constructor"));
       <<  "Constructor "  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
62    calibTrk2 = new CalibTrk2Event();    calibTrk2 = new CalibTrk2Event();
63  }  }
64    
# Line 69  CalibTrk2Reader::CalibTrk2Reader(void): Line 67  CalibTrk2Reader::CalibTrk2Reader(void):
67   */   */
68  std::string CalibTrk2Reader::GetVersionInfo(void) const {  std::string CalibTrk2Reader::GetVersionInfo(void) const {
69    return    return
70      "$Header: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v 1.4 2004/08/19 15:24:46 kusanagi Exp $\n";      "$Header: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v 1.5 2004/08/24 16:01:57 kusanagi Exp $\n";
71  }  }
72    
73  /**  /**
# Line 77  std::string CalibTrk2Reader::GetVersionI Line 75  std::string CalibTrk2Reader::GetVersionI
75   * event reader routines for all packet types.   * event reader routines for all packet types.
76   */   */
77  void CalibTrk2Reader::Init(PamelaRun *run) {  void CalibTrk2Reader::Init(PamelaRun *run) {
78      logger->debug(_T("Initialize"));
79    SetInputStream(run);    SetInputStream(run);
80    run->WriteSubPacket(this, &calibTrk2, calibTrk2->Class());    run->WriteSubPacket(this, &calibTrk2, calibTrk2->Class());
81  }  }
# Line 85  void CalibTrk2Reader::Init(PamelaRun *ru Line 84  void CalibTrk2Reader::Init(PamelaRun *ru
84   * Unpack the CalibTrk2 event from an input file.   * Unpack the CalibTrk2 event from an input file.
85   */   */
86  void CalibTrk2Reader::RunEvent(int EventNumber, long int length) {  void CalibTrk2Reader::RunEvent(int EventNumber, long int length) {
87            std::stringstream oss;    
88      char     *subData;      char     *subData;
89      char      eventCRC[2];      char      eventCRC[2];
90      UINT16    subCRC;      //CRC of the data      UINT16    subCRC;      //CRC of the data
# Line 154  void CalibTrk2Reader::RunEvent(int Event Line 153  void CalibTrk2Reader::RunEvent(int Event
153              }              }
154          }          }
155  //-----------------------------------------------------------------------------------------  //-----------------------------------------------------------------------------------------
156            oss.flush();
157          cat <<  log4cpp::Priority::ERROR          oss <<  "Fortran77 function trkcalibpkt error code = " << ERROR;
158              <<  "Fortran77 function trkcalibpkt error code = " << ERROR          logger->warn(oss.str().c_str());
             <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
159      } else {      } else {
160          cat <<  log4cpp::Priority::ERROR          logger->debug(_T("Wrong CRC for CalibTrk2 Packet "));
             <<  "Wrong CRC for CalibTrk2 Packet "  
             <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
161      }      }
162      delete [] subData;      delete [] subData;
163  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23