Revision: | 1.1 |
Committed: | Fri Jan 23 07:34:34 2009 UTC (16 years, 3 months ago) by loizides |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_009c, Mit_009b, Mit_009a, Mit_009, Mit_008, Mit_008pre2, Mit_008pre1, Mit_006b, Mit_006a, HEAD |
Branch point for: | Mit_025c_branch |
Log Message: | Simple Table to keep constants. Eg. will be used for xsections |
# | Content |
---|---|
1 | //-------------------------------------------------------------------------------------------------- |
2 | // $Id: EventHeader.h,v 1.10 2008/12/09 17:47:00 loizides Exp $ |
3 | // |
4 | // SimpleTable |
5 | // |
6 | // Simple wrapper around a THashTable. It can be used to access constants via a given name. |
7 | // Entries must be read from a plain text file. |
8 | // |
9 | // Authors: C.Loizides |
10 | //-------------------------------------------------------------------------------------------------- |
11 | |
12 | #ifndef MITANA_UTILS_SIMPLETABLE_H |
13 | #define MITANA_UTILS_SIMPLETABLE_H |
14 | |
15 | #include "MitCommon/DataFormats/interface/Types.h" |
16 | #include <THashTable.h> |
17 | #include <TParameter.h> |
18 | |
19 | namespace mithep |
20 | { |
21 | class SimpleTable : public TObject |
22 | { |
23 | public: |
24 | class MyParameter : public TParameter<double> |
25 | { |
26 | public: |
27 | MyParameter() {} |
28 | MyParameter(const char *n, Double_t v) : |
29 | TParameter<double>(n,v), fHash(TString(n).Hash()) {} |
30 | |
31 | ULong_t Hash() const { return fHash; } |
32 | void Print(Option_t */*option*/="") const; |
33 | |
34 | protected: |
35 | ULong_t fHash; //stored hash value |
36 | |
37 | ClassDef(MyParameter,1) // Extension to TParameter<double> |
38 | }; |
39 | |
40 | public: |
41 | SimpleTable(const char *input); |
42 | ~SimpleTable() {} |
43 | |
44 | Double_t Get(const char *name) const; |
45 | Double_t Has(const char *name) const; |
46 | void Print(Option_t *opt="") const; |
47 | |
48 | protected: |
49 | THashTable fTable; |
50 | |
51 | ClassDef(SimpleTable, 1) // Simple table to keep numbers |
52 | }; |
53 | } |
54 | #endif |