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> |
23 |
|
typedef std::map<MitClass, EdmClass> revMapType; |
24 |
|
|
25 |
|
public: |
26 |
< |
AssociationMap() : edmProductId_(0) {} |
26 |
> |
AssociationMap(const char *n=0) : edmProductId_(0), brname_(n) {} |
27 |
|
~AssociationMap() {} |
28 |
|
|
29 |
< |
void Add(EdmClass edmObj, MitClass mitObj); |
30 |
< |
EdmClass GetEdm(MitClass mitObj) const; |
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; } |
29 |
> |
void Add(EdmClass edmObj, MitClass mitObj); |
30 |
> |
EdmClass GetEdm(MitClass mitObj) const; |
31 |
> |
Int_t GetEdmProductId() const { return edmProductId_; } |
32 |
> |
Int_t GetEntries() const { return fwdMap_.size(); } |
33 |
> |
MitClass GetMit(EdmClass edmObj) const; |
34 |
> |
const char *GetName() const { return brname_.c_str(); } |
35 |
> |
bool HasMit(EdmClass edmObj) const; |
36 |
> |
void Reset() { fwdMap_.clear(); revMap_.clear(); } |
37 |
> |
void SetEdmProductId(Int_t id) { edmProductId_ = id; } |
38 |
> |
void SetName(const char *n) { brname_ = n; } |
39 |
|
|
40 |
|
protected: |
41 |
< |
fwdMapType fwdMap_; //map between edm ref and mit ptr |
42 |
< |
revMapType revMap_; //map between mit ptr and edm ref |
43 |
< |
Int_t edmProductId_; //product id for consistency check |
41 |
> |
fwdMapType fwdMap_; //map between edm ref and mit ptr |
42 |
> |
revMapType revMap_; //map between mit ptr and edm ref |
43 |
> |
Int_t edmProductId_; //product id for consistency check |
44 |
> |
std::string brname_; //branch name of MIT objects |
45 |
|
}; |
46 |
|
} |
47 |
|
|
89 |
|
else |
90 |
|
return false; |
91 |
|
} |
90 |
– |
|
92 |
|
#endif |