--- UserCode/MitProd/TreeFiller/interface/AssociationMap.h 2008/07/30 08:39:08 1.4 +++ UserCode/MitProd/TreeFiller/interface/AssociationMap.h 2008/09/10 03:30:22 1.6 @@ -1,16 +1,15 @@ //-------------------------------------------------------------------------------------------------- -// $Id: AssociationMap.h,v 1.4 2008/07/30 08:39:08 loizides Exp $ +// $Id: AssociationMap.h,v 1.6 2008/09/10 03:30:22 loizides Exp $ // // Association Map // // Wrapper for std::map, used to resolve links during tree filling. -// This class needs work! CL. // // Authors: J.Bendavid, C.Loizides //-------------------------------------------------------------------------------------------------- -#ifndef TREEFILLER_ASSOCIATIONMAP_H -#define TREEFILLER_ASSOCIATIONMAP_H +#ifndef MITPROD_TREEFILLER_ASSOCIATIONMAP_H +#define MITPROD_TREEFILLER_ASSOCIATIONMAP_H #include #include @@ -32,6 +31,7 @@ namespace mithep Int_t GetEdmProductId() const { return edmProductId_; } Int_t GetEntries() const { return fwdMap_.size(); } MitClass GetMit(EdmClass edmObj) const; + bool HasMit(EdmClass edmObj) const; void Reset() { fwdMap_.clear(); revMap_.clear(); } void SetEdmProductId(Int_t id) { edmProductId_ = id; } @@ -74,4 +74,16 @@ inline EdmClass mithep::AssociationMap +inline bool mithep::AssociationMap::HasMit(EdmClass edmObj) const +{ + typename fwdMapType::const_iterator iter = fwdMap_.find(edmObj); + + if (iter != fwdMap_.end()) + return true; + else + return false; +} #endif