/[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.6.2.1 by kusanagi, Fri Mar 4 10:13:10 2005 UTC revision 6.3 by kusanagi, Tue May 30 19:10:02 2006 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.6 2005/01/29 00:26:41 kusanagi Exp $   * $Id: EventCounter.cpp,v 6.2 2006/05/30 19:10:01 kusanagi Exp $
4   * $Author: kusanagi $   * $Author: kusanagi $
5   *   *
6   * Implementation of the EventCounter class.   * Implementation of the EventCounter class.
# Line 30  EventCounter::EventCounter(int run): Line 30  EventCounter::EventCounter(int run):
30    CalibTrkBoth(0),    CalibTrkBoth(0),
31    CalibTrk1(0),    CalibTrk1(0),
32    CalibTrk2(0),    CalibTrk2(0),
   CalibTrd(0),  
33    CalibTof(0),    CalibTof(0),
34    CalibS4(0),    CalibS4(0),
35    CalibCalPed(0),    CalibCalPed(0),
36    Calib1_Ac1(0),    Calib1_Ac1(0),
   Calib1_Ac2(0),  
37    Calib2_Ac1(0),    Calib2_Ac1(0),
38      Calib1_Ac2(0),
39    Calib2_Ac2(0),    Calib2_Ac2(0),
40      CalibCal(0),
41    RunHeader(0),    RunHeader(0),
42    RunTrailer(0),    RunTrailer(0),
43    CalibHeader(0),    CalibHeader(0),
# Line 45  EventCounter::EventCounter(int run): Line 45  EventCounter::EventCounter(int run):
45    InitHeader(0),    InitHeader(0),
46    InitTrailer(0),    InitTrailer(0),
47    EventTrk(0),    EventTrk(0),
   TestTrk(0),  
   TestTof(0),  
48    Log(0),    Log(0),
49    VarDump(0),    VarDump(0),
50    ArrDump(0),    ArrDump(0),
# Line 63  EventCounter::EventCounter(int run): Line 61  EventCounter::EventCounter(int run):
61    S4Init(0),    S4Init(0),
62    Ac2Init(0),    Ac2Init(0),
63    CalAlarm(0),    CalAlarm(0),
64    AcAlarm(0),    Ac1Alarm(0),
65    TrkAlarm(0),    TrkAlarm(0),
66    TrgAlarm(0),    TrgAlarm(0),
67    TofAlarm(0),    TofAlarm(0),
68    S4Alarm(0),    S4Alarm(0),
69      Ac2Alarm(0),
70    TsbT(0),    TsbT(0),
71    TsbB(0),      TsbB(0),
72    RunNumber(run) {    RunNumber(run) {
73      CMap.insert(CounterMap::value_type(PacketType::Pscu,            &Pscu));      CMap.insert(CounterMap::value_type(PacketType::Pscu,            &Pscu));
74      CMap.insert(CounterMap::value_type(PacketType::PhysEndRun,      &PhysEndRun));      CMap.insert(CounterMap::value_type(PacketType::PhysEndRun,      &PhysEndRun));
# Line 79  EventCounter::EventCounter(int run): Line 78  EventCounter::EventCounter(int run):
78      CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth,    &CalibTrkBoth));      CMap.insert(CounterMap::value_type(PacketType::CalibTrkBoth,    &CalibTrkBoth));
79      CMap.insert(CounterMap::value_type(PacketType::CalibTrk1,       &CalibTrk1));      CMap.insert(CounterMap::value_type(PacketType::CalibTrk1,       &CalibTrk1));
80      CMap.insert(CounterMap::value_type(PacketType::CalibTrk2,       &CalibTrk2));      CMap.insert(CounterMap::value_type(PacketType::CalibTrk2,       &CalibTrk2));
     CMap.insert(CounterMap::value_type(PacketType::CalibTrd,        &CalibTrd));  
81      CMap.insert(CounterMap::value_type(PacketType::CalibTof,        &CalibTof));      CMap.insert(CounterMap::value_type(PacketType::CalibTof,        &CalibTof));
82      CMap.insert(CounterMap::value_type(PacketType::CalibS4,         &CalibS4));      CMap.insert(CounterMap::value_type(PacketType::CalibS4,         &CalibS4));
83      CMap.insert(CounterMap::value_type(PacketType::CalibCalPed,     &CalibCalPed));      CMap.insert(CounterMap::value_type(PacketType::CalibCalPed,     &CalibCalPed));
84      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac1,      &Calib1_Ac1));      CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac1,      &Calib1_Ac1));
     CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac2,      &Calib1_Ac2));  
85      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac1,      &Calib2_Ac1));      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac1,      &Calib2_Ac1));
86        CMap.insert(CounterMap::value_type(PacketType::Calib1_Ac2,      &Calib1_Ac2));
87      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac2,      &Calib2_Ac2));      CMap.insert(CounterMap::value_type(PacketType::Calib2_Ac2,      &Calib2_Ac2));
88        CMap.insert(CounterMap::value_type(PacketType::CalibCal,        &CalibCal));
89      CMap.insert(CounterMap::value_type(PacketType::RunHeader,       &RunHeader));      CMap.insert(CounterMap::value_type(PacketType::RunHeader,       &RunHeader));
90      CMap.insert(CounterMap::value_type(PacketType::RunTrailer,      &RunTrailer));      CMap.insert(CounterMap::value_type(PacketType::RunTrailer,      &RunTrailer));
91      CMap.insert(CounterMap::value_type(PacketType::CalibHeader,     &CalibHeader));      CMap.insert(CounterMap::value_type(PacketType::CalibHeader,     &CalibHeader));
# Line 94  EventCounter::EventCounter(int run): Line 93  EventCounter::EventCounter(int run):
93      CMap.insert(CounterMap::value_type(PacketType::InitHeader,      &InitHeader));      CMap.insert(CounterMap::value_type(PacketType::InitHeader,      &InitHeader));
94      CMap.insert(CounterMap::value_type(PacketType::InitTrailer,     &InitTrailer));        CMap.insert(CounterMap::value_type(PacketType::InitTrailer,     &InitTrailer));  
95      CMap.insert(CounterMap::value_type(PacketType::EventTrk,        &EventTrk));        CMap.insert(CounterMap::value_type(PacketType::EventTrk,        &EventTrk));  
     CMap.insert(CounterMap::value_type(PacketType::TestTrk,         &TestTrk));    
     CMap.insert(CounterMap::value_type(PacketType::TestTof,         &TestTof));    
96      CMap.insert(CounterMap::value_type(PacketType::Log,             &Log));      CMap.insert(CounterMap::value_type(PacketType::Log,             &Log));
97      CMap.insert(CounterMap::value_type(PacketType::VarDump,         &VarDump));      CMap.insert(CounterMap::value_type(PacketType::VarDump,         &VarDump));
98      CMap.insert(CounterMap::value_type(PacketType::ArrDump,         &ArrDump));      CMap.insert(CounterMap::value_type(PacketType::ArrDump,         &ArrDump));
# Line 107  EventCounter::EventCounter(int run): Line 104  EventCounter::EventCounter(int run):
104      CMap.insert(CounterMap::value_type(PacketType::CalInit,         &CalInit));      CMap.insert(CounterMap::value_type(PacketType::CalInit,         &CalInit));
105      CMap.insert(CounterMap::value_type(PacketType::TrkInit,         &TrkInit));      CMap.insert(CounterMap::value_type(PacketType::TrkInit,         &TrkInit));
106      CMap.insert(CounterMap::value_type(PacketType::TofInit,         &TofInit));      CMap.insert(CounterMap::value_type(PacketType::TofInit,         &TofInit));
107        CMap.insert(CounterMap::value_type(PacketType::TrgInit,         &TrgInit));
108      CMap.insert(CounterMap::value_type(PacketType::NdInit,          &NdInit));      CMap.insert(CounterMap::value_type(PacketType::NdInit,          &NdInit));
109      CMap.insert(CounterMap::value_type(PacketType::S4Init,          &S4Init));      CMap.insert(CounterMap::value_type(PacketType::S4Init,          &S4Init));
110      CMap.insert(CounterMap::value_type(PacketType::Ac2Init,         &Ac2Init));      CMap.insert(CounterMap::value_type(PacketType::Ac2Init,         &Ac2Init));
111      CMap.insert(CounterMap::value_type(PacketType::CalAlarm,        &CalAlarm));      CMap.insert(CounterMap::value_type(PacketType::CalAlarm,        &CalAlarm));
112      CMap.insert(CounterMap::value_type(PacketType::AcAlarm,         &AcAlarm));      CMap.insert(CounterMap::value_type(PacketType::Ac1Alarm,        &Ac1Alarm));
113      CMap.insert(CounterMap::value_type(PacketType::TrkAlarm,        &TrkAlarm));      CMap.insert(CounterMap::value_type(PacketType::TrkAlarm,        &TrkAlarm));
114      CMap.insert(CounterMap::value_type(PacketType::TrgAlarm,        &TrgAlarm));      CMap.insert(CounterMap::value_type(PacketType::TrgAlarm,        &TrgAlarm));
115      CMap.insert(CounterMap::value_type(PacketType::TofAlarm,        &TofAlarm));      CMap.insert(CounterMap::value_type(PacketType::TofAlarm,        &TofAlarm));
116      CMap.insert(CounterMap::value_type(PacketType::S4Alarm,         &S4Alarm));      CMap.insert(CounterMap::value_type(PacketType::S4Alarm,         &S4Alarm));
117        CMap.insert(CounterMap::value_type(PacketType::Ac2Alarm,        &Ac2Alarm));
118      CMap.insert(CounterMap::value_type(PacketType::TsbT,            &TsbT));      CMap.insert(CounterMap::value_type(PacketType::TsbT,            &TsbT));
119      CMap.insert(CounterMap::value_type(PacketType::TsbB,            &TsbB));      CMap.insert(CounterMap::value_type(PacketType::TsbB,            &TsbB));
120  }  }
# Line 131  void EventCounter::Increment(PacketType Line 130  void EventCounter::Increment(PacketType
130      (*counter)++;      (*counter)++;
131      oss.str("");      oss.str("");
132      oss << " Counter." <<  type->GetName() << " = " <<  (*counter);      oss << " Counter." <<  type->GetName() << " = " <<  (*counter);
133      logger->debug(oss.str().c_str());      logger->info(oss.str().c_str());
134    } else {    } else {
135      oss.str("");      oss.str("");
136      oss << "\n No counter of type  " << type->GetName().c_str();      oss << "\n No counter of type  " << type->GetName().c_str();
# Line 183  void EventCounter::PrintCounters() const Line 182  void EventCounter::PrintCounters() const
182    for(CounterMap::const_iterator p = CMap.begin(); p != CMap.end(); p++) {    for(CounterMap::const_iterator p = CMap.begin(); p != CMap.end(); p++) {
183    oss.str("");    oss.str("");
184    oss <<  " Counter." <<  (p->first)->GetName()  <<   " \t \t " <<  (*p->second);    oss <<  " Counter." <<  (p->first)->GetName()  <<   " \t \t " <<  (*p->second);
185    logger->warn(oss.str().c_str());    logger->info(oss.str().c_str());
186    }    }
187  }  }
188            

Legend:
Removed from v.2.6.2.1  
changed lines
  Added in v.6.3

  ViewVC Help
Powered by ViewVC 1.1.23