00001 // -*- C++ -*- 00003 // File: hash.h // 00004 // Description: header file for classes hash_element and hash_cones // 00005 // This file is part of the SISCone project. // 00006 // For more details, see http://projects.hepforge.org/siscone // 00007 // // 00008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez // 00009 // // 00010 // This program is free software; you can redistribute it and/or modify // 00011 // it under the terms of the GNU General Public License as published by // 00012 // the Free Software Foundation; either version 2 of the License, or // 00013 // (at your option) any later version. // 00014 // // 00015 // This program is distributed in the hope that it will be useful, // 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 00018 // GNU General Public License for more details. // 00019 // // 00020 // You should have received a copy of the GNU General Public License // 00021 // along with this program; if not, write to the Free Software // 00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 00023 // // 00024 // $Revision:: 123 $// 00025 // $Date:: 2007-02-28 20:52:16 -0500 (Wed, 28 Feb 2007) $// 00027 00028 #ifndef __HASH_H__ 00029 #define __HASH_H__ 00030 00031 #include "momentum.h" 00032 #include "reference.h" 00033 00034 namespace siscone{ 00035 00045 class hash_element{ 00046 public: 00047 Creference ref; 00048 double eta; 00049 double phi; 00050 bool is_stable; 00051 00052 hash_element *next; 00053 }; 00054 00062 class hash_cones{ 00063 public: 00067 hash_cones(int _Np, double _R2); 00068 00070 ~hash_cones(); 00071 00081 int insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io); 00082 00090 int insert(Cmomentum *v); 00091 00093 hash_element **hash_array; 00094 00096 int n_cones; 00097 00099 int mask; 00100 00103 double R2; 00104 00113 inline bool is_inside(Cmomentum *centre, Cmomentum *v); 00114 }; 00115 00116 } 00117 #endif