Changeset 3429 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
03/07/04 17:56:39 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3428 r3429  
    2626  * mcalib/MHCalibrationChargeCam.[h,cc]
    2727    - include MBadPixelsCam
     28    - include one additional MBadPixelsPix for the average inner and
     29      outer pixel, respectively
    2830
    2931  * mcalib/MHCalibrationChargePix.[h,cc]
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.cc

    r3068 r3429  
    112112 MCalibrationCalc - valid for the result of a calibration run:
    113113
    114   <-  1  Pedestals not available
    115   <-  2  FADC samples not available
    116 
    117114      3  Hi-Gain saturated, no LoGain available
    118115
     
    122119      6  Cannot be fitted - calibrated using Histogram Mean and RMS
    123120
    124       7  Mean Charge smaller than PedRMS
    125       8  Mean Charge smaller than Mean charge in camera minus 5 sigma
    126       9  Mean Charge bigger than Mean charge in camera plus 5 sigma
    127 
    128      10  Sigma Charge smaller than PedRMS
    129 
    130      11  Result of F-Factor    method invalid
    131      12  Result of Blind Pixel method invalid
    132      13  Result of PIN-Diode   method invalid
    133      14  Methods inconsistency
    134 
    135      15  Gains oscillate
    136 
    137   <- 16  Arrival Time not calculated
    138   <- 17  Arrival Time not valid
    139 
    140      18  Sigma  Arrival Time  bigger than  FADC window
    141      19  Mean   Arrival Time  at edge of   FADC window
    142121     */
    143122
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3423 r3429  
    330330      return kFALSE;
    331331    }
    332  
     332
    333333  fCam->SetGeomCam(fGeom);
     334  fCam->SetBadPixelsCam(fBadPixels);
    334335
    335336  fNumHiGainSamples  =  fSignals->GetNumUsedHiGainFADCSlices();
     
    438439      pix.CheckTimeValidity(&bad);
    439440     
    440       if (!bad.IsCalibrationOK())
     441      if (!bad.IsCalibrationResultOK())
    441442        continue;
    442443
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r3426 r3429  
    167167    fAverageInnerPix = new MCalibrationChargePix("AverageInnerPix","Container of the fit results of the camera average inner pixels");
    168168    fAverageOuterPix = new MCalibrationChargePix("AverageOuterPix","Container of the fit results of the camera average outer pixels");
     169    fAverageInnerBadPix = new MBadPixelsPix("AverageInnerBadPix","Bad Pixel Container of the camera average inner pixels");
     170    fAverageOuterBadPix = new MBadPixelsPix("AverageOuterBadPix","Bad Pixel Container of the camera average outer pixels");
    169171
    170172    Clear();
     
    188190  delete fAverageOuterPix;
    189191 
     192  delete fAverageInnerBadPix;
     193  delete fAverageOuterBadPix;
     194 
    190195  if (fOffsets)
    191196    delete fOffsets;
     
    252257  fAverageInnerPix->Clear();
    253258  fAverageOuterPix->Clear();
     259
     260  fAverageInnerBadPix->Clear();
     261  fAverageOuterBadPix->Clear();
    254262
    255263  fNumExcludedPixels                 = 0;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r3426 r3429  
    1616class MCalibrationChargePINDiode;
    1717class MCalibrationChargePix;
     18class MBadPixelsPix;
    1819class MBadPixelsCam;
    1920class MCalibrationChargeCam : public MParContainer, public MCamEvent
     
    2526  MCalibrationChargePix *fAverageInnerPix;       //-> Average Pixel of all events
    2627  MCalibrationChargePix *fAverageOuterPix;       //-> Average Pixel of all events
     28 
     29  MBadPixelsPix         *fAverageInnerBadPix;    //-> Average Pixel of all events
     30  MBadPixelsPix         *fAverageOuterBadPix;    //-> Average Pixel of all events
    2731 
    2832  const MCalibrationChargeBlindPix *fBlindPixel; //! Pointer to the Blind Pixel with fit results
     
    8589  const MCalibrationChargePix *GetAverageOuterPix() const  { return fAverageOuterPix; }
    8690
     91  MBadPixelsPix *GetAverageInnerBadPix()              { return fAverageInnerBadPix; }
     92  const MBadPixelsPix *GetAverageInnerBadPix() const  { return fAverageInnerBadPix; }
     93
     94  MBadPixelsPix *GetAverageOuterBadPix()              { return fAverageOuterBadPix; }
     95  const MBadPixelsPix *GetAverageOuterBadPix() const  { return fAverageOuterBadPix; }
     96
    8797  // Prints
    8898  void Print(Option_t *o="") const;
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc

    r3362 r3429  
    8181#include "MGeomPix.h"
    8282
     83#include "MBadPixelsCam.h"
     84#include "MBadPixelsPix.h"
     85
    8386#include "MRawEvtData.h"
    8487#include "MRawEvtPixelIter.h"
     
    97100//
    98101MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title)
     102    : fRawEvt(NULL), fGeom(NULL), fBadPixels(NULL)
    99103{
    100104    fName  = name  ? name  : "MHCalibrationChargeCam";
     
    128132    fAverageLoGainOuterPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Outer pixels LoGain");
    129133
    130     fAverageHiGainInnerPix->SetChargeLast(1000.);
    131     fAverageLoGainInnerPix->SetChargeLast(100.);
    132     fAverageHiGainOuterPix->SetChargeLast(1000.);
    133     fAverageLoGainOuterPix->SetChargeLast(100.);
     134    fAverageHiGainInnerPix->SetChargeFirst(-1000.);
     135    fAverageHiGainOuterPix->SetChargeFirst(-1000.);
     136
     137    fAverageHiGainInnerPix->SetChargeLast(4000.);
     138    fAverageLoGainInnerPix->SetChargeLast(4000.);
     139    fAverageHiGainOuterPix->SetChargeLast(4000.);
     140    fAverageLoGainOuterPix->SetChargeLast(4000.);
    134141
    135142    fAverageHiGainInnerPix->SetChargeNbins(4000);
     
    143150    fNumInnerPixels = 0;
    144151    fNumOuterPixels = 0;
     152    fNumExcluded    = 0;
    145153}
    146154
     
    295303Bool_t MHCalibrationChargeCam::ReInit(MParList *pList)
    296304{
     305
     306  fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
     307  if (!fBadPixels)
     308  {
     309      gLog << err << GetDescriptor() << ": ERROR: Could not find MBadPixelsCam ... aborting " << endl;
     310      return kFALSE;
     311  }
    297312
    298313  fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
     
    318333      for (Int_t i=0; i<n; i++)
    319334      {
     335          //
     336          // Oscillating pixels
     337          //
    320338          (*fHiGainArray)[i] = new MHCalibrationChargeHiGainPix;
     339
     340          if ((*fBadPixels)[i].IsBad())
     341          {
     342              fNumExcluded++;
     343              (*this)[i].SetExcluded();
     344          }
    321345          (*this)[i].Init();
    322346          (*this)[i].ChangeHistId(i);
    323          
    324347      }
    325348  }
     
    332355      {
    333356          (*fLoGainArray)[i] = new MHCalibrationChargeLoGainPix;
     357          //
     358          // Pixels with non-valid behavior
     359          //
     360          if ((*fBadPixels)[i].IsBad())
     361            (*this)(i).SetExcluded();
     362
    334363          (*this)(i).Init();
    335364          (*this)(i).ChangeHistId(i);
    336365      }
    337366  }
     367
     368
     369 
     370
     371  *fLog << inf << GetDescriptor() << ": " << fNumExcluded << " excluded Pixels " << endl;
    338372
    339373  return kTRUE;
     
    382416  for (int i=0; i<n; i++)
    383417    {
     418
     419      if ((*this)[i].IsExcluded())
     420        continue;
    384421
    385422      const MExtractedSignalPix &pix = (*signal)[i];
     
    430467  //
    431468  sumhiinnertot = sumloinnertot = sumhioutertot = sumlooutertot = 0.;
     469  fNumInnerPixels = fNumOuterPixels = 0;
     470
    432471  MRawEvtPixelIter pixel(fRawEvt);
    433472  while (pixel.Next())
     
    435474     
    436475      const UInt_t pixid = pixel.GetPixelId();
    437      
    438       const Float_t timehi = (Float_t)pixel.GetIdxMaxHiGainSample();
     476
     477      if ((*this)[pixid].IsExcluded())
     478        continue;
     479
     480      const Int_t timehi   = (Int_t)pixel.GetIdxMaxHiGainSample();
    439481      const Float_t timelo = (Float_t)pixel.GetIdxMaxLoGainSample() + 15.;
    440482
     
    446488          sumhiinnertot += timehi;
    447489          sumloinnertot += timelo;
     490          fNumInnerPixels++;
    448491      }
    449492      else
     
    451494          sumhioutertot += timehi;
    452495          sumlooutertot += timelo;
     496          fNumOuterPixels++;
    453497      }
    454498    }
     
    478522    {
    479523     
     524        MCalibrationChargePix        &pix    = (*fCam)[i];
    480525        MHCalibrationChargeHiGainPix &histhi = (*this)[i];
    481         MCalibrationChargePix        &pix    = (*fCam)[i];
    482 
    483         FinalizeHiGainHists(histhi,pix);
     526        MBadPixelsPix                &bad    = (*fBadPixels)[i];
     527
     528        FinalizeHiGainHists(histhi,pix,bad);
     529
    484530    }
    485531
     
    487533    {
    488534     
     535        if ((*this)(i).IsExcluded())
     536           continue;
     537
    489538        MHCalibrationChargeLoGainPix &histlo = (*this)(i);
    490539        MCalibrationChargePix        &pix    = (*fCam)[i];
    491 
    492         FinalizeLoGainHists(histlo,pix);
    493     }
    494 
    495     FinalizeHiGainHists(*fAverageHiGainInnerPix,*fCam->GetAverageInnerPix());
    496     FinalizeLoGainHists(*fAverageLoGainInnerPix,*fCam->GetAverageInnerPix());
    497     FinalizeHiGainHists(*fAverageHiGainOuterPix,*fCam->GetAverageOuterPix());
    498     FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix());
     540        MBadPixelsPix                &bad    = (*fBadPixels)[i];
     541
     542        FinalizeLoGainHists(histlo,pix,bad);
     543
     544    }
     545
     546    FinalizeHiGainHists(*fAverageHiGainInnerPix,*fCam->GetAverageInnerPix(),*fCam->GetAverageInnerBadPix());
     547    FinalizeLoGainHists(*fAverageLoGainInnerPix,*fCam->GetAverageInnerPix(),*fCam->GetAverageInnerBadPix());
     548    FinalizeHiGainHists(*fAverageHiGainOuterPix,*fCam->GetAverageOuterPix(),*fCam->GetAverageOuterBadPix());
     549    FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix(),*fCam->GetAverageOuterBadPix());
    499550
    500551    fCam->GetAverageInnerPix()->SetSigmaCharge   (fCam->GetAverageInnerPix()->GetSigmaCharge()   *TMath::Sqrt((Float_t)fNumInnerPixels));
     
    502553    fCam->GetAverageInnerPix()->SetSigmaChargeErr(fCam->GetAverageInnerPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumInnerPixels));
    503554    fCam->GetAverageOuterPix()->SetSigmaChargeErr(fCam->GetAverageOuterPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumOuterPixels));
     555   
     556    *fLog << err << TMath::Sqrt((Float_t)fNumInnerPixels) << endl;
     557    *fLog << err << TMath::Sqrt((Float_t)fNumOuterPixels) << endl;
    504558
    505559    return kTRUE;
    506560}
    507561
    508 void MHCalibrationChargeCam::FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix)
     562void MHCalibrationChargeCam::FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist,
     563                                                 MCalibrationChargePix &pix,
     564                                                 MBadPixelsPix &bad)
    509565{
    510566
    511567    if (hist.IsEmpty())
    512568        return;
    513    
     569
    514570    if (hist.GetSaturated() > fNumHiGainSaturationLimit*hist.GetHGausHist()->GetEntries())
    515571    {
    516572        pix.SetHiGainSaturation();
     573        bad.SetHiGainSaturation();
    517574        return;
    518575    }
     
    522579    //
    523580    if (hist.FitGaus())
    524         pix.SetHiGainFitted();
    525     //
    526     // 3) In case of failure set the bit kFitted to false and take histogram means and RMS
     581        bad.SetHiGainFitted();
     582    //
     583    // 3) In case of failure set the bit Fitted to false and take histogram means and RMS
    527584    //
    528585    else if (hist.RepeatFit())
    529         pix.SetHiGainFitted();
     586        bad.SetHiGainFitted();
    530587    else
     588      {
    531589        hist.BypassFit();
    532    
     590        bad.SetNoHiGainFitted();
     591      }
     592
    533593    //
    534594    // 4) Check for pickup
     
    553613    pix.SetAbsTimeRms          ( hist.GetAbsTimeRms() );
    554614   
    555     pix.SetHiGainOscillating   ( !hist.IsFourierSpectrumOK() );
    556615    pix.SetHiGainNumPickup     (  hist.GetPickup()           );
    557616   
    558 }
    559 
    560 
    561 void MHCalibrationChargeCam::FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix)
     617    if (!hist.IsFourierSpectrumOK())
     618      bad.SetHiGainOscillating();
     619}
     620
     621
     622void MHCalibrationChargeCam::FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist,
     623                                                 MCalibrationChargePix &pix,
     624                                                 MBadPixelsPix &bad)
    562625{
    563626
     
    569632    {
    570633        pix.SetLoGainSaturation();
     634        bad.SetLoGainSaturation();
    571635        return;
    572636    }
     
    575639    //
    576640    if (hist.FitGaus())
    577         pix.SetLoGainFitted();
     641        bad.SetLoGainFitted();
    578642    //
    579643    // 3) In case of failure set the bit kFitted to false and take histogram means and RMS
    580644    //
    581645    else if (hist.RepeatFit())
    582         pix.SetLoGainFitted();
     646        bad.SetLoGainFitted();
    583647    else
     648      {
    584649        hist.BypassFit();
    585    
     650        bad.SetNoLoGainFitted();
     651      }
     652
    586653    //
    587654    // 4) Check for pickup
     
    609676    }       
    610677   
    611     pix.SetLoGainOscillating   ( !hist.IsFourierSpectrumOK() );
    612678    pix.SetLoGainNumPickup     (  hist.GetPickup()           );
    613    
     679
     680    if (!hist.IsFourierSpectrumOK())
     681      bad.SetLoGainOscillating();
    614682}   
    615683
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h

    r3427 r3429  
    1616class MGeomCam;
    1717class MBadPixelsCam;
     18class MBadPixelsPix;
    1819class MCalibrationChargeCam;
    1920class MCalibrationChargePix;
     
    4647  Int_t fNumExcluded;
    4748
    48   void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix);
    49   void FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix);
     49  void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);
     50  void FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);
    5051
    5152public:
Note: See TracChangeset for help on using the changeset viewer.