1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: TriggerName.h,v 1.5 2009/02/18 15:38:55 loizides Exp $
|
3 |
//
|
4 |
// TriggerName
|
5 |
//
|
6 |
// A class to hold a name and a number, ie the trigger name and trigger bit.
|
7 |
//
|
8 |
// Authors: C.Loizides
|
9 |
//--------------------------------------------------------------------------------------------------
|
10 |
|
11 |
#ifndef MITANA_DATATREE_TRIGGERNAME_H
|
12 |
#define MITANA_DATATREE_TRIGGERNAME_H
|
13 |
|
14 |
#include <string>
|
15 |
#include <TObject.h>
|
16 |
#include <TString.h>
|
17 |
#include "MitAna/DataTree/interface/DataBase.h"
|
18 |
|
19 |
namespace mithep
|
20 |
{
|
21 |
class TriggerName : public DataBase
|
22 |
{
|
23 |
public:
|
24 |
TriggerName() : fId(0), fHash(0) {}
|
25 |
TriggerName(const char *name, UShort_t id) :
|
26 |
fName(name), fId(id), fHash(fName.Hash()) {}
|
27 |
TriggerName(const std::string &name, UShort_t id) :
|
28 |
fName(name), fId(id), fHash(fName.Hash()) {}
|
29 |
TriggerName(const TString &name, UShort_t id) :
|
30 |
fName(name), fId(id), fHash(fName.Hash()) {}
|
31 |
|
32 |
UShort_t Id() const { return fId; }
|
33 |
const char *GetName() const { return fName; }
|
34 |
ULong_t Hash() const { return fHash; }
|
35 |
const char *Name() const { return fName; }
|
36 |
EObjType ObjType() const { return kTriggerName; }
|
37 |
void Print(Option_t *opt="") const;
|
38 |
|
39 |
protected:
|
40 |
TString fName; //name
|
41 |
UShort_t fId; //id
|
42 |
UInt_t fHash; //hash
|
43 |
|
44 |
ClassDef(TriggerName, 1) // Trigger name class
|
45 |
};
|
46 |
}
|
47 |
#endif
|