/[PAMELA software]/yoda/techmodel/physics/NeutronDetectorReader.cpp
ViewVC logotype

Diff of /yoda/techmodel/physics/NeutronDetectorReader.cpp

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

revision 2.1 by kusanagi, Wed Sep 22 13:14:31 2004 UTC revision 2.2 by kusanagi, Thu Dec 9 08:48:54 2004 UTC
# Line 22  NeutronDetectorReader::NeutronDetectorRe Line 22  NeutronDetectorReader::NeutronDetectorRe
22   */   */
23  std::string NeutronDetectorReader::GetVersionInfo(void) const {  std::string NeutronDetectorReader::GetVersionInfo(void) const {
24    return    return
25      "$Header: /home/cvsmanager/yoda/techmodel/physics/NeutronDetectorReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $";      "$Header: /home/cvsmanager/yoda/techmodel/physics/NeutronDetectorReader.cpp,v 2.1 2004/09/22 13:14:31 kusanagi Exp $";
26  }  }
27    
28  /**  /**
# Line 46  void NeutronDetectorReader::RunEvent(int Line 46  void NeutronDetectorReader::RunEvent(int
46   * Unpack the NeutronDetector data event from the physical packet.   * Unpack the NeutronDetector data event from the physical packet.
47   */   */
48  void NeutronDetectorReader::RunEvent(int EventNumber, const char subData[], long int lenght) {  void NeutronDetectorReader::RunEvent(int EventNumber, const char subData[], long int lenght) {
49      NeutronRecord *rec;     NeutronRecord *rec;
50      const int lenNeutronData = 12;     const int lenNeutronData = 12;
51      char *data = new char[lenght];     char *data = new char[lenght];
52      //the 2 bytes subtracted belong to the final event CRC bytes     memcpy(data, subData, lenght);
     memcpy(data, subData, lenght);  
53     neutronEvent->Records->Clear();     neutronEvent->Records->Clear();
54     TClonesArray &recs = *(neutronEvent->Records);     TClonesArray &recs = *(neutronEvent->Records);
55     int offset;     int offset;
# Line 67  void NeutronDetectorReader::RunEvent(int Line 66  void NeutronDetectorReader::RunEvent(int
66      delete[] data;      delete[] data;
67  }  }
68    
69    /* For definition the definition for Neutron detector data is
70     * "The last data bunch in the phyics packet" */
71  bool NeutronDetectorReader::haveData(const char data[], long int lenght){  bool NeutronDetectorReader::haveData(const char data[], long int lenght){
72      bool ret = false;      bool ret = false;
73      if (((data[lenght-1] && data[lenght - 5] && data[lenght - 9]) && 0x0F) &&      if (((data[lenght-1] && data[lenght - 5] && data[lenght - 9]) && 0x0F) &&

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

  ViewVC Help
Powered by ViewVC 1.1.23