ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/TriggerName.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/TriggerName.h (file contents):
Revision 1.5 by loizides, Wed Feb 18 15:38:55 2009 UTC vs.
Revision 1.6 by loizides, Tue Mar 24 16:10:15 2009 UTC

# Line 14 | Line 14
14   #include <string>
15   #include <TObject.h>
16   #include <TString.h>
17 #include <THashTable.h>
17   #include "MitAna/DataTree/interface/DataBase.h"
18  
19   namespace mithep
# Line 44 | Line 43 | namespace mithep
43  
44      ClassDef(TriggerName, 1) // Trigger name class
45    };
47
48 //--------------------------------------------------------------------------------------------------
49 // TriggerTable
50 //
51 // A convenient THashTable for storage of TriggerNames (not streamable).
52 //
53 // Authors: C.Loizides
54 //--------------------------------------------------------------------------------------------------
55  class TriggerTable : public THashTable
56  {
57    public:
58      TriggerTable(Int_t capacity = TCollection::kInitHashTableCapacity, Int_t rehash = 0) :
59        THashTable(capacity,rehash) {}
60
61      const TriggerName *Get(const char *name)   const;
62      UShort_t           GetId(const char *name) const;
63      using TCollection::Print;
64      void               Print(Option_t *opt="") const;
65  };
66 }
67
68 //--------------------------------------------------------------------------------------------------
69 inline const mithep::TriggerName *mithep::TriggerTable::Get(const char *name) const
70 {
71  // Return TriggerName pointer for given name.
72
73  return dynamic_cast<const TriggerName *>(FindObject(name));
74 }
75
76 //--------------------------------------------------------------------------------------------------
77 inline UShort_t mithep::TriggerTable::GetId(const char *name) const
78 {
79  // Return trigger id of trigger with given name.
80
81  const mithep::TriggerName *tn = Get(name);
82  if (tn)
83    return tn->Id();
84  
85  Error("GetId", "TriggerName for %s not found. Returning 65535.", name);
86  return 65535;
46   }
47   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines