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 5.0 2005/08/29 09:46:13 Maurizio Nagni Exp $ |
* $Id: PhysicsReader.cpp,v 6.0 2006/02/07 17:11:10 kusanagi Exp $ |
4 |
* $Author: Maurizio Nagni $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the LogReader class. |
* Implementation of the LogReader class. |
7 |
* ToBeDone: |
* ToBeDone: |
19 |
|
|
20 |
#include <fstream> |
#include <fstream> |
21 |
#include "stdio.h" |
#include "stdio.h" |
22 |
|
#include <sys/wait.h> |
23 |
#include "ReaderAlgorithms.h" |
#include "ReaderAlgorithms.h" |
24 |
|
|
25 |
|
|
55 |
*/ |
*/ |
56 |
std::string PhysicsReader::GetVersionInfo(void) const { |
std::string PhysicsReader::GetVersionInfo(void) const { |
57 |
return |
return |
58 |
"$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 5.0 2005/08/29 09:46:13 Maurizio Nagni Exp $\n"; |
"$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 6.0 2006/02/07 17:11:10 kusanagi Exp $\n"; |
59 |
} |
} |
60 |
|
|
61 |
/** |
/** |
83 |
InputFile->read(subData, sizeof(unsigned char)*dataLenght); |
InputFile->read(subData, sizeof(unsigned char)*dataLenght); |
84 |
|
|
85 |
/*-----------------*/ |
/*-----------------*/ |
86 |
|
/* |
87 |
//passo packetData a tutti i reader dei vari rivelatori |
//passo packetData a tutti i reader dei vari rivelatori |
88 |
|
int childtrk, childac, childcalo, childnd, childs4, childtof, childtrig, Status; |
89 |
|
int retctrk, retcac, retccalo, retcnd, retcs4, retctof, retctrig; |
90 |
|
|
91 |
|
if ((childtrk = fork()) > 0) { |
92 |
|
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
93 |
|
} |
94 |
|
if ((childac = fork()) > 0) { |
95 |
|
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
96 |
|
} |
97 |
|
if ((childcalo = fork()) > 0) { |
98 |
|
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
99 |
|
} |
100 |
|
if ((childnd = fork()) > 0) { |
101 |
|
neutronReader->RunEvent(EventNumber, subData, dataLenght); |
102 |
|
} |
103 |
|
if ((childs4 = fork()) > 0) { |
104 |
|
s4Reader->RunEvent(EventNumber, subData, dataLenght); |
105 |
|
} |
106 |
|
if ((childtof = fork()) > 0) { |
107 |
|
tofReader->RunEvent(EventNumber, subData, dataLenght); |
108 |
|
} |
109 |
|
if ((childtrig = fork()) > 0) { |
110 |
|
triggerReader->RunEvent(EventNumber, subData, dataLenght); |
111 |
|
} |
112 |
|
|
113 |
|
do { |
114 |
|
retctrk = waitpid(childtrk, &Status, 0); |
115 |
|
retcac = waitpid(childac, &Status, 0); |
116 |
|
retccalo = waitpid(childcalo, &Status, 0); |
117 |
|
retcnd = waitpid(childnd, &Status, 0); |
118 |
|
retcs4 = waitpid(childs4, &Status, 0); |
119 |
|
retctof = waitpid(childtof, &Status, 0); |
120 |
|
retctrig = waitpid(childtrig, &Status, 0); |
121 |
|
} while( (retctrk > 0 || (retctrk == -1)) && |
122 |
|
(retcac > 0 || (retcac == -1)) && |
123 |
|
(retccalo > 0 || (retccalo == -1)) && |
124 |
|
(retcnd > 0 || (retcnd == -1)) && |
125 |
|
(retcs4 > 0 || (retcs4 == -1)) && |
126 |
|
(retctof > 0 || (retctof == -1)) && |
127 |
|
(retctrig > 0 || (retctrig == -1)) ); |
128 |
|
*/ |
129 |
|
|
130 |
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
131 |
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
132 |
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
134 |
s4Reader->RunEvent(EventNumber, subData, dataLenght); |
s4Reader->RunEvent(EventNumber, subData, dataLenght); |
135 |
tofReader->RunEvent(EventNumber, subData, dataLenght); |
tofReader->RunEvent(EventNumber, subData, dataLenght); |
136 |
triggerReader->RunEvent(EventNumber, subData, dataLenght); |
triggerReader->RunEvent(EventNumber, subData, dataLenght); |
137 |
|
|
138 |
/*-----------------*/ |
/*-----------------*/ |
139 |
delete [] subData; |
delete [] subData; |
140 |
} |
} |