//======================================================= // // File: VertexInfo.hpp // // Purpose: functions to access VertexCollChunk's content // // Created: 11-NOV-1998 Meenakshi Narain // 12-FEB-1999: Moved to vertex_evt package // 08-JUN-1999: New signatures + methods // 25-JUN-1999: Deep modifications to avoid copying // 28-JUN-1999: New version using pointers only // 1-OCT-1999: use LinkIndex (Serban Protopopescu) //=================================================== #ifndef VERTEXINFO_HPP #define VERTEXINFO_HPP #include #include #include "edm/Event.hpp" #include "identifiers/ChunkID.hpp" #include "edm/LinkIndex.hpp" #include "vertexutil/Vertex.hpp" #include "vertexutil/VertexColl.hpp" #include "vertexutil/VertexType.hpp" /** Primary Vertex namespace Functions to access the vertices stored in {\bf VertexCollChunk} objects. */ namespace vertex { typedef edm::LinkIndex VertexIndex; typedef edm::LinkIndex VtxIndex; /// Given an event, return pointer to the first vertex stored in chunk vtype bool get_Vertex(const edm::Event& event, VertexType& vtype,const Vertex*& pv); bool get_Vertex(const edm::Event& event, VertexType& vtype,const Vertex*& pv, edm::ChunkID& cid); /// Given an event, return pointer to first vertex and its {\bf Index} bool get_Vertex(const edm::Event& e, VertexType& vtype, VertexIndex& vID, const Vertex*& pv); bool get_Vertex(const edm::Event& e, VertexType& vtype, VertexIndex& vID, const Vertex*& pv, edm::ChunkID& cid); /// Given an event, return pointer to the best primary vertex bool get_PrimaryVertex(const edm::Event& event, const Vertex*& pv); bool get_PrimaryVertex(const edm::Event& event, const Vertex*& pv, edm::ChunkID& cid); /// Given an event, return the best primary vertex and its {\bf D0Index} bool get_PrimaryVertex(const edm::Event& event, VertexIndex& vID, const Vertex*& pv); bool get_PrimaryVertex(const edm::Event& event, VertexIndex& vID, const Vertex*& pv, edm::ChunkID& cid); /// Given an event, return the 'best guess' primary vertex. // picks up from PV selected if it exists, else Vertex get_bestguessPrimaryVertex(const edm::Event& event); /// Given an event, return pointer to the collection of vertices bool get_AllVertices(const edm::Event& event,VertexType& vtype, const std::vector*& pv); bool get_AllVertices(const edm::Event& event,VertexType& vtype, const std::vector*& pv, edm::ChunkID& cid); /// Given an event, return pointer to the vertices and their ID's bool get_AllVertices(const edm::Event& event, VertexType& vtype, std::vector& vID, const std::vector*& pv); bool get_AllVertices(const edm::Event& event, VertexType& vtype, std::vector& vID, const std::vector*& pv, edm::ChunkID& cid); // get prefered list of primary vertices bool get_AllPVertices(const edm::Event& event, std::vector& vID, const std::vector*& pv, edm::ChunkID& cid); // get list of P verticies used in the TMB. PVRECO, reordered. // Not different function signature. Due to memory management issues bool get_AllPTMBVertices(const edm::Event& event, std::vector& vID, std::vector& pv, edm::ChunkID& cid); // get prefered list of secondary vertices bool get_AllSVertices(const edm::Event& event, std::vector& vID, const std::vector*& pv, edm::ChunkID& cid); /// function to extract the VertexColl from a chunk based on its type // returns best vertex const VertexColl* extractFromPVChunk(const edm::Event& event, VertexType& vtype, VertexIndex& vID, edm::ChunkID& cid); const VertexColl* extractFromPVChunk(const edm::Event& event, VertexType& vertexType, std::vector& vIDs, edm::ChunkID& cid); /// function to extract the VertexColl from a chunk based on its type // returns ChunkID const VertexColl* extractFromPVChunk(const edm::Event& event, VertexType& vtype, edm::ChunkID& cid); /// function to extract the VertexColl from a chunk based on its ID const VertexColl* extractFromPVChunk(const edm::Event& event, const edm::ChunkID& id); } #endif //VERTEXINFO_HPP