Changeset 3350 for trunk/MagicSoft


Ignore:
Timestamp:
02/28/04 02:38:54 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
3 edited

Legend:

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

    r3312 r3350  
    345345  // loop over the pedestal events and check if we have calibration
    346346  //
    347   Int_t nvalid = 0;
    348   for (UInt_t pixid=0; pixid<fPedestals->GetSize(); pixid++)
     347  Int_t nvalid   = 0;
     348  Float_t avped  = 0;
     349  Float_t avprms = 0;
     350  Float_t avnum  = 0;
     351  for (Int_t pixid=0; pixid<fPedestals->GetSize(); pixid++)
    349352    {
    350353
     
    364367      const Float_t num    = TMath::Sqrt((Float_t)fPedestals->GetTotalEntries());
    365368
     369      avped  += ped;
     370      avprms += prms;
     371      avnum  += num;
    366372      //
    367373      // set them in the calibration camera
     
    394400    }
    395401
     402
     403
    396404  //
    397405  // The Michele check ...
     
    404412  }
    405413
     414  MCalibrationChargePix *avinnerpix = fCam->GetAverageInnerPix();
     415  MCalibrationChargePix *avouterpix = fCam->GetAverageOuterPix();
     416  //
     417  // set the pedestans in the calibration camera
     418  //
     419  if (avinnerpix->IsHiGainSaturation())
     420  {
     421      avinnerpix->SetPedestal(avped  * fNumLoGainSamples,
     422                         avprms * TMath::Sqrt((Float_t)fNumLoGainSamples),
     423                         avprms * fNumLoGainSamples / avnum);
     424      avinnerpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples);
     425      avinnerpix->ApplyLoGainConversion();
     426  }
     427  else
     428  {
     429      avinnerpix->SetPedestal(avped  * fNumHiGainSamples,
     430                         avprms * TMath::Sqrt((Float_t)fNumHiGainSamples),
     431                         avprms * fNumHiGainSamples / avnum);
     432  }
     433
     434  if (avouterpix->IsHiGainSaturation())
     435  {
     436      avouterpix->SetPedestal(avped  * fNumLoGainSamples,
     437                         avprms * TMath::Sqrt((Float_t)fNumLoGainSamples),
     438                         avprms * fNumLoGainSamples / avnum);
     439      avouterpix->SetNumLoGainSamples((Float_t)fNumLoGainSamples);
     440      avouterpix->ApplyLoGainConversion();
     441  }
     442  else
     443  {
     444      avouterpix->SetPedestal(avped  * fNumHiGainSamples,
     445                         avprms * TMath::Sqrt((Float_t)fNumHiGainSamples),
     446                         avprms * fNumHiGainSamples / avnum);
     447  }
     448 
     449  if (!avinnerpix->CheckChargeValidity() || !avinnerpix->CheckTimeValidity())
     450      if (!avinnerpix->CalcReducedSigma())
     451          avinnerpix->CalcFFactorMethod();
     452
     453  if (!avouterpix->CheckChargeValidity() || !avouterpix->CheckTimeValidity())
     454      if (!avouterpix->CalcReducedSigma())
     455          avouterpix->CalcFFactorMethod();
     456
     457
    406458  if (!fBlindPixel->CheckChargeFitValidity())
    407459  {
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r3319 r3350  
    159159    fTitle = title ? title : "Storage container for the Calibration Information in the camera";
    160160
    161     fPixels     = new TClonesArray("MCalibrationChargePix",1);
     161    fPixels          = new TClonesArray("MCalibrationChargePix",1);
     162    fAverageInnerPix = new MCalibrationChargePix("AverageInnerPix","Container of the fit results of the camera average inner pixels");
     163    fAverageOuterPix = new MCalibrationChargePix("AverageOuterPix","Container of the fit results of the camera average outer pixels");
    162164
    163165    Clear();
     
    178180  //
    179181  delete fPixels;
    180 
     182  delete fAverageInnerPix;
     183  delete fAverageOuterPix;
     184 
    181185  if (fOffsets)
    182186    delete fOffsets;
     
    199203{
    200204 
    201   //
    202   // check if we have already initialized to size
    203   //
    204   if (CheckBounds(i))
    205     return;
    206  
    207205  fPixels->ExpandCreate(i);
    208206
     
    221219}
    222220
     221
    223222// --------------------------------------------------------------------------
    224223//
    225 // Check if position i is inside the current bounds of the TClonesArray
    226 //
    227 Bool_t MCalibrationChargeCam::CheckBounds(Int_t i) const
    228 {
    229   return i < GetSize();
    230 }
    231 
     224// Get i-th pixel (pixel number)
     225//
     226MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i)
     227{
     228  return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i));
     229}
    232230
    233231// --------------------------------------------------------------------------
     
    235233// Get i-th pixel (pixel number)
    236234//
    237 MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i)
     235const MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) const
    238236{
    239237  return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i));
    240238}
    241239
    242 // --------------------------------------------------------------------------
    243 //
    244 // Get i-th pixel (pixel number)
    245 //
    246 const MCalibrationChargePix &MCalibrationChargeCam::operator[](UInt_t i) const
    247 {
    248   return *static_cast<MCalibrationChargePix*>(fPixels->UncheckedAt(i));
    249 }
    250 
    251240
    252241// --------------------------------------
     
    256245
    257246  fPixels->ForEach(TObject, Clear)();
     247  fAverageInnerPix->Clear();
     248  fAverageOuterPix->Clear();
    258249
    259250  fNumExcludedPixels                 = 0;
     
    385376  }
    386377  *fLog << all << id << " Excluded pixels " << endl;
     378  *fLog << endl;
     379  *fLog << all << "Average Inner Pix:         "
     380                << ":  Ped.  Rms: "            << fAverageInnerPix->GetPedRms()        << " +- " << fAverageInnerPix->GetPedRmsErr()
     381                << "   Mean signal: "          << fAverageInnerPix->GetMeanCharge()    << " +- " << fAverageInnerPix->GetSigmaCharge()
     382                << "   Reduced Sigma: "        << fAverageInnerPix->GetRSigmaCharge()
     383                << "   Nr Phe's: "             << fAverageInnerPix->GetPheFFactorMethod()
     384                << endl;
     385  *fLog << all << "Average Outer Pix:         "
     386                << ":  Ped.  Rms: "            << fAverageOuterPix->GetPedRms()        << " +- " << fAverageOuterPix->GetPedRmsErr()
     387                << "   Mean signal: "          << fAverageOuterPix->GetMeanCharge()    << " +- " << fAverageOuterPix->GetSigmaCharge()
     388                << "   Reduced Sigma: "        << fAverageOuterPix->GetRSigmaCharge()
     389                << "   Nr Phe's: "             << fAverageOuterPix->GetPheFFactorMethod()
     390                << endl;
     391
    387392}
    388393
     
    755760void MCalibrationChargeCam::DrawPixelContent(Int_t idx) const
    756761{
    757   (*this)[idx].DrawClone();
     762    if (idx == -1)
     763        fAverageInnerPix->DrawClone();
     764    if (idx == -2)
     765        fAverageOuterPix->DrawClone();
     766
     767    (*this)[idx].DrawClone();
    758768}
    759769
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r3313 r3350  
    2222  Int_t fNumPixels;
    2323  TClonesArray *fPixels;                                        //-> Array of MCalibrationPix with fit results
     24  MCalibrationChargePix *fAverageInnerPix;                      //-> Average Pixel of all events
     25  MCalibrationChargePix *fAverageOuterPix;                      //-> Average Pixel of all events
    2426 
    2527  const MCalibrationChargeBlindPix *fBlindPixel;                //! Pointer to the Blind Pixel with fit results
     
    7375  MCalibrationChargePix &operator[](UInt_t i);
    7476  const MCalibrationChargePix &operator[](UInt_t i) const;
    75  
    76   Bool_t CheckBounds(Int_t i) const;
     77
     78  MCalibrationChargePix *GetAverageInnerPix()              { return fAverageInnerPix; }
     79  const MCalibrationChargePix *GetAverageInnerPix() const  { return fAverageInnerPix; }
     80
     81  MCalibrationChargePix *GetAverageOuterPix()              { return fAverageOuterPix; }
     82  const MCalibrationChargePix *GetAverageOuterPix() const  { return fAverageOuterPix; }
    7783
    7884  // Prints
Note: See TracChangeset for help on using the changeset viewer.