//----------------------------------------------------------- // 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 using std::vector; // Collaborating Class Headers -------- // Class Member definitions ----------- ClassImp(McIdCollection) McIdCollection::McIdCollection(){;} McIdCollection::~McIdCollection() { fMCIDs.clear(); } McIdCollection::McIdCollection(const McIdCollection& coll) : fMCIDs(coll.fMCIDs) {} bool McIdCollection::AddID(const McId& id, double w){ vector::iterator it=find(fMCIDs.begin(),fMCIDs.end(),id); if(it==fMCIDs.end()){ fMCIDs.push_back(id); fMCIDs.back().setweight(id.weight()*w); return true; } else { (*it).IncWeight(id.weight()*w); return false; } }; bool McIdCollection::AddIDCollection(const McIdCollection& coll, double w){ unsigned int n=coll.nIDs(); bool ret=false; for(unsigned int i=0; i