Changeset 1460 for trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
- Timestamp:
- 07/31/02 11:27:21 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MHillasExt.cc
r1222 r1460 72 72 MHillas::Reset(); 73 73 74 fConc = 0;75 fConc1 = 0;76 fAsym = 0;77 fM3Long = 0;78 fM3Trans = 0;74 fConc = -1; 75 fConc1 = -1; 76 fAsym = 0; 77 fM3Long = 0; 78 fM3Trans = 0; 79 79 } 80 80 … … 107 107 // -------------------------------------------- 108 108 // 109 // loop to get third moments along ellipse axes and two max pixels 110 // 111 float m3x = 0; 112 float m3y = 0; 113 114 float maxpix1 = 0; // [#phot] 115 float maxpix2 = 0; // [#phot] 116 117 float maxpixx = 0; // [mm] 118 float maxpixy = 0; // [mm] 109 // loop to get third moments along ellipse axes and two max pixels 110 // 111 // For the moments double precision is used to make sure, that 112 // the complex matrix multiplication and sum is evaluated correctly. 113 // 114 Double_t m3x = 0; 115 Double_t m3y = 0; 116 117 Float_t maxpix1 = 0; // [#phot] 118 Float_t maxpix2 = 0; // [#phot] 119 120 Int_t maxpixid = 0; 119 121 120 122 const UInt_t npixevt = evt.GetNumPixels(); 123 124 const Float_t A0 = geom[0].GetA(); 121 125 122 126 for (UInt_t i=0; i<npixevt; i++) … … 127 131 128 132 const MGeomPix &gpix = geom[pix.GetPixId()]; 129 const float dx = gpix.GetX() - GetMeanX();// [mm]130 const float dy = gpix.GetY() - GetMeanY();// [mm]131 132 const float nphot = pix.GetNumPhotons();// [1]133 134 const float dzx = GetCosDelta()*dx + GetSinDelta()*dy;// [mm]135 const float dzy = -GetSinDelta()*dx + GetCosDelta()*dy;// [mm]133 const Double_t dx = gpix.GetX() - GetMeanX(); // [mm] 134 const Double_t dy = gpix.GetY() - GetMeanY(); // [mm] 135 136 Double_t nphot = pix.GetNumPhotons(); // [1] 137 138 const Double_t dzx = GetCosDelta()*dx + GetSinDelta()*dy; // [mm] 139 const Double_t dzy = -GetSinDelta()*dx + GetCosDelta()*dy; // [mm] 136 140 137 141 m3x += nphot * dzx*dzx*dzx; // [mm^3] 138 142 m3y += nphot * dzy*dzy*dzy; // [mm^3] 139 143 144 /* 145 // 146 // count number of photons in pixels at the edge of the camera 147 // 148 if (gpix.IsInOutermostRing()) 149 edgepix1 += nphot; 150 if (gpix.IsInOuterRing()) 151 edgepix2 += nphot; 152 */ 153 154 // 155 // Now we are working on absolute values of nphot, which 156 // must take pixel size into account 157 // 158 const Double_t r = A0/gpix.GetA(); 159 nphot *= r; 160 140 161 if (nphot>maxpix1) 141 162 { 142 maxpix2 = maxpix1; 143 maxpix1 = nphot; // [1] 144 maxpixx = dx + GetMeanX(); // [mm] 145 maxpixy = dy + GetMeanY(); // [mm] 163 maxpix2 = maxpix1; 164 maxpix1 = nphot; // [1] 165 maxpixid = pix.GetPixId(); 146 166 continue; // [1] 147 167 } … … 149 169 if (nphot>maxpix2) 150 170 maxpix2 = nphot; // [1] 171 172 /* 173 // 174 // get sums for calculating fAsymna 175 // the outer pixels are 4 times as big (in area) 176 // as the inner pixels ! 177 // 178 const Double_t dummy = pow(nphot, na)/r; 179 180 sna += dummy; 181 xna += dzx*dummy; 182 183 sna1 += sna/nphot; 184 xna1 += xna/nphot; 185 186 // 187 // forward-backward asymmetry 188 // 189 fb += dzx<0 ? -nphot: nphot; 190 */ 151 191 } 152 192 153 fAsym = (GetMeanX()-maxpixx)*GetCosDelta() + (GetMeanY()-maxpixy)*GetSinDelta(); // [mm] 193 const MGeomPix &maxpix = geom[maxpixid]; 194 195 fAsym = 196 (GetMeanX()*2-maxpix.GetX())*GetCosDelta() + 197 (GetMeanY()*2-maxpix.GetY())*GetSinDelta(); // [mm] 198 154 199 fConc = (maxpix1+maxpix2)/GetSize(); // [ratio] 155 200 fConc1 = maxpix1/GetSize(); // [ratio] 156 201 202 /* 203 204 // 205 // power na for calculating fAsymna; 206 // the value 1.5 was suggested by Thomas Schweizer 207 // 208 Double_t na = 1.5; 209 210 fLeakage1 = edgepix1 / GetSize(); 211 fLeakage2 = edgepix2 / GetSize(); 212 fAsym0 = fb / GetSize(); 213 214 fAsymna = na * (sna*xna1 - sna1*xna) / (sna*sna); 215 */ 216 157 217 // 158 218 // Third moments along axes get normalized … … 161 221 m3y /= GetSize(); 162 222 163 fM3Long = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3); // [mm]164 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm]223 fM3Long = m3x<0 ? -pow(-m3x, 1./3) : pow(m3x, 1./3); // [mm] 224 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm] 165 225 166 226 SetReadyToSave(); … … 169 229 } 170 230 231 /* 171 232 // ------------------------------------------------------------------------- 172 233 // … … 181 242 fin >> fM3Trans; 182 243 } 183 244 */ 184 245 // ------------------------------------------------------------------------- 185 246 /*
Note:
See TracChangeset
for help on using the changeset viewer.