Changeset 3060 in Sophya for trunk/SophyaLib/HiStats
- Timestamp:
- Aug 13, 2006, 3:20:02 PM (19 years ago)
- Location:
- trunk/SophyaLib/HiStats
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/HiStats/histos.cc
r3057 r3060 1 1 // 2 // $Id: histos.cc,v 1.2 4 2006-08-12 22:41:08cmv Exp $2 // $Id: histos.cc,v 1.25 2006-08-13 13:20:01 cmv Exp $ 3 3 // 4 4 -
trunk/SophyaLib/HiStats/histos.h
r3057 r3060 1 1 // This may look like C code, but it is really -*- C++ -*- 2 2 // 3 // $Id: histos.h,v 1.2 4 2006-08-12 22:41:08cmv Exp $3 // $Id: histos.h,v 1.25 2006-08-13 13:20:02 cmv Exp $ 4 4 // 5 5 -
trunk/SophyaLib/HiStats/histos2.cc
r3057 r3060 96 96 97 97 mHprojx = mHprojy = NULL; 98 if(h.mHprojx) { 99 SetProjX(); 100 *mHprojx = *(h.mHprojx); 101 } 102 if(h.mHprojy) { 103 SetProjY(); 104 *mHprojy = *(h.mHprojy); 105 } 106 107 int_4 nb; 108 r_8 min,max; 98 if(h.mHprojx) {SetProjX(); *mHprojx = *(h.mHprojx);} 99 if(h.mHprojy) {SetProjY(); *mHprojy = *(h.mHprojy);} 100 101 int_4 nb; r_8 min,max; 109 102 nb = h.NSliX(); 110 if(nb>0) { 111 SetSliX(nb); 112 for(i=0; i<NSliX();i++) *HSliX(i) = *(h.HSliX(i)); 113 } 103 if(nb>0) {SetSliX(nb); for(i=0;i<NSliX();i++) *HSliX(i)=*(h.HSliX(i));} 114 104 nb = h.NSliY(); 115 if(nb>0) { 116 SetSliY(nb); 117 for(i=0; i<NSliY();i++) *HSliY(i) = *(h.HSliY(i)); 118 } 105 if(nb>0) {SetSliY(nb); for(i=0;i<NSliY();i++) *HSliY(i)=*(h.HSliY(i));} 119 106 120 107 nb = h.NBandX(); 121 108 if(nb>0) { 122 for(i=0; i<nb;i++) { 123 h.GetBandX(i,min,max); 124 SetBandX(min,max); 125 *HBandX(i) = *(h.HBandX(i)); 126 } 127 for(i=0; i<NBandX();i++) *HBandX(i) = *(h.HBandX(i)); 109 for(i=0;i<nb;i++) 110 {h.GetBandX(i,min,max); SetBandX(min,max); *HBandX(i)=*(h.HBandX(i));} 111 for(i=0;i<NBandX();i++) *HBandX(i) = *(h.HBandX(i)); 128 112 } 129 113 nb = h.NBandY(); 130 114 if(nb>0) { 131 for(i=0; i<nb;i++) { 132 h.GetBandY(i,min,max); 133 SetBandY(min,max); 134 *HBandY(i) = *(h.HBandY(i)); 135 } 115 for(i=0;i<nb;i++) 116 {h.GetBandY(i,min,max); SetBandY(min,max); *HBandY(i)=*(h.HBandY(i));} 136 117 for(i=0; i<NBandY();i++) *HBandY(i) = *(h.HBandY(i)); 137 118 } … … 166 147 for(int_4 i=0;i<3;i++) for(int_4 j=0;j<3;j++) mOver[i][j]=0.; 167 148 mB_s.H = NULL; 149 150 DelProjX(); DelProjY(); 151 DelBandX(); DelBandY(); 152 DelSliX(); DelSliY(); 168 153 } 169 154 … … 177 162 178 163 DelProj(); 179 180 DelBandX(); 181 DelBandY(); 182 183 DelSliX(); 184 DelSliY(); 164 DelBandX(); DelBandY(); 165 DelSliX(); DelSliY(); 185 166 186 167 nHist = 0; … … 208 189 ZeroProj(); 209 190 210 ZeroBandX(); 211 ZeroBandY(); 212 213 ZeroSliX(); 214 ZeroSliY(); 191 ZeroBandX(); ZeroBandY(); 192 193 ZeroSliX(); ZeroSliY(); 215 194 } 216 195 … … 242 221 nHist = h.nHist; nEntries = h.nEntries; 243 222 244 DelProjX(); 245 if(h.mHprojx) { 246 SetProjX(); 247 *mHprojx = *(h.mHprojx); 248 } 249 DelProjY(); 250 if(h.mHprojy) { 251 SetProjY(); 252 *mHprojy = *(h.mHprojy); 253 } 223 if(h.mHprojx) {SetProjX(); *mHprojx = *(h.mHprojx);} 224 if(h.mHprojy) {SetProjY(); *mHprojy = *(h.mHprojy);} 254 225 255 226 int_4 nb; 256 DelSliX();257 227 nb = h.NSliX(); 258 228 if(nb>0) { … … 260 230 for(int i=0; i<NSliX();i++) *HSliX(i) = *(h.HSliX(i)); 261 231 } 262 DelSliY();263 232 nb = h.NSliY(); 264 233 if(nb>0) { … … 267 236 } 268 237 269 DelBandX();270 238 nb = h.NBandX(); 271 239 if(nb>0) { … … 278 246 for(int i=0; i<NBandX();i++) *HBandX(i) = *(h.HBandX(i)); 279 247 } 280 DelBandY();281 248 nb = h.NBandY(); 282 249 if(nb>0) { … … 1063 1030 if( mHprojx != NULL ) DelProjX(); 1064 1031 mHprojx = new Histo(mXmin,mXmax,mNx); 1065 if( mErr2 != NULL && mHprojx != NULL) mHprojx->Errors();1032 if(mErr2 && mHprojx) mHprojx->Errors(); 1066 1033 } 1067 1034 … … 1073 1040 if( mHprojy != NULL ) DelProjY(); 1074 1041 mHprojy = new Histo(mYmin,mYmax,mNy); 1075 if( mErr2 != NULL && mHprojy != NULL) mHprojy->Errors();1042 if(mErr2 && mHprojy) mHprojy->Errors(); 1076 1043 } 1077 1044 … … 1164 1131 mB_s.max = ybmax; 1165 1132 mB_s.H = new Histo(mXmin,mXmax,mNx); 1133 if(mErr2 && mB_s.H) mB_s.H->Errors(); 1166 1134 mLBandx.push_back(mB_s); 1167 1135 mB_s.H = NULL; … … 1178 1146 mB_s.max = xbmax; 1179 1147 mB_s.H = new Histo(mYmin,mYmax,mNy); 1148 if(mErr2 && mB_s.H) mB_s.H->Errors(); 1180 1149 mLBandy.push_back(mB_s); 1181 1150 mB_s.H = NULL; … … 1317 1286 mB_s.max = mB_s.min + w; 1318 1287 mB_s.H = new Histo(mXmin,mXmax,mNx); 1288 if(mErr2 && mB_s.H) mB_s.H->Errors(); 1319 1289 mLSlix.push_back(mB_s); 1320 1290 mB_s.H = NULL; … … 1338 1308 mB_s.max = mB_s.min + w; 1339 1309 mB_s.H = new Histo(mYmin,mYmax,mNy); 1310 if(mErr2 && mB_s.H) mB_s.H->Errors(); 1340 1311 mLSliy.push_back(mB_s); 1341 1312 mB_s.H = NULL; … … 1410 1381 if( (*i).num == n ) return (*i).H; 1411 1382 return NULL; 1383 } 1384 1385 /*! 1386 Retourne les limites de la bande equidistante numero `n' selon X. 1387 */ 1388 void Histo2D::GetSliX(int_4 n,r_8& ybmin,r_8& ybmax) const 1389 { 1390 ybmin = 0.; ybmax = 0.; 1391 if( mLSlix.size() <= 0 || n < 0 || n >= (int_4) mLSlix.size() ) return; 1392 for(list<bande_slice>::const_iterator i = mLSlix.begin(); i != mLSlix.end(); i++) 1393 if( (*i).num == n ) { ybmin = (*i).min; ybmax = (*i).max; return;} 1394 return; 1395 } 1396 1397 /*! 1398 Retourne les limites de la bande equidistante numero `n' selon Y. 1399 */ 1400 void Histo2D::GetSliY(int_4 n,r_8& xbmin,r_8& xbmax) const 1401 { 1402 xbmin = 0.; xbmax = 0.; 1403 if( mLSliy.size() <= 0 || n < 0 || n >= (int_4) mLSliy.size() ) return; 1404 for(list<bande_slice>::const_iterator i = mLSliy.begin(); i != mLSliy.end(); i++) 1405 if( (*i).num == n ) { xbmin = (*i).min; xbmax = (*i).max; return;} 1406 return; 1412 1407 } 1413 1408 -
trunk/SophyaLib/HiStats/histos2.h
r3053 r3060 195 195 Histo* HSliX(int_4 n) const; 196 196 Histo* HSliY(int_4 n) const; 197 void GetSliX(int_4 n,r_8& ybmin,r_8& ybmax) const; 198 void GetSliY(int_4 n,r_8& xbmin,r_8& xbmax) const; 197 199 void ShowSli(int_4 lp = 0) const; 198 200
Note:
See TracChangeset
for help on using the changeset viewer.