1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/event/EventCounter.cpp,v $ |
* $Source: /home/cvsmanager/yoda/event/EventCounter.cpp,v $ |
3 |
* $Id: EventCounter.cpp,v 1.4 2004/07/08 12:31:22 kusanagi Exp $ |
* $Id: EventCounter.cpp,v 1.5 2004/07/29 16:18:53 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the EventCounter class. |
* Implementation of the EventCounter class. |
10 |
#include "EventCounter.h" |
#include "EventCounter.h" |
11 |
#include "PscuHeader.h" |
#include "PscuHeader.h" |
12 |
|
|
13 |
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.raw.EventCounter"); |
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.EventCounter"); |
14 |
|
|
15 |
using namespace pamela; |
using namespace pamela; |
16 |
|
|
28 |
CalibTrkBoth(0), |
CalibTrkBoth(0), |
29 |
Calib_Trk1(0), |
Calib_Trk1(0), |
30 |
Calib_Trk2(0), |
Calib_Trk2(0), |
|
Calib_Cal(0), |
|
31 |
Calib_Trd(0), |
Calib_Trd(0), |
32 |
Calib_Tof(0), |
Calib_Tof(0), |
33 |
Calib_S4(0), |
Calib_S4(0), |
62 |
CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth, &CalibTrkBoth)); |
CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth, &CalibTrkBoth)); |
63 |
CMap.insert(CounterMap::value_type(PacketType::CalibTrk1, &Calib_Trk1)); |
CMap.insert(CounterMap::value_type(PacketType::CalibTrk1, &Calib_Trk1)); |
64 |
CMap.insert(CounterMap::value_type(PacketType::CalibTrk2, &Calib_Trk2)); |
CMap.insert(CounterMap::value_type(PacketType::CalibTrk2, &Calib_Trk2)); |
|
CMap.insert(CounterMap::value_type(PacketType::CalibCal, &Calib_Cal)); |
|
65 |
CMap.insert(CounterMap::value_type(PacketType::CalibTrd, &Calib_Trd)); |
CMap.insert(CounterMap::value_type(PacketType::CalibTrd, &Calib_Trd)); |
66 |
CMap.insert(CounterMap::value_type(PacketType::CalibTof, &Calib_Tof)); |
CMap.insert(CounterMap::value_type(PacketType::CalibTof, &Calib_Tof)); |
67 |
CMap.insert(CounterMap::value_type(PacketType::CalibS4, &Calib_S4)); |
CMap.insert(CounterMap::value_type(PacketType::CalibS4, &Calib_S4)); |
98 |
if (p != CMap.end()) { |
if (p != CMap.end()) { |
99 |
int *counter = p->second; |
int *counter = p->second; |
100 |
(*counter)++; |
(*counter)++; |
101 |
cat << log4cpp::Priority::INFO |
cat << log4cpp::Priority::DEBUG |
102 |
<< " Counter." << type->GetName() << " = " << (*counter) |
<< " Counter." << type->GetName() << " = " << (*counter) |
103 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
104 |
} else { |
} else { |
105 |
cat << log4cpp::Priority::INFO |
cat << log4cpp::Priority::WARN |
106 |
<< " No counter for packet type " << type->GetName() |
<< " No counter for packet type " << type->GetName() |
107 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
108 |
} |
} |
122 |
const int *counter = p->second; |
const int *counter = p->second; |
123 |
return *counter; |
return *counter; |
124 |
} else { |
} else { |
125 |
cat << log4cpp::Priority::INFO |
cat << log4cpp::Priority::WARN |
126 |
<< " No counter for packet type " << type->GetName() |
<< " No counter for packet type " << type->GetName() |
127 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
128 |
return -1; |
return -1; |