NtupleWriter14/src/VertexCollectionSvc.cxx

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // 18.08.2007, AUTHOR: OLIVER KORTNER
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00006 //:: IMPLEMENTATION OF METHODS DEFINED IN THE CLASS VertexCollectionSvc ::
00007 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00008 
00009 //::::::::::::::::::
00010 //:: HEADER FILES ::
00011 //::::::::::::::::::
00012 
00013 // Gaudi //
00014 #include "GaudiKernel/MsgStream.h"
00015 
00016 // NtupleWriter14 //
00017 #include "NtupleWriter14/VertexCollectionSvc.h"
00018 
00019 //::::::::::::::::::::::::
00020 //:: NAMESPACE SETTINGS ::
00021 //::::::::::::::::::::::::
00022 
00023 using namespace std;
00024 using namespace MPIHiggsAnalysis;
00025 
00026 //*****************************************************************************
00027 
00028 //:::::::::::::::::
00029 //:: CONSTRUCTOR ::
00030 //:::::::::::::::::
00031 
00032 VertexCollectionSvc::VertexCollectionSvc(const std::string & name,
00033                                 ISvcLocator * svcloc) : Service(name, svcloc) {
00034 }
00035 
00036 //*****************************************************************************
00037 
00038 //::::::::::::::::
00039 //:: DESTRUCTOR ::
00040 //::::::::::::::::
00041 
00042 VertexCollectionSvc::~VertexCollectionSvc(void) {
00043 }
00044 
00045 //*****************************************************************************
00046 
00047 //::::::::::::::::::::::::
00048 //:: METHOD interfaceID ::
00049 //::::::::::::::::::::::::
00050 
00051 const InterfaceID & VertexCollectionSvc::interfaceID() {
00052 
00053         return IID_IVertexCollectionSvc;
00054 
00055 }
00056 
00057 //*****************************************************************************
00058 
00059 //:::::::::::::::::::::::::::
00060 //:: METHOD queryInterface ::
00061 //:::::::::::::::::::::::::::
00062 
00063 StatusCode VertexCollectionSvc::queryInterface(const InterfaceID& riid,
00064                                                         void** ppvUnknown) {
00065 
00066         if (IID_IVertexCollectionSvc.versionMatch(riid)) {
00067                 *ppvUnknown = static_cast<VertexCollectionSvc *>(this);
00068         } else {
00069                 return Service::queryInterface(riid, ppvUnknown);
00070         }
00071 
00072         return StatusCode::SUCCESS;
00073 
00074 }
00075 
00076 //****************************************************************************
00077 
00078 //:::::::::::::::::::::::
00079 //:: METHOD initialize ::
00080 //:::::::::::::::::::::::
00081 
00082 StatusCode VertexCollectionSvc::initialize(void) {
00083 
00084         Service::initialize();
00085 
00087 // VARIABLES //
00089 
00090         MsgStream log(messageService(), name());
00091 
00093 // MESSAGE //
00095 
00096         log << MSG::INFO << "initialize VertexCollectionSvc" << endreq;
00097 
00098         return StatusCode::SUCCESS;
00099 
00100 }
00101 
00102 //*****************************************************************************
00103 
00104 //:::::::::::::::::::::
00105 //:: METHOD finalize ::
00106 //:::::::::::::::::::::
00107 
00108 StatusCode VertexCollectionSvc::finalize(void) {
00109 
00111 // VARIABLES //
00113 
00114         MsgStream log(messageService(), name());
00115 
00117 // MESSAGE //
00119 
00120         log << MSG::INFO << "finalize VertexCollectionSvc" << endreq;
00121 
00122         return StatusCode::SUCCESS;
00123 
00124 }
00125 
00126 //*****************************************************************************
00127 
00128 //::::::::::::::::::::::::
00129 //:: METHOD setVertices ::
00130 //::::::::::::::::::::::::
00131 
00132 void VertexCollectionSvc::setVertices(const std::vector<Vertex> & vert) {
00133 
00135 // REMOVE OLD VERTICES //
00137 
00138         m_vertices.clear();
00139 
00141 // GET THE NEW VERTICES //
00143 
00144         m_vertices = vector<Vertex>(vert.size());
00145         for (unsigned int k=0; k<vert.size(); k++) {
00146                 m_vertices[k] = vert[k];
00147         }
00148 
00149         return;
00150 
00151 }
00152 
00153 //*****************************************************************************
00154 
00155 //::::::::::::::::::::::::::::::::::::::
00156 //:: METHOD sortVerticesAscendingInEt ::
00157 //::::::::::::::::::::::::::::::::::::::
00158 
00159 void VertexCollectionSvc::sortVerticesAscendingInEt(void) {
00160 
00161         sort(m_vertices.begin(), m_vertices.end());
00162         return;
00163 
00164 }
00165 
00166 //*****************************************************************************
00167 
00168 //::::::::::::::::::::::::
00169 //:: METHOD getVertices ::
00170 //::::::::::::::::::::::::
00171 
00172 const std::vector<Vertex> & VertexCollectionSvc::getVertices(void) const {
00173 
00174         return m_vertices;
00175 
00176 }

Generated on Tue Oct 21 11:50:43 2008 for NtupleAnalysis by  doxygen 1.5.1