Ignore:
Timestamp:
06/01/05 18:13:13 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
3 edited

Legend:

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

    r7095 r7122  
    157157    }
    158158 
    159   if (header->IsMonteCarloRun())
    160     return kTRUE;
    161 
    162   if (header->GetRunNumber() > gkFirstRunWithFinalBits)
    163     return kTRUE;
    164 
    165159  //
    166160  // Consider the case that a pedestal run is interleaved in the calibration run sequence ... prepare
     
    176170    }
    177171 
     172  //
     173  // Check if the color was set explicitly from outside
     174  //
    178175  if (fIsExplicitColor)
    179176    {
     
    182179      return kTRUE;
    183180    }
     181
     182  //
     183  // 1) Do nothing if this is a MC run. Correct settings of all flags is assumed
     184  // 2) Skip the rest if the run already contains the correct color information
     185  //
     186  if (header->IsMonteCarloRun() || header->GetRunNumber()>gkFirstRunWithFinalBits)
     187      return kTRUE;
    184188
    185189  const Int_t num = header->GetRunNumber();
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r7099 r7122  
    107107
    108108#include "MGeomCam.h"
     109#include "MRawRunHeader.h"
    109110
    110111#include "MPedestalCam.h"
     
    153154    : fGeomCam(NULL),   fBadPixels(NULL), fCalibrations(NULL),
    154155      fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), fCalibConstCam(NULL),
    155       fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.)
     156      fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.), fScaleFactor(1.)
    156157{
    157158
     
    318319Bool_t MCalibrateData::ReInit(MParList *pList)
    319320{
     321    MRawRunHeader *header = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     322    if (!header)
     323    {
     324        *fLog << err << "MRawRunHeader not found... abort." << endl;
     325        return kFALSE;
     326    }
     327
    320328    fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    321329    if (!fGeomCam)
     
    399407      break;
    400408    }
    401    
     409
     410    if (header->IsMonteCarloRun())
     411    {
     412        *fLog << "Additional scale factor: 1 (MonteCarloRun)" << endl;
     413        fScaleFactor = 1;
     414    }
     415    else
     416        *fLog << "Additional scale factor: " << fScaleFactor << endl;
     417
    402418    const Int_t npixels = fGeomCam->GetNumPixels();
    403419
     
    603619          }
    604620
    605         calibConv    *= fRenormFactor * calibUpdate;
    606         calibFFactor *= TMath::Sqrt(fRenormFactor);
     621        calibConv    *= fRenormFactor*fScaleFactor * calibUpdate;
     622        calibFFactor *= TMath::Sqrt(fRenormFactor*fScaleFactor);
    607623
    608624        fHiLoConv     [pixidx] = hiloconv;
     
    861877    }
    862878
     879    if (IsEnvDefined(env, prefix, "ScaleFactor", print))
     880    {
     881        fScaleFactor = GetEnvValue(env, prefix, "ScaleFactor", fScaleFactor);
     882        rc = kTRUE;
     883    }
     884
    863885    return rc;
    864886}
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r7099 r7122  
    7171 
    7272  Float_t  fRenormFactor;                // Possible renormalization factor for signals (-> phes)
     73  Float_t  fScaleFactor;                 // Possible scale factor for signals
    7374 
    7475  TList   fNamesPedestal;                // Names of input and output pedestal conatainer
     
    110111  void   SetCalibConvMinLimit( const Float_t f=gkCalibConvMinLimit ) { fCalibConvMinLimit = f; }
    111112  void   SetCalibConvMaxLimit( const Float_t f=gkCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
    112    
     113
     114  void   SetScaleFactor(const Float_t f=1) { fScaleFactor=1; }
     115
    113116  Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
    114117
Note: See TracChangeset for help on using the changeset viewer.