- Timestamp:
- 08/11/10 17:59:53 (14 years ago)
- Location:
- trunk/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/Changelog
r9848 r9849 28 28 * mimage/MHillasExt.[h,cc]: 29 29 - added new data members fTimeSpread and fTimeSpreadWeighted 30 - added new data members fSlopeSpread and fSlopeSpreadWeighted (not yet used)31 - implemented code to calculate the time spreads 30 - added new data members fSlopeSpread and fSlopeSpreadWeighted 31 - implemented code to calculate the time spreads and slope spreads 32 32 - increased class version id by 1 33 33 -
trunk/Mars/mimage/MHillasExt.cc
r9845 r9849 153 153 Double_t sumxt = 0; 154 154 Double_t sumyt = 0; 155 Double_t sumxw = 0; 156 Double_t sumyw = 0; 155 157 Double_t sumtw = 0; 156 158 Double_t sumx2 = 0; … … 160 162 Double_t sumx3 = 0; 161 163 Double_t sumy3 = 0; 164 Double_t sumxw2 = 0; 165 Double_t sumyw2 = 0; 166 Double_t sumtx2 = 0; 167 Double_t sumty2 = 0; 162 168 Double_t sumtw2 = 0; 163 169 Double_t sumx2y = 0; 164 170 Double_t sumxy2 = 0; 171 Double_t sumtxw2 = 0; 172 Double_t sumtyw2 = 0; 165 173 Double_t sumt2w2 = 0; 166 174 … … 190 198 sumt2 += t*t; 191 199 192 sumtw += t*nphot;193 sumtw2 += t*nphot*nphot;194 sumt2w2 += t*t*nphot*nphot;195 196 200 sumw += nphot; 197 201 sumw2 += nphot*nphot; 202 203 sumxw += x*nphot; 204 sumyw += x*nphot; 205 sumtw += t*nphot; 206 207 sumtx2 += x*nphot*nphot; 208 sumty2 += y*nphot*nphot; 209 sumtw2 += t*nphot*nphot; 210 211 sumtxw2 += t*x*nphot*nphot; 212 sumtyw2 += t*y*nphot*nphot; 213 sumt2w2 += t*t*nphot*nphot; 198 214 199 215 sumx2 += x*x; … … 235 251 // 236 252 fTimeSpread = TMath::Sqrt(sumt2/cnt - sumt*sumt/cnt/cnt); 237 fTimeSpreadWeighted = TMath::Sqrt(sumt2w2 + sumw2*sumtw/sumw - 2*sumtw/sum2*sumtw2)/sumw;253 fTimeSpreadWeighted = TMath::Sqrt(sumt2w2 + (sumw2 - 2*sumtw2)*sumtw/sumw)/sumw; 238 254 239 255 // … … 254 270 fSlopeLong = detx==0 ? 0 : (cnt*dxt - sumt*dx)/detx; 255 271 fSlopeTrans = dety==0 ? 0 : (cnt*dyt - sumt*dy)/dety; 272 273 // 274 // Calculate time spread around longitudinal time slope 275 // 276 const Double_t sumdt = sumt - fSlopeLong*(c*sumx + s*sumy); 277 const Double_t sumdtw = sumtw - fSlopeLong*(c*sumxw + s*sumyw); 278 const Double_t sumdtw2 = sumtw2 - fSlopeLong*(c*sumxw2 + s*sumyw2); 279 const Double_t sumdt2 = sumt2 - 2*fSlopeLong*(c*sumxt + s*sumyt) + fSlopeLong*fSlopeLong * (c*c*sumx2 + s*s*sumy2 + 2*c*s*sumxy); 280 const Double_t sumdt2w2 = sumt2w2 - 2*fSlopeLong*(c*sumtxw2 + s*sumtyw2) + fSlopeLong*fSlopeLong * (c*c*sumx2 + s*s*sumy2 + 2*c*s*sumxy) * sumw2; 281 282 fSlopeSpread = TMath::Sqrt(sumdt2/cnt - sumdt*sumdt/cnt/cnt); 283 fSlopeSpreadWeighted = TMath::Sqrt(sumdt2w2 + (sumw2 - 2*sumdtw2)*sumdtw/sumw)/sumw; 256 284 257 285 //
Note:
See TracChangeset
for help on using the changeset viewer.