00001 #include<TMuiClusterO.h> 00002 #include<TDataType.h> 00003 00004 ClassImp(TMuiClusterO) 00005 ClassImp(TMuiClusterO_v1) 00006 ClassImp(TMuiClusterO_v2) 00007 00009 TMuiClusterO_v1::TMuiClusterO_v1() : 00010 _arm(0), 00011 _plane(0), 00012 _panel(0), 00013 _orientation(0), 00014 _size(0), 00015 _index(0) 00016 { 00017 std::fill(_centroidpos,_centroidpos+POINT_SIZE,0); 00018 std::fill(_centroidsigma,_centroidsigma+POINT_SIZE,0); 00019 } 00020 00021 TMuiClusterO_v1::TMuiClusterO_v1(const Key& key, 00022 UShort_t arm, 00023 UShort_t plane, 00024 UShort_t panel, 00025 UShort_t orientation, 00026 UShort_t index) : 00027 TMuiClusterO(key), 00028 _arm(arm), 00029 _plane(plane), 00030 _panel(panel), 00031 _orientation(orientation), 00032 _size(0), 00033 _index(index) 00034 { 00035 std::fill(_centroidpos,_centroidpos+POINT_SIZE,0); 00036 std::fill(_centroidsigma,_centroidsigma+POINT_SIZE,0); 00037 } 00038 00039 00040 TMuiClusterO_v1::TMuiClusterO_v1(const TMuiClusterO* base_ptr) : 00041 TMuiClusterO(*base_ptr), 00042 _arm(base_ptr->get_arm()), 00043 _plane(base_ptr->get_plane()), 00044 _panel(base_ptr->get_panel()), 00045 _orientation(base_ptr->get_orientation()), 00046 _size(base_ptr->get_size()), 00047 _index(base_ptr->get_index()) 00048 { 00049 set_centroidpos(base_ptr->get_centroidpos()); 00050 set_centroidsigma(base_ptr->get_centroidsigma()); 00051 } 00052 00053 TMuiClusterO_v1::TMuiClusterO_v1(const TMuiClusterO& base_ref) : 00054 TMuiClusterO(base_ref), 00055 _arm(base_ref.get_arm()), 00056 _plane(base_ref.get_plane()), 00057 _panel(base_ref.get_panel()), 00058 _orientation(base_ref.get_orientation()), 00059 _size(base_ref.get_size()), 00060 _index(base_ref.get_index()) 00061 { 00062 set_centroidpos(base_ref.get_centroidpos()); 00063 set_centroidsigma(base_ref.get_centroidsigma()); 00064 } 00065 00066 void TMuiClusterO_v1::set_centroidpos(const PHPoint& point) 00067 { 00068 _centroidpos[0] = point.getX(); 00069 _centroidpos[1] = point.getY(); 00070 _centroidpos[2] = point.getZ(); 00071 } 00072 00073 void TMuiClusterO_v1::set_centroidsigma(const PHPoint& point) 00074 { 00075 _centroidsigma[0] = point.getX(); 00076 _centroidsigma[1] = point.getY(); 00077 _centroidsigma[2] = point.getZ(); 00078 } 00079 00080 PHPoint 00081 TMuiClusterO_v1::get_centroidpos() const 00082 { 00083 return PHPoint(_centroidpos[0], 00084 _centroidpos[1], 00085 _centroidpos[2]); 00086 } 00087 00088 PHPoint 00089 TMuiClusterO_v1::get_centroidsigma() const 00090 { 00091 return PHPoint(_centroidsigma[0], 00092 _centroidsigma[1], 00093 _centroidsigma[2]); 00094 } 00095 00097 TMuiClusterO_v2::TMuiClusterO_v2() : 00098 _arm(0), 00099 _plane(0), 00100 _panel(0), 00101 _orientation(0), 00102 _size(0), 00103 _index(0) 00104 { 00105 std::fill(_centroidpos,_centroidpos+POINT_SIZE,0); 00106 std::fill(_centroidsigma,_centroidsigma+POINT_SIZE,0); 00107 std::fill(_point_1,_point_1+POINT_SIZE,0); 00108 std::fill(_point_2,_point_2+POINT_SIZE,0); 00109 } 00110 00111 TMuiClusterO_v2::TMuiClusterO_v2(const Key& key, 00112 UShort_t arm, 00113 UShort_t plane, 00114 UShort_t panel, 00115 UShort_t orientation, 00116 UShort_t index) : 00117 TMuiClusterO(key), 00118 _arm(arm), 00119 _plane(plane), 00120 _panel(panel), 00121 _orientation(orientation), 00122 _size(0), 00123 _index(index) 00124 { 00125 std::fill(_centroidpos,_centroidpos+POINT_SIZE,0); 00126 std::fill(_centroidsigma,_centroidsigma+POINT_SIZE,0); 00127 std::fill(_point_1,_point_1+POINT_SIZE,0); 00128 std::fill(_point_2,_point_2+POINT_SIZE,0); 00129 } 00130 00131 00132 TMuiClusterO_v2::TMuiClusterO_v2(const TMuiClusterO* base_ptr) : 00133 TMuiClusterO(*base_ptr), 00134 _arm(base_ptr->get_arm()), 00135 _plane(base_ptr->get_plane()), 00136 _panel(base_ptr->get_panel()), 00137 _orientation(base_ptr->get_orientation()), 00138 _size(base_ptr->get_size()), 00139 _index(base_ptr->get_index()) 00140 { 00141 set_centroidpos(base_ptr->get_centroidpos()); 00142 set_centroidsigma(base_ptr->get_centroidsigma()); 00143 set_coord(PHLine(base_ptr->get_coord_begin(), 00144 base_ptr->get_coord_end())); 00145 } 00146 00147 TMuiClusterO_v2::TMuiClusterO_v2(const TMuiClusterO& base_ref) : 00148 TMuiClusterO(base_ref), 00149 _arm(base_ref.get_arm()), 00150 _plane(base_ref.get_plane()), 00151 _panel(base_ref.get_panel()), 00152 _orientation(base_ref.get_orientation()), 00153 _size(base_ref.get_size()), 00154 _index(base_ref.get_index()) 00155 { 00156 set_centroidpos(base_ref.get_centroidpos()); 00157 set_centroidsigma(base_ref.get_centroidsigma()); 00158 set_coord(PHLine(base_ref.get_coord_begin(), 00159 base_ref.get_coord_end())); 00160 } 00161 00162 void TMuiClusterO_v2::set_centroidpos(const PHPoint& point) 00163 { 00164 _centroidpos[0] = point.getX(); 00165 _centroidpos[1] = point.getY(); 00166 _centroidpos[2] = point.getZ(); 00167 } 00168 00169 void TMuiClusterO_v2::set_centroidsigma(const PHPoint& point) 00170 { 00171 _centroidsigma[0] = point.getX(); 00172 _centroidsigma[1] = point.getY(); 00173 _centroidsigma[2] = point.getZ(); 00174 } 00175 00176 PHPoint 00177 TMuiClusterO_v2::get_centroidpos() const 00178 { 00179 return PHPoint(_centroidpos[0], 00180 _centroidpos[1], 00181 _centroidpos[2]); 00182 } 00183 00184 PHPoint 00185 TMuiClusterO_v2::get_centroidsigma() const 00186 { 00187 return PHPoint(_centroidsigma[0], 00188 _centroidsigma[1], 00189 _centroidsigma[2]); 00190 } 00191 00192 PHLine TMuiClusterO_v2::get_coord() const 00193 { 00194 return PHLine(PHPoint(_point_1[0], 00195 _point_1[1], 00196 _point_1[2]), 00197 PHPoint(_point_2[0], 00198 _point_2[1], 00199 _point_2[2])); 00200 return PHLine(); 00201 } 00202 00203 PHPoint TMuiClusterO_v2::get_coord_end() const 00204 { 00205 return PHPoint(_point_2[0], 00206 _point_2[1], 00207 _point_2[2]); 00208 } 00209 00210 PHPoint TMuiClusterO_v2::get_coord_begin() const 00211 { 00212 return PHPoint(_point_1[0], 00213 _point_1[1], 00214 _point_1[2]); 00215 } 00216 00217 void TMuiClusterO_v2::set_coord(const PHLine& line) 00218 { 00219 _point_1[0] = line.getBasepoint().getX(); 00220 _point_1[1] = line.getBasepoint().getY(); 00221 _point_1[2] = line.getBasepoint().getZ(); 00222 _point_2[0] = _point_1[0] + line.getDirection().getX(); 00223 _point_2[1] = _point_1[1] + line.getDirection().getY(); 00224 _point_2[2] = _point_1[2] + line.getDirection().getZ(); 00225 } 00226 00227 void TMuiClusterO_v2::set_coord_end(const PHPoint& point) 00228 { 00229 _point_2[0] = point.getX(); 00230 _point_2[1] = point.getY(); 00231 _point_2[2] = point.getZ(); 00232 } 00233 00234 void TMuiClusterO_v2::set_coord_begin(const PHPoint& point) 00235 { 00236 _point_1[0] = point.getX(); 00237 _point_1[1] = point.getY(); 00238 _point_1[2] = point.getZ(); 00239 }