]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONLogger.h
New class to log things that should be collected during the processing, but only...
[u/mrichter/AliRoot.git] / MUON / AliMUONLogger.h
diff --git a/MUON/AliMUONLogger.h b/MUON/AliMUONLogger.h
new file mode 100644 (file)
index 0000000..b5ba743
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef ALIMUONLOGGER_H
+#define ALIMUONLOGGER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup base
+/// \class AliMUONLogger
+/// \brief A logger that keeps track of the number of times a message appeared
+/// 
+/// \author Laurent Aphecetche
+
+#ifndef ROOT_TObject
+#  include "TObject.h"
+#endif
+
+class AliMUONStringIntMap;
+
+class AliMUONLogger : public TObject
+{
+public:
+  AliMUONLogger(Int_t maxNumberOfEntries=-1);
+  virtual ~AliMUONLogger();
+  
+  Int_t Log(const char* message);
+  
+  void Print(Option_t* opt="") const;
+  
+private:
+  
+  AliMUONLogger(const AliMUONLogger& rhs); // not implemented
+  AliMUONLogger& operator=(const AliMUONLogger& rhs); // not implemented
+  
+private:
+  
+  Int_t fMaxNumberOfEntries; //!< after this number, print and reset
+  AliMUONStringIntMap* fLog; //!< map from message to number of times the message was issued
+  
+  ClassDef(AliMUONLogger,1) // 
+};
+
+#endif