- Timestamp:
- 11/11/04 09:55:25 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/library/MIslandsClean.cc
r5170 r5379 144 144 Int_t MIslandsClean::Process() 145 145 { 146 //147 //eliminates the island with a signal-to-noise148 //lower than a given limit149 //150 //if ( fIslandCleaningMethod == kNoTiming ){151 146 152 147 MImgIsland *imgIsl = new MImgIsland; … … 156 151 Int_t idPix = -1; 157 152 158 if ( fIslandCleaningMethod == 1 ) { 153 //////////////////////////////////////////////////// 154 // 155 // TIME SPREAD ISLAND CLEANING 156 // eliminates the island with a time spread 157 // higher than a given limit 158 /////////////////////////////////////////////////// 159 if( fIslandCleaningMethod == 0 ){ 160 while ((imgIsl=(MImgIsland*)Next())) { 161 162 //fIslCleanThreshold has different values, FIXME, put two variables 163 if(imgIsl->GetTimeSpread() > fIslCleanThres) 164 { 165 pixNum = imgIsl->GetPixNum(); 166 167 for(Int_t k = 0; k<pixNum; k++) 168 { 169 idPix = imgIsl->GetPixList(k); 170 MCerPhotPix &pix = (*fEvt)[idPix]; 171 pix.SetPixelUnused(); 172 } 173 } 174 } 175 176 } 177 178 179 //////////////////////////////////////////////////// 180 // 181 // SIGNAL TO NOISE ISLAND CLEANING 182 // eliminates the island with a signal-to-noise 183 // lower than a given limit 184 /////////////////////////////////////////////////// 185 else if ( fIslandCleaningMethod == 1 ) { 159 186 while ((imgIsl=(MImgIsland*)Next())) { 160 187 … … 173 200 } 174 201 175 // 176 //eliminates the island with a time spread 177 //higher than a given limit 178 // 179 //else if( fIslandCleaningMethod == kTiming ){ 180 else if( fIslandCleaningMethod == 0 ){ 181 while ((imgIsl=(MImgIsland*)Next())) { 182 183 //fIslCleanThreshold has different values, FIXME, put two variables 184 if(imgIsl->GetTimeSpread() > fIslCleanThres) 202 203 //////////////////////////////////////////////////// 204 // 205 // ISLAND SIZE OVER EVENT SIZE ISLAND CLEANING 206 // eliminates the island with an island size over event size 207 // lower than a given limit 208 /////////////////////////////////////////////////// 209 else if ( fIslandCleaningMethod == 2 ) { 210 Float_t size = 0; 211 while ((imgIsl=(MImgIsland*)Next())) { 212 size += imgIsl->GetSizeIsl(); 213 } 214 215 Next.Reset(); 216 while ((imgIsl=(MImgIsland*)Next())) { 217 218 if(imgIsl->GetSizeIsl()/size < fIslCleanThres) 185 219 { 186 220 pixNum = imgIsl->GetPixNum(); … … 193 227 } 194 228 } 195 } 196 197 } 198 199 // 200 //eliminates all the islands except the continent, 201 //i.e. the larger island in the event 202 // 229 } 230 } 231 232 233 //////////////////////////////////////////////////// 234 // 235 // CONTINENT ISLAND CLEANING 236 // eliminates all the islands except the continent 237 // i.e. the larger island in the event 238 // according the number of pixels 239 /////////////////////////////////////////////////// 203 240 else if( fIslandCleaningMethod == 3 ){ 204 241 Int_t i = 0; … … 219 256 } 220 257 258 259 //////////////////////////////////////////////////// 260 // 261 // LARGER and SECOND LARGER ISLAND CLEANING 262 // eliminates all the islands except the two biggest 263 // ones according size 264 // 265 /////////////////////////////////////////////////// 266 else if( fIslandCleaningMethod == 4 ){ 267 268 Int_t i = 0; 269 Int_t islnum = fIsl->GetIslNum(); 270 Float_t islSize[islnum]; 271 Int_t islIdx[islnum]; 272 273 for (Int_t j = 0; j<islnum ; j++){ 274 islSize[j] = -1; 275 islIdx[j] = -1; 276 } 277 278 while ((imgIsl=(MImgIsland*)Next())) { 279 280 islSize[i] = imgIsl->GetSizeIsl(); 281 i++; 282 } 283 284 285 TMath::Sort(islnum, islSize, islIdx, kTRUE); 286 287 i = 0; 288 Next.Reset(); 289 while ((imgIsl=(MImgIsland*)Next())) { 290 if (islnum > 1 && islIdx[0]!=i && islIdx[1]!=i){ 291 292 //cout << "removed " << i << " isl 0" << islIdx[0] << " isl 1" << islIdx[1] << endl; 293 294 pixNum = imgIsl->GetPixNum(); 295 296 for(Int_t k = 0; k<pixNum; k++) 297 { 298 idPix = imgIsl->GetPixList(k); 299 MCerPhotPix &pix = (*fEvt)[idPix]; 300 pix.SetPixelUnused(); 301 } 302 } 303 i++; 304 } 305 } 306 307 308 309 /////////////////////////////////////////////////////// 310 // 311 // LARGER and SECOND LARGER ISLAND CLEANING II 312 // eliminates all the islands except the two biggest 313 // ones according size, if the second one almost has 314 // the 80% of the size of the biggest one 315 // 316 // 317 ////////////////////////////////////////////////////// 318 else if( fIslandCleaningMethod == 5 ){ 319 320 Int_t i = 0; 321 Int_t islnum = fIsl->GetIslNum(); 322 Float_t islSize[islnum]; 323 Int_t islIdx[islnum]; 324 325 for (Int_t j = 0; j<islnum ; j++){ 326 islSize[j] = -1; 327 islIdx[j] = -1; 328 } 329 330 while ((imgIsl=(MImgIsland*)Next())) { 331 332 islSize[i] = imgIsl->GetSizeIsl(); 333 i++; 334 } 335 336 337 TMath::Sort(islnum, islSize, islIdx, kTRUE); 338 339 i = 0; 340 Next.Reset(); 341 while ((imgIsl=(MImgIsland*)Next())) { 342 343 if (islnum > 1 && islIdx[0]!=i && islIdx[1]!=i){ 344 345 pixNum = imgIsl->GetPixNum(); 346 347 for(Int_t k = 0; k<pixNum; k++) 348 { 349 idPix = imgIsl->GetPixList(k); 350 MCerPhotPix &pix = (*fEvt)[idPix]; 351 pix.SetPixelUnused(); 352 } 353 } 354 else if(islnum>1 && islSize[islIdx[1]]<0.6*islSize[islIdx[0]]){ 355 356 pixNum = imgIsl->GetPixNum(); 357 358 for(Int_t k = 0; k<pixNum; k++) 359 { 360 idPix = imgIsl->GetPixList(k); 361 MCerPhotPix &pix = (*fEvt)[idPix]; 362 pix.SetPixelUnused(); 363 } 364 } 365 i++; 366 } 367 } 368 221 369 fEvt->SetReadyToSave(); 222 370
Note:
See TracChangeset
for help on using the changeset viewer.