//========================================================================= // Print the list of MCParticle keys associated to the specified LHCbID //========================================================================= void PrPixelDebugTool::printKey(MsgStream& msg, LHCb::LHCbID id) { LinkedTo<LHCb::MCParticle> vLink(evtSvc(), msgSvc(), LHCb::VPClusterLocation::Default); LHCb::VPChannelID idV = id.vpID(); LHCb::MCParticle* part = vLink.first(idV); while (part) { msg << " " << part->key(); part = vLink.next(); } }
//============================================================================= // Check if a given LHCbID is associated to the MCParticle of the specified key //============================================================================= bool PrPixelDebugTool::matchKey(LHCb::LHCbID id, int key) { LinkedTo<LHCb::MCParticle> vLink(evtSvc(), msgSvc(), LHCb::VPClusterLocation::Default); LHCb::VPChannelID idV = id.vpID(); LHCb::MCParticle* part = vLink.first(idV); while (part) { if (key == part->key()) return true; part = vLink.next(); } return false; }
int main() { Vertex* v1 = vNew("A"); Vertex* v2 = vNew("B"); Link* origlink = linkNew(); vLink(v1, v2, (EdgePayload*)origlink); vSetParent(v2, v1, (EdgePayload*)linkNew()); //results in invalid write vDestroy(v1, 1); vDestroy(v2, 1); linkDestroy(origlink); return 1; }