00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "GaudiKernel/MsgStream.h"
00015
00016
00017 #include "NtupleWriter14/VertexCollectionSvc.h"
00018
00019
00020
00021
00022
00023 using namespace std;
00024 using namespace MPIHiggsAnalysis;
00025
00026
00027
00028
00029
00030
00031
00032 VertexCollectionSvc::VertexCollectionSvc(const std::string & name,
00033 ISvcLocator * svcloc) : Service(name, svcloc) {
00034 }
00035
00036
00037
00038
00039
00040
00041
00042 VertexCollectionSvc::~VertexCollectionSvc(void) {
00043 }
00044
00045
00046
00047
00048
00049
00050
00051 const InterfaceID & VertexCollectionSvc::interfaceID() {
00052
00053 return IID_IVertexCollectionSvc;
00054
00055 }
00056
00057
00058
00059
00060
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
00080
00081
00082 StatusCode VertexCollectionSvc::initialize(void) {
00083
00084 Service::initialize();
00085
00087
00089
00090 MsgStream log(messageService(), name());
00091
00093
00095
00096 log << MSG::INFO << "initialize VertexCollectionSvc" << endreq;
00097
00098 return StatusCode::SUCCESS;
00099
00100 }
00101
00102
00103
00104
00105
00106
00107
00108 StatusCode VertexCollectionSvc::finalize(void) {
00109
00111
00113
00114 MsgStream log(messageService(), name());
00115
00117
00119
00120 log << MSG::INFO << "finalize VertexCollectionSvc" << endreq;
00121
00122 return StatusCode::SUCCESS;
00123
00124 }
00125
00126
00127
00128
00129
00130
00131
00132 void VertexCollectionSvc::setVertices(const std::vector<Vertex> & vert) {
00133
00135
00137
00138 m_vertices.clear();
00139
00141
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
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
00170
00171
00172 const std::vector<Vertex> & VertexCollectionSvc::getVertices(void) const {
00173
00174 return m_vertices;
00175
00176 }