Ignore:
Timestamp:
02/08/04 20:54:22 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3029 r3057  
    2929//   Task to calculate the calibration conversion factors from the FADC
    3030//   time slices. The integrated time slices have to be delivered by an
    31 //   MExtractedSignalCam. The pedestals by an MPedestalCam and possibly
    32 //   arrival times from MArrivalTime
     31//   MExtractedSignalCam. The pedestals by an MPedestalCam.
    3332//
    3433//   The output container MCalibrationCam holds one entry of type MCalibrationPix
     
    3736//   ProProcess: Search for MPedestalCam, MExtractedSignalCam
    3837//               Initialize MCalibrationCam
    39 //               Initialize MArrivalTime if exists
    4038//               Initialize pulser light wavelength
    4139//               
     
    6260//
    6361//                Fits can be excluded via the commands:
    64 //                MalibrationCam::SkipTimeFits()   (skip all time fits)
    6562//                MalibrationCam::SkipBlindPixelFits()  (skip all blind
    6663//                pixel fits)
     
    112109#include "MCalibrationPINDiode.h"
    113110
    114 #include "MArrivalTime.h"
    115 
    116111ClassImp(MCalibrationCalc);
    117112
    118113using namespace std;
    119114
    120 const Int_t MCalibrationCalc::fBlindPixelId = 559;
    121 const Int_t MCalibrationCalc::fPINDiodeId   = 9999;
     115const UInt_t MCalibrationCalc::fBlindPixelId = 559;
     116const UInt_t MCalibrationCalc::fPINDiodeId   = 9999;
    122117const Byte_t MCalibrationCalc::fgSaturationLimit = 254;
    123118const Byte_t MCalibrationCalc::fgBlindPixelFirst = 3;
     
    130125MCalibrationCalc::MCalibrationCalc(const char *name, const char *title)
    131126    : fPedestals(NULL), fCalibrations(NULL), fSignals(NULL),
    132       fRawEvt(NULL), fRunHeader(NULL), fArrivalTime(NULL), fEvtTime(NULL)
     127      fRawEvt(NULL), fRunHeader(NULL), fEvtTime(NULL)
    133128{
    134129
     
    147142{
    148143 
    149     SETBIT(fFlags, kUseTimes);
    150144    SETBIT(fFlags, kUseBlindPixelFit);
    151145    SETBIT(fFlags, kUseCosmicsRejection);
     
    153147    SETBIT(fFlags, kHiLoGainCalibration);
    154148
    155     CLRBIT(fFlags, kBlindPixelOverFlow);
    156     CLRBIT(fFlags, kPINDiodeOverFlow);
    157149    CLRBIT(fFlags, kHiGainOverFlow);
    158150    CLRBIT(fFlags, kLoGainOverFlow);
     
    198190// The following output containers are only searched, but not created
    199191//
    200 //  - MArrivaltime
    201192//  - MTime
    202193//
     
    226217        return kFALSE;
    227218      }
    228 
    229     fArrivalTime  = (MArrivalTime*)pList->FindObject("MArrivalTime");
    230219
    231220    fEvtTime      = (MTime*)pList->FindObject("MTime");
     
    310299        if (!TESTBIT(fFlags,kUseQualityChecks))
    311300          pix.SetExcludeQualityCheck();
     301
     302        // Exclude the blind pixel and the PIN Diode from normal pixel calibration:
     303        if (i == fBlindPixelId)
     304          pix.SetExcluded();
     305
     306        if (i == fPINDiodeId)
     307          pix.SetExcluded();
    312308
    313309     }
     
    450446  // Create a (second) loop to do fill the calibration histograms
    451447  // Search for: a signal in MExtractedSignalCam
    452   //             a time in MArrivalTime.
    453448  // Fill histograms with:
    454449  //             charge
     
    463458      MCalibrationPix &pix = (*fCalibrations)[pixid];
    464459     
    465       if (pix.IsExcluded())
    466         continue;
    467      
    468460      MExtractedSignalPix &sig =  (*fSignals)[pixid];
    469461     
     
    474466      Float_t reltime = 0.;
    475467
     468#if 0
    476469      if (TESTBIT(fFlags,kUseTimes))
    477470        {
     
    492485              if (pixid == 1)
    493486                referencetime = (Float_t)pixel.GetIdxMaxHiGainSample();
    494 
     487#endif
    495488              if (sig.IsLoGainUsed())
    496489                {
    497490                  abstime = (Float_t)pixel.GetIdxMaxLoGainSample();
    498                   reltime = abstime - referencetime;
     491                  //            reltime = abstime - referencetime;
    499492                }
    500493              else
    501494                {
    502495                  abstime = (Float_t)pixel.GetIdxMaxHiGainSample();
    503                   reltime = abstime - referencetime;
     496                  //                  reltime = abstime - referencetime;
    504497                }
    505             }
    506         }  /* if Use Times */
    507      
     498              //            }
     499              //        }  /* if Use Times */
     500
    508501      switch(pixid)
    509502        {
     
    526519                  "Overflow or Underflow occurred filling Blind Pixel sum = " << blindpixelsum << endl;
    527520             
    528               if (TESTBIT(fFlags,kUseTimes))
    529                 {
    530                   if (!blindpixel.FillTime(reltime))
    531                     *fLog << warn <<
    532                       "Overflow or Underflow occurred filling Blind Pixel time = " << reltime << endl;
    533                 }
    534              
    535               if (!TESTBIT(fFlags,kBlindPixelOverFlow))
    536                 if (!blindpixel.FillRChargevsTime(blindpixelsum,fEvents))
    537                   {
    538                     *fLog << warn <<
    539                       "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl;
    540                     SETBIT(fFlags,kBlindPixelOverFlow);
    541                   }
     521              //              if (!blindpixel.FillRChargevsTime(blindpixelsum,fEvents))
     522                  //                  *fLog << warn <<
     523                  //                    "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl;
    542524            } /* if use blind pixel */
    543525         
     
    550532         
    551533              if (!pindiode.FillCharge(sumhi))
    552                 *fLog << warn <<
    553                   "Overflow or Underflow occurred filling PINDiode: sum = " << sumhi << endl;
     534                *fLog << warn
     535                      << "Overflow or Underflow occurred filling PINDiode: sum = "
     536                      << sumhi << endl;
    554537             
    555               if (TESTBIT(fFlags,kUseTimes))
    556                 {
    557                   if (!pindiode.FillAbsTime(abstime))
    558                     *fLog << warn <<
    559                       "Overflow or Underflow occurred filling PINDiode abs. time = " << abstime << endl;
    560                   if (!pindiode.FillRelTime(reltime))
    561                     *fLog << warn <<
    562                       "Overflow or Underflow occurred filling PINDiode rel. time = " << reltime << endl;
    563                 }
    564              
    565               if (!TESTBIT(fFlags,kPINDiodeOverFlow))
    566                 if (!pindiode.FillRChargevsTime(sumhi,fEvents))
    567                   {
    568                     *fLog << warn
    569                           << "Overflow or Underflow occurred filling PINDiode: eventnr = "
    570                           << fEvents << endl;
    571                     SETBIT(fFlags,kPINDiodeOverFlow);
    572                   }
     538              if (!pindiode.FillAbsTime(abstime))
     539                 *fLog << warn
     540                       << "Overflow or Underflow occurred filling PINDiode abs. time = "
     541                       << abstime << endl;
     542
     543              if (!pindiode.FillGraphs(sumhi,sumlo))
     544                *fLog << warn
     545                      << "Overflow or Underflow occurred filling PINDiode: eventnr = "
     546                      << fEvents << endl;
    573547             
    574548            } /* if use PIN Diode */
     
    578552        default:
    579553             
    580           if (!TESTBIT(fFlags,kLoGainOverFlow))
    581             if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents))
    582               {
    583                 *fLog << warn
    584                       << "Overflow filling Histogram ChargevsNLoGain eventnr = "
    585                       << fEvents << endl;
    586                 SETBIT(fFlags,kLoGainOverFlow);
    587                 SkipHiLoGainCalibration();
    588               }
    589          
    590           if (!TESTBIT(fFlags,kHiGainOverFlow))
    591             if (!pix.FillRChargevsTimeHiGain(sumhi,fEvents))
    592               {
    593                 *fLog << warn
    594                       << "Overflow filling Histogram ChargevsNHiGain eventnr = "
    595                       << fEvents << endl;
    596                 SETBIT(fFlags,kHiGainOverFlow);
    597                 SkipHiLoGainCalibration();
    598               }
    599 
    600 
    601           if (TESTBIT(fFlags,kHiLoGainCalibration))
    602             pix.FillChargesInGraph(sumhi,sumlo);
     554          if (pix.IsExcluded())
     555            continue;
     556
     557          pix.FillGraphs(sumhi,sumlo);
    603558
    604559          if (sig.IsLoGainUsed())
     
    608563                *fLog << warn << "Could not fill Lo Gain Charge of pixel: " << pixid
    609564                      << " signal = " << sumlo << endl;
    610              
    611               if (TESTBIT(fFlags,kUseTimes))
    612                 {
    613                   if (!pix.FillAbsTimeLoGain(abstime))
    614                     *fLog << warn << "Could not fill Lo Gain Abs. Time of pixel: "
    615                           << pixid << " time = " << abstime << endl;
    616                   if (!pix.FillRelTimeLoGain(reltime))
    617                     *fLog << warn << "Could not fill Lo Gain Rel. Time of pixel: "
    618                           << pixid << " time = " << reltime << endl;
    619                 }
     565
     566              if (!pix.FillAbsTimeLoGain(abstime))
     567                *fLog << warn << "Could not fill Lo Gain Abs. Time of pixel: "
     568                      << pixid << " time = " << abstime << endl;
     569              /*
     570                if (!pix.FillRelTimeLoGain(reltime))
     571                *fLog << warn << "Could not fill Lo Gain Rel. Time of pixel: "
     572                    << pixid << " time = " << reltime << endl;
     573              */
    620574            } /* if (sig.IsLoGainUsed()) */
    621575          else
     
    625579                      << " signal = " << sumhi << endl;
    626580             
    627               if (TESTBIT(fFlags,kUseTimes))
    628                 {
    629                   if (!pix.FillAbsTimeHiGain(abstime))
    630                     *fLog << warn << "Could not fill Hi Gain Abs. Time of pixel: "
    631                           << pixid << " time = " << abstime << endl;
    632                   if (!pix.FillRelTimeHiGain(reltime))
     581              if (!pix.FillAbsTimeHiGain(abstime))
     582                *fLog << warn << "Could not fill Hi Gain Abs. Time of pixel: "
     583                      << pixid << " time = " << abstime << endl;
     584              /*
     585              if (!pix.FillRelTimeHiGain(reltime))
    633586                    *fLog << warn << "Could not fill Hi Gain Rel. Time of pixel: "
    634587                          << pixid << " time = " << reltime << endl;
    635                 }
     588              */
    636589            } /* else (sig.IsLoGainUsed()) */
    637590          break;
     
    771724
    772725      //
    773       // Perform the Gauss fits to the arrival times
    774       //
    775       if (TESTBIT(fFlags,kUseTimes))
    776         pix.FitTime();
     726      // check also for oscillations
     727      //
     728      pix.CheckOscillations();
    777729     
    778730    }
Note: See TracChangeset for help on using the changeset viewer.