]>
Commit | Line | Data |
---|---|---|
1 | /***************************************************************************** | |
2 | * Project: BaBar detector at the SLAC PEP-II B-factory | |
3 | * Package: EvtGenBase | |
4 | * File: $Id: EvtAbsBinning.hh,v 1.1 2003/05/02 21:41:08 dvoretsk Exp $ | |
5 | * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002 | |
6 | * | |
7 | * Copyright (C) 2002 Caltech | |
8 | *****************************************************************************/ | |
9 | ||
10 | /* | |
11 | * Data point to bin value mapping | |
12 | */ | |
13 | ||
14 | #ifndef EVT_ABS_BINNING_HH | |
15 | #define EVT_ABS_BINNING_HH | |
16 | #define BIN_OUTSIDE -1 | |
17 | ||
18 | #include <stdio.h> | |
19 | ||
20 | template <class T> class EvtAbsBinning { | |
21 | public: | |
22 | ||
23 | EvtAbsBinning() | |
24 | {} | |
25 | EvtAbsBinning(const EvtAbsBinning<T>& other) | |
26 | {} | |
27 | virtual ~EvtAbsBinning() | |
28 | {} | |
29 | ||
30 | virtual EvtAbsBinning<T>* clone() const = 0; | |
31 | virtual int getBin(const T& point) const = 0; | |
32 | virtual T getBinPoint(int bin) const = 0; | |
33 | virtual double size(int bin) const = 0; | |
34 | ||
35 | virtual int nTypes() const = 0; | |
36 | ||
37 | virtual char* typeLabel(int i) const | |
38 | { | |
39 | char* a = new char[128]; | |
40 | sprintf(a,"%d",i); | |
41 | return a; | |
42 | } | |
43 | ||
44 | }; | |
45 | ||
46 | #endif |