2 // $Id: Error.hh 389 2006-12-14 18:29:16Z salam $
4 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
6 //----------------------------------------------------------------------
7 // This file is part of FastJet.
9 // FastJet is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // The algorithms that underlie FastJet have required considerable
15 // development and are described in hep-ph/0512210. If you use
16 // FastJet as part of work towards a scientific publication, please
17 // include a citation to the FastJet paper.
19 // FastJet is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
24 // You should have received a copy of the GNU General Public License
25 // along with FastJet; if not, write to the Free Software
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 //----------------------------------------------------------------------
33 #ifndef __FASTJET_ERROR_HH__
34 #define __FASTJET_ERROR_HH__
38 #include "fastjet/internal/base.hh"
40 namespace fastjet { // defined in fastjet/internal/base.hh
42 /// class corresponding to errors that will be thrown by fastjet
47 Error(const std::string & message) {
49 if (_print_errors) std::cerr << "fastjet::Error: "<<message << std::endl;
52 std::string message() const {return _message;};
54 static void set_print_errors(bool print_errors) {
55 _print_errors = print_errors;};
59 static bool _print_errors;
63 } // fastjet namespace
65 #endif // __FASTJET_ERROR_HH__