Ignore:
Timestamp:
09/30/05 10:42:20 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

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

    r7353 r7374  
    429429    // output information or warnings:
    430430    //
    431     switch(fSignalType)
     431    switch (fSignalType)
    432432    {
    433433    case kPhe:
    434       *fLog << inf << "Calibrating in units of equivalent (outer/inner=4) photo-electrons." << endl;
    435       break;
     434        *fLog << inf << "Calibrating in units of equivalent (outer/inner=4) photo-electrons." << endl;
     435        break;
    436436    case kPhot:
    437       *fLog << inf << "Calibrating in units of photons." << endl;
    438       break;
     437        *fLog << inf << "Calibrating in units of photons." << endl;
     438        break;
    439439    }
    440440
    441441    if (header->IsMonteCarloRun())
    442442    {
    443         *fLog << "Additional scale factor: 1 (MonteCarloRun)" << endl;
     443        *fLog << inf << "Additional scale factor forced to: 1 (MonteCarloRun)" << endl;
    444444        fScaleFactor = 1;
    445445    }
    446446    else
    447         *fLog << "Additional scale factor: " << fScaleFactor << endl;
     447    {
     448        if (!fFileNameScale.IsNull())
     449        {
     450            if (gSystem->AccessPathName(fFileNameScale, kFileExists))
     451            {
     452                *fLog << err << "ERROR - Configuration file '" << fFileNameScale << "' doesn't exist... abort." << endl;
     453                return kFALSE;
     454            }
     455
     456            const Int_t   p   = header->GetRunStart().GetMagicPeriod();
     457            const TString per = Form("%2d", p);
     458
     459            TEnv rc(fFileNameScale);
     460            const Double_t scale = rc.GetValue(per, -1.);
     461
     462            if (scale<=0)
     463            {
     464                *fLog << err << "ERROR - No valid entry for scale factor found for period " << p << " in " << fFileNameScale << "... abort." << endl;
     465                return kFALSE;
     466            }
     467
     468            *fLog << inf << "New additional scale factor for period " << p << ": " << scale << endl;
     469            fScaleFactor = scale;
     470        }
     471        else
     472            *fLog << inf << "Additional scale factor set to: " << fScaleFactor << endl;
     473    }
    448474
    449475    const Int_t npixels = fGeomCam->GetNumPixels();
     
    931957    }
    932958
     959    if (IsEnvDefined(env, prefix, "FileNameScale", print))
     960    {
     961        fFileNameScale = GetEnvValue(env, prefix, "FileNameScale", fFileNameScale);
     962        rc = kTRUE;
     963    }
     964
    933965    return rc;
    934966}
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r7189 r7374  
    7979  Float_t  fRenormFactor;                // Possible renormalization factor for signals (-> phes)
    8080  Float_t  fScaleFactor;                 // Possible scale factor for signals
    81  
     81
     82  TString  fFileNameScale;               // File name for list of scale factors
     83
    8284  TList   fNamesPedestal;                // Names of input and output pedestal conatainer
    8385  TList   fPedestalCams;                 //! List of pointers to input MPedestalCam
     
    106108  void   EnablePedestalType(PedestalType_t i)     { fPedestalFlag |=  i;      }
    107109
    108   Int_t  GetSize() const { return fCalibConsts.GetSize(); }
     110  //Int_t  GetSize() const { return fCalibConsts.GetSize(); }
    109111
    110112  void   Print(Option_t *o="") const;
Note: See TracChangeset for help on using the changeset viewer.