00001 /***************************************************************************** 00002 * Project: BaBar detector at the SLAC PEP-II B-factory 00003 * Package: EvtGenBase 00004 * File: $Id: EvtAbsBinning.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $ 00005 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 00006 * 00007 * Copyright (C) 2002 Caltech 00008 *****************************************************************************/ 00009 00010 /* 00011 * Data point to bin value mapping 00012 */ 00013 00014 #ifndef EVT_ABS_BINNING_HH 00015 #define EVT_ABS_BINNING_HH 00016 #define BIN_OUTSIDE -1 00017 00018 #include <stdio.h> 00019 00020 template <class T> class EvtAbsBinning { 00021 public: 00022 00023 EvtAbsBinning() 00024 {} 00025 EvtAbsBinning(const EvtAbsBinning<T>& other) 00026 {} 00027 virtual ~EvtAbsBinning() 00028 {} 00029 00030 virtual EvtAbsBinning<T>* clone() const = 0; 00031 virtual int getBin(const T& point) const = 0; 00032 virtual T getBinPoint(int bin) const = 0; 00033 virtual double size(int bin) const = 0; 00034 00035 virtual int nTypes() const = 0; 00036 00037 virtual char* typeLabel(int i) const 00038 { 00039 char* a = new char[128]; 00040 sprintf(a,"%d",i); 00041 return a; 00042 } 00043 00044 }; 00045 00046 #endif