Ignore:
Timestamp:
04/01/04 14:52:32 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3622 r3624  
    151151
    152152    fPixels           = new TClonesArray("MCalibrationChargePix",1);
    153     fAveragePixels    = new TClonesArray("MCalibrationChargePix",1);
    154     fAverageBadPixels = new TClonesArray("MBadPixelsPix",1);
     153    fAverageAreas     = new TClonesArray("MCalibrationChargePix",1);
     154    fAverageBadAreas  = new TClonesArray("MBadPixelsPix",1);
     155    fAverageSectors     = new TClonesArray("MCalibrationChargePix",1);
     156    fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
    155157
    156158    Clear();
     
    175177  //
    176178  delete fPixels;
    177   delete fAveragePixels;
    178   delete fAverageBadPixels;
     179  delete fAverageAreas;
     180  delete fAverageBadAreas;
     181  delete fAverageSectors;
     182  delete fAverageBadSectors;
     183 
    179184 
    180185  if (fOffsets)
     
    200205}
    201206
    202 void MCalibrationChargeCam::InitAverageSize(const UInt_t i)
    203 {
    204   fAveragePixels->ExpandCreate(i);
    205   fAverageBadPixels->ExpandCreate(i);
     207void MCalibrationChargeCam::InitAverageAreas(const UInt_t i)
     208{
     209  fAverageAreas->ExpandCreate(i);
     210  fAverageBadAreas->ExpandCreate(i);
     211}
     212
     213void MCalibrationChargeCam::InitAverageSectors(const UInt_t i)
     214{
     215  fAverageSectors->ExpandCreate(i);
     216  fAverageBadSectors->ExpandCreate(i);
    206217}
    207218
     
    220231}
    221232
    222 Int_t MCalibrationChargeCam::GetAverageSize() const
    223 {
    224   return fAveragePixels->GetEntriesFast();
     233Int_t MCalibrationChargeCam::GetAverageAreas() const
     234{
     235  return fAverageAreas->GetEntriesFast();
     236}
     237
     238Int_t MCalibrationChargeCam::GetAverageSectors() const
     239{
     240  return fAverageSectors->GetEntriesFast();
    225241}
    226242
     
    248264// Get i-th average pixel (area number)
    249265//
    250 MCalibrationChargePix &MCalibrationChargeCam::GetAveragePix(UInt_t i)
    251 {
    252   return *static_cast<MCalibrationChargePix*>(fAveragePixels->UncheckedAt(i));
     266MCalibrationChargePix &MCalibrationChargeCam::GetAverageArea(UInt_t i)
     267{
     268  return *static_cast<MCalibrationChargePix*>(fAverageAreas->UncheckedAt(i));
    253269}
    254270
     
    257273// Get i-th average pixel (area number)
    258274//
    259 const MCalibrationChargePix &MCalibrationChargeCam::GetAveragePix(UInt_t i) const
    260 {
    261   return *static_cast<MCalibrationChargePix*>(fAveragePixels->UncheckedAt(i));
     275const MCalibrationChargePix &MCalibrationChargeCam::GetAverageArea(UInt_t i) const
     276{
     277  return *static_cast<MCalibrationChargePix*>(fAverageAreas->UncheckedAt(i));
     278}
     279
     280// --------------------------------------------------------------------------
     281//
     282// Get i-th average pixel (sector number)
     283//
     284MCalibrationChargePix &MCalibrationChargeCam::GetAverageSector(UInt_t i)
     285{
     286  return *static_cast<MCalibrationChargePix*>(fAverageSectors->UncheckedAt(i));
     287}
     288
     289// --------------------------------------------------------------------------
     290//
     291// Get i-th average pixel (sector number)
     292//
     293const MCalibrationChargePix &MCalibrationChargeCam::GetAverageSector(UInt_t i) const
     294{
     295  return *static_cast<MCalibrationChargePix*>(fAverageSectors->UncheckedAt(i));
    262296}
    263297
     
    266300// Get i-th average pixel (area number)
    267301//
    268 MBadPixelsPix &MCalibrationChargeCam::GetAverageBadPix(UInt_t i)
    269 {
    270   return *static_cast<MBadPixelsPix*>(fAverageBadPixels->UncheckedAt(i));
     302MBadPixelsPix &MCalibrationChargeCam::GetAverageBadArea(UInt_t i)
     303{
     304  return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));
    271305}
    272306
     
    275309// Get i-th average pixel (area number)
    276310//
    277 const MBadPixelsPix &MCalibrationChargeCam::GetAverageBadPix(UInt_t i) const
    278 {
    279   return *static_cast<MBadPixelsPix*>(fAverageBadPixels->UncheckedAt(i));
     311const MBadPixelsPix &MCalibrationChargeCam::GetAverageBadArea(UInt_t i) const
     312{
     313  return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));
     314}
     315
     316// --------------------------------------------------------------------------
     317//
     318// Get i-th average pixel (sector number)
     319//
     320MBadPixelsPix &MCalibrationChargeCam::GetAverageBadSector(UInt_t i)
     321{
     322  return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));
     323}
     324
     325// --------------------------------------------------------------------------
     326//
     327// Get i-th average pixel (sector number)
     328//
     329const MBadPixelsPix &MCalibrationChargeCam::GetAverageBadSector(UInt_t i) const
     330{
     331  return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));
    280332}
    281333
     
    291343  // another ForEach does not compile, thus have to do the loop ourselves:
    292344  //
    293   for (Int_t i=0;i<GetAverageSize();i++)
    294     {
    295       fAveragePixels[i].Clear();
    296       fAverageBadPixels[i].Clear();
     345  for (Int_t i=0;i<GetAverageAreas();i++)
     346    {
     347      fAverageAreas[i].Clear();
     348      fAverageBadAreas[i].Clear();
     349    }
     350
     351  //
     352  // another ForEach does not compile, thus have to do the loop ourselves:
     353  //
     354  for (Int_t i=0;i<GetAverageSectors();i++)
     355    {
     356      fAverageSectors[i].Clear();
     357      fAverageBadSectors[i].Clear();
    297358    }
    298359 
     
    418479  *fLog << endl;
    419480
    420   TIter Next5(fAveragePixels);
     481  TIter Next5(fAverageAreas);
    421482  while ((pix=(MCalibrationChargePix*)Next5()))
    422483  {
    423     *fLog << all << "Average Pix:"
     484    *fLog << all << "Average Area:"
    424485          << "   Ped.  Rms: "            << pix->GetPedRms()        << " +- " << pix->GetPedRmsErr()
    425486          << "   Mean signal: "          << pix->GetMeanCharge()    << " +- " << pix->GetMeanChargeErr()
     
    429490          << endl;
    430491  }
     492
     493  TIter Next6(fAverageSectors);
     494  while ((pix=(MCalibrationChargePix*)Next5()))
     495  {
     496    *fLog << all << "Average Sector:"
     497          << "   Ped.  Rms: "            << pix->GetPedRms()        << " +- " << pix->GetPedRmsErr()
     498          << "   Mean signal: "          << pix->GetMeanCharge()    << " +- " << pix->GetMeanChargeErr()
     499          << "   Sigma signal: "         << pix->GetSigmaCharge()    << " +- "<< pix->GetSigmaChargeErr()
     500          << "   Reduced Sigma: "        << pix->GetRSigmaCharge()
     501          << "   Nr Phe's: "             << pix->GetPheFFactorMethod()
     502          << endl;
     503  }
     504
    431505}
    432506
Note: See TracChangeset for help on using the changeset viewer.