Changeset 9845 for trunk/Mars
- Timestamp:
- 08/11/10 17:05:32 (14 years ago)
- Location:
- trunk/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/Changelog
r9829 r9845 26 26 - improved/fixed error calculation/display 27 27 28 * mimage/MHillasExt.[h,cc]: 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 32 - increased class version id by 1 33 28 34 29 35 -
trunk/Mars/NEWS
r9822 r9845 51 51 ns anymore, but in ns/deg. This means that the values for MAGIC 52 52 have to be scaled by a factor of 10. 53 54 * Star now calculates new timing parameters, namely: 55 56 ** MHillasExt.fTimeSpread: 57 This is the time spread (rms) around the mean of the arrival times. 58 It is calulated as 59 <math>\sqrt{\sum{t_i}/n}</math> 60 ** MHillasExt.fTimeSpreadWeighted: 61 This is the weighted time spread (rms) around the weighted mean of the arrival times. 62 It is calulated as 63 <math>\frac{1}{\sum{n_i}}\sqrt{\sum{n_i^2(t_i-<wt>)^2}}}</math> 64 or 65 <math>\frac{1}{\sum{n_i}}\sqrt{\sum{n_i^2t_i^2}+<wt>^2\sum{n_i^2}-2<wt>\sum{t_in_i^2}}</math> 53 66 54 67 ;trainenergy.C: -
trunk/Mars/mimage/MHillasExt.cc
r9369 r9845 20 20 ! Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-20 0722 ! Copyright: MAGIC Software Development, 2000-2010 23 23 ! 24 24 ! … … 56 56 // fSlopeLong added 57 57 // fSlopeTrans added 58 // 59 // Version 5: 60 // ---------- 61 // fTimeSpread added 62 // fTimeSpreadWeighted added 63 // 64 // fSlopeSpread added 65 // fSlopeSpreadWeighted added 58 66 // 59 67 // … … 138 146 UInt_t cnt = 0; 139 147 140 Double_t sumx = 0; 141 Double_t sumy = 0; 142 Double_t sumt = 0; 143 Double_t sumxy = 0; 144 Double_t sumxt = 0; 145 Double_t sumyt = 0; 146 Double_t sumx2 = 0; 147 Double_t sumy2 = 0; 148 Double_t sumx3 = 0; 149 Double_t sumy3 = 0; 150 Double_t sumx2y = 0; 151 Double_t sumxy2 = 0; 148 Double_t sumx = 0; 149 Double_t sumy = 0; 150 Double_t sumt = 0; 151 Double_t sumw = 0; 152 Double_t sumxy = 0; 153 Double_t sumxt = 0; 154 Double_t sumyt = 0; 155 Double_t sumtw = 0; 156 Double_t sumx2 = 0; 157 Double_t sumy2 = 0; 158 Double_t sumw2 = 0; 159 Double_t sumt2 = 0; 160 Double_t sumx3 = 0; 161 Double_t sumy3 = 0; 162 Double_t sumtw2 = 0; 163 Double_t sumx2y = 0; 164 Double_t sumxy2 = 0; 165 Double_t sumt2w2 = 0; 152 166 153 167 const UInt_t npix = evt.GetNumPixels(); … … 167 181 const Double_t t = pix.GetArrivalTime(); 168 182 183 Double_t nphot = pix.GetNumPhotons(); // [1] 184 169 185 // --- time slope ---- 170 sumx += x; 171 sumy += y; 172 sumt += t; 186 sumx += x; 187 sumy += y; 188 189 sumt += t; 190 sumt2 += t*t; 191 192 sumtw += t*nphot; 193 sumtw2 += t*nphot*nphot; 194 sumt2w2 += t*t*nphot*nphot; 195 196 sumw += nphot; 197 sumw2 += nphot*nphot; 173 198 174 199 sumx2 += x*x; … … 181 206 const Double_t dx = x - hil.GetMeanX(); // [mm] 182 207 const Double_t dy = y - hil.GetMeanY(); // [mm] 183 184 Double_t nphot = pix.GetNumPhotons(); // [1]185 208 186 209 sumx3 += nphot * dx*dx*dx; … … 209 232 210 233 // 234 // Time spread 235 // 236 fTimeSpread = TMath::Sqrt(sumt2/cnt - sumt*sumt/cnt/cnt); 237 fTimeSpreadWeighted = TMath::Sqrt(sumt2w2 + sumw2*sumtw/sumw - 2*sumtw/sum2*sumtw2)/sumw; 238 239 // 211 240 // Time slope 212 241 // … … 225 254 fSlopeLong = detx==0 ? 0 : (cnt*dxt - sumt*dx)/detx; 226 255 fSlopeTrans = dety==0 ? 0 : (cnt*dyt - sumt*dy)/dety; 256 257 // 258 // FIXME: Missing Time spread along slope 259 // 227 260 228 261 // -
trunk/Mars/mimage/MHillasExt.h
r8619 r9845 20 20 Float_t fM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 21 21 22 Float_t fSlopeLong; 23 Float_t fSlopeTrans; 22 Float_t fSlopeLong; // [ns/mm] Slope of the arrival time along the major axis 23 Float_t fSlopeTrans; // [ns/mm] Slope of the arrival time along the minor axis 24 25 // FIXME: We could try to use the Medians! 26 Float_t fTimeSpread; // [ns] Spread (RMS) of the arrival times around the mean arrival time 27 Float_t fTimeSpreadWeighted; // [ns] Weighted spread (RMS) of the arrival times around the weighted mean arrival time 28 29 Float_t fSlopeSpread; // [ns] Spread (RMS) of the arrival time around the slope along the major axis 30 Float_t fSlopeSpreadWeighted; // [ns] Weighted spread (RMS) of the arrival time around the slope along the major axis 24 31 25 32 public: … … 28 35 void Reset(); 29 36 30 Float_t GetAsym() const { return fAsym; } 31 Float_t GetM3Long() const { return fM3Long; } 32 Float_t GetM3Trans() const { return fM3Trans; } 33 Float_t GetSlopeLong() const { return fSlopeLong; } 34 Float_t GetSlopeTrans() const { return fSlopeTrans; } 37 Float_t GetAsym() const { return fAsym; } 38 Float_t GetM3Long() const { return fM3Long; } 39 Float_t GetM3Trans() const { return fM3Trans; } 40 Float_t GetSlopeLong() const { return fSlopeLong; } 41 Float_t GetSlopeTrans() const { return fSlopeTrans; } 42 Float_t GetTimeSpread() const { return fTimeSpread; } 43 Float_t GetTimeSpreadWeighted() const { return fTimeSpreadWeighted; } 35 44 36 45 Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, … … 44 53 void Set(const TArrayF &arr); 45 54 46 ClassDef(MHillasExt, 4) // Storage Container for extended Hillas Parameter55 ClassDef(MHillasExt, 5) // Storage Container for extended Hillas Parameter 47 56 }; 48 57 #endif
Note:
See TracChangeset
for help on using the changeset viewer.