Ignore:
Timestamp:
04/20/05 11:59:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r6926 r6963  
    5151
    5252#include "MHCalibrationCam.h"
    53 #include "MCalibrationCam.h"
     53#include "MCalibrationChargeCam.h"
    5454#include "MCalibrationBlindCam.h"
    5555
     
    6161#include "MBadPixelsIntensityCam.h"
    6262
     63#include "MCalibrationChargeCam.h"
    6364#include "MCalibrationChargeCalc.h"
    6465#include "MCalibrationRelTimeCalc.h"
    6566
    6667#include "MRawRunHeader.h"
    67 #include "MRawEvtHeader.h"
    6868#include "MCalibrationPattern.h"
    6969
     
    8181    : fCalibPattern(NULL), fGeom(NULL), fParList(NULL),
    8282      fIntensCharge(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    83       fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL), fPattern(0)
     83      fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL)
    8484{
    8585
     
    109109    {
    110110      *fLog << err << "MRawRunHeader not found... abort." << endl;
    111       return kFALSE;
    112     }
    113 
    114   fEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
    115   if (!fEvtHeader)
    116     {
    117       *fLog << err << "MRawEvtHeader not found... abort." << endl;
    118111      return kFALSE;
    119112    }
     
    228221      }
    229222  }
     223 
     224  fColor = MCalibrationCam::kNONE;
     225  fStrength = 0.;
    230226     
    231227  return kTRUE;
     
    241237{
    242238
    243   const UInt_t pattern = fEvtHeader->GetPulserSlotPattern();
    244 
    245   if (fPattern == 0)
    246     {
    247       fPattern = pattern;
     239  const MCalibrationCam::PulserColor_t col = fCalibPattern->GetPulserColor();
     240  const Float_t strength                   = fCalibPattern->GetPulserStrength();
     241
     242  if (fColor ==MCalibrationCam::kNONE)
     243    {
     244      fColor = col;
     245      fStrength = strength;
    248246      return kTRUE;
    249247    }
    250248
    251   if (pattern == 0 || pattern == fPattern)
     249  const Float_t strdiff = TMath::Abs(fStrength-strength);
     250
     251  if (col  == MCalibrationCam::kNONE || (col == fColor && strdiff < 0.05))
    252252    return kTRUE;
    253253
    254   *fLog << inf << GetDescriptor() << " : old pattern: " << fPattern << flush;
    255 
    256   fPattern = pattern;
    257  
    258   *fLog << " : new pattern: " << pattern << flush;
     254  *fLog << inf << GetDescriptor() << " : Color - old=" << fColor << flush;
     255  fColor = col;
     256  *fLog << " / new=" << fColor << endl;
     257
     258  *fLog << inf << GetDescriptor() << " : Strength - old=" << fStrength << flush;
     259  fStrength = strength;
     260  *fLog << " / new=" << fStrength << endl;
    259261
    260262  //
     
    325327  if (fIntensCharge)
    326328    {
     329      MCalibrationChargeCam *oldcam = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    327330      fIntensCharge->AddToList(Form("MCalibrationChargeCam%s",namep.Data()),*fGeom);
    328       MCalibrationCam *cam = fIntensCharge->GetCam();
     331      MCalibrationChargeCam *cam    = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    329332      cam->SetPulserColor(fCalibPattern->GetPulserColor());
     333      if (!cam->CopyHiLoConversionFactors(*oldcam))
     334        return kFALSE;
    330335      *fLog << inf << "New MCalibrationChargeCam with name: " << cam->GetName() << endl;
    331336    }
Note: See TracChangeset for help on using the changeset viewer.