Ignore:
Timestamp:
08/04/04 11:18:07 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r4444 r4450  
    1717!
    1818!   Author(s): Thomas Bretz, 10/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    19 !             Hendrik Bartko, 08/2004 <mailto:hbartko@mppmu.mpg.de>
    20 !
    21 !   Copyright: MAGIC Software Development, 2000-2003
     19!   Author(s): Hendrik Bartko, 08/2004 <mailto:hbartko@mppmu.mpg.de>
     20!
     21!   Copyright: MAGIC Software Development, 2000-2004
    2222!
    2323!
     
    2727//
    2828// MCameraData
     29//
     30// This is a generalized class storing camera data. For example the cleaning
     31// level for the image cleaning is one possibility.
    2932//
    3033/////////////////////////////////////////////////////////////////////////////
     
    5659{
    5760    fName  = name  ? name  : "MCameraData";
    58     fTitle = title ? title : "Photons/PedRMS Information";
     61    fTitle = title ? title : "Generalized storage container for camera contents";
    5962}
    6063
     
    9194// scales with the inverse square root of the pixel area.
    9295//
    93 
     96// FIXME: Should the check noise<=0 be replaced by MBadPixels?
     97//
    9498void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MPedPhotCam &cam,
    9599                                    const MGeomCam &geom)
     
    138142// inner and outer pixels into account.
    139143//
    140 
     144// FIXME: Should the check noise<=0 be replaced by MBadPixels?
     145//
    141146void MCameraData::CalcCleaningLevel2(const MCerPhotEvt &evt, const MPedPhotCam &cam,
    142                                     const MGeomCam &geom)
    143 {
    144     const Int_t n = geom.GetNumPixels();
    145 
    146     fData.Set(n);
    147     fData.Reset();
    148 
    149     fValidity.Set(n);
    150     fValidity.Reset();
    151 
    152     const Int_t entries = evt.GetNumPixels();
    153 
    154     const Float_t meannoise[2] = {cam.GetArea(0).GetRms(), cam.GetArea(1).GetRms()} ; // mean noise for the inner and the outer pixels
    155 
    156     //
    157     // check the number of all pixels against the noise level and
    158     // set them to 'unused' state if necessary
    159     //
    160     for (Int_t i=0; i<entries; i++)
    161     {
    162         const MCerPhotPix &pix = evt[i];
    163 
    164         const Int_t idx = pix.GetPixId();
    165         const Float_t noise = cam[idx].GetRms();
     147                                     const MGeomCam &geom)
     148{
     149    const Int_t n = geom.GetNumPixels();
     150
     151    fData.Set(n);
     152    fData.Reset();
     153
     154    fValidity.Set(n);
     155    fValidity.Reset();
     156
     157    const Int_t entries   = evt.GetNumPixels();
     158    const Float_t anoise0 = cam.GetArea(0).GetRms();
     159    if (anoise0<=0)
     160        return;
     161
     162    //
     163    // check the number of all pixels against the noise level and
     164    // set them to 'unused' state if necessary
     165    //
     166    for (Int_t i=0; i<entries; i++)
     167    {
     168        const MCerPhotPix &pix = evt[i];
     169
     170        const Int_t   idx   = pix.GetPixId();
     171        const Float_t noide = cam[idx].GetRms();
    166172
    167173        if (noise<=0) // fData[idx]=0, fValidity[idx]=0
     
    174180        // with the square root of the pixel area.
    175181        //
    176 
    177         const UInt_t aidx = geom[idx].GetAidx();
    178 
    179 
    180         if (meannoise[0] > 0 && meannoise[1] > 0) 
    181         {
    182           fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) * meannoise[aidx] / meannoise[0] / noise;
    183          
    184         }
    185         else fData[idx] = pix.GetNumPhotons() * geom.GetPixRatioSqrt(idx) / noise;
    186 
     182        const UInt_t  aidx  = geom[idx].GetAidx();
     183        const Float_t ratio = cam.GetArea(aidx).GetRms()/noise0;
     184
     185        fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) * ratio / noise;
    187186        fValidity[idx] = 1;
    188187    }
     
    231230}
    232231
    233 
    234232// --------------------------------------------------------------------------
    235233//
     
    238236// inner pixel and the average pedestal RMS of the inner pixels (democratic
    239237// image cleaning, see TDAS 02-14).
    240 
    241 
     238//
     239// FIXME: Should the check noise<=0 be replaced by MBadPixels?
     240//
    242241void MCameraData::CalcCleaningLevelDemocratic(const MCerPhotEvt &evt, const MPedPhotCam &cam,
    243242                                              const MGeomCam &geom)
     
    251250    fValidity.Reset();
    252251
    253     const Int_t entries = evt.GetNumPixels();
    254 
    255     const Float_t meannoise[2] = {cam.GetArea(0).GetRms(), cam.GetArea(1).GetRms()} ; // mean noise for the inner and the outer pixels
    256 
    257        
    258     //
    259     // check the number of all pixels against the noise level and
    260     // set them to 'unused' state if necessary
    261     //
    262     for (Int_t i=0; i<entries; i++)
    263     {
    264       const MCerPhotPix &pix = evt[i];
    265      
    266       const Int_t idx = pix.GetPixId();
    267       const Float_t noise = cam[idx].GetRms();
    268      
    269       if (noise<=0)
    270         continue;
    271        
    272       //
    273       // We calculate a correction factor which accounts for the     
    274       // fact that pixels have different size (see TDAS 02-14).
    275       //
    276      
    277      
    278       if (meannoise[0]>0) // fData[idx]=0, fValidity[idx]=0
    279       {
    280         fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) / meannoise[0];
    281         fValidity[idx] = 1;
    282       }
    283       else
    284         fValidity[idx] = 0;
    285     }
    286    
    287 }
    288 
    289 
    290 
    291 // --------------------------------------------------------------------------
    292 //
    293 // Returns, depending on the type flag:
    294 //
    295 //  0: Number of Photons*PixRatio
    296 //  1: Error*sqrt(PixRatio)
    297 //  2: Cleaning level = Num Photons*sqrt(PixRatio)/Error
    298 //  3: Number of Photons
    299 //  4: Error
     252    const Int_t   entries = evt.GetNumPixels();
     253    const Float_t noise0  = cam.GetArea(0).GetRms();
     254    if (noise0<=0)
     255        return;
     256
     257    //
     258    // check the number of all pixels against the noise level and
     259    // set them to 'unused' state if necessary
     260    //
     261    for (Int_t i=0; i<entries; i++)
     262    {
     263        const MCerPhotPix &pix = evt[i];
     264
     265        const Int_t idx     = pix.GetPixId();
     266        const Float_t noise = cam[idx].GetRms();
     267
     268        if (noise<=0)
     269            continue;
     270
     271        //
     272        // We calculate a correction factor which accounts for the
     273        // fact that pixels have different size (see TDAS 02-14).
     274        //
     275        fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) / noise0;
     276        fValidity[idx] = 1;
     277    }
     278}
     279
     280// --------------------------------------------------------------------------
     281//
     282// Returns the contents of the pixel.
    300283//
    301284Bool_t MCameraData::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
Note: See TracChangeset for help on using the changeset viewer.