/[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 1.5 by kusanagi, Thu Jul 29 16:18:53 2004 UTC revision 1.6 by kusanagi, Thu Aug 19 15:24:10 2004 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 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.
# Line 10  Line 10 
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    
# Line 28  EventCounter::EventCounter(int run): Line 28  EventCounter::EventCounter(int run):
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),
# Line 63  EventCounter::EventCounter(int run): Line 62  EventCounter::EventCounter(int run):
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));
# Line 100  void EventCounter::Increment(PacketType Line 98  void EventCounter::Increment(PacketType
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    }    }
# Line 124  int EventCounter::Get(PacketType const * Line 122  int EventCounter::Get(PacketType const *
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;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23