/[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 6.1 by kusanagi, Wed Aug 16 13:15:23 2006 UTC revision 6.3 by mocchiut, Fri Sep 29 10:19:25 2006 UTC
# Line 1  Line 1 
1      /** @file      /** @file
2   * $Source: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v $   * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/PhysicsReader.cpp,v $
3   * $Id: PhysicsReader.cpp,v 6.0 2006/02/07 17:11:10 kusanagi Exp $   * $Id: PhysicsReader.cpp,v 6.2 2006/08/23 14:39:44 pam-rm2 Exp $
4   * $Author: kusanagi $   * $Author: pam-rm2 $
5   *   *
6   * Implementation of the LogReader class.   * Implementation of the LogReader class.
7  * ToBeDone:  * ToBeDone:
# Line 19  extern "C" { Line 19  extern "C" {
19    
20  #include <fstream>  #include <fstream>
21  #include "stdio.h"  #include "stdio.h"
 #include <sys/wait.h>  
22  #include "ReaderAlgorithms.h"  #include "ReaderAlgorithms.h"
23    
24    
# Line 55  PhysicsReader::PhysicsReader(void): Line 54  PhysicsReader::PhysicsReader(void):
54   */   */
55  std::string PhysicsReader::GetVersionInfo(void) const {  std::string PhysicsReader::GetVersionInfo(void) const {
56    return    return
57      "$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 6.0 2006/02/07 17:11:10 kusanagi Exp $\n";      "$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/PhysicsReader.cpp,v 6.2 2006/08/23 14:39:44 pam-rm2 Exp $\n";
58  }  }
59    
60  /**  /**
# Line 80  void PhysicsReader::Init(PamelaRun *run) Line 79  void PhysicsReader::Init(PamelaRun *run)
79   */   */
80  void PhysicsReader::RunEvent(int EventNumber, long int dataLenght) throw (Exception){  void PhysicsReader::RunEvent(int EventNumber, long int dataLenght) throw (Exception){
81      char *subData = new char[dataLenght];      char *subData = new char[dataLenght];
82        memset(subData,  0, dataLenght*sizeof(char));
83      InputFile->read(subData, sizeof(unsigned char)*dataLenght);      InputFile->read(subData, sizeof(unsigned char)*dataLenght);
84    
85      /*-----------------*/      /*-----------------*/
     /*  
86      //passo packetData a tutti i reader dei vari rivelatori      //passo packetData a tutti i reader dei vari rivelatori
     int childtrk, childac, childcalo, childnd, childs4, childtof, childtrig, Status;  
     int retctrk, retcac, retccalo, retcnd, retcs4, retctof, retctrig;  
       
     if ((childtrk = fork()) > 0) {  
         trackerReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childac = fork()) > 0) {  
         anticounterReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childcalo = fork()) > 0) {  
         calorimeterReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childnd = fork()) > 0) {  
         neutronReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childs4 = fork()) > 0) {  
         s4Reader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childtof = fork()) > 0) {  
         tofReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
     if ((childtrig = fork()) > 0) {  
         triggerReader->RunEvent(EventNumber, subData, dataLenght);  
     }  
       
     do {  
         retctrk  = waitpid(childtrk, &Status, 0);  
         retcac   = waitpid(childac, &Status, 0);  
         retccalo = waitpid(childcalo, &Status, 0);  
         retcnd   = waitpid(childnd, &Status, 0);  
         retcs4   = waitpid(childs4, &Status, 0);  
         retctof  = waitpid(childtof, &Status, 0);  
         retctrig = waitpid(childtrig, &Status, 0);  
     } while(    (retctrk > 0  || (retctrk == -1))   &&  
                 (retcac > 0   || (retcac == -1))    &&  
                 (retccalo > 0 || (retccalo == -1))  &&  
                 (retcnd > 0   || (retcnd == -1))    &&  
                 (retcs4 > 0   || (retcs4 == -1))    &&  
                 (retctof > 0  || (retctof == -1))   &&  
                 (retctrig > 0 || (retctrig == -1)) );  
 */    
     
87      trackerReader->RunEvent(EventNumber, subData, dataLenght);      trackerReader->RunEvent(EventNumber, subData, dataLenght);
88      anticounterReader->RunEvent(EventNumber, subData, dataLenght);      anticounterReader->RunEvent(EventNumber, subData, dataLenght);
89      calorimeterReader->RunEvent(EventNumber, subData, dataLenght);      calorimeterReader->RunEvent(EventNumber, subData, dataLenght);
# Line 134  void PhysicsReader::RunEvent(int EventNu Line 91  void PhysicsReader::RunEvent(int EventNu
91      s4Reader->RunEvent(EventNumber, subData, dataLenght);      s4Reader->RunEvent(EventNumber, subData, dataLenght);
92      tofReader->RunEvent(EventNumber, subData, dataLenght);      tofReader->RunEvent(EventNumber, subData, dataLenght);
93      triggerReader->RunEvent(EventNumber, subData, dataLenght);      triggerReader->RunEvent(EventNumber, subData, dataLenght);
       
94      /*-----------------*/      /*-----------------*/
95      delete [] subData;      delete [] subData;
96  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23