Ignore:
Timestamp:
09/14/04 00:11:10 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
10 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/CalibLinkDef.h

    r4933 r4986  
    1414#pragma link C++ class MCalibrationIntensityCam+;
    1515#pragma link C++ class MCalibrationIntensityChargeCam+;
     16#pragma link C++ class MCalibrationIntensityBlindCam+;
    1617#pragma link C++ class MCalibrationIntensityQECam+;
    1718#pragma link C++ class MCalibrationIntensityRelTimeCam+;
     
    3132#pragma link C++ class MCalibrationChargeCam+;
    3233#pragma link C++ class MCalibrationChargePix+;
     34#pragma link C++ class MCalibrationBlindCam+;
     35#pragma link C++ class MCalibrationBlindPix+;
     36#pragma link C++ class MCalibrationBlindCamOneOldStyle+;
     37#pragma link C++ class MCalibrationBlindCamTwoNewStyle+;
    3338#pragma link C++ class MCalibrationChargeBlindCamOneOldStyle+;
    3439#pragma link C++ class MCalibrationChargeBlindCamTwoNewStyle+;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r4967 r4986  
    8989MCalibrationCam::MCalibrationCam(const char *name, const char *title)
    9090    : fPulserColor(kNONE),
    91       fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL)
    92 {
    93 
    94   fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
    95   fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
     91      fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL),
     92      fAverageBadAreas(NULL), fAverageBadSectors(NULL)
     93{
    9694
    9795  fNumHiGainFADCSlices.Set(1);
     
    125123    delete fAverageSectors;
    126124
    127   delete fAverageBadAreas;
    128   delete fAverageBadSectors;
     125  if (fAverageBadAreas)
     126    delete fAverageBadAreas;
     127
     128  if (fAverageBadSectors)
     129    delete fAverageBadSectors;
    129130 
    130131}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r4967 r4986  
    1 /* ======================================================================== *\
     1 /* ======================================================================== *\
    22!
    33! *
     
    208208#include "MCalibrationChargePix.h"
    209209#include "MCalibrationChargePINDiode.h"
    210 #include "MCalibrationChargeBlindPix.h"
    211 #include "MCalibrationChargeBlindCam.h"
     210#include "MCalibrationBlindPix.h"
     211#include "MCalibrationBlindCam.h"
    212212
    213213#include "MExtractedSignalCam.h"
     
    317317    fCam        = NULL;
    318318    fIntensCam  = NULL;
    319     fBlindPixel = NULL;
    320319    fBlindCam   = NULL;
    321320    fPINDiode   = NULL;
     
    404403//
    405404// Search for the following input containers and give a warning if not existing:
    406 //  - MCalibrationChargeBlindPix
     405//  - MCalibrationBlindPix
    407406//  - MCalibrationChargePINDiode
    408407//
     
    426425//
    427426// - MCalibrationChargeCam
    428 // - MCalibrationChargeBlindPix (if existing)
     427// - MCalibrationBlindPix (if existing)
    429428// - MCalibrationChargePINDiode (if existing)
    430429//
     
    456455  // Optional Containers
    457456  //
    458   fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindObject("MCalibrationChargeBlindPix");
    459   if (!fBlindPixel)
    460     {
    461       fBlindCam = (MCalibrationChargeBlindCam*)pList->FindObject("MCalibrationChargeBlindCam");
    462       if (!fBlindCam)
    463         {
     457  fBlindCam = (MCalibrationBlindCam*)pList->FindObject("MCalibrationBlindCam");
     458  if (!fBlindCam)
     459    {
    464460      *fLog << endl;
    465461      *fLog << warn << GetDescriptor()
    466             << ": MCalibrationChargeBlindPix nor MCalibrationChargeBlindCam "
     462            << ": MCalibrationBlindPix nor MCalibrationBlindCam "
    467463            << " found... no Blind Pixel method! " << endl;
    468         }
    469     }
    470  
     464    }
     465
    471466  fPINDiode = (MCalibrationChargePINDiode*)pList->FindObject("MCalibrationChargePINDiode");
    472467  if (!fPINDiode)
     
    603598    fCam->SetPulserColor( fPulserColor );
    604599 
    605   if (fBlindPixel)
    606     fBlindPixel->SetColor( fPulserColor );
    607  
    608600  if (fBlindCam)
    609     fBlindCam->SetColor( fPulserColor );
     601    fBlindCam->SetPulserColor( fPulserColor );
    610602 
    611603  if (fPINDiode)
     
    640632// 
    641633// Call MParContainer::SetReadyToSave() for fIntensCam, fCam, fQECam, fBadPixels and
    642 //                                          fBlindPixel and fPINDiode if they exist
     634//                                          fBlindCam and fPINDiode if they exist
    643635//
    644636// Print out some statistics
     
    658650              << ": MCalibrationChargePINDiode is declared not valid... no PIN Diode method! " << endl;
    659651        fPINDiode = NULL;
    660       }
    661 
    662   if (fBlindPixel)
    663     if (!fBlindPixel->IsValid())
    664       {
    665         *fLog << warn << GetDescriptor()
    666               << ": MCalibrationChargeBlindPix is declared not valid... no Blind Pixel method! " << endl;
    667         fBlindPixel = NULL;
    668652      }
    669653
     
    766750  // Finalize Blind Pixel
    767751  //
    768   if (fBlindPixel)
    769     if (FinalizeBlindPixel())
    770       fQECam->SetBlindPixelMethodValid(kTRUE);
    771     else
    772       fQECam->SetBlindPixelMethodValid(kFALSE);
    773   else
    774     if (FinalizeBlindCam())
    775       fQECam->SetBlindPixelMethodValid(kTRUE);
    776     else
    777       fQECam->SetBlindPixelMethodValid(kFALSE);
     752  if (FinalizeBlindCam())
     753    fQECam->SetBlindPixelMethodValid(kTRUE);
     754  else
     755    fQECam->SetBlindPixelMethodValid(kFALSE);
    778756
    779757  //
     
    812790  fBadPixels->SetReadyToSave();
    813791
    814   if (fBlindPixel)
    815     fBlindPixel->SetReadyToSave();
    816792  if (fBlindCam)
    817793    fBlindCam->SetReadyToSave();
     
    14071383
    14081384
     1385
    14091386// ------------------------------------------------------------------------
    14101387//
    1411 // Returns kFALSE if pointer to MCalibrationChargeBlindPix is NULL
     1388// Returns kFALSE if pointer to MCalibrationBlindCam is NULL
    14121389//
    14131390// The check returns kFALSE if:
     
    14171394//
    14181395// Calls:
    1419 // - MCalibrationChargeBlindPix::CalcFluxInsidePlexiglass()
    1420 //
    1421 Bool_t MCalibrationChargeCalc::FinalizeBlindPixel()
    1422 {
    1423 
    1424   if (!fBlindPixel)
    1425     return kFALSE; 
    1426 
    1427   const Float_t lambda      = fBlindPixel->GetLambda();
    1428   const Float_t lambdaerr   = fBlindPixel->GetLambdaErr();
    1429   const Float_t lambdacheck = fBlindPixel->GetLambdaCheck();
    1430 
    1431   if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) > fLambdaCheckLimit)
    1432     {
    1433       *fLog << warn << GetDescriptor()
    1434             << Form("%s%4.2f%s%4.2f%s%4.2f%s",": Lambda: ",lambda," and Lambda-Check: ",
    1435                     lambdacheck," differ by more than ",fLambdaCheckLimit," in the Blind Pixel ")
    1436             << endl;
    1437       return kFALSE;
    1438     }
    1439  
    1440   if (lambdaerr > fLambdaErrLimit)
    1441     {
    1442       *fLog << warn << GetDescriptor()
    1443             << Form("%s%4.2f%s%4.2f%s",": Error of Fitted Lambda: ",lambdaerr," is greater than ",
    1444                     fLambdaErrLimit," in Blind Pixel ") << endl;
    1445       return kFALSE;
    1446     }
    1447      
    1448   if (!fBlindPixel->CalcFluxInsidePlexiglass())
    1449     {
    1450       *fLog << warn << "Could not calculate the flux of photons from the Blind Pixel, "
    1451             << "will skip Blind Pixel Calibration " << endl;
    1452       return kFALSE;
    1453     }
    1454  
    1455   return kTRUE;
    1456 }
    1457 
    1458 // ------------------------------------------------------------------------
    1459 //
    1460 // Returns kFALSE if pointer to MCalibrationChargeBlindCam is NULL
    1461 //
    1462 // The check returns kFALSE if:
    1463 //
    1464 // 1) fLambda and fLambdaCheck are separated relatively to each other by more than fLambdaCheckLimit
    1465 // 2) BlindPixel has an fLambdaErr greater than fLambdaErrLimit
    1466 //
    1467 // Calls:
    1468 // - MCalibrationChargeBlindPix::CalcFluxInsidePlexiglass()
     1396// - MCalibrationBlindPix::CalcFluxInsidePlexiglass()
    14691397//
    14701398Bool_t MCalibrationChargeCalc::FinalizeBlindCam()
     
    14781406  Int_t   nvalid  = 0;
    14791407
    1480   for (UInt_t i=0; i<fBlindCam->GetNumBlindPixels(); i++)
    1481     {
    1482      
    1483       MCalibrationChargeBlindPix &blindpix = (*fBlindCam)[i];
     1408  for (Int_t i=0; i<fBlindCam->GetSize(); i++)
     1409    {
     1410     
     1411      MCalibrationBlindPix &blindpix = (MCalibrationBlindPix&)(*fBlindCam)[i];
    14841412
    14851413      if (!blindpix.IsValid())
     
    18581786// Loop over pixels:
    18591787//
    1860 // - Continue, if not MCalibrationChargeBlindPix::IsFluxInsidePlexiglassAvailable() and set:
     1788// - Continue, if not MCalibrationBlindPix::IsFluxInsidePlexiglassAvailable() and set:
    18611789//                    MCalibrationQEPix::SetBlindPixelMethodValid(kFALSE,fPulserColor)
    18621790//
    18631791// - Calculate the quantum efficiency with the formula:
    18641792//
    1865 //   QE =  Num.Phes / MCalibrationChargeBlindPix::GetFluxInsidePlexiglass()
     1793//   QE =  Num.Phes / MCalibrationBlindPix::GetFluxInsidePlexiglass()
    18661794//        / MGeomPix::GetA() * MCalibrationQECam::GetPlexiglassQE()
    18671795//
     
    18801808  // Set the results in the MCalibrationChargeCam
    18811809  //
     1810  /*
    18821811  if (fBlindPixel)
    18831812    {
     
    19011830        }
    19021831    }
     1832  */
    19031833  //
    19041834  //  With the knowledge of the overall photon flux, calculate the
     
    19101840      MCalibrationQEPix   &qepix = (MCalibrationQEPix&)  (*fQECam)[i];
    19111841
    1912       if (!fBlindPixel)
     1842      if (!fBlindCam)
    19131843        {
    19141844          qepix.SetBlindPixelMethodValid(kFALSE, fPulserColor);
     
    19161846        }
    19171847
     1848      /*
    19181849      if (!fBlindPixel->IsFluxInsidePlexiglassAvailable())
    19191850        {
     
    19211852          continue;
    19221853        }
    1923      
     1854      */     
     1855
    19241856      MBadPixelsPix &bad = (*fBadPixels)[i];
    19251857      if (bad.IsUnsuitable (MBadPixelsPix::kUnsuitableRun))
     
    19351867     
    19361868      const Float_t qe        = pix.GetPheFFactorMethod()
    1937                              / fBlindPixel->GetFluxInsidePlexiglass()
     1869        //                             / fBlindPixel->GetFluxInsidePlexiglass()
    19381870                             / geo.GetA()
    19391871                             * fQECam->GetPlexiglassQE();
    19401872
    1941       const Float_t qerelvar = fBlindPixel->GetFluxInsidePlexiglassRelVar()
    1942                                + fQECam->GetPlexiglassQERelVar()
     1873      const Float_t qerelvar = /* fBlindPixel->GetFluxInsidePlexiglassRelVar()
     1874                                  + */ fQECam->GetPlexiglassQERelVar()
    19431875                               + pix.GetPheFFactorMethodRelVar();
    19441876
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r4947 r4986  
    3131class MPedestalPix;
    3232class MCalibrationChargePINDiode;
    33 class MCalibrationChargeBlindCam;
    34 class MCalibrationChargeBlindPix;
     33class MCalibrationBlindCam;
    3534class MCalibrationChargePix;
    3635class MCalibrationChargeCam;
     
    8483  MCalibrationIntensityChargeCam *fIntensCam;  //  Calibrated Charges of all pixels   
    8584  MCalibrationChargeCam      *fCam;            //  Calibrated Charges of all pixels
    86   MCalibrationChargeBlindPix *fBlindPixel;     //  Calibrated Charges of the Blind Pixel
    87   MCalibrationChargeBlindCam *fBlindCam;       //  Calibrated Charges of the Blind Pixels
     85  MCalibrationBlindCam       *fBlindCam;       //  Calibrated Charges of the Blind Pixels
    8886  MCalibrationChargePINDiode *fPINDiode;       //  Calibrated Charges of the PIN Diode
    8987  MCalibrationQECam          *fQECam;          //  Calibrated Quantum Efficiencies of all pixels
     
    112110  Bool_t FinalizeCharges         ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
    113111  Bool_t FinalizePINDiode        ();
    114   Bool_t FinalizeBlindPixel      ();
    115112  Bool_t FinalizeBlindCam        (); 
    116113  Bool_t FinalizeFFactorMethod   ();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r4967 r4986  
    129129  fTitle = title ? title : "Storage container for the Calibration Information in the camera";
    130130 
    131   fPixels           = new TClonesArray("MCalibrationChargePix",1);
    132   fAverageAreas     = new TClonesArray("MCalibrationChargePix",1);
    133   fAverageSectors   = new TClonesArray("MCalibrationChargePix",1);
     131  fPixels            = new TClonesArray("MCalibrationChargePix",1);
     132  fAverageAreas      = new TClonesArray("MCalibrationChargePix",1);
     133  fAverageSectors    = new TClonesArray("MCalibrationChargePix",1);
     134  fAverageBadAreas   = new TClonesArray("MBadPixelsPix",1);
     135  fAverageBadSectors = new TClonesArray("MBadPixelsPix",1);
    134136
    135137  Clear();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc

    r4333 r4986  
    102102}
    103103
     104
     105// -----------------------------------------------------
     106//
     107// copy 'constructor'
     108//
     109void MCalibrationPix::Copy(TObject& object) const
     110{
     111
     112  MCalibrationPix &pix = (MCalibrationPix&)object;
     113
     114  //
     115  // Copy the data members
     116  //
     117  pix.fPixId             = fPixId;
     118  pix.fFlags             = fFlags;
     119  pix.fHiGainMean        = fHiGainMean;
     120  pix.fHiGainMeanVar     = fHiGainMeanVar;
     121  pix.fHiGainNumBlackout = fHiGainNumBlackout;
     122  pix.fHiGainNumPickup   = fHiGainNumPickup;
     123  pix.fHiGainSigma       = fHiGainSigma;
     124  pix.fHiGainSigmaVar    = fHiGainSigmaVar;
     125  pix.fHiGainProb        = fHiGainProb;
     126  pix.fLoGainMean        = fLoGainMean;
     127  pix.fLoGainMeanVar     = fLoGainMeanVar;
     128  pix.fLoGainNumBlackout = fLoGainNumBlackout;
     129  pix.fLoGainNumPickup   = fLoGainNumPickup;
     130  pix.fLoGainSigma       = fLoGainSigma;
     131  pix.fLoGainSigmaVar    = fLoGainSigmaVar;
     132  pix.fLoGainProb        = fLoGainProb;
     133 
     134}
     135
     136
    104137// --------------------------------------------------------------------------
    105138//
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h

    r4333 r4986  
    3434  ~MCalibrationPix() {}
    3535 
    36   virtual void Clear(Option_t *o="");
    37 
     36  void Clear(Option_t *o="");
     37  void Copy(TObject& object) const;
     38 
    3839  // Setter
    3940  void SetPixId( const Int_t i )   { fPixId = i; }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc

    r4882 r4986  
    110110    fTitle = title ? title : "Storage container for the calibrated Quantum Efficiency of the camera";
    111111
    112     fPixels           = new TClonesArray("MCalibrationQEPix",1);
    113     fAverageAreas     = new TClonesArray("MCalibrationQEPix",1);
    114     fAverageSectors   = new TClonesArray("MCalibrationQEPix",1);
     112    fPixels             = new TClonesArray("MCalibrationQEPix",1);
     113    fAverageAreas       = new TClonesArray("MCalibrationQEPix",1);
     114    fAverageSectors     = new TClonesArray("MCalibrationQEPix",1);
     115    fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
     116    fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
    115117
    116118    fFlags.Set(MCalibrationCam::gkNumPulserColors);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc

    r4269 r4986  
    112112  fTitle = title ? title : "Container for Relative Time Calibration Information";
    113113 
    114   fPixels           = new TClonesArray("MCalibrationRelTimePix",1);
    115   fAverageAreas     = new TClonesArray("MCalibrationRelTimePix",1);
    116   fAverageSectors   = new TClonesArray("MCalibrationRelTimePix",1);
     114  fPixels             = new TClonesArray("MCalibrationRelTimePix",1);
     115  fAverageAreas       = new TClonesArray("MCalibrationRelTimePix",1);
     116  fAverageSectors     = new TClonesArray("MCalibrationRelTimePix",1);
     117  fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
     118  fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
    117119 
    118120}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationTestCam.cc

    r4649 r4986  
    8989  fTitle = title ? title : "Storage container for the Calibration Test Information in the camera";
    9090 
    91   fPixels           = new TClonesArray("MCalibrationTestPix",1);
    92   fAverageAreas     = new TClonesArray("MCalibrationTestPix",1);
    93   fAverageSectors   = new TClonesArray("MCalibrationTestPix",1);
     91  fPixels            = new TClonesArray("MCalibrationTestPix",1);
     92  fAverageAreas      = new TClonesArray("MCalibrationTestPix",1);
     93  fAverageSectors    = new TClonesArray("MCalibrationTestPix",1);
    9494
    9595  Clear();
  • trunk/MagicSoft/Mars/mcalib/Makefile

    r4934 r4986  
    3838           MCalibrationIntensityCam.cc \
    3939           MCalibrationIntensityChargeCam.cc \
     40           MCalibrationIntensityBlindCam.cc \
    4041           MCalibrationIntensityQECam.cc \
    4142           MCalibrationIntensityRelTimeCam.cc \
     
    5556           MCalibrationChargeCam.cc \
    5657           MCalibrationChargePix.cc  \
     58           MCalibrationBlindCam.cc  \
     59           MCalibrationBlindPix.cc  \
     60           MCalibrationBlindCamOneOldStyle.cc  \
     61           MCalibrationBlindCamTwoNewStyle.cc  \
    5762           MCalibrationChargeBlindCamOneOldStyle.cc  \
    5863           MCalibrationChargeBlindCamTwoNewStyle.cc  \
Note: See TracChangeset for help on using the changeset viewer.