Changeset 1049 for trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
- Timestamp:
- 11/07/01 12:01:27 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
r1003 r1049 17 17 ! 18 18 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de) 19 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)19 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de) 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2001 … … 31 31 // Please look at the three CleanSteps and Process // 32 32 // // 33 // FIXME: MImgCleanStd is rather slow at the moment because it loops // 34 // unnecessarily over all pixels in all its loops (s.MHillas) // 35 // The speed could be improved very much by using Hash-Tables // 36 // (linked lists, see THashTable and THashList, too) // 33 // FIXME: MImgCleanStd is not yet completely optimized for speed. // 34 // Maybe we don't have to loop over all pixels all the time... // 37 35 // // 38 36 // Input Containers: // … … 94 92 95 93 // COBB: '<=' to skip entry=noise=0 96 if (entry <= fCleanLvl1 * noise 94 if (entry <= fCleanLvl1 * noise) 97 95 pix.SetPixelUnused(); 98 96 } … … 108 106 const Int_t entries = fEvt->GetNumPixels(); 109 107 108 // 109 // In the worst case we have to loop 6 times 577 times, to 110 // catch the behaviour of all next neighbors. Here we can gain 111 // much by using an array instead of checking through all pixels 112 // (MCerPhotEvt::IsPixelUsed) all the time. 113 // 114 Byte_t ispixused[577]; 115 116 for (Int_t i=0; i<entries; i++) 117 { 118 MCerPhotPix &pix = (*fEvt)[i]; 119 ispixused[pix.GetPixId()] = pix.IsPixelUsed(); 120 } 121 110 122 for (Int_t i=0; i<entries; i++) 111 123 { … … 133 145 const Int_t nnmax = gpix.GetNumNeighbors(); 134 146 135 Int_t cnt = 0;147 Bool_t cnt = kFALSE; 136 148 for (Int_t j=0; j<nnmax; j++) 137 149 { 138 const Int_t id2 = gpix.GetNeighbor(j); //GetNN(id, in) ;139 140 if ( id2 < 0)150 const Int_t id2 = gpix.GetNeighbor(j); 151 152 if (!ispixused[id2]) 141 153 continue; 142 154 143 if (fEvt->IsPixelUsed(id2))144 cnt++;155 cnt = kTRUE; 156 break; 145 157 } 158 if (cnt) 159 continue; 146 160 147 161 // … … 149 163 // set this pixel to 'unused', too. 150 164 // 151 if (cnt==0) 152 pix.SetPixelUnused(); 165 pix.SetPixelUnused(); 153 166 } 154 167 … … 213 226 const Int_t id2 = gpix.GetNeighbor(j); 214 227 215 if (id2 <0)216 continue;217 218 228 if (!fEvt->IsPixelCore(id2)) 219 229 continue; 220 230 221 231 pix.SetPixelUsed(); 222 223 break ; 232 break; 224 233 } 225 234 }
Note:
See TracChangeset
for help on using the changeset viewer.