4 |
|
// Association Map |
5 |
|
// |
6 |
|
// Wrapper for std::map, used to resolve links during tree filling. |
7 |
– |
// This class needs work! CL. |
7 |
|
// |
8 |
|
// Authors: J.Bendavid, C.Loizides |
9 |
|
//-------------------------------------------------------------------------------------------------- |
10 |
|
|
11 |
< |
#ifndef TREEFILLER_ASSOCIATIONMAP_H |
12 |
< |
#define TREEFILLER_ASSOCIATIONMAP_H |
11 |
> |
#ifndef MITPROD_TREEFILLER_ASSOCIATIONMAP_H |
12 |
> |
#define MITPROD_TREEFILLER_ASSOCIATIONMAP_H |
13 |
|
|
14 |
|
#include <map> |
15 |
|
#include <TObject.h> |
31 |
|
Int_t GetEdmProductId() const { return edmProductId_; } |
32 |
|
Int_t GetEntries() const { return fwdMap_.size(); } |
33 |
|
MitClass GetMit(EdmClass edmObj) const; |
34 |
+ |
bool HasMit(EdmClass edmObj) const; |
35 |
|
void Reset() { fwdMap_.clear(); revMap_.clear(); } |
36 |
|
void SetEdmProductId(Int_t id) { edmProductId_ = id; } |
37 |
|
|
74 |
|
<< "Error! MITHEP Object (" << typeid(mitObj).name() |
75 |
|
<< ") not found in AssociationMap (" << typeid(*this).name() << ")." << std::endl; |
76 |
|
} |
77 |
+ |
|
78 |
+ |
//-------------------------------------------------------------------------------------------------- |
79 |
+ |
template <class EdmClass, class MitClass> |
80 |
+ |
inline bool mithep::AssociationMap<EdmClass,MitClass>::HasMit(EdmClass edmObj) const |
81 |
+ |
{ |
82 |
+ |
typename fwdMapType::const_iterator iter = fwdMap_.find(edmObj); |
83 |
+ |
|
84 |
+ |
if (iter != fwdMap_.end()) |
85 |
+ |
return true; |
86 |
+ |
else |
87 |
+ |
return false; |
88 |
+ |
} |
89 |
|
#endif |