Ignore:
Timestamp:
02/21/01 14:41:54 (24 years ago)
Author:
harald
Message:
implemented the Image Cleaning a la CT1 to the class MCerPhotEvt

changed the readCT1.C file to show the effects of the image cleaning
a la CT1
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r601 r603  
    1818  fPixId    = pix ;
    1919  fIsUsed   = kTRUE ;
     20  fIsCore   = kFALSE ;
    2021  fPhot     = phot ;
    2122  fErrPhot  = errphot ;
     
    2627  fPixId    = pix ;
    2728  fIsUsed   = kTRUE ;
     29  fIsUsed   = kFALSE ;
    2830  fPhot     = phot ;
    2931  fErrPhot  = errphot ;
     
    4143      cout << " UnUsed " ;
    4244
     45  if ( fIsCore == kTRUE )
     46    cout << "   Core " ;
     47  else
     48    if ( fIsCore == kFALSE )
     49      cout << "        " ;
     50
    4351  cout << "  Nphot= " << fPhot
    4452       << "  Error(Nphot) = " << fErrPhot
     
    127135    {
    128136      entry = ((MCerPhotPix *) fPixels->At(il))->GetPhotons() ;
    129       noise =  3 * ((MCerPhotPix *) fPixels->At(il))->GetErrorPhot() ;
     137      noise = ((MCerPhotPix *) fPixels->At(il))->GetErrorPhot() ;
    130138     
    131139      if (entry < 3 * noise )
     
    154162            id2 = fNN->GetNN(id, in ) ;
    155163           
    156             if ( PixelIsUsed(id2) == kTRUE )
    157               cout << " hulibu " << id << "/" << id2 << endl ; 
    158            
    159            
     164            if (id2 >=0 ) {
     165              if ( PixelIsUsed(id2) == kTRUE )
     166                itest++ ;
     167            }   
     168          }
     169         
     170          //
     171          //   check if no neighbor, then set unused
     172          //
     173          if ( itest == 0 )
     174            {
     175              ((MCerPhotPix *) fPixels->At(il))->SetPixelUnused() ;
     176            }
     177
     178        }
     179    }
     180 
     181  // now we declare all pixels that survive as CorePixels
     182 
     183  for (Int_t il=0; il<fPixels->GetEntries(); il++ )
     184    {
     185      if ( ((MCerPhotPix *) fPixels->At(il))->IsPixelUsed() == kTRUE )
     186        {
     187          ((MCerPhotPix *) fPixels->At(il))->SetCorePixel() ;
     188        }
     189    }
     190
     191}
     192
     193void MCerPhotEvt::CleanLevel3()
     194{
     195  //   Look for the boundary pixels around the core pixels
     196  //   if a pixel has more than 2.5 sigma, and a core neigbor
     197  //   it is declared as used.
     198 
     199  Float_t entry, noise ;
     200  Int_t   id, id2 ;
     201  for (Int_t il=0; il<fPixels->GetEntries(); il++ )
     202    {
     203      if ( ((MCerPhotPix *) fPixels->At(il))->IsCorePixel() == kFALSE )
     204        { 
     205          entry = ((MCerPhotPix *) fPixels->At(il))->GetPhotons() ;
     206          noise = ((MCerPhotPix *) fPixels->At(il))->GetErrorPhot() ;
     207     
     208          if (entry > 2.5 * noise ) {
     209            id = ((MCerPhotPix *) fPixels->At(il))->GetPixId()  ;
     210            for (Int_t in=0 ; in < 6 ; in++ )
     211              {
     212                id2 = fNN->GetNN(id, in ) ;
     213                if (id2 >=0 )
     214                  {
     215                    if ( PixelIsCore(id2) == kTRUE ) {
     216                      ((MCerPhotPix *) fPixels->At(il))->SetPixelUsed() ;
     217                      break ;
     218                    }
     219                  }
     220              }
    160221          }
    161222        }
     
    163224}
    164225
     226
     227
     228
    165229Bool_t MCerPhotEvt::PixelExist(Int_t id )
    166230{
     
    171235      if ( id == ((MCerPhotPix *) fPixels->At(il))->GetPixId() ) {
    172236       
    173         cout << " PixelExist " << il ;
     237        // cout << " PixelExist " << il ;
    174238        return kTRUE ;
    175239      }
     
    189253           ((MCerPhotPix *) fPixels->At(il))->IsPixelUsed() == kTRUE ) {
    190254       
    191         cout << " PixelIsUsed  " << il ;
     255        // cout << " PixelIsUsed  " << il ;
     256        return kTRUE ;
     257      }
     258    }
     259
     260  return kFALSE ;
     261
     262}
     263
     264Bool_t MCerPhotEvt::PixelIsCore(Int_t id )
     265{
     266  //   Checks if in the pixel list is an entry with pixel id
     267 
     268  for (Int_t il=0; il<fPixels->GetEntries(); il++ )
     269    {
     270      if ( id == ((MCerPhotPix *) fPixels->At(il))->GetPixId() &&
     271           ((MCerPhotPix *) fPixels->At(il))->IsCorePixel() == kTRUE ) {
     272       
    192273        return kTRUE ;
    193274      }
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r601 r603  
    1818  Int_t    fPixId     ;  //   the pixel Id
    1919  Bool_t   fIsUsed    ;  //   the pixel is used for calculations --> kTRUE
     20  Bool_t   fIsCore    ;  //   the pixel is a Core pixel          --> kTRUE
    2021  Float_t  fPhot      ;  //   The number of Cerenkov photons
    2122  Float_t  fErrPhot   ;  //   the error of fPhot
     
    5960    } 
    6061 
     62  void SetCorePixel()
     63    {
     64      fIsCore = kTRUE ;
     65    }
     66
     67  Bool_t IsCorePixel()
     68    {
     69      return fIsCore ;
     70    } 
    6171 
    6272 
     
    96106  void CleanLevel1() ;
    97107  void CleanLevel2() ;
     108  void CleanLevel3() ;
    98109 
    99110  Bool_t PixelExist( Int_t id ) ;
    100111  Bool_t PixelIsUsed( Int_t id ) ;
     112  Bool_t PixelIsCore( Int_t id ) ;
    101113 
    102114  Int_t GetPixelId(Int_t i ) ;
Note: See TracChangeset for help on using the changeset viewer.