Ignore:
Timestamp:
12/03/04 20:17:06 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r5521 r5558  
    150150/////////////////////////////////////////////////////////////////////////////
    151151#include "MExtractPedestal.h"
    152 #include "MExtractTimeAndCharge.h"
    153152
    154153#include "MParList.h"
     
    168167#include "MGeomCam.h"
    169168
     169#include "MTaskEnv.h"
     170#include "MExtractTimeAndCharge.h"
     171
    170172ClassImp(MExtractPedestal);
    171173
     
    173175
    174176const TString MExtractPedestal::fgNamePedestalCam = "MPedestalCam";
     177
    175178// --------------------------------------------------------------------------
    176179//
     
    189192      fExtractWinFirst(0), fExtractWinSize(0)
    190193{
    191 
    192   fName  = name  ? name  : "MExtractPedestal";
    193   fTitle = title ? title : "Base class to calculate pedestals";
    194  
    195   AddToBranchList("fHiGainPixId");
    196   AddToBranchList("fLoGainPixId");
    197   AddToBranchList("fHiGainFadcSamples");
    198   AddToBranchList("fLoGainFadcSamples");
    199  
    200   SetPedestalUpdate(kTRUE);
    201 
    202   SetNamePedestalCamIn();
    203   SetNamePedestalCamOut();
    204   SetNumEventsDump();
    205   SetNumAreasDump();
    206   SetNumSectorsDump();
    207  
    208   Clear();
     194    fName  = name  ? name  : "MExtractPedestal";
     195    fTitle = title ? title : "Base class to calculate pedestals";
     196
     197    AddToBranchList("fHiGainPixId");
     198    AddToBranchList("fLoGainPixId");
     199    AddToBranchList("fHiGainFadcSamples");
     200    AddToBranchList("fLoGainFadcSamples");
     201
     202    SetPedestalUpdate(kTRUE);
     203
     204    SetNamePedestalCamIn();
     205    SetNamePedestalCamOut();
     206    SetNumEventsDump();
     207    SetNumAreasDump();
     208    SetNumSectorsDump();
     209
     210    Clear();
    209211}
    210212
     
    212214{
    213215    // Reset contents of arrays.
    214   fSumx.Reset();       
    215   fSumx2.Reset();       
    216   fSumAB0.Reset();     
    217   fSumAB1.Reset();     
    218   fAreaSumx.Reset();   
    219   fAreaSumx2.Reset();   
    220   fAreaSumAB0.Reset(); 
    221   fAreaSumAB1.Reset(); 
    222   fAreaFilled.Reset();   
    223   fAreaValid.Reset();   
    224   fSectorSumx.Reset(); 
    225   fSectorSumx2.Reset();
    226   fSectorSumAB0.Reset();
    227   fSectorSumAB1.Reset();
    228   fSectorFilled.Reset();
    229   fSectorValid.Reset();
     216    fSumx.Reset();
     217    fSumx2.Reset();
     218    fSumAB0.Reset();
     219    fSumAB1.Reset();
     220    fAreaSumx.Reset();
     221    fAreaSumx2.Reset();
     222    fAreaSumAB0.Reset();
     223    fAreaSumAB1.Reset();
     224    fAreaFilled.Reset();
     225    fAreaValid.Reset();
     226    fSectorSumx.Reset();
     227    fSectorSumx2.Reset();
     228    fSectorSumAB0.Reset();
     229    fSectorSumAB1.Reset();
     230    fSectorFilled.Reset();
     231    fSectorValid.Reset();
    230232
    231233}
     
    248250  fRunHeader    = NULL;
    249251  fEvtHeader    = NULL;
    250   fPedestalsIn  = NULL;
    251252  fPedestalsOut = NULL;
    252253
     
    270271 
    271272  if (odd)
    272     {
     273  {
    273274      *fLog << warn << GetDescriptor();
    274       *fLog << " - WARNING: Window size in SetExtraxtWindow has to be even... " 
    275         " raising from " << windows << " to " << flush;
     275      *fLog << " - WARNING: Window size in SetExtraxtWindow has to be even... ";
     276      *fLog << " raising from " << windows << " to ";
    276277      windows += 1;
    277278      *fLog << windows << "!" << endl;
    278279      rc = kFALSE;
    279     }
    280 
    281   if (windows==0) 
    282     {
     280  }
     281
     282  if (windows==0)
     283  {
    283284      *fLog << warn << GetDescriptor();
    284285      *fLog << " - WARNING: Window size in SetExtraxtWindow has to be > 0... adjusting to 2!" << endl;
    285286      windows = 2;
    286287      rc = kFALSE;
    287     }
     288  }
    288289
    289290  fExtractWinSize  = windows;
     
    315316  fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    316317  if (!fRawEvt)
    317     {
     318  {
    318319      *fLog << err << AddSerialNumber("MRawEvtData") << " not found... aborting." << endl;
    319320      return kFALSE;
    320     }
     321  }
    321322 
    322323  fRunHeader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
    323324  if (!fRunHeader)
    324     {
     325  {
    325326      *fLog << err << AddSerialNumber("MRawRunHeader") << " not found... aborting." << endl;
    326327      return kFALSE;
    327     }
     328  }
    328329 
    329330  fEvtHeader = (MRawEvtHeader*)pList->FindObject(AddSerialNumber("MRawEvtHeader"));
    330331  if (!fEvtHeader)
    331     {
     332  {
    332333      *fLog << err << AddSerialNumber("MRawEvtHeader") << " not found... aborting." << endl;
    333334      return kFALSE;
    334     }
     335  }
    335336 
    336337  fGeom = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    337338  if (!fGeom)
    338     {
     339  {
    339340      *fLog << err << AddSerialNumber("MGeomCam") << " not found... aborting." << endl;
    340341      return kFALSE;
    341     }
    342  
    343   fPedestalsIn = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamIn.Data()));
    344   if (!fPedestalsIn)
    345     {
    346       *fLog << err << fNamePedestalCamIn.Data() << " could not be found nor created... aborting" << endl;
     342  }
     343
     344  if (fExtractor && !fPedestalsIn)
     345  {
     346      fPedestalsIn = (MPedestalCam*)pList->FindObject("MPedestalCam", AddSerialNumber(fNamePedestalCamIn));
     347      if (!fPedestalsIn)
     348      {
     349          *fLog << err << AddSerialNumber(fNamePedestalCamIn) << " not found... aborting." << endl;
     350          return kFALSE;
     351      }
     352  }
     353
     354  fPedestalsOut = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamOut));
     355  if (!fPedestalsOut)
    347356      return kFALSE;
    348     }
    349  
    350   fPedestalsOut = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamOut.Data()));
    351   if (!fPedestalsOut)
    352     {
    353       *fLog << err << fNamePedestalCamOut.Data() << " could not be found nor created... aborting" << endl;
    354       return kFALSE;
    355     }
    356  
     357
    357358  *fLog << inf;
    358  
     359  Print();
     360
    359361  return kTRUE;
    360362}
     
    382384Bool_t MExtractPedestal::ReInit(MParList *pList)
    383385{
    384 
    385386  // If the size is not yet set, set the size
    386387  if (fSumx.GetSize()==0)
    387388  {
    388     const Int_t npixels  = fPedestalsOut->GetSize();
    389     const Int_t areas    = fPedestalsOut->GetAverageAreas();
    390     const Int_t sectors  = fPedestalsOut->GetAverageSectors();
    391    
    392     fSumx.  Set(npixels);
    393     fSumx2. Set(npixels);
    394     fSumAB0.Set(npixels);
    395     fSumAB1.Set(npixels);
    396    
    397     fAreaSumx.  Set(areas);
    398     fAreaSumx2. Set(areas);
    399     fAreaSumAB0.Set(areas);
    400     fAreaSumAB1.Set(areas);
    401     fAreaFilled.Set(areas);
    402     fAreaValid .Set(areas);
    403    
    404     fSectorSumx.  Set(sectors);
    405     fSectorSumx2. Set(sectors);
    406     fSectorSumAB0.Set(sectors);
    407     fSectorSumAB1.Set(sectors);
    408     fSectorFilled.Set(sectors);
    409     fSectorValid .Set(sectors);
    410 
    411     for (Int_t i=0; i<npixels; i++)
     389      const Int_t npixels  = fPedestalsOut->GetSize();
     390      const Int_t areas    = fPedestalsOut->GetNumAverageArea();
     391      const Int_t sectors  = fPedestalsOut->GetNumAverageSector();
     392
     393      fSumx.  Set(npixels);
     394      fSumx2. Set(npixels);
     395      fSumAB0.Set(npixels);
     396      fSumAB1.Set(npixels);
     397
     398      fAreaSumx.  Set(areas);
     399      fAreaSumx2. Set(areas);
     400      fAreaSumAB0.Set(areas);
     401      fAreaSumAB1.Set(areas);
     402      fAreaFilled.Set(areas);
     403      fAreaValid .Set(areas);
     404
     405      fSectorSumx.  Set(sectors);
     406      fSectorSumx2. Set(sectors);
     407      fSectorSumAB0.Set(sectors);
     408      fSectorSumAB1.Set(sectors);
     409      fSectorFilled.Set(sectors);
     410      fSectorValid .Set(sectors);
     411
     412      for (Int_t i=0; i<npixels; i++)
    412413      {
    413         const UInt_t aidx   = (*fGeom)[i].GetAidx();
    414         const UInt_t sector = (*fGeom)[i].GetSector();     
    415        
    416         fAreaValid  [aidx]  ++;
    417         fSectorValid[sector]++;
     414          const UInt_t aidx   = (*fGeom)[i].GetAidx();
     415          const UInt_t sector = (*fGeom)[i].GetSector();
     416
     417          fAreaValid  [aidx]  ++;
     418          fSectorValid[sector]++;
    418419      }
    419420  }
    420  
     421
    421422  if (fExtractor)
    422     {
     423  {
    423424      if (!fExtractor->InitArrays())
    424         return kFALSE;
    425       SetExtractWindow(fExtractor->GetHiGainFirst(),(Int_t)fExtractor->GetNumHiGainSamples());
    426     }
    427 
    428   Print();
     425          return kFALSE;
     426
     427      SetExtractWindow(fExtractor->GetHiGainFirst(), (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
     428  }
    429429
    430430  return kTRUE;
    431431}
     432
     433Int_t MExtractPedestal::PostProcess()
     434{
     435    fPedestalsIn = NULL;
     436    return kTRUE;
     437}
     438
    432439
    433440// --------------------------------------------------------------------------
     
    441448Int_t MExtractPedestal::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
    442449{
    443 
    444   Bool_t rc=kFALSE;
    445  
    446   // find resource for numeventsdump
    447   if (IsEnvDefined(env, prefix, "NumEventsDump", print))
    448     {
    449       SetNumEventsDump(GetEnvValue(env, prefix, "NumEventsDump", (Int_t)fNumEventsDump));
    450       rc = kTRUE;
    451     }
    452 
    453   // find resource for numeventsdump
    454   if (IsEnvDefined(env, prefix, "NumAreasDump", print))
    455     {
    456       SetNumAreasDump(GetEnvValue(env, prefix, "NumAreasDump", (Int_t)fNumAreasDump));
    457       rc = kTRUE;
    458     }
    459 
    460   // find resource for numeventsdump
    461   if (IsEnvDefined(env, prefix, "NumSectorsDump", print))
    462     {
    463       SetNumSectorsDump(GetEnvValue(env, prefix, "NumSectorsDump", (Int_t)fNumSectorsDump));
    464       rc = kTRUE;
    465     }
    466 
    467   // find resource for pedestal update
    468   if (IsEnvDefined(env, prefix, "PedestalUpdate", print))
    469     {
    470       SetPedestalUpdate(GetEnvValue(env, prefix, "PedestalUpdate", fPedestalUpdate));
    471       rc = kTRUE;
    472     }
    473  
    474   // Find resources for ExtractWindow
    475   Int_t ef = fExtractWinFirst;
    476   Int_t es = fExtractWinSize;
    477   if (IsEnvDefined(env, prefix, "ExtractWinFirst", print))
    478     {
    479       ef = GetEnvValue(env, prefix, "ExtractWinFirst", ef);
    480       rc = kTRUE;
    481     }
    482   if (IsEnvDefined(env, prefix, "ExtractWinSize", print))
    483     {
    484       es = GetEnvValue(env, prefix, "ExtractWinSize", es);
    485       rc = kTRUE;
    486     }
    487  
    488   SetExtractWindow(ef,es);
    489  
    490   // find resource for MPedestalCam
    491   if (IsEnvDefined(env, prefix, "NamePedestalCamIn", print))
    492     {
    493       SetNamePedestalCamIn(GetEnvValue(env, prefix, "NamePedestalCamIn", fNamePedestalCamIn));
    494       rc = kTRUE;
    495     }
    496  
    497   if (IsEnvDefined(env, prefix, "NamePedestalCamOut", print))
    498     {
    499       SetNamePedestalCamOut(GetEnvValue(env, prefix, "NamePedestalCamOut", fNamePedestalCamOut));
    500       rc = kTRUE;
    501     }
    502  
    503   return rc;
     450    Bool_t rc=kFALSE;
     451
     452    // find resource for numeventsdump
     453    if (IsEnvDefined(env, prefix, "NumEventsDump", print))
     454    {
     455        SetNumEventsDump(GetEnvValue(env, prefix, "NumEventsDump", (Int_t)fNumEventsDump));
     456        rc = kTRUE;
     457    }
     458
     459    // find resource for numeventsdump
     460    if (IsEnvDefined(env, prefix, "NumAreasDump", print))
     461    {
     462        SetNumAreasDump(GetEnvValue(env, prefix, "NumAreasDump", (Int_t)fNumAreasDump));
     463        rc = kTRUE;
     464    }
     465
     466    // find resource for numeventsdump
     467    if (IsEnvDefined(env, prefix, "NumSectorsDump", print))
     468    {
     469        SetNumSectorsDump(GetEnvValue(env, prefix, "NumSectorsDump", (Int_t)fNumSectorsDump));
     470        rc = kTRUE;
     471    }
     472
     473    // find resource for pedestal update
     474    if (IsEnvDefined(env, prefix, "PedestalUpdate", print))
     475    {
     476        SetPedestalUpdate(GetEnvValue(env, prefix, "PedestalUpdate", fPedestalUpdate));
     477        rc = kTRUE;
     478    }
     479
     480    // Find resources for ExtractWindow
     481    Int_t ef = fExtractWinFirst;
     482    Int_t es = fExtractWinSize;
     483    if (IsEnvDefined(env, prefix, "ExtractWinFirst", print))
     484    {
     485        ef = GetEnvValue(env, prefix, "ExtractWinFirst", ef);
     486        rc = kTRUE;
     487    }
     488    if (IsEnvDefined(env, prefix, "ExtractWinSize", print))
     489    {
     490        es = GetEnvValue(env, prefix, "ExtractWinSize", es);
     491        rc = kTRUE;
     492    }
     493
     494    SetExtractWindow(ef,es);
     495
     496    // find resource for MPedestalCam
     497    if (IsEnvDefined(env, prefix, "NamePedestalCamIn", print))
     498    {
     499        SetNamePedestalCamIn(GetEnvValue(env, prefix, "NamePedestalCamIn", fNamePedestalCamIn));
     500        rc = kTRUE;
     501    }
     502
     503    if (IsEnvDefined(env, prefix, "NamePedestalCamOut", print))
     504    {
     505        SetNamePedestalCamOut(GetEnvValue(env, prefix, "NamePedestalCamOut", fNamePedestalCamOut));
     506        rc = kTRUE;
     507    }
     508
     509    return rc;
    504510}
    505511
     
    516522void MExtractPedestal::CalcPixResults(const UInt_t nevts, const UInt_t pixid)
    517523{
    518  
    519   const Float_t sum         = fSumx.At(pixid);
    520   const Float_t sum2        = fSumx2.At(pixid);
    521 
    522   // 1. Calculate the mean of the sums:
    523   Float_t ped         = sum/nevts;
    524  
    525   // 2. Calculate the Variance of the sums:
    526   Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
    527 
    528   // 3. Calculate the amplitude of the 150MHz "AB" noise
    529   Float_t abOffs = (fSumAB0[pixid] - fSumAB1[pixid]) / nevts;
    530 
    531   // 4. Scale the mean, variance and AB-noise to the number of slices:
    532   ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    533   var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    534   abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    535  
    536   // 5. Calculate the RMS from the Variance:
    537   const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
    538  
    539   (*fPedestalsOut)[pixid].Set(ped, rms, abOffs, nevts);
     524    const Float_t sum  = fSumx[pixid];
     525    const Float_t sum2 = fSumx2[pixid];
     526
     527    // 1. Calculate the mean of the sums:
     528    Float_t ped        = sum/nevts;
     529
     530    // 2. Calculate the Variance of the sums:
     531    Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
     532
     533    // 3. Calculate the amplitude of the 150MHz "AB" noise
     534    Float_t abOffs = (fSumAB0[pixid] - fSumAB1[pixid]) / nevts;
     535
     536    // 4. Scale the mean, variance and AB-noise to the number of slices:
     537    ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     538    var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     539    abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     540
     541    // 5. Calculate the RMS from the Variance:
     542    const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
     543
     544    (*fPedestalsOut)[pixid].Set(ped, rms, abOffs, nevts);
    540545}
    541546
     
    552557void MExtractPedestal::CalcAreaResults(const UInt_t nevts, const UInt_t napix, const UInt_t aidx)
    553558{
    554  
    555   const Float_t sum         = fAreaSumx.At(aidx);
    556   const Float_t sum2        = fAreaSumx2.At(aidx);
    557 
    558   // 1. Calculate the mean of the sums:
    559   Float_t ped         = sum/nevts;     
    560   //
    561   // 2. Calculate the Variance of the sums:
    562   //
    563   Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
    564   //
    565   // 3. Calculate the amplitude of the 150MHz "AB" noise
    566   //
    567   Float_t abOffs = (fAreaSumAB0[aidx] - fAreaSumAB1[aidx]) / nevts;
    568   //
    569   // 4. Scale the mean, variance and AB-noise to the number of slices:
    570   //
    571   ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    572   var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    573   abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    574   //
    575   // 5. Scale the mean, variance and AB-noise to the number of pixels:
    576   //
    577   ped    /= napix;
    578   var    /= napix;
    579   abOffs /= napix;
    580   //
    581   // 6. Calculate the RMS from the Variance:
    582   //
    583   const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
    584 
    585   fPedestalsOut->GetAverageArea(aidx).Set(ped, rms,abOffs,nevts);
    586  
     559    const Float_t sum  = fAreaSumx[aidx];
     560    const Float_t sum2 = fAreaSumx2[aidx];
     561
     562    // 1. Calculate the mean of the sums:
     563    Float_t ped        = sum/nevts;
     564
     565    // 2. Calculate the Variance of the sums:
     566    Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
     567
     568    // 3. Calculate the amplitude of the 150MHz "AB" noise
     569    Float_t abOffs = (fAreaSumAB0[aidx] - fAreaSumAB1[aidx]) / nevts;
     570
     571    // 4. Scale the mean, variance and AB-noise to the number of slices:
     572    ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     573    var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     574    abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     575
     576    // 5. Scale the mean, variance and AB-noise to the number of pixels:
     577    ped    /= napix;
     578    var    /= napix;
     579    abOffs /= napix;
     580
     581    // 6. Calculate the RMS from the Variance:
     582    const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
     583
     584    fPedestalsOut->GetAverageArea(aidx).Set(ped, rms, abOffs, nevts);
    587585}
    588586
     
    599597void MExtractPedestal::CalcSectorResults(const UInt_t nevts, const UInt_t nspix, const UInt_t sector)
    600598{
    601  
    602   const Float_t sum         = fSectorSumx.At(sector);
    603   const Float_t sum2        = fSectorSumx2.At(sector);
    604 
    605   // 1. Calculate the mean of the sums:
    606   Float_t ped         = sum/nevts;     
    607   //
    608   // 2. Calculate the Variance of the sums:
    609   //
    610   Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
    611   //
    612   // 3. Calculate the amplitude of the 150MHz "AB" noise
    613   //
    614   Float_t abOffs = (fSectorSumAB0[sector] - fSectorSumAB1[sector]) / nevts;
    615   //
    616   // 4. Scale the mean, variance and AB-noise to the number of slices:
    617   //
    618   ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    619   var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    620   abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
    621   //
    622   // 5. Scale the mean, variance and AB-noise to the number of pixels:
    623   //
    624   ped    /= nspix;
    625   var    /= nspix;
    626   abOffs /= nspix;
    627   //
    628   // 6. Calculate the RMS from the Variance:
    629   //
    630   const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
    631 
    632   fPedestalsOut->GetAverageSector(sector).Set(ped, rms,abOffs,nevts);
    633 }
    634 
    635 
     599    const Float_t sum  = fSectorSumx[sector];
     600    const Float_t sum2 = fSectorSumx2[sector];
     601
     602    // 1. Calculate the mean of the sums:
     603    Float_t ped        = sum/nevts;
     604
     605    // 2. Calculate the Variance of the sums:
     606    Float_t var = (sum2-sum*sum/nevts)/(nevts-1.);
     607
     608    // 3. Calculate the amplitude of the 150MHz "AB" noise
     609    Float_t abOffs = (fSectorSumAB0[sector] - fSectorSumAB1[sector]) / nevts;
     610
     611    // 4. Scale the mean, variance and AB-noise to the number of slices:
     612    ped    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     613    var    /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     614    abOffs /= fExtractor ? fExtractor->GetNumHiGainSamples() : fExtractWinSize;
     615
     616    // 5. Scale the mean, variance and AB-noise to the number of pixels:
     617    ped    /= nspix;
     618    var    /= nspix;
     619    abOffs /= nspix;
     620
     621    // 6. Calculate the RMS from the Variance:
     622    const Float_t rms = var<0 ? 0 : TMath::Sqrt(var);
     623
     624    fPedestalsOut->GetAverageSector(sector).Set(ped, rms, abOffs, nevts);
     625}
    636626
    637627void MExtractPedestal::Print(Option_t *o) const
    638628{
    639 
    640629    *fLog << GetDescriptor() << ":" << endl;
    641     *fLog << "Name of incoming MPedestalCam Container:  " << fNamePedestalCamIn.Data() << endl;
    642     *fLog << "Name of outgoing MPedestalCam Container:  " << fNamePedestalCamOut.Data() << endl;
    643     *fLog << "Number events for pedestal calculation:  " << fNumEventsDump << endl;
    644     *fLog << "Number events for av. areas calculation: " << fNumAreasDump << endl;
    645     *fLog << "Number events for av. sector calculation: " << fNumSectorsDump << endl;
    646     *fLog << "Pedestal Update is                        " << (fPedestalUpdate?"on":"off") << endl;
     630    *fLog << "Name of input  MPedestalCam:  " << (fPedestalsIn?fPedestalsIn->GetName():fNamePedestalCamIn.Data()) << " (" << fPedestalsIn << ")" << endl;
     631    *fLog << "Name of output MPedestalCam:  " << (fPedestalsOut?fPedestalsOut->GetName():fNamePedestalCamOut.Data()) << " (" << fPedestalsOut << ")" << endl;
     632    *fLog << "Num evts for pedestal   calc: " << fNumEventsDump << endl;
     633    *fLog << "Num evts for avg.areas  calc: " << fNumAreasDump << endl;
     634    *fLog << "Num evts for avg.sector calc: " << fNumSectorsDump << endl;
     635    *fLog << "Pedestal Update is            " << (fPedestalUpdate?"on":"off") << endl;
    647636    *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl;
    648 }
     637
     638    if (fExtractor)
     639        *fLog << "Extractor used:               " << fExtractor->ClassName() << endl;
     640}
Note: See TracChangeset for help on using the changeset viewer.