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

Legend:

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

    r4986 r5024  
    204204
    205205#include "MCalibrationIntensityChargeCam.h"
     206#include "MCalibrationIntensityQECam.h"
     207#include "MCalibrationIntensityBlindCam.h"
    206208
    207209#include "MCalibrationChargeCam.h"
     
    216218#include "MExtractedSignalPINDiode.h"
    217219
     220#include "MBadPixelsIntensityCam.h"
    218221#include "MBadPixelsCam.h"
    219222
     
    263266//
    264267MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title)
    265     : fQECam(NULL), fGeom(NULL), fSignal(NULL), fHeader(NULL)
     268    :
     269      fGeom(NULL), fSignal(NULL), fHeader(NULL)
    266270{
    267271       
     
    314318    fNumInnerFFactorMethodUsed = 0;
    315319
    316     fBadPixels  = NULL;
    317     fCam        = NULL;
    318     fIntensCam  = NULL;
    319     fBlindCam   = NULL;
    320     fPINDiode   = NULL;
    321     fPedestals  = NULL;
     320    fIntensBad   = NULL;
     321    fBadPixels   = NULL;
     322    fIntensCam   = NULL;
     323    fCam         = NULL;
     324    fIntensQE    = NULL;
     325    fQECam       = NULL;
     326    fIntensBlind = NULL;
     327    fBlindCam    = NULL;
     328    fPINDiode    = NULL;
     329    fPedestals   = NULL;
    322330
    323331    fPulserPattern = 0;
     
    367375    }
    368376 
    369   //
    370   // Containers that are created in case that they are not there.
    371   //
    372   fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam");
    373   if (!fQECam)
    374     {
    375       *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl;
    376       return kFALSE;
    377     }
    378 
    379   fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
    380   if (!fBadPixels)
    381     {
    382       *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;
    383       return kFALSE;
    384     }
    385 
    386377  fHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
    387378  if (!fHeader)
     
    452443    }
    453444 
     445  fIntensQE = (MCalibrationIntensityQECam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityQECam"));
     446  if (fIntensQE)
     447    *fLog << inf << "Found MCalibrationIntensityQECam ... " << endl;
     448  else
     449    {
     450      fQECam = (MCalibrationQECam*)pList->FindObject(AddSerialNumber("MCalibrationQECam"));
     451      if (!fQECam)
     452        {
     453          *fLog << err << "Cannot find MCalibrationQECam ... abort." << endl;
     454          *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationQECam before..." << endl;
     455          return kFALSE;
     456        }
     457    }
     458 
     459  fIntensBlind = (MCalibrationIntensityBlindCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityBlindCam"));
     460  if (fIntensBlind)
     461    *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << endl;
     462  else
     463    {
     464      fBlindCam = (MCalibrationBlindCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam"));
     465      if (!fBlindCam)
     466        {
     467          *fLog << endl;
     468          *fLog << warn << GetDescriptor()
     469                << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
     470          return kFALSE;
     471        }
     472    }
     473 
     474  fIntensBad = (MBadPixelsIntensityCam*)pList->FindObject(AddSerialNumber("MBadPixelsIntensityCam"));
     475  if (fIntensBad)
     476    *fLog << inf << "Found MBadPixelsIntensityCam ... " << endl;
     477  else
     478    {
     479      fBadPixels = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam"));
     480      if (!fBadPixels)
     481        {
     482          *fLog << err << "Cannot find MBadPixelsCam ... abort." << endl;
     483          return kFALSE;
     484        }
     485    }
     486 
    454487  //
    455488  // Optional Containers
    456489  //
    457   fBlindCam = (MCalibrationBlindCam*)pList->FindObject("MCalibrationBlindCam");
    458   if (!fBlindCam)
    459     {
    460       *fLog << endl;
    461       *fLog << warn << GetDescriptor()
    462             << ": MCalibrationBlindPix nor MCalibrationBlindCam "
    463             << " found... no Blind Pixel method! " << endl;
    464     }
    465 
    466490  fPINDiode = (MCalibrationChargePINDiode*)pList->FindObject("MCalibrationChargePINDiode");
    467491  if (!fPINDiode)
     
    486510        ? (MCalibrationChargePix&)(*fIntensCam)[i]
    487511        : (MCalibrationChargePix&)(*fCam)      [i];
    488       MCalibrationQEPix     &pqe = (MCalibrationQEPix&)    (*fQECam)[i];
    489       MBadPixelsPix         &bad = (*fBadPixels)[i];
     512      MCalibrationQEPix     &pqe = fIntensQE
     513        ? (MCalibrationQEPix&)    (*fIntensQE)[i]
     514        : (MCalibrationQEPix&)    (*fQECam)[i];
     515      MBadPixelsPix         &bad = fIntensBad
     516        ? (*fIntensBad)[i]
     517        : (*fBadPixels)[i];
    490518     
    491519      pix.SetPixId(i);
     
    598626    fCam->SetPulserColor( fPulserColor );
    599627 
    600   if (fBlindCam)
     628  if (fIntensBlind)
     629    fIntensBlind->SetPulserColor( fPulserColor );
     630  else if (fBlindCam)
    601631    fBlindCam->SetPulserColor( fPulserColor );
    602632 
     
    671701
    672702      MPedestalPix  &ped = (*fPedestals)[pixid];
    673       MBadPixelsPix &bad = (*fBadPixels)[pixid];
     703      MBadPixelsPix &bad = fIntensBad
     704        ? (*fIntensBad)[pixid]
     705        : (*fBadPixels)[pixid];
    674706      const Int_t aidx    = (*fGeom)[pixid].GetAidx();
    675707
     
    750782  // Finalize Blind Pixel
    751783  //
    752   if (FinalizeBlindCam())
    753     fQECam->SetBlindPixelMethodValid(kTRUE);
     784  if (fIntensQE)
     785    fIntensQE->SetBlindPixelMethodValid(FinalizeBlindCam());
    754786  else
    755     fQECam->SetBlindPixelMethodValid(kFALSE);
     787    fQECam->SetBlindPixelMethodValid(FinalizeBlindCam());
    756788
    757789  //
    758790  // Finalize PIN Diode
    759791  //
    760   if (FinalizePINDiode())
    761     fQECam->SetPINDiodeMethodValid(kTRUE);
     792  if (fIntensQE)
     793    fIntensQE->SetBlindPixelMethodValid(FinalizePINDiode());
    762794  else
    763     fQECam->SetPINDiodeMethodValid(kFALSE);
     795    fQECam->SetBlindPixelMethodValid(FinalizePINDiode());
    764796
    765797  //
     
    787819    fCam      ->SetReadyToSave();
    788820
    789   fQECam    ->SetReadyToSave();
    790   fBadPixels->SetReadyToSave();
    791 
     821  if (fIntensQE)
     822    fIntensQE ->SetReadyToSave();
     823  else
     824    fQECam    ->SetReadyToSave();
     825
     826  if (fIntensBad)
     827    fIntensBad->SetReadyToSave();
     828  else
     829    fBadPixels->SetReadyToSave();
     830
     831  if (fIntensBlind)
     832    fIntensBlind->SetReadyToSave();
    792833  if (fBlindCam)
    793834    fBlindCam->SetReadyToSave();
     
    9851026    {
    9861027     
    987       MBadPixelsPix    &bad    = (*fBadPixels)[i];
     1028      MBadPixelsPix    &bad    = fIntensBad ? (*fIntensBad)[i] : (*fBadPixels)[i];
    9881029      MCalibrationPix  &pix    = fIntensCam ? (*fIntensCam)[i] : (*fCam)[i];
    9891030
     
    10911132        ? (MCalibrationChargePix&)(*fIntensCam)[i]
    10921133        : (MCalibrationChargePix&)(*fCam)  [i];
    1093       MBadPixelsPix         &bad = (*fBadPixels)[i];
     1134      MBadPixelsPix         &bad = fIntensBad
     1135        ? (*fIntensBad)[i]
     1136        : (*fBadPixels)[i];
    10941137     
    10951138      if (!pix.IsFFactorMethodValid())
     
    12101253        continue;
    12111254
    1212       MBadPixelsPix         &bad = (*fBadPixels)[i];
     1255      MBadPixelsPix         &bad = fIntensBad
     1256        ? (*fIntensBad)[i]
     1257        : (*fBadPixels)[i];
    12131258
    12141259      if (bad.IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid))
     
    13531398        ? (MCalibrationChargePix&)(*fIntensCam)[i]
    13541399        : (MCalibrationChargePix&)(*fCam)[i];
    1355       MBadPixelsPix         &bad = (*fBadPixels)[i];
     1400      MBadPixelsPix         &bad = fIntensBad
     1401        ? (*fIntensBad)[i]
     1402        : (*fBadPixels)[i];
    13561403
    13571404      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     
    13991446{
    14001447
    1401   if (!fBlindCam)
     1448  if (!fBlindCam && !fIntensBlind)
    14021449    return kFALSE; 
    14031450
     
    14061453  Int_t   nvalid  = 0;
    14071454
    1408   for (Int_t i=0; i<fBlindCam->GetSize(); i++)
    1409     {
    1410      
    1411       MCalibrationBlindPix &blindpix = (MCalibrationBlindPix&)(*fBlindCam)[i];
     1455  MCalibrationBlindCam  *blindcam = fIntensBlind   
     1456    ? (MCalibrationBlindCam*)fIntensBlind->GetCam() : fBlindCam;
     1457  MCalibrationQECam     *qecam    = fIntensQE     
     1458    ? (MCalibrationQECam*)fIntensQE->GetCam()    : fQECam;
     1459  MCalibrationChargeCam *chargecam = fIntensCam
     1460    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1461
     1462  for (Int_t i=0; i<blindcam->GetSize(); i++)
     1463    {
     1464     
     1465      MCalibrationBlindPix &blindpix = (MCalibrationBlindPix&)(*blindcam)[i];
    14121466
    14131467      if (!blindpix.IsValid())
     
    14561510  fluxvar /= 1./fluxvar;
    14571511
    1458   const Float_t photons = flux * (*fGeom)[0].GetA() / fQECam->GetPlexiglassQE();
    1459   if (fIntensCam)
    1460     fIntensCam->SetNumPhotonsBlindPixelMethod(photons);
    1461   else
    1462     fCam->SetNumPhotonsBlindPixelMethod(photons);
    1463  
    1464   const Float_t photrelvar = fluxvar / flux / flux + fQECam->GetPlexiglassQERelVar();
     1512  const Float_t photons = flux * (*fGeom)[0].GetA() / qecam->GetPlexiglassQE();
     1513  chargecam->SetNumPhotonsBlindPixelMethod(photons);
     1514 
     1515  const Float_t photrelvar = fluxvar / flux / flux + qecam->GetPlexiglassQERelVar();
    14651516  if (photrelvar > 0.)
    1466     if (fIntensCam)
    1467       fIntensCam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons)); 
    1468     else
    1469       fCam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons)); 
     1517    chargecam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons)); 
    14701518
    14711519  return kTRUE;
     
    15751623    }
    15761624 
    1577   MCalibrationChargePix &avpix = fIntensCam
    1578     ? (MCalibrationChargePix&)fIntensCam->GetAverageArea(0)
    1579     : (MCalibrationChargePix&)fCam->GetAverageArea(0);
    1580   MCalibrationQEPix     &qepix = (MCalibrationQEPix&)  fQECam->GetAverageArea(0); 
     1625  MCalibrationQECam     *qecam     = fIntensQE     
     1626    ? (MCalibrationQECam*)    fIntensQE->GetCam()   : fQECam;
     1627  MCalibrationChargeCam *chargecam = fIntensCam
     1628    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1629  MBadPixelsCam         *badcam    = fIntensBad
     1630    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
     1631
     1632  MCalibrationChargePix &avpix = (MCalibrationChargePix&)chargecam->GetAverageArea(0);
     1633  MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    qecam->GetAverageArea(0);
    15811634
    15821635  const Float_t avphotons   = avpix.GetPheFFactorMethod()       
     
    15841637                           / qepix.GetPMTCollectionEff()
    15851638                           / qepix.GetLightGuidesEff(fPulserColor)
    1586                            / fQECam->GetPlexiglassQE();
     1639                           / qecam->GetPlexiglassQE();
    15871640
    15881641  const Float_t avphotrelvar = avpix.GetPheFFactorMethodRelVar()
     
    15901643                            + qepix.GetPMTCollectionEffRelVar()
    15911644                            + qepix.GetLightGuidesEffRelVar(fPulserColor)
    1592                             + fQECam->GetPlexiglassQERelVar();
     1645                            + qecam->GetPlexiglassQERelVar();
    15931646
    15941647  const UInt_t nareas   = fGeom->GetNumAreas();
     
    15971650  // Set the results in the MCalibrationChargeCam
    15981651  //
    1599   if (fIntensCam)
    1600     fIntensCam->SetNumPhotonsFFactorMethod   (avphotons);
    1601   else
    1602     fCam->SetNumPhotonsFFactorMethod   (avphotons);
     1652  charge->SetNumPhotonsFFactorMethod   (avphotons);
    16031653
    16041654  if (avphotrelvar > 0.)
    1605     if (fIntensCam)
    1606       fIntensCam->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons)); 
    1607     else
    1608       fCam->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons)); 
     1655    charge->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons)); 
    16091656
    16101657  TArrayF lowlim           (nareas);
     
    16211668    {
    16221669     
    1623       MCalibrationChargePix &pix = fIntensCam
    1624         ? (MCalibrationChargePix&)(*fIntensCam)[i]
    1625         : (MCalibrationChargePix&)(*fCam)[i];
    1626       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    1627       MBadPixelsPix         &bad =                   (*fBadPixels)[i];
     1670      MCalibrationChargePix &avpix = (MCalibrationChargePix&)(*chargecam)[i];
     1671      MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    (*qecam)    [i];
     1672      MBadPixelsPix         &bad =                           (*badcam)   [i];
    16281673
    16291674      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     
    16491694      if (!pix.CalcMeanFFactor( photons , avphotrelvar ))
    16501695        {
    1651           (*fBadPixels)[i].SetUncalibrated( MBadPixelsPix::kDeviatingFFactor );
     1696          bad.SetUncalibrated( MBadPixelsPix::kDeviatingFFactor );
    16521697          if (IsCheckDeviatingBehavior())
    1653             (*fBadPixels)[i].SetUnsuitable  ( MBadPixelsPix::kUnreliableRun    );
     1698            bad.SetUnsuitable  ( MBadPixelsPix::kUnreliableRun    );
    16541699          continue;
    16551700        }
     
    16761721        }
    16771722
    1678       avffactorphotvar[i] = (avffactorphotvar[i] - avffactorphotons[i]*avffactorphotons[i]/numffactor[i]) / (numffactor[i]-1.);
     1723      avffactorphotvar[i] = (avffactorphotvar[i] - avffactorphotons[i]*avffactorphotons[i]/numffactor[i])
     1724                          / (numffactor[i]-1.);
    16791725      avffactorphotons[i] = avffactorphotons[i] / numffactor[i];
    16801726
     
    17391785    {
    17401786     
    1741       MCalibrationChargePix &pix = fIntensCam
    1742         ? (MCalibrationChargePix&)(*fIntensCam)[i]
    1743         : (MCalibrationChargePix&)(*fCam)[i];
    1744       MBadPixelsPix         &bad =                   (*fBadPixels)[i];
     1787      MCalibrationChargePix &pix   = (MCalibrationChargePix&)(*chargecam)[i];
     1788      MBadPixelsPix         &bad   =                         (*badcam)   [i];
    17451789
    17461790      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     
    17651809    {
    17661810     
    1767       MCalibrationChargePix &pix = fIntensCam
    1768         ? (MCalibrationChargePix&)(*fIntensCam)[i]
    1769         : (MCalibrationChargePix&)(*fCam)[i];
    1770       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    1771       MBadPixelsPix         &bad =                   (*fBadPixels)[i];
    1772      
     1811      MCalibrationChargePix &pix   = (MCalibrationChargePix&)(*chargecam)[i];
     1812      MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    (*qecam)    [i];
     1813      MBadPixelsPix         &bad   =                         (*badcam)   [i];
     1814
    17731815      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
    17741816        {
     
    18051847  const UInt_t npixels  = fGeom->GetNumPixels();
    18061848
     1849  MCalibrationQECam     *qecam     = fIntensQE     
     1850    ? (MCalibrationQECam*)    fIntensQE->GetCam()   : fQECam;
     1851  MCalibrationChargeCam *chargecam = fIntensCam
     1852    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1853  MCalibrationBlindCam  *blindcam  = fIntensBlind
     1854    ? (MCalibrationBlindCam*) fIntensBlind->GetCam(): fBlindCam;
     1855  MBadPixelsCam         *badcam    = fIntensBad
     1856    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
     1857
    18071858  //
    18081859  // Set the results in the MCalibrationChargeCam
    18091860  //
    18101861  /*
    1811   if (fBlindPixel)
     1862  if (blindcam)
    18121863    {
    18131864      if (fBlindPixel->IsFluxInsidePlexiglassAvailable())
     
    18381889    {
    18391890     
    1840       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    1841 
    1842       if (!fBlindCam)
     1891      MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    (*qecam)    [i];
     1892     
     1893      if (!blindcam)
    18431894        {
    18441895          qepix.SetBlindPixelMethodValid(kFALSE, fPulserColor);
     
    18461897        }
    18471898
    1848       /*
    1849       if (!fBlindPixel->IsFluxInsidePlexiglassAvailable())
     1899      MBadPixelsPix         &bad   =                         (*badcam)   [i];
     1900
     1901      if (bad.IsUnsuitable (MBadPixelsPix::kUnsuitableRun))
    18501902        {
    18511903          qepix.SetBlindPixelMethodValid(kFALSE, fPulserColor);
    18521904          continue;
    18531905        }
    1854       */     
    1855 
    1856       MBadPixelsPix &bad = (*fBadPixels)[i];
    1857       if (bad.IsUnsuitable (MBadPixelsPix::kUnsuitableRun))
    1858         {
    1859           qepix.SetBlindPixelMethodValid(kFALSE, fPulserColor);
    1860           continue;
    1861         }
    1862      
    1863       MCalibrationChargePix &pix = fIntensCam
    1864         ? (MCalibrationChargePix&)(*fIntensCam)[i]
    1865         : (MCalibrationChargePix&)(*fCam)[i];       
    1866       MGeomPix              &geo =                        (*fGeom)[i];
    1867      
     1906     
     1907      MCalibrationChargePix &pix   = (MCalibrationChargePix&)(*chargecam)[i];
     1908      MGeomPix              &geo   =                         (*fGeom)    [i];
     1909
    18681910      const Float_t qe        = pix.GetPheFFactorMethod()
    1869         //                             / fBlindPixel->GetFluxInsidePlexiglass()
     1911                             / blindcam->GetFluxInsidePlexiglass()
    18701912                             / geo.GetA()
    1871                              * fQECam->GetPlexiglassQE();
    1872 
    1873       const Float_t qerelvar = /* fBlindPixel->GetFluxInsidePlexiglassRelVar()
    1874                                   + */ fQECam->GetPlexiglassQERelVar()
     1913                             * qecam->GetPlexiglassQE();
     1914
     1915      const Float_t qerelvar = blindcam->GetFluxInsidePlexiglassRelVar()
     1916                               + qecam->GetPlexiglassQERelVar()
    18751917                               + pix.GetPheFFactorMethodRelVar();
    18761918
     
    19071949  const UInt_t npixels  = fGeom->GetNumPixels();
    19081950
     1951  MCalibrationQECam     *qecam     = fIntensQE     
     1952    ? (MCalibrationQECam*)    fIntensQE->GetCam()   : fQECam;
     1953  MCalibrationChargeCam *chargecam = fIntensCam
     1954    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1955  MCalibrationBlindCam  *blindcam  = fIntensBlind
     1956    ? (MCalibrationBlindCam*) fIntensBlind->GetCam(): fBlindCam;
     1957  MBadPixelsCam         *badcam    = fIntensBad
     1958    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
    19091959  //
    19101960  //  With the knowledge of the overall photon flux, calculate the
     
    19141964    {
    19151965     
    1916       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
     1966      MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    (*qecam)    [i];
    19171967
    19181968      if (!fPINDiode)
     
    19281978        }
    19291979
    1930       MBadPixelsPix &bad  =  (*fBadPixels)[i];
     1980      MBadPixelsPix         &bad   =                         (*badcam)   [i];
    19311981
    19321982      if (!bad.IsUnsuitable (MBadPixelsPix::kUnsuitableRun))
     
    19361986        }
    19371987     
    1938       MCalibrationChargePix &pix = fIntensCam
    1939         ?  (MCalibrationChargePix&)(*fIntensCam)[i]     
    1940         :  (MCalibrationChargePix&)(*fCam)[i];
    1941       MGeomPix              &geo =                        (*fGeom)[i];
     1988      MCalibrationChargePix &pix   = (MCalibrationChargePix&)(*chargecam)[i];
     1989      MGeomPix              &geo =                           (*fGeom)    [i];
    19421990     
    19431991      const Float_t qe       =  pix.GetPheFFactorMethod()
     
    19682016  const UInt_t npixels  = fGeom->GetNumPixels();
    19692017
     2018  MCalibrationQECam     *qecam     = fIntensQE     
     2019    ? (MCalibrationQECam*)    fIntensQE->GetCam()   : fQECam;
     2020  MBadPixelsCam         *badcam    = fIntensBad
     2021    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
     2022
    19702023  for (UInt_t i=0; i<npixels; i++)
    19712024    {
    19722025     
    1973       MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    1974       MBadPixelsPix       &bad   = (*fBadPixels)[i];
     2026      MCalibrationQEPix     &qepix = (MCalibrationQEPix&)    (*qecam)    [i];
     2027      MBadPixelsPix         &bad   =                         (*badcam)   [i];
    19752028
    19762029      if (!bad.IsUnsuitable (MBadPixelsPix::kUnsuitableRun))
     
    20002053  TArrayI counts(nareas);
    20012054
    2002   for (Int_t i=0; i<fBadPixels->GetSize(); i++)
    2003     {
    2004       MBadPixelsPix &bad = (*fBadPixels)[i];
     2055  MBadPixelsCam         *badcam    = fIntensBad
     2056    ? (MBadPixelsCam*)fIntensBad->GetCam()  : fBadPixels;
     2057  MCalibrationChargeCam *chargecam = fIntensCam
     2058    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     2059
     2060  for (Int_t i=0; i<badcam->GetSize(); i++)
     2061    {
     2062      MBadPixelsPix &bad = (*badcam)[i];
    20052063      if (!bad.IsBad())
    20062064        {
     
    20162074  counts.Reset();
    20172075
    2018   for (Int_t i=0; i<fBadPixels->GetSize(); i++)
    2019     {
    2020       MBadPixelsPix &bad = (*fBadPixels)[i];
     2076  for (Int_t i=0; i<badcam->GetSize(); i++)
     2077    {
     2078      MBadPixelsPix &bad =  (*badcam)[i];
     2079
    20212080      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
    20222081        {
     
    20272086
    20282087  for (Int_t aidx=0; aidx<nareas; aidx++)
    2029     if (fIntensCam)
    2030       fIntensCam->SetNumUnsuitable(counts[aidx], aidx);
    2031     else
    2032       fCam->SetNumUnsuitable(counts[aidx], aidx);
     2088    chargecam->SetNumUnsuitable(counts[aidx], aidx);
    20332089
    20342090  if (fGeom->InheritsFrom("MGeomCamMagic"))
     
    20382094  counts.Reset();
    20392095
    2040   for (Int_t i=0; i<fBadPixels->GetSize(); i++)
    2041     {
    2042       MBadPixelsPix &bad = (*fBadPixels)[i];
     2096  for (Int_t i=0; i<badcam->GetSize(); i++)
     2097    {
     2098
     2099      MBadPixelsPix &bad = (*badcam)[i];
     2100
    20432101      if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun))
    20442102        {
     
    20492107
    20502108  for (Int_t aidx=0; aidx<nareas; aidx++)
    2051     if (fIntensCam)
    2052       fIntensCam->SetNumUnreliable(counts[aidx], aidx);
    2053     else
    2054       fCam->SetNumUnreliable(counts[aidx], aidx);
     2109    chargecam->SetNumUnreliable(counts[aidx], aidx);
    20552110
    20562111  *fLog << " " << setw(7) << "Unreliable Pixels:              "
     
    20692124  UInt_t countouter = 0;
    20702125
    2071   for (Int_t i=0; i<fBadPixels->GetSize(); i++)
    2072     {
    2073       MBadPixelsPix &bad = (*fBadPixels)[i];
     2126  MBadPixelsCam         *badcam    = fIntensBad
     2127    ? (MBadPixelsCam*)fIntensBad->GetCam()  : fBadPixels;
     2128
     2129  for (Int_t i=0; i<badcam->GetSize(); i++)
     2130    {
     2131      MBadPixelsPix &bad = (*badcam)[i];
     2132
    20742133      if (bad.IsUncalibrated(typ))
    20752134        {
Note: See TracChangeset for help on using the changeset viewer.