00001
00002
00003
00004
00005 #ifndef VERTEX_CC
00006 #define VERTEX_CC
00007
00008 #include "vertex.hh"
00009
00010 namespace larlight {
00011
00012
00013 vertex::vertex(DATA::DATA_TYPE type) : data_base(type)
00014
00015 {
00016 if(_type!=DATA::Vertex &&
00017 _type!=DATA::FeatureVertex &&
00018 _type!=DATA::HarrisVertex) {
00019
00020 Message::send(MSG::ERROR,__FUNCTION__,
00021 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00022 _type=DATA::Vertex;
00023 }
00024
00025 clear_data();
00026
00027 }
00028
00029
00030 vertex::vertex(Double_t* xyz,
00031 Int_t id,
00032 DATA::DATA_TYPE type)
00033 : data_base(type),
00034 fID(id)
00035
00036 {
00037 if(_type!=DATA::Vertex &&
00038 _type!=DATA::FeatureVertex &&
00039 _type!=DATA::HarrisVertex) {
00040
00041 Message::send(MSG::ERROR,__FUNCTION__,
00042 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00043 _type=DATA::Vertex;
00044 }
00045
00046 fXYZ[0] = xyz[0];
00047 fXYZ[1] = xyz[1];
00048 fXYZ[2] = xyz[2];
00049 }
00050
00051
00052 void vertex::XYZ(Double_t *xyz) const
00053
00054 {
00055 xyz[0] = fXYZ[0];
00056 xyz[1] = fXYZ[1];
00057 xyz[2] = fXYZ[2];
00058 }
00059
00060
00061 void vertex::clear_data()
00062
00063 {
00064 data_base::clear_data();
00065 fXYZ[0] = DATA::INVALID_DOUBLE;
00066 fXYZ[1] = DATA::INVALID_DOUBLE;
00067 fXYZ[2] = DATA::INVALID_DOUBLE;
00068 fID = DATA::INVALID_INT;
00069 }
00070
00071
00072
00073 event_vertex::event_vertex(DATA::DATA_TYPE type) : std::vector<larlight::vertex>(),
00074 event_base(type)
00075
00076 {
00077 if(_type!=DATA::Vertex &&
00078 _type!=DATA::FeatureVertex &&
00079 _type!=DATA::HarrisVertex) {
00080
00081 Message::send(MSG::ERROR,__FUNCTION__,
00082 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00083 _type=DATA::Vertex;
00084 }
00085
00086 clear_data();
00087 }
00088
00089 }
00090
00091 #endif