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

Diff of /chewbacca/event/EventCounter.cpp

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

revision 1.1.1.1 by mocchiut, Tue Sep 23 07:19:51 2008 UTC revision 1.3 by mocchiut, Wed Jul 29 15:47:19 2009 UTC
# Line 1  Line 1 
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   */   */
# Line 23  using namespace pamela; Line 23  using namespace pamela;
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),
# Line 31  EventCounter::EventCounter(int run): Line 32  EventCounter::EventCounter(int run):
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),
# Line 69  EventCounter::EventCounter(int run): Line 70  EventCounter::EventCounter(int run):
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));
# Line 139  void EventCounter::Increment(PacketType Line 139  void EventCounter::Increment(PacketType
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());
# Line 160  int EventCounter::Get(PacketType const * Line 161  int EventCounter::Get(PacketType const *
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  }  }
# Line 177  int EventCounter::Next(PacketType const Line 179  int EventCounter::Next(PacketType const
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  }  }
# Line 197  void EventCounter::PrintCounters() const Line 200  void EventCounter::PrintCounters() const
200    //logger->info(oss.str().c_str());    //logger->info(oss.str().c_str());
201    }    }
202  }  }
203            
204    ClassImp(EventCounter)  

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23