Ignore:
Timestamp:
09/15/04 15:31:22 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc

    r5019 r5031  
    106106}
    107107
     108// --------------------------------------------------------------------------
     109//
     110// Return true, if any of the blind pixels have an available photon flux
     111//
     112Bool_t MCalibrationBlindCam::IsFluxInsidePlexiglassAvailable() const
     113{
     114  for (Int_t i=0; i<GetSize(); i++)
     115    {
     116      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];     
     117      if (bp.IsFluxInsidePlexiglassAvailable())
     118        return kTRUE;
     119    }
     120 
     121  return kFALSE;
     122}
    108123
     124// --------------------------------------------------------------------------
     125//
     126// Returns weighted average of the flux calculated by each blind pixel
     127//
     128Float_t MCalibrationBlindCam::GetFluxInsidePlexiglass() const
     129{
     130
     131  Float_t flux    = 0.;
     132  Float_t fluxvar = 0.; 
     133
     134  for (Int_t i=0; i<GetSize(); i++)
     135    {
     136      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
     137      if (bp.IsFluxInsidePlexiglassAvailable())
     138        {
     139          const Float_t weight = 1./
     140                                bp.GetFluxInsidePlexiglassErr()
     141                                / bp.GetFluxInsidePlexiglassErr();
     142          flux    += weight * bp.GetFluxInsidePlexiglass();
     143          fluxvar += weight;
     144        }
     145    }
     146  return fluxvar > 0.0001 ? flux / fluxvar : -1.;
     147}
     148
     149// --------------------------------------------------------------------------
     150//
     151// Returns weighted variance of the flux calculated by each blind pixel
     152//
     153Float_t MCalibrationBlindCam::GetFluxInsidePlexiglassVar() const
     154{
     155
     156  Float_t fluxvar = 0.; 
     157
     158  for (Int_t i=0; i<GetSize(); i++)
     159    {
     160      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
     161      if (bp.IsFluxInsidePlexiglassAvailable())
     162        {
     163          const Float_t weight = 1./
     164                                bp.GetFluxInsidePlexiglassErr()
     165                                / bp.GetFluxInsidePlexiglassErr();
     166          fluxvar += weight;
     167        }
     168    }
     169  return fluxvar > 0.0001 ? 1. / fluxvar : -1.;
     170}
     171
     172// --------------------------------------------------------------------------
     173//
     174// Returns weighted rel. variance of the flux calculated by each blind pixel
     175//
     176Float_t MCalibrationBlindCam::GetFluxInsidePlexiglassRelVar() const
     177{
     178
     179  Float_t flux    = 0.;
     180  Float_t fluxvar = 0.; 
     181
     182  for (Int_t i=0; i<GetSize(); i++)
     183    {
     184      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
     185      if (bp.IsFluxInsidePlexiglassAvailable())
     186        {
     187          const Float_t weight = 1./
     188                                bp.GetFluxInsidePlexiglassErr()
     189                                / bp.GetFluxInsidePlexiglassErr();
     190          flux    += weight * bp.GetFluxInsidePlexiglass();
     191          fluxvar += weight;
     192        }
     193    }
     194
     195  return fluxvar > 0.0001 ? flux * fluxvar : -1.;
     196}
     197
     198
Note: See TracChangeset for help on using the changeset viewer.