]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenBase/EvtAbsBinning.hh
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtAbsBinning.hh
CommitLineData
da0e9ce3 1/*****************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
3 * Package: EvtGenBase
0ca57c2f 4 * File: $Id: EvtAbsBinning.hh,v 1.2 2009-03-16 16:43:39 robbep Exp $
da0e9ce3 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
20template <class T> class EvtAbsBinning {
21public:
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