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 2.1 2004/12/03 22:08:01 kusanagi Exp $ |
* $Id: PhysicsReader.cpp,v 5.0 2005/08/29 09:46:13 Maurizio Nagni Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: Maurizio Nagni $ |
5 |
* |
* |
6 |
* Implementation of the LogReader class. |
* Implementation of the LogReader class. |
7 |
* ToBeDone: |
* ToBeDone: |
29 |
using namespace pamela::calorimeter; |
using namespace pamela::calorimeter; |
30 |
using namespace pamela::neutron; |
using namespace pamela::neutron; |
31 |
using namespace pamela::S4; |
using namespace pamela::S4; |
32 |
|
using namespace pamela::tof; |
33 |
|
using namespace pamela::trigger; |
34 |
|
|
35 |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PhysicsReader")); |
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.PhysicsReader")); |
36 |
|
|
38 |
* Constructor. |
* Constructor. |
39 |
*/ |
*/ |
40 |
PhysicsReader::PhysicsReader(void): |
PhysicsReader::PhysicsReader(void): |
41 |
TechmodelAlgorithm(PacketType::Physics, "TechmodelPhysicsReader") { |
TechmodelAlgorithm(PacketType::Physics, "TechmodelPhysicsReader") { |
42 |
logger->debug(_T("Constructor")); |
logger->debug(_T("Constructor")); |
43 |
trackerReader = new TrackerReader; |
trackerReader = new TrackerReader; |
44 |
anticounterReader = new AnticounterReader; |
anticounterReader = new AnticounterReader; |
45 |
calorimeterReader = new CalorimeterReader; |
calorimeterReader = new CalorimeterReader; |
46 |
neutronReader = new NeutronDetectorReader; |
neutronReader = new NeutronDetectorReader; |
47 |
s4Reader = new S4Reader; |
s4Reader = new S4Reader; |
48 |
|
tofReader = new TofReader; |
49 |
|
triggerReader = new TriggerReader; |
50 |
} |
} |
51 |
|
|
52 |
/** |
/** |
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 2.1 2004/12/03 22:08:01 kusanagi Exp $\n"; |
"$Header: /home/cvsmanager/yoda/techmodel/PhysicsReader.cpp,v 5.0 2005/08/29 09:46:13 Maurizio Nagni Exp $\n"; |
58 |
} |
} |
59 |
|
|
60 |
/** |
/** |
62 |
* event reader routines for all packet types. |
* event reader routines for all packet types. |
63 |
*/ |
*/ |
64 |
void PhysicsReader::Init(PamelaRun *run) { |
void PhysicsReader::Init(PamelaRun *run) { |
65 |
SetInputStream(run); |
SetInputStream(run); |
66 |
trackerReader->Init(run); |
trackerReader->Init(run); |
67 |
anticounterReader->Init(run); |
anticounterReader->Init(run); |
68 |
calorimeterReader->Init(run); |
calorimeterReader->Init(run); |
69 |
neutronReader->Init(run); |
neutronReader->Init(run); |
70 |
|
s4Reader->Init(run); |
71 |
|
tofReader->Init(run); |
72 |
|
triggerReader->Init(run); |
73 |
//run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class()); |
//run->WriteSubPacket(this, &physicsEvent, physicsEvent->Class()); |
74 |
logger->debug(_T("Initialize")); |
logger->debug(_T("Initialize")); |
75 |
} |
} |
81 |
char *subData = new char[dataLenght]; |
char *subData = new char[dataLenght]; |
82 |
InputFile->read(subData, sizeof(unsigned char)*dataLenght); |
InputFile->read(subData, sizeof(unsigned char)*dataLenght); |
83 |
|
|
84 |
/*-----------------*/ |
/*-----------------*/ |
85 |
//passo packetData a tutti i reader dei vari rivelatori |
//passo packetData a tutti i reader dei vari rivelatori |
86 |
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
trackerReader->RunEvent(EventNumber, subData, dataLenght); |
87 |
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
anticounterReader->RunEvent(EventNumber, subData, dataLenght); |
88 |
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
calorimeterReader->RunEvent(EventNumber, subData, dataLenght); |
89 |
neutronReader->RunEvent(EventNumber, subData, dataLenght); |
neutronReader->RunEvent(EventNumber, subData, dataLenght); |
90 |
s4Reader->RunEvent(EventNumber, subData, dataLenght); |
s4Reader->RunEvent(EventNumber, subData, dataLenght); |
91 |
/*-----------------*/ |
tofReader->RunEvent(EventNumber, subData, dataLenght); |
92 |
delete[] subData; |
triggerReader->RunEvent(EventNumber, subData, dataLenght); |
93 |
|
/*-----------------*/ |
94 |
|
delete [] subData; |
95 |
} |
} |
96 |
|
|