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

Diff of /yoda/techmodel/CalibTofReader.cpp

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

revision 4.4 by kusanagi, Sat May 28 10:44:11 2005 UTC revision 6.3 by mocchiut, Fri Sep 29 10:19:20 2006 UTC
# Line 1  Line 1 
1  /** @file  /** @file
2   * $Source: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v $   * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/CalibTofReader.cpp,v $
3   * $Id: CalibTofReader.cpp,v 4.0 2005/03/06 04:33:02 kusanagi Exp $   * $Id: CalibTofReader.cpp,v 6.2 2006/05/30 19:10:03 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the LogReader class.   * Implementation of the LogReader class.
# Line 8  Line 8 
8  * Control the CRC for the entire data Packet not just for single records  * Control the CRC for the entire data Packet not just for single records
9   */   */
10    
 #define UINT unsigned int  
 #define BYTE  unsigned char  
 #include <string>  
 #include <log4cxx/logger.h>  
 extern "C" {  
 #include <sys/time.h>  
 #include "CRC.h"  
 }  
11    
 #include <fstream>  
 #include "stdio.h"  
12  #include "ReaderAlgorithms.h"  #include "ReaderAlgorithms.h"
13    
 #include "event/CalibTofEvent.h"  
   
 using namespace pamela;  
14  using namespace pamela::techmodel;  using namespace pamela::techmodel;
15    
16  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTofReader"));  static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTofReader"));
# Line 34  static log4cxx::LoggerPtr logger = log4c Line 21  static log4cxx::LoggerPtr logger = log4c
21  CalibTofReader::CalibTofReader(void):  CalibTofReader::CalibTofReader(void):
22    TechmodelAlgorithm(PacketType::Log, "TechmodelCalibTofReader") {    TechmodelAlgorithm(PacketType::Log, "TechmodelCalibTofReader") {
23    logger->debug(_T("Constructor"));    logger->debug(_T("Constructor"));
24    CalibTof = new CalibTofEvent();    calibTof = new CalibTofEvent();
25  }  }
26    
27  /**  /**
# Line 42  CalibTofReader::CalibTofReader(void): Line 29  CalibTofReader::CalibTofReader(void):
29   */   */
30  std::string CalibTofReader::GetVersionInfo(void) const {  std::string CalibTofReader::GetVersionInfo(void) const {
31    return    return
32      "$Header: /home/cvsmanager/yoda/techmodel/CalibTofReader.cpp,v 4.0 2005/03/06 04:33:02 kusanagi Exp $\n";      "$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/CalibTofReader.cpp,v 6.2 2006/05/30 19:10:03 kusanagi Exp $\n";
33  }  }
34    
35  /**  /**
# Line 52  std::string CalibTofReader::GetVersionIn Line 39  std::string CalibTofReader::GetVersionIn
39  void CalibTofReader::Init(PamelaRun *run) {  void CalibTofReader::Init(PamelaRun *run) {
40    logger->debug(_T("Initialize"));    logger->debug(_T("Initialize"));
41    SetInputStream(run);    SetInputStream(run);
42    run->WriteSubPacket(this, &CalibTof, CalibTof->Class());    run->WriteSubPacket(this, &calibTof, calibTof->Class());
43  }  }
44    
45  /**  /**
46   * Unpack the CalibTof event from an input file.   * Unpack the CalibTof event from an input file.
47   */   */
48  void CalibTofReader::RunEvent(int EventNumber, long int length) throw (Exception){  void CalibTofReader::RunEvent(int EventNumber, long int dataLength) throw (Exception){
49            char      subData[dataLength];
50            memset(subData,  0, dataLength*sizeof(char));
51        InputFile->read(subData, sizeof(subData));
52        calibTof->calibTofData        = new TArrayC(dataLength, subData);
53  }  }
54    

Legend:
Removed from v.4.4  
changed lines
  Added in v.6.3

  ViewVC Help
Powered by ViewVC 1.1.23