//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Implementation of class McIdCollection // see McIdCollection.hh for details // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // // //----------------------------------------------------------- // This Class' Header ------------------ #include "McIdCollection.h" // C/C++ Headers ---------------------- #include // Collaborating Class Headers -------- // Class Member definitions ----------- ClassImp(McIdCollection) McIdCollection::McIdCollection(){;} McIdCollection::~McIdCollection() { _MCIDs.clear(); } McIdCollection::McIdCollection(const McIdCollection& coll) : _MCIDs(coll._MCIDs) {} bool McIdCollection::AddID(const McId& ID){ vector::iterator it=find(_MCIDs.begin(),_MCIDs.end(),ID); if(it==_MCIDs.end()){ _MCIDs.push_back(ID); return true; } else { (*it).IncWeight(ID.weight()); return false; } }; bool McIdCollection::AddIDCollection(const McIdCollection& coll){ unsigned int n=coll.nIDs(); bool ret=false; for(unsigned int i=0; i