1 |
/** @file |
/** @file |
2 |
* $Source: /repository/event/EventCounter.cpp,v $ |
* $Source: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/event/EventCounter.cpp,v $ |
3 |
* $Id: EventCounter.cpp,v 1.2 2008-02-07 18:17:23 messineo Exp $ |
* $Id: EventCounter.cpp,v 1.2 2009/07/24 13:53:49 mocchiut Exp $ |
4 |
* $Author: messineo $ |
* $Author: mocchiut $ |
5 |
* |
* |
6 |
* Implementation of the EventCounter class. |
* Implementation of the EventCounter class. |
7 |
*/ |
*/ |
23 |
*/ |
*/ |
24 |
EventCounter::EventCounter(int run): |
EventCounter::EventCounter(int run): |
25 |
// New Packets. |
// New Packets. |
26 |
|
RunNumber(run), |
27 |
Pscu(0), |
Pscu(0), |
28 |
PhysEndRun(0), |
PhysEndRun(0), |
29 |
CalibCalPulse1(0), |
CalibCalPulse1(0), |
32 |
CalibTrkBoth(0), |
CalibTrkBoth(0), |
33 |
CalibTrk1(0), |
CalibTrk1(0), |
34 |
CalibTrk2(0), |
CalibTrk2(0), |
35 |
|
CalibCal(0), |
36 |
CalibTof(0), |
CalibTof(0), |
37 |
CalibS4(0), |
CalibS4(0), |
38 |
CalibCalPed(0), |
CalibCalPed(0), |
39 |
Calib1_Ac1(0), |
Calib1_Ac1(0), |
|
Calib2_Ac1(0), |
|
40 |
Calib1_Ac2(0), |
Calib1_Ac2(0), |
41 |
|
Calib2_Ac1(0), |
42 |
Calib2_Ac2(0), |
Calib2_Ac2(0), |
|
CalibCal(0), |
|
43 |
RunHeader(0), |
RunHeader(0), |
44 |
RunTrailer(0), |
RunTrailer(0), |
45 |
CalibHeader(0), |
CalibHeader(0), |
70 |
S4Alarm(0), |
S4Alarm(0), |
71 |
Ac2Alarm(0), |
Ac2Alarm(0), |
72 |
TsbT(0), |
TsbT(0), |
73 |
TsbB(0), |
TsbB(0) { |
|
RunNumber(run) { |
|
74 |
CMap.insert(CounterMap::value_type(PacketType::Pscu, &Pscu)); |
CMap.insert(CounterMap::value_type(PacketType::Pscu, &Pscu)); |
75 |
CMap.insert(CounterMap::value_type(PacketType::PhysEndRun, &PhysEndRun)); |
CMap.insert(CounterMap::value_type(PacketType::PhysEndRun, &PhysEndRun)); |
76 |
CMap.insert(CounterMap::value_type(PacketType::CalibCalPulse1, &CalibCalPulse1)); |
CMap.insert(CounterMap::value_type(PacketType::CalibCalPulse1, &CalibCalPulse1)); |
139 |
} else { |
} else { |
140 |
|
|
141 |
oss.str(""); |
oss.str(""); |
142 |
oss << "\n No counter of type " << type->GetName().c_str(); |
// oss << "\n No counter of type " << type->GetName().c_str(); |
143 |
|
oss << "\n No counter of type " << type->GetName(); |
144 |
//std::cout<<oss.str()<<std::endl; //marco |
//std::cout<<oss.str()<<std::endl; //marco |
145 |
|
|
146 |
throw NotExistingCounterException(oss.str().c_str()); |
throw NotExistingCounterException(oss.str().c_str()); |
161 |
const int *counter = p->second; |
const int *counter = p->second; |
162 |
return *counter; |
return *counter; |
163 |
} else { |
} else { |
164 |
throw NotExistingCounterException(type->GetName().c_str()); |
// throw NotExistingCounterException(type->GetName().c_str()); |
165 |
|
throw NotExistingCounterException(type->GetName()); |
166 |
return -1; |
return -1; |
167 |
} |
} |
168 |
} |
} |
179 |
const int *counter = p->second; |
const int *counter = p->second; |
180 |
return *counter + 1; |
return *counter + 1; |
181 |
} else { |
} else { |
182 |
throw NotExistingCounterException(type->GetName().c_str()); |
// throw NotExistingCounterException(type->GetName().c_str()); |
183 |
|
throw NotExistingCounterException(type->GetName()); |
184 |
return -1; |
return -1; |
185 |
} |
} |
186 |
} |
} |
200 |
//logger->info(oss.str().c_str()); |
//logger->info(oss.str().c_str()); |
201 |
} |
} |
202 |
} |
} |
203 |
|
|
204 |
|
ClassImp(EventCounter) |