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

Diff of /yoda/techmodel/PhysicsReader.cpp

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

revision 1.3 by kusanagi, Sat Jul 17 20:03:38 2004 UTC revision 2.0 by kusanagi, Tue Sep 21 20:50:54 2004 UTC
# Line 1  Line 1 
1  /** @file      /** @file
2   * $Source: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v $   * $Source: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v $
3   * $Id: PhysicsReader.cpp,v 1.2 2004/07/06 13:31:18 kusanagi Exp $   * $Id: PhysicsReader.cpp,v 1.9 2004/09/21 20:24:33 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 <sys/time.h>  #include <sys/time.h>
17  #include "CRC.h"  #include "CRC.h"
# Line 27  using namespace pamela::techmodel; Line 27  using namespace pamela::techmodel;
27  using namespace pamela::tracker;  using namespace pamela::tracker;
28  using namespace pamela::anticounter;  using namespace pamela::anticounter;
29  using namespace pamela::calorimeter;  using namespace pamela::calorimeter;
30    using namespace pamela::neutron;
31    
32  static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.PhysicsReader");    static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PhysicsReader"));
33    
34  /**  /**
35   * Constructor.   * Constructor.
36   */   */
37  PhysicsReader::PhysicsReader(void):  PhysicsReader::PhysicsReader(void):
38    TechmodelAlgorithm(PacketType::Log, "TechmodelPhysicsReader") {    TechmodelAlgorithm(PacketType::Physics, "TechmodelPhysicsReader") {
39    cat <<  log4cpp::Priority::DEBUG    logger->debug(_T("Constructor"));
       <<  "Constructor "  
       <<  "\n " << log4cpp::CategoryStream::ENDLINE;  
40    trackerReader     = new TrackerReader();    trackerReader     = new TrackerReader();
41    anticounterReader = new AnticounterReader();    anticounterReader = new AnticounterReader();
42    calorimeterReader = new CalorimeterReader();    calorimeterReader = new CalorimeterReader();
43      neutronReader     = new NeutronDetectorReader();
44  }  }
45    
46  /**  /**
# Line 48  PhysicsReader::PhysicsReader(void): Line 48  PhysicsReader::PhysicsReader(void):
48   */   */
49  std::string PhysicsReader::GetVersionInfo(void) const {  std::string PhysicsReader::GetVersionInfo(void) const {
50    return    return
51      "$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 1.2 2004/07/06 13:31:18 kusanagi Exp $\n";      "$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 1.9 2004/09/21 20:24:33 kusanagi Exp $\n";
52  }  }
53    
54  /**  /**
# Line 60  void PhysicsReader::Init(PamelaRun *run) Line 60  void PhysicsReader::Init(PamelaRun *run)
60    trackerReader->Init(run);    trackerReader->Init(run);
61    anticounterReader->Init(run);    anticounterReader->Init(run);
62    calorimeterReader->Init(run);    calorimeterReader->Init(run);
63      neutronReader->Init(run);
64    //run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class());    //run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class());
65      logger->debug(_T("Initialize"));
66  }  }
67    
68  /**  /**
69   * Unpack the Physics event from an input file.   * Unpack the Physics event from an input file.
70   */   */
71  void PhysicsReader::RunEvent(int EventNumber, long int dataLength) {  void PhysicsReader::RunEvent(int EventNumber, long int dataLenght) {
72      char *subData = new char[dataLength];      char *subData = new char[dataLenght];
73      InputFile->read(subData, sizeof(unsigned char)*dataLength);      InputFile->read(subData, sizeof(unsigned char)*dataLenght);
74    
75          /*-----------------*/          /*-----------------*/
76          //passo packetData a tutti i reader dei vari rivelatori          //passo packetData a tutti i reader dei vari rivelatori
77          trackerReader->RunEvent(EventNumber, subData, dataLength);          trackerReader->RunEvent(EventNumber, subData, dataLenght);
78          anticounterReader->RunEvent(EventNumber, subData, dataLength);          anticounterReader->RunEvent(EventNumber, subData, dataLenght);
79          calorimeterReader->RunEvent(EventNumber, subData, dataLength);          calorimeterReader->RunEvent(EventNumber, subData, dataLenght);
80            neutronReader->RunEvent(EventNumber, subData, dataLenght);
81          /*-----------------*/          /*-----------------*/
82        delete[] subData;
83  }  }
84    

Legend:
Removed from v.1.3  
changed lines
  Added in v.2.0

  ViewVC Help
Powered by ViewVC 1.1.23