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

Diff of /yoda/techmodel/CalibTrkBothReader.cpp

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

revision 1.1 by kusanagi, Thu Aug 19 15:24:46 2004 UTC revision 6.3 by mocchiut, Fri Sep 29 10:19:22 2006 UTC
# Line 1  Line 1 
   
1  // Implementation of the CalibTrkBothReader class.  // Implementation of the CalibTrkBothReader class.
2    
   
 #define UINT unsigned int  
 #define BYTE  unsigned char  
 #include <string>  
 #include <log4cpp/Category.hh>  
 extern "C" {  
 #include <sys/time.h>  
 #include "CRC.h"  
 }  
   
 #include <fstream>  
 #include "stdio.h"  
3  #include "ReaderAlgorithms.h"  #include "ReaderAlgorithms.h"
4    
 #include "event/CalibTrkBothEvent.h"  
   
 using namespace pamela;  
5  using namespace pamela::techmodel;  using namespace pamela::techmodel;
6    
7  static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.CalibTrkBothReader");    static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.CalibTrkBothReader"));
8    
9  /**  /**
10   * Constructor.   * Constructor.
11   */   */
12  CalibTrkBothReader::CalibTrkBothReader(void):  CalibTrkBothReader::CalibTrkBothReader(void):
13    TechmodelAlgorithm(PacketType::CalibTrkBoth, "TechmodelCalibTrkBothReader") {    TechmodelAlgorithm(PacketType::CalibTrkBoth, "TechmodelCalibTrkBothReader") {
14    cat <<  log4cpp::Priority::DEBUG    logger->debug(_T("Constructor"));
       <<  "Constructor "  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
15    calibTrkBoth = new CalibTrkBothEvent();    calibTrkBoth = new CalibTrkBothEvent();
16  }  }
17    
# Line 38  CalibTrkBothReader::CalibTrkBothReader(v Line 20  CalibTrkBothReader::CalibTrkBothReader(v
20   */   */
21  std::string CalibTrkBothReader::GetVersionInfo(void) const {  std::string CalibTrkBothReader::GetVersionInfo(void) const {
22    return    return
23      "$Header: /home/cvsmanager/yoda/techmodel/CalibTrkBothReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $\n";      "$Trailer: /home/cvsmanager/yoda/techmodel/CalibTrkBothReader.cpp,v 1.1.1.1 2004/07/06 12:20:23 Maurizio Nagni Exp $\n";
24  }  }
25    
26  /**  /**
# Line 48  std::string CalibTrkBothReader::GetVersi Line 30  std::string CalibTrkBothReader::GetVersi
30  void CalibTrkBothReader::Init(PamelaRun *run) {  void CalibTrkBothReader::Init(PamelaRun *run) {
31    SetInputStream(run);    SetInputStream(run);
32    run->WriteSubPacket(this, &calibTrkBoth, calibTrkBoth->Class());    run->WriteSubPacket(this, &calibTrkBoth, calibTrkBoth->Class());
33      logger->debug(_T("Initialize"));
34  }  }
35    
36  /**  /**
37   * Unpack the CalibTrkBoth event from an input file.   * Unpack the CalibTrkBoth event from an input file.
38     * The CPU does not add any CRC control at the packet end.
39     * @param EventNumber
40     * @param dataLength
41   */   */
42  void CalibTrkBothReader::RunEvent(int EventNumber, long int length) {  void CalibTrkBothReader::RunEvent(int EventNumber, long int dataLength) throw (WrongCRCException){
43            char      subData[dataLength];
44            memset(subData,  0, dataLength*sizeof(char));
45        InputFile->read(subData, sizeof(subData));
46        calibTrkBoth->calibTrkBothData        = new TArrayC(dataLength, subData);
47  }  }
48    

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

  ViewVC Help
Powered by ViewVC 1.1.23