Changeset 2756
- Timestamp:
- 01/07/04 18:47:54 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2755 r2756 10 10 TSpline5 Root Class to interpolate the Fadc Slices. The time is 11 11 the abscissa value of the absolute maximum of the interpolation 12 - added new method to find clusters with similar arrival times. 13 For now it's a preliminary version. It simply search for adiacent 14 pixels having the same arrival time (color). 12 15 13 16 * manalysis/MArrivalTimeCalc.[h,cc] -
trunk/MagicSoft/Mars/manalysis/MArrivalTime.cc
r2754 r2756 33 33 34 34 #include "MGeomCam.h" 35 #include "MGeomPix.h" 35 36 36 37 #include "MLog.h" … … 140 141 } 141 142 142 143 // ------------------------------------------------------------------------- 144 // 145 // Finds the clusters with similar Arrival Time 146 // 147 // PRELIMINARY!! For now the Arrival Time is not the one calculated with 148 // the splines, but it's the Max Slice Idx 149 // 150 // TEST!! This method is used only for test. Do not use it until 151 // it becomes stable 152 // 153 154 void MArrivalTime::EvalClusters(const MRawEvtData &evt, const MGeomCam &geom) 155 { 156 const Int_t n = geom.GetNumPixels(); 157 158 fData2.Set(n); 159 fData2.Reset(-1); 160 fData3.Set(n); 161 fData3.Reset(-1); 162 fData4.Set(n); 163 fData4.Reset(-1); 164 fData5.Set(n); 165 fData5.Reset(-1); 166 167 MRawEvtPixelIter pixel((MRawEvtData*)&evt); 168 169 // Array that says if a pixel has been already checked or not 170 171 for (Int_t i = 0; i < n; i++) 172 fPixelChecked[i] = kFALSE; 173 174 // This fakeData array will be subsituted with the fData Array. 175 fakeData.Set(n); 176 fakeData.Reset(); 177 178 while ( pixel.Next() ) 179 { 180 fakeData[pixel.GetPixelId()]=pixel.GetIdxMaxHiLoGainSample(); 181 } 182 // End of fakeData preparation 183 184 // Max dimension of cluster 185 Short_t dimCluster; 186 187 while ( pixel.Next() ) 188 { 189 if (!fPixelChecked[pixel.GetPixelId()]) 190 { 191 dimCluster = 0; 192 fCluster.Set(n); 193 fCluster.Reset(-1); 194 fCluster[dimCluster]=pixel.GetPixelId(); 195 dimCluster++; 196 197 CheckNeighbours(evt,geom, 198 pixel.GetPixelId(), &dimCluster); 199 200 if (dimCluster > 4) 201 { 202 for (Int_t i = 0; i < dimCluster; i++) 203 fData5[fCluster[i]]=fakeData[fCluster[i]]; 204 } 205 if (dimCluster > 3) 206 { 207 for (Int_t i = 0; i < dimCluster; i++) 208 fData4[fCluster[i]]=fakeData[fCluster[i]]; 209 } 210 if (dimCluster > 2) 211 { 212 for (Int_t i = 0; i < dimCluster; i++) 213 fData3[fCluster[i]]=fakeData[fCluster[i]]; 214 } 215 if (dimCluster > 1) 216 { 217 for (Int_t i = 0; i < dimCluster; i++) 218 fData2[fCluster[i]]=fakeData[fCluster[i]]; 219 } 220 } 221 } 222 223 } 224 225 // -------------------------------------------------------------------------- 226 // 227 // Function to check the nearest neighbour pixels arrivaltime 228 // 229 230 void MArrivalTime::CheckNeighbours(const MRawEvtData &evt, const MGeomCam &geom, 231 Short_t idx, Short_t *dimCluster) 232 { 233 Byte_t numNeighbors=geom[idx].GetNumNeighbors(); 234 fPixelChecked[idx] = kTRUE; 235 236 for (Byte_t i=0x00; i < numNeighbors; i++) 237 { 238 239 if (!fPixelChecked[geom[idx].GetNeighbor(i)] && 240 fakeData[idx] == fakeData[geom[idx].GetNeighbor(i)]) 241 { 242 fCluster[*dimCluster]=geom[idx].GetNeighbor(i); 243 *dimCluster++; 244 CheckNeighbours(evt, geom, 245 geom[idx].GetNeighbor(i), dimCluster); 246 } 247 } 248 } 143 249 // -------------------------------------------------------------------------- 144 250 // … … 151 257 return kFALSE; 152 258 153 val = fData[idx]; 259 switch (type) 260 { 261 case 0: 262 case 1: 263 val = fData[idx]; 264 break; 265 case 2: 266 val = fData2[idx]; 267 break; 268 case 3: 269 val = fData3[idx]; 270 break; 271 case 4: 272 val = fData4[idx]; 273 break; 274 case 5: 275 val = fData5[idx]; 276 break; 277 } 278 154 279 return kTRUE; 155 280 } -
trunk/MagicSoft/Mars/manalysis/MArrivalTime.h
r2752 r2756 4 4 #ifndef ROOT_TArrayF 5 5 #include <TArrayF.h> 6 #endif 7 #ifndef ROOT_TArrayS 8 #include <TArrayS.h> 6 9 #endif 7 10 #ifndef ROOT_TSpline … … 12 15 #endif 13 16 14 class MGeom Cam;17 class MGeomPix; 15 18 class MRawEvtData; 16 19 class MRawEvtPixelIter; … … 20 23 private: 21 24 TArrayF fData; // Stores the arrival times 25 26 TArrayF fData2; // Clusters with at most 2 pix 27 TArrayF fData3; // Clusters with at most 3 pix 28 TArrayF fData4; // Clusters with at most 4 pix 29 TArrayF fData5; // Clusters with at most 5 pix 22 30 31 Bool_t *fPixelChecked; // For each pixel says if it's already been checked 32 TArrayS fCluster; // Idxs of the pixels in the current cluster 33 TArrayS fakeData; //Test purpose 23 34 public: 24 35 MArrivalTime(const char *name=NULL, const char *title=NULL); … … 28 39 29 40 void Calc(const MRawEvtData &evt, const MGeomCam &geom); // Calculates arrival times 41 42 void MArrivalTime::EvalClusters(const MRawEvtData &evt, const MGeomCam &geom); 43 44 void MArrivalTime::CheckNeighbours(const MRawEvtData &evt, const MGeomCam &geom, 45 Short_t idx, Short_t *dimCluster); 30 46 31 47 const TArrayF &GetData() const { return fData; }
Note:
See TracChangeset
for help on using the changeset viewer.