/[PAMELA software]/yoda/event/EventCounter.cpp
ViewVC logotype

Diff of /yoda/event/EventCounter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.4 by kusanagi, Thu Dec 16 17:32:46 2004 UTC revision 3.0 by kusanagi, Fri Mar 4 15:54:11 2005 UTC
# Line 1  Line 1 
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 2.3 2004/12/09 08:47:42 kusanagi Exp $   * $Id: EventCounter.cpp,v 2.8 2005/03/03 10:23:30 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the EventCounter class.   * Implementation of the EventCounter class.
# Line 28  EventCounter::EventCounter(int run): Line 28  EventCounter::EventCounter(int run):
28    CalibCalPulse2(0),    CalibCalPulse2(0),
29    Physics(0),    Physics(0),
30    CalibTrkBoth(0),    CalibTrkBoth(0),
31    Calib_Trk1(0),    CalibTrk1(0),
32    Calib_Trk2(0),    CalibTrk2(0),
33    Calib_Trd(0),    CalibTrd(0),
34    Calib_Tof(0),    CalibTof(0),
35    Calib_S4(0),    CalibS4(0),
36    Calib_CalPed(0),    CalibCalPed(0),
37    Calib1_Ac1(0),    Calib1_Ac1(0),
38    Calib1_Ac2(0),    Calib1_Ac2(0),
39    Calib2_Ac1(0),    Calib2_Ac1(0),
40    Calib2_Ac2(0),    Calib2_Ac2(0),
41    Run_Header(0),    RunHeader(0),
42    Run_Trailer(0),    RunTrailer(0),
43    CalibHeader(0),    CalibHeader(0),
44    CalibTrailer(0),    CalibTrailer(0),
45    InitHeader(0),    InitHeader(0),
# Line 68  EventCounter::EventCounter(int run): Line 68  EventCounter::EventCounter(int run):
68    TrgAlarm(0),    TrgAlarm(0),
69    TofAlarm(0),    TofAlarm(0),
70    S4Alarm(0),    S4Alarm(0),
71      TsbT(0),
72      TsbB(0),
73    RunNumber(run) {    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));
# Line 75  EventCounter::EventCounter(int run): Line 77  EventCounter::EventCounter(int run):
77      CMap.insert(CounterMap::value_type(PacketType::CalibCalPulse2,  &CalibCalPulse2));      CMap.insert(CounterMap::value_type(PacketType::CalibCalPulse2,  &CalibCalPulse2));
78      CMap.insert(CounterMap::value_type(PacketType::Physics,         &Physics));      CMap.insert(CounterMap::value_type(PacketType::Physics,         &Physics));
79      CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth,    &CalibTrkBoth));      CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth,    &CalibTrkBoth));
80      CMap.insert(CounterMap::value_type(PacketType::CalibTrk1,       &Calib_Trk1));      CMap.insert(CounterMap::value_type(PacketType::CalibTrk1,       &CalibTrk1));
81      CMap.insert(CounterMap::value_type(PacketType::CalibTrk2,       &Calib_Trk2));      CMap.insert(CounterMap::value_type(PacketType::CalibTrk2,       &CalibTrk2));
82      CMap.insert(CounterMap::value_type(PacketType::CalibTrd,        &Calib_Trd));      CMap.insert(CounterMap::value_type(PacketType::CalibTrd,        &CalibTrd));
83      CMap.insert(CounterMap::value_type(PacketType::CalibTof,        &Calib_Tof));      CMap.insert(CounterMap::value_type(PacketType::CalibTof,        &CalibTof));
84      CMap.insert(CounterMap::value_type(PacketType::CalibS4,         &Calib_S4));      CMap.insert(CounterMap::value_type(PacketType::CalibS4,         &CalibS4));
85      CMap.insert(CounterMap::value_type(PacketType::CalibCalPed,     &Calib_CalPed));      CMap.insert(CounterMap::value_type(PacketType::CalibCalPed,     &CalibCalPed));
86      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac1,      &Calib1_Ac1));      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac1,      &Calib1_Ac1));
87      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac2,      &Calib1_Ac2));      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac2,      &Calib1_Ac2));
88      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac1,      &Calib2_Ac1));      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac1,      &Calib2_Ac1));
89      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac2,      &Calib2_Ac2));      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac2,      &Calib2_Ac2));
90      CMap.insert(CounterMap::value_type(PacketType::RunHeader,       &Run_Header));      CMap.insert(CounterMap::value_type(PacketType::RunHeader,       &RunHeader));
91      CMap.insert(CounterMap::value_type(PacketType::RunTrailer,      &Run_Trailer));      CMap.insert(CounterMap::value_type(PacketType::RunTrailer,      &RunTrailer));
92      CMap.insert(CounterMap::value_type(PacketType::CalibHeader,     &CalibHeader));      CMap.insert(CounterMap::value_type(PacketType::CalibHeader,     &CalibHeader));
93      CMap.insert(CounterMap::value_type(PacketType::CalibTrailer,    &CalibTrailer));        CMap.insert(CounterMap::value_type(PacketType::CalibTrailer,    &CalibTrailer));  
94      CMap.insert(CounterMap::value_type(PacketType::InitHeader,      &InitHeader));      CMap.insert(CounterMap::value_type(PacketType::InitHeader,      &InitHeader));
# Line 114  EventCounter::EventCounter(int run): Line 116  EventCounter::EventCounter(int run):
116      CMap.insert(CounterMap::value_type(PacketType::TrgAlarm,        &TrgAlarm));      CMap.insert(CounterMap::value_type(PacketType::TrgAlarm,        &TrgAlarm));
117      CMap.insert(CounterMap::value_type(PacketType::TofAlarm,        &TofAlarm));      CMap.insert(CounterMap::value_type(PacketType::TofAlarm,        &TofAlarm));
118      CMap.insert(CounterMap::value_type(PacketType::S4Alarm,         &S4Alarm));      CMap.insert(CounterMap::value_type(PacketType::S4Alarm,         &S4Alarm));
119        CMap.insert(CounterMap::value_type(PacketType::TsbT,            &TsbT));
120        CMap.insert(CounterMap::value_type(PacketType::TsbB,            &TsbB));
121  }  }
122    
123  /**  /**
# Line 127  void EventCounter::Increment(PacketType Line 131  void EventCounter::Increment(PacketType
131      (*counter)++;      (*counter)++;
132      oss.str("");      oss.str("");
133      oss << " Counter." <<  type->GetName() << " = " <<  (*counter);      oss << " Counter." <<  type->GetName() << " = " <<  (*counter);
134      logger->debug(oss.str().c_str());      logger->info(oss.str().c_str());
135    } else {    } else {
136      throw NotExistingCounterException(type->GetName().c_str());      oss.str("");
137        oss << "\n No counter of type  " << type->GetName().c_str();
138        throw NotExistingCounterException(oss.str().c_str());
139    }    }
140  }  }
141    
# Line 177  void EventCounter::PrintCounters() const Line 183  void EventCounter::PrintCounters() const
183    for(CounterMap::const_iterator p = CMap.begin(); p != CMap.end(); p++) {    for(CounterMap::const_iterator p = CMap.begin(); p != CMap.end(); p++) {
184    oss.str("");    oss.str("");
185    oss <<  " Counter." <<  (p->first)->GetName()  <<   " \t \t " <<  (*p->second);    oss <<  " Counter." <<  (p->first)->GetName()  <<   " \t \t " <<  (*p->second);
186    logger->warn(oss.str().c_str());    logger->info(oss.str().c_str());
187    }    }
188  }  }

Legend:
Removed from v.2.4  
changed lines
  Added in v.3.0

  ViewVC Help
Powered by ViewVC 1.1.23