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.7 2004/08/24 08:01:44 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the LogReader class. |
* Implementation of the LogReader class. |
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 log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.PhysicsReader"); |
33 |
|
|
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 |
cat << log4cpp::Priority::DEBUG |
40 |
<< "Constructor " |
<< "Constructor " |
41 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
42 |
trackerReader = new TrackerReader(); |
trackerReader = new TrackerReader(); |
43 |
anticounterReader = new AnticounterReader(); |
anticounterReader = new AnticounterReader(); |
44 |
calorimeterReader = new CalorimeterReader(); |
calorimeterReader = new CalorimeterReader(); |
45 |
|
neutronReader = new NeutronDetectorReader(); |
46 |
} |
} |
47 |
|
|
48 |
/** |
/** |
50 |
*/ |
*/ |
51 |
std::string PhysicsReader::GetVersionInfo(void) const { |
std::string PhysicsReader::GetVersionInfo(void) const { |
52 |
return |
return |
53 |
"$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.7 2004/08/24 08:01:44 kusanagi Exp $\n"; |
54 |
} |
} |
55 |
|
|
56 |
/** |
/** |
62 |
trackerReader->Init(run); |
trackerReader->Init(run); |
63 |
anticounterReader->Init(run); |
anticounterReader->Init(run); |
64 |
calorimeterReader->Init(run); |
calorimeterReader->Init(run); |
65 |
|
neutronReader->Init(run); |
66 |
//run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class()); |
//run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class()); |
67 |
} |
} |
68 |
|
|
69 |
/** |
/** |
70 |
* Unpack the Physics event from an input file. |
* Unpack the Physics event from an input file. |
71 |
*/ |
*/ |
72 |
void PhysicsReader::RunEvent(int EventNumber, long int dataLength) { |
void PhysicsReader::RunEvent(int EventNumber, long int dataLenght) { |
73 |
char *subData = new char[dataLength]; |
char *subData = new char[dataLenght]; |
74 |
InputFile->read(subData, sizeof(unsigned char)*dataLength); |
InputFile->read(subData, sizeof(unsigned char)*dataLenght); |
75 |
|
|
76 |
/*-----------------*/ |
/*-----------------*/ |
77 |
//passo packetData a tutti i reader dei vari rivelatori |
//passo packetData a tutti i reader dei vari rivelatori |
78 |
trackerReader->RunEvent(EventNumber, subData, dataLength); |
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
79 |
anticounterReader->RunEvent(EventNumber, subData, dataLength); |
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
80 |
calorimeterReader->RunEvent(EventNumber, subData, dataLength); |
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
81 |
|
neutronReader->RunEvent(EventNumber, subData, dataLenght); |
82 |
/*-----------------*/ |
/*-----------------*/ |
83 |
} |
} |
84 |
|
|