Changeset 7013 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
05/11/05 19:06:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7010 r7013  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23 2005/05/11 Thomas Bretz
     24
     25   * mbase/MStatusDisplay.cc:
     26     - fixed year of copyright
     27
     28   * mcalib/MCalibCalcFromPast.cc:
     29     - undocumented change from BCN: a new resource has been implemented
     30       in ReadEnv (NumEventsDump)
     31
     32   * mjobs/MJob.[h,cc]:
     33     - added new static member function which can be used
     34       to overwrite relative paths with a default
     35
     36
     37
     38 2005/05/11 Abelardo Moralejo (2005/05/11)
     39
     40   * mjobs/MJPedestal.cc
     41     - Fixed use of MFTriggerPattern: first, added it to the tasklist
     42       (was missing); second, added to tasklist MTriggerPatternDecode
     43       before MFTriggerPattern. This was the reason for the problems
     44       reported by T. Coarasa on May 9. I do not know why the behaviour
     45       of the previous version depended on compiler, but this seemed to
     46       be the case...
     47
     48
     49
     50 2005/05/11 Markus Gaug (2005/05/11)
     51
     52   * mjobs/MJCalibration.cc
     53     - display in Tab "Conv" in the 3rd column the conversion to equiv.
     54       phes instead of Cherenkov photons.
     55   
     56   * mjobs/calibrationref.rc,  mjobs/calibrationref_Nov04.rc,
     57     mjobs/calibrationref_Dec04.rc:
     58     - add reference lines for the conv. to equiv. phes.
     59
     60   * mcalib/MCalibrationChargeCam.cc, mcalib/MCalibrationChargeCalc.cc:
     61     - make a distinction between newly excluded pixels (by calibration)
     62       and previously excluded pixels in the displays and print-functions
     63
     64   * mcalib/MCalibrationChargeCalc.cc
     65     - introduce the check for fluctuating arrival times.
     66     - set charge limit to from 2.5 to 4.5
     67
     68
     69
     70 2005/05/10 Markus Gaug (2005/05/10)
     71
     72   * mhcalib/MHCalibrationHiLoCam.cc
     73     - ask for averageing and do not fill the arrays per pixel any more.
     74       This caused too much memory usage for the calculation of the
     75       high-gain low-gain inter-calibration constants.
     76
     77   * mcalib/MCalibrationChargePix.[h,cc]
     78     - store number of saturated events in the results container.
     79     - set version number by one higher (due to new data member).
     80 
     81   * mhcalib/MHCalibrationChargeCam.cc
     82     - store number of saturated events in the results container.
     83     - allow reading of NumHiGainSaturationLimit and
     84       NumLoGainSaturationLimit in ReadEnv
     85     - set saturation limit from 5% to 8.5%
     86
     87   * mbadpixels/MBadPixelsPix.h
     88     - introduce new bits: kDeadPedestalRms, kPreviouslyExcluded,
     89       kFluctuatingArrivalTimes
     90
     91   * mbadpixels/MBadPixelsCam.cc
     92     - set bit kPreviouslyExcluded in the AsciiRead-Function
     93     - include three new bits in the Print() function
     94
     95   * mjobs/MJCalibration.cc
     96     - display excluded pixels from DeadPedestalRms in Defect-Tab.
     97     - display correct error of the RMS/Mean charge diagramm.
     98
     99   * mcalib/MCalibrationChargeCam.cc
     100     - calculate the error of RMS/Mean values in GetPixelContent Nr.33
     101
     102
     103
     104 2005/05/11 Hendrik Bartko (2005/05/09)
     105
     106   * msignal/MC_weights46.dat
     107     - updated weights file for digital filter with dedicated MC weights
     108       with 4 slices for the high gain and 6 slices for the low gain
     109
     110
    23111
    24112 2005/05/10 Daniela Dorner
  • trunk/MagicSoft/Mars/NEWS

    r7002 r7013  
    7373
    7474   - The storage of the palette in MHCamera is now possible
     75
     76   - new bits describing unsuitable and unreliable pixels have been
     77     introduced in MBadPixelsPix: kPreviouslyExcluded, kDeadPedestalRms,
     78     kFluctuatingArrivalTimes
     79
     80   - the calibration now does a consistency check of the arrival time
     81
     82   - the charge timit in the calibration has been raised from 2.5 to 4.5
     83
     84   - callisto: new setup read from callisto.rc
     85     + MCalibCalcFromPast.fNuMEventsDump
     86     + MHCalibrationChargeCam.NumHiGainSaturationLimit
     87     + MHCalibrationChargeCam.NumLoGainSaturationLimit
    7588
    7689
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r7005 r7013  
    334334// Read the setup from a TEnv, eg:
    335335//   MCalibCalcFromPast.UpdateWithFFactorMethod: Off, On
     336//   MCalibCalcFromPast.NumEventsDump: 500
    336337//
    337338Int_t MCalibCalcFromPast::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     
    344345    }
    345346
     347    if (IsEnvDefined(env, prefix, "NumEventsDump", print))
     348    {
     349        SetNumEventsDump(GetEnvValue(env, prefix, "NumEventsDump", (Int_t)fNumEventsDump));
     350        rc = kTRUE;
     351    }
     352
    346353    return rc;
    347354}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r6928 r7013  
    231231using namespace std;
    232232
    233 const Float_t MCalibrationChargeCalc::fgChargeLimit            = 2.5;
     233const Float_t MCalibrationChargeCalc::fgChargeLimit            = 4.5;
    234234const Float_t MCalibrationChargeCalc::fgChargeErrLimit         = 0.;
    235235const Float_t MCalibrationChargeCalc::fgChargeRelErrLimit      = 1.;
     
    238238const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 4.5;
    239239const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 4.5;
     240const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit        = 3.5;
    240241const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam";
     242
    241243// --------------------------------------------------------------------------
    242244//
     
    252254//
    253255// Initializes:
     256// - fArrTimeRmsLimit   to fgArrTimeRmsLimit
    254257// - fChargeLimit       to fgChargeLimit
    255258// - fChargeErrLimit    to fgChargeErrLimit   
     
    282285  AddToBranchList("MRawEvtData.fLoGainFadcSamples");
    283286 
     287  SetArrTimeRmsLimit   ();
    284288  SetChargeLimit       ();
    285289  SetChargeErrLimit    (); 
     
    294298  SetDebug       ( kFALSE );
    295299
     300  SetCheckArrivalTimes     ();
    296301  SetCheckDeadPixels       ();
    297302  SetCheckDeviatingBehavior();
     
    732737      if (FinalizeCharges(pix,bad,"pixel  "))
    733738        nvalid++;
     739
     740      FinalizeArrivalTimes(pix,bad,"pixel  ");
    734741    }
    735742
     
    760767      FinalizePedestals(ped,pix,aidx);
    761768      FinalizeCharges(pix, chargecam->GetAverageBadArea(aidx),"area id");
     769      FinalizeArrivalTimes(pix, chargecam->GetAverageBadArea(aidx), "area id");
    762770    }
    763771 
     
    855863  PrintUncalibrated(MBadPixelsPix::kLoGainOverFlow,   
    856864                    "Pixels with Low Gain Overflow :                   ");
     865  PrintUncalibrated(MBadPixelsPix::kFluctuatingArrivalTimes,
     866                    "Fluctuating Pulse Arrival Times:                  ");
     867  PrintUncalibrated(MBadPixelsPix::kDeadPedestalRms,
     868                    "Presumably dead from Pedestal Rms:                ");
     869  PrintUncalibrated(MBadPixelsPix::kPreviouslyExcluded,
     870                    "Previously excluded:                              ");
    857871
    858872  *fLog << inf << endl;
     
    10181032}
    10191033
    1020 
     1034// -----------------------------------------------------------------------------------
     1035//
     1036// Test the arrival Times RMS of the pixel and set the bit
     1037// - MBadPixelsPix::kFluctuatingArrivalTimes
     1038//
     1039void MCalibrationChargeCalc::FinalizeArrivalTimes(MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what)
     1040{
     1041    if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     1042        return;
     1043
     1044    if (cal.GetAbsTimeRms() > fArrTimeRmsLimit)
     1045    {
     1046        *fLog << warn;
     1047        *fLog << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms());
     1048        *fLog << " FADC sl. < " << Form("%2.1", fArrTimeRmsLimit);
     1049        *fLog << "   in " << what << Form("%3i", cal.GetPixId()) << endl;
     1050        bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes);
     1051    }
     1052}
    10211053
    10221054// -----------------------------------------------------------------------------------
     
    10391071{
    10401072 
    1041   MBadPixelsCam         *badcam    = fIntensBad
    1042     ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
    1043   MCalibrationChargeCam *chargecam = fIntensCam
    1044     ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1073  MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels;
    10451074
    10461075  for (Int_t i=0; i<badcam->GetSize(); i++)
    10471076    {
    10481077     
    1049       MBadPixelsPix    &bad    = (*badcam)   [i];
    1050       MCalibrationPix  &pix    = (*chargecam)[i];
     1078      MBadPixelsPix &bad = (*badcam)[i];
    10511079
    10521080      if (IsCheckDeadPixels())
     
    10861114        }
    10871115     
    1088       if (bad.IsUnsuitable(   MBadPixelsPix::kUnsuitableRun    ))
    1089         pix.SetExcluded();
     1116      if (IsCheckArrivalTimes())
     1117        {
     1118          if (bad.IsUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes ))
     1119            bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
     1120        }
    10901121
    10911122      if (bad.IsUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ))
     
    18121843          qepix.SetFFactorMethodValid(kFALSE,fPulserColor);
    18131844          pix.SetFFactorMethodValid(kFALSE);
    1814           pix.SetExcluded();
    18151845          continue;
    18161846        }
     
    22002230      rc = kTRUE;
    22012231    }
     2232  if (IsEnvDefined(env, prefix, "ArrTimeRmsLimit", print))
     2233    {
     2234      SetArrTimeRmsLimit(GetEnvValue(env, prefix, "ArrTimeRmsLimit", fArrTimeRmsLimit));
     2235      rc = kTRUE;
     2236    }
    22022237  if (IsEnvDefined(env, prefix, "FFactorErrLimit", print))
    22032238    {
     
    22452280      rc = kTRUE;
    22462281    }
    2247  
     2282  if (IsEnvDefined(env, prefix, "CheckArrivalTimes", print))
     2283    {
     2284      SetCheckArrivalTimes(GetEnvValue(env, prefix, "CheckArrivalTimes", IsCheckArrivalTimes()));
     2285      rc = kTRUE;
     2286    }
     2287
    22482288  return rc;
    22492289}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r6153 r7013  
    5656  static const Float_t fgPheErrLimit;          //! Default for fPheErrLimit        (now set to: 4.5)
    5757  static const Float_t fgFFactorErrLimit;      //! Default for fFFactorErrLimit    (now set to: 4.5)
     58  static const Float_t fgArrTimeRmsLimit;      //! Default for fArrTimeRmsLimit    (now set to: 3.5)
    5859 
    5960  static const TString fgNamePedestalCam;      //! "MPedestalCam"
     
    6970  Float_t fPheErrLimit;                        // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
    7071  Float_t fFFactorErrLimit;                    // Limit acceptance F-Factor w.r.t. area idx mean
     72  Float_t fArrTimeRmsLimit;                    // Limit acceptance RMS of absolute arrival times
    7173  Float_t fSqrtHiGainSamples;                  // Square root nr. High-Gain FADC slices used by extractor
    7274  Float_t fSqrtLoGainSamples;                  // Square root nr. Low -Gain FADC slices used by extractor
     
    112114      kCheckHistOverflow,
    113115      kCheckDeviatingBehavior,
    114       kCheckOscillations
     116      kCheckOscillations,
     117      kCheckArrivalTimes
    115118    };                                         // Possible Checks
    116119
     
    122125  // functions
    123126  void   FinalizePedestals       ( const MPedestalPix    &ped, MCalibrationChargePix &cal, const Int_t aidx );
     127  void   FinalizeArrivalTimes    ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
    124128  Bool_t FinalizeCharges         ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
    125129  Bool_t FinalizePINDiode        ();
     
    141145  Bool_t IsCheckHistOverflow     () const { return TESTBIT(fCheckFlags,kCheckHistOverflow);      }
    142146  Bool_t IsCheckOscillations     () const { return TESTBIT(fCheckFlags,kCheckOscillations);      }
     147  Bool_t IsCheckArrivalTimes     () const { return TESTBIT(fCheckFlags,kCheckArrivalTimes);      }
    143148
    144149  void   PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
     
    182187
    183188  // Checks
     189  void SetCheckArrivalTimes( const Bool_t b=kTRUE ) {
     190    b ? SETBIT(fCheckFlags,kCheckArrivalTimes)
     191      : CLRBIT(fCheckFlags,kCheckArrivalTimes); }
    184192  void SetCheckDeadPixels( const Bool_t b=kTRUE ) {
    185193    b ? SETBIT(fCheckFlags,kCheckDeadPixels)
     
    203211  void SetPedestals(MPedestalCam *cam) { fPedestals=cam; }
    204212                                                                         
     213  void SetArrTimeRmsLimit   ( const Float_t f=fgArrTimeRmsLimit        ) { fArrTimeRmsLimit   = f;     }
    205214  void SetFFactorErrLimit   ( const Float_t f=fgFFactorErrLimit        ) { fFFactorErrLimit   = f;     }
    206215  void SetLambdaErrLimit    ( const Float_t f=fgLambdaErrLimit         ) { fLambdaErrLimit    = f;     }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r7005 r7013  
    289289    {
    290290     
    291       if (!pix->IsExcluded())
     291      if (pix->IsFFactorMethodValid())
    292292        {                           
    293293
     
    311311   
    312312  *fLog << all << endl;
    313   *fLog << all << "Excluded pixels:" << endl;
     313  *fLog << all << "Previously Excluded pixels:" << endl;
    314314  *fLog << all << endl;
    315315 
     
    329329  }
    330330 
     331  *fLog << all << endl;
     332  *fLog << all << "New Excluded pixels:" << endl;
     333  *fLog << all << endl;
     334 
     335  TIter Next5(fPixels);
     336  while ((pix=(MCalibrationChargePix*)Next5()))
     337  {
     338      if (!pix->IsFFactorMethodValid() && !pix->IsExcluded())
     339      {
     340        *fLog << all << pix->GetPixId() << " ";
     341        id++;
     342
     343        if (!(id % 25))
     344          *fLog << endl;
     345      }
     346  }
     347 
    331348  *fLog << endl;
    332349  *fLog << all << id << " Excluded pixels " << endl;
     
    337354  *fLog << all << endl;
    338355
    339   TIter Next5(fAverageAreas);
    340   while ((pix=(MCalibrationChargePix*)Next5()))
     356  TIter Next6(fAverageAreas);
     357  while ((pix=(MCalibrationChargePix*)Next6()))
    341358  {
    342359    *fLog << all << Form("%s%3i","Area Idx: ",pix->GetPixId())
     
    353370  *fLog << all << endl;
    354371
    355   TIter Next6(fAverageSectors);
    356   while ((pix=(MCalibrationChargePix*)Next6()))
     372  TIter Next7(fAverageSectors);
     373  while ((pix=(MCalibrationChargePix*)Next7()))
    357374  {
    358375    *fLog << all << Form("%s%3i","Sector: ",pix->GetPixId())
     
    482499      break;
    483500    case 5:
    484       if (pix.IsExcluded())
     501      if (!pix.IsFFactorMethodValid())
    485502        return kFALSE;
    486503      if (pix.GetRSigma() == -1.)
     
    489506      break;
    490507    case 6:
    491       if (pix.IsExcluded())
     508      if (!pix.IsFFactorMethodValid())
    492509        return kFALSE;   
    493510      if (pix.GetRSigma() == -1.)
     
    496513      break;
    497514    case 7:
    498       if (pix.IsExcluded())
     515      if (!pix.IsFFactorMethodValid())
    499516        return kFALSE;
    500517      val = pix.GetRSigmaPerCharge();
    501518      break;
    502519    case 8:
    503       if (pix.IsExcluded())
     520      if (!pix.IsFFactorMethodValid())
    504521        return kFALSE;
    505522      val =  pix.GetRSigmaPerChargeErr();
    506523      break;
    507524    case 9:
    508       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     525      if (!pix.IsFFactorMethodValid())
    509526        return kFALSE;
    510527      val = pix.GetPheFFactorMethod();
    511528      break;
    512529    case 10:
    513       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     530      if (!pix.IsFFactorMethodValid())
    514531        return kFALSE;
    515532      val = pix.GetPheFFactorMethodErr();
    516533      break;
    517534    case 11:
    518       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     535      if (!pix.IsFFactorMethodValid())
    519536        return kFALSE;
    520537      val = pix.GetMeanConvFADC2Phe();
    521538      break;
    522539    case 12:
    523       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     540      if (!pix.IsFFactorMethodValid())
    524541        return kFALSE;
    525542      val = pix.GetMeanConvFADC2PheErr();
    526543      break;
    527544    case 13:
    528       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     545      if (!pix.IsFFactorMethodValid())
    529546        return kFALSE;
    530547      val = pix.GetMeanFFactorFADC2Phot();
    531548      break;
    532549    case 14:
    533       if (pix.IsExcluded() || !pix.IsFFactorMethodValid())
     550      if (!pix.IsFFactorMethodValid())
    534551        return kFALSE;
    535552      val = pix.GetMeanFFactorFADC2PhotErr();
     
    625642      break;
    626643    case 32:
     644      if (pix.IsExcluded())
     645        return kFALSE;
    627646      val = pix.GetMean() == 0. ? 0. : pix.GetRms()/pix.GetMean();
     647      break;
     648    case 33:
     649      if (pix.IsExcluded())
     650        return kFALSE;
     651      if (pix.GetMean() == 0.)
     652        val = 0.;
     653      else
     654        val = pix.GetSigmaErr()/pix.GetMean() + pix.GetRms()/pix.GetMean()/pix.GetMean()*pix.GetMeanErr();
    628655      break;
    629656    default:
     
    633660  return val!=-1.;
    634661}
    635 
    636662
    637663
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc

    r5200 r7013  
    6969//           MHCalibrationChargeCam, MHCalibrationChargePix
    7070//
     71//
     72// ClassVersion 3:
     73//  + fNumSaturated
     74//
    7175/////////////////////////////////////////////////////////////////////////////
    7276#include "MCalibrationChargePix.h"
     
    9094const Float_t MCalibrationChargePix::fgPheFFactorMethodLimit    = 1.;
    9195const Float_t MCalibrationChargePix::fgConvFFactorRelErrLimit   = 0.85;
     96
    9297// --------------------------------------------------------------------------
    9398//
     
    105110//
    106111MCalibrationChargePix::MCalibrationChargePix(const char *name, const char *title)
    107     : fCalibFlags(0)
     112    : fCalibFlags(0), fNumSaturated(0)
    108113{
    109114
     
    158163  fMeanFFactorFADC2Phot             =  -1.;
    159164  fMeanFFactorFADC2PhotVar          =  -1.; 
     165
     166  fNumSaturated                     =   0;
    160167
    161168  MCalibrationPix::Clear();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h

    r5197 r7013  
    4141  Float_t fRSigmaSquare;                    // Square of Reduced sigma
    4242  Float_t fRSigmaSquareVar;                 // Variance Reduced sigma
     43
     44  Int_t   fNumSaturated;                    // Number of (high-gain) saturated events
    4345 
    4446  enum  { kFFactorMethodValid   };          // Possible bits to be set
     
    7173  void SetPheFFactorMethodVar   ( const Float_t f)                          { fPheFFactorMethodVar    = f; } 
    7274  void SetPheFFactorMethodLimit ( const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit  = f; }
     75  void SetNumSaturated          ( const Int_t   i)                          { fNumSaturated           = i; }
    7376 
    7477  // Getters
     
    9093  Float_t GetMeanFFactorFADC2PhotErr () const;
    9194  Float_t GetMeanFFactorFADC2PhotVar () const { return fMeanFFactorFADC2PhotVar; }   
     95  Int_t   GetNumSaturated            () const { return fNumSaturated;            }
    9296  Float_t GetPed                     () const { return fPed;                     }
    9397  Float_t GetPedErr                  () const { return TMath::Sqrt(fPedVar);     }
     
    113117  Bool_t CalcMeanFFactor   ( const Float_t nphotons, const Float_t nphotonsrelvar );
    114118 
    115   ClassDef(MCalibrationChargePix, 2)    // Container Charge Calibration Results Pixel
     119  ClassDef(MCalibrationChargePix, 3)    // Container Charge Calibration Results Pixel
    116120};
    117121
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r6919 r7013  
    171171const TString MHCalibrationChargeCam::gsAbsHistXTitle     = "Time [FADC slices]";
    172172const TString MHCalibrationChargeCam::gsAbsHistYTitle     = "Nr. events";
    173 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.05;
     173const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.085;
    174174const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005;
    175175const Float_t MHCalibrationChargeCam::fgTimeLowerLimit           = 1.;
    176176const Float_t MHCalibrationChargeCam::fgTimeUpperLimit           = 3.;
    177177const TString MHCalibrationChargeCam::fgReferenceFile = "mjobs/calibrationref.rc";
     178
    178179// --------------------------------------------------------------------------
    179180//
     
    883884      MCalibrationChargePix  &pix = (MCalibrationChargePix&)(*chargecam)[i] ;
    884885
    885       if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries())
     886      const Int_t numsat = histhi.GetSaturated();
     887
     888      pix.SetNumSaturated(numsat);
     889
     890      if (numsat > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries())
    886891        {
    887892          pix.SetHiGainSaturation();
     
    14181423    }
    14191424
     1425  if (IsEnvDefined(env, prefix, "NumHiGainSaturationLimit", print))
     1426  {
     1427      SetNumHiGainSaturationLimit(GetEnvValue(env, prefix, "NumHiGainSaturationLimit", fNumHiGainSaturationLimit));
     1428      rc = kTRUE;
     1429  }
     1430
     1431  if (IsEnvDefined(env, prefix, "NumLoGainSaturationLimit", print))
     1432  {
     1433      SetNumLoGainSaturationLimit(GetEnvValue(env, prefix, "NumLoGainSaturationLimit", fNumLoGainSaturationLimit));
     1434      rc = kTRUE;
     1435  }
     1436
    14201437  TEnv refenv(fReferenceFile);
    14211438
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc

    r6773 r7013  
    342342      MHCalibrationPix &histhi = (*this)[i];
    343343
    344       histhi.FillHistAndArray(ratio);
     344      histhi.FillHist(ratio);
    345345      fSumareahi  [aidx]   += ratio;
    346346      fNumareahi  [aidx]   ++;
     
    355355          const Float_t diff = tix.GetArrivalTimeLoGain() - tix.GetArrivalTimeHiGain();
    356356
    357           histlo.FillHistAndArray(diff);
     357          histlo.FillHist(diff);
    358358          fSumarealo  [aidx]   += diff;
    359359          fNumarealo  [aidx]   ++;
     
    362362        }
    363363    }
     364
     365  if (!IsAverageing())
     366      return kTRUE;
    364367 
    365368  for (Int_t j=0; j<nareas; j++)
     
    420423    }
    421424
    422   for (Int_t j=0; j<nareas; j++)
    423     {
    424      
    425       MHCalibrationPix    &hist = GetAverageHiGainArea(j);     
    426       //
    427       // Check histogram overflow
    428       //
    429       CheckOverflow(hist);
    430    }
    431  
    432   for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++)
    433     {
    434      
    435       MHCalibrationPix &hist = GetAverageHiGainSector(j);     
    436       //
    437       // Check histogram overflow
    438       //
    439       CheckOverflow(hist);
    440     }
     425  //
     426  // Check histogram overflow
     427  //
     428  if (IsAverageing())
     429  {
     430      for (Int_t j=0; j<nareas; j++)
     431          GetAverageHiGainArea(j).CheckOverflow(hist);
     432
     433      for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++)
     434          GetAverageHiGainSector(j).CheckOverflow(hist);
     435  }
     436
    441437
    442438  FitHiGainArrays(*hilocam,*badcam,
     
    458454    }
    459455
    460   for (Int_t j=0; j<nareas; j++)
    461     {
    462      
    463       MHCalibrationPix    &hist = GetAverageLoGainArea(j);     
    464       CheckOverflow(hist);
    465    }
    466  
    467   for (Int_t j=0; j<nsectors; j++)
    468     {
    469      
    470       MHCalibrationPix &hist = GetAverageLoGainSector(j);     
    471       CheckOverflow(hist);
    472     }
     456  if (IsAverageing())
     457  {
     458      for (Int_t j=0; j<nareas; j++)
     459          GetAverageLoGainArea(j).CheckOverflow(hist);
     460
     461      for (Int_t j=0; j<nsectors; j++)
     462          GetAverageLoGainSector(j).CheckOverflow(hist);
     463  }
    473464
    474465  FitLoGainArrays(*hilocam,*badcam,
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.h

    r5575 r7013  
    2727 
    2828  // Getters
    29   const Double_t GetBlackout       () const; 
    30   const Double_t GetPickup         () const;
    31   const Float_t  GetSaturated      () const { return fSaturated;      }
     29  const Double_t GetBlackout() const;
     30  const Double_t GetPickup() const;
     31  const Int_t    GetSaturated() const { return fSaturated;      }
    3232
    3333  // Fits
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r7005 r7013  
    222222  fTimeResolutionMin         =  0.;
    223223  fTimeResolutionMax         =  1.;
    224  
    225   fRefConvFADC2PheInner      = 0.14;       
    226   fRefConvFADC2PheOuter      = 0.4;       
    227   fRefConvFADC2PhotInner     = 0.8;
    228   fRefConvFADC2PhotOuter     = 3.8;
     224
     225  fRefFADC2PheInner          = 0.14;
     226  fRefFADC2PheOuter          = 0.4;
     227  fRefConvFADC2PheInner      = 0.14;
     228  fRefConvFADC2PheOuter      = 0.52;
    229229  fRefQEInner                = 0.18;           
    230230  fRefQEOuter                = 0.12;
     
    330330    MHCamera disp4 (geomcam, "RSigmaPerCharge",   "Reduced Sigma per Charge");
    331331    MHCamera disp5 (geomcam, "NumPhes",           "Number Photo-electrons");
    332     MHCamera disp6 (geomcam, "ConvFADC2Phes",     "Phes per Charge (before flat-field)");
     332    MHCamera disp6 (geomcam, "ConvFADC2Phes",     "Phes per Charge (Before Flat-Field)");
    333333    MHCamera disp7 (geomcam, "TotalFFactor",      "Total F-Factor(F-Factor Method)");
    334334    MHCamera disp8 (geomcam, "CascadesQEFFactor", "Cascades QE (F-Factor Method)");
     
    336336    MHCamera disp10(geomcam, "CascadesQEPINDiode","Cascades QE (PIN Diode Method)");
    337337    MHCamera disp11(geomcam, "CascadesQECombined","Cascades QE (Combined Method)");
    338     MHCamera disp12(geomcam, "FFactorValid",      "Pixels with valid F-Factor calibration");
    339     MHCamera disp13(geomcam, "BlindPixelValid",   "Pixels with valid BlindPixel calibration");
    340     MHCamera disp14(geomcam, "PINdiodeValid",     "Pixels with valid PINDiode calibration");
    341     MHCamera disp15(geomcam, "CombinedValid",     "Pixels with valid Combined calibration");
    342     MHCamera disp16(geomcam, "Saturation",        "Pixels with saturated Hi Gain");
     338    MHCamera disp12(geomcam, "FFactorValid",      "Pixels with Valid F-Factor Calibration");
     339    MHCamera disp13(geomcam, "BlindPixelValid",   "Pixels with valid BlindPixel Calibration");
     340    MHCamera disp14(geomcam, "PINdiodeValid",     "Pixels with Valid PINDiode Calibration");
     341    MHCamera disp15(geomcam, "CombinedValid",     "Pixels with Valid Combined Calibration");
     342    MHCamera disp16(geomcam, "Saturation",        "Pixels with Saturated Hi Gain");
    343343    MHCamera disp17(geomcam, "ConversionMeans",   "Conversion HiGain.vs.LoGain Means");
    344344    MHCamera disp18(geomcam, "ConversionSigmas",  "Conversion HiGain.vs.LoGain Sigmas");
    345     MHCamera disp19(geomcam, "HiGainPickup",      "Number Pickup events Hi Gain");
    346     MHCamera disp20(geomcam, "LoGainPickup",      "Number Pickup events Lo Gain");
    347     MHCamera disp21(geomcam, "HiGainBlackout",    "Number Blackout events Hi Gain");
    348     MHCamera disp22(geomcam, "LoGainBlackout",    "Number Blackout events Lo Gain");
    349     MHCamera disp23(geomcam, "Excluded",          "Pixels previously excluded");
    350     MHCamera disp24(geomcam, "UnSuitable",        "Pixels not suited for further analysis");
    351     MHCamera disp25(geomcam, "UnReliable",        "Pixels suitable, but not reliable for further analysis");
     345    MHCamera disp19(geomcam, "HiGainPickup",      "Number Pickup Events Hi Gain");
     346    MHCamera disp20(geomcam, "LoGainPickup",      "Number Pickup Events Lo Gain");
     347    MHCamera disp21(geomcam, "HiGainBlackout",    "Number Blackout Events Hi Gain");
     348    MHCamera disp22(geomcam, "LoGainBlackout",    "Number Blackout Events Lo Gain");
     349    MHCamera disp23(geomcam, "Excluded",          "Pixels Previously Excluded");
     350    MHCamera disp24(geomcam, "UnSuitable",        "Pixels NOT Suited for Further Analysis");
     351    MHCamera disp25(geomcam, "UnReliable",        "Pixels Suitable, but NOT Reliable for Further Analysis");
    352352    MHCamera disp26(geomcam, "HiGainOscillating", "Oscillating Pixels High Gain");
    353353    MHCamera disp27(geomcam, "LoGainOscillating", "Oscillating Pixels Low Gain");
     
    357357    MHCamera disp31(geomcam, "SigmaTime",         "Sigma Rel. Arrival Times");
    358358    MHCamera disp32(geomcam, "TimeProb",          "Probability of Time Fit");
    359     MHCamera disp33(geomcam, "TimeNotFitValid",   "Pixels with not valid fit results");
     359    MHCamera disp33(geomcam, "TimeNotFitValid",   "Pixels with not valid Fit Results");
    360360    MHCamera disp34(geomcam, "TimeOscillating",   "Oscillating Pixels");
    361     MHCamera disp35(geomcam, "TotalConv",         "Conversion Factor to photons");
     361    MHCamera disp35(geomcam, "TotalConv",         "Conversion Factor to Photons");
    362362    MHCamera disp36(geomcam, "RMSperMean",        "Charge histogram RMS per Mean");
     363    MHCamera disp37(geomcam, "TotalConvPhe",      "Conversion Factor to equiv. Phe's");
    363364   
    364365    MCalibrationChargeCam  *cam    = NULL;
     
    447448    // RMS and Mean
    448449    disp36.SetCamContent(*cam,32);
     450    disp36.SetCamError(*cam,33);
    449451
    450452    disp1.SetYTitle("Q [FADC cnts]");
     
    484486    disp28.SetYTitle("Mean Abs. Time [FADC sl.]");
    485487    disp29.SetYTitle("RMS Abs. Time [FADC sl.]");
    486 
    487488    disp35.SetYTitle("Conv.Factor [Ph/FADC cnts]");
    488 
    489489    disp36.SetYTitle("Charge RMS/<Q> [1]");
     490    disp37.SetYTitle("Conv.Factor [Phe/FADC cnts]");
    490491
    491492    for (UInt_t i=0;i<geomcam.GetNumPixels();i++)
     
    503504        disp35.Fill(i,convphe/quaeff);
    504505        disp35.SetUsed(i);
     506
     507        disp37.Fill(i,convphe/quaeff*MCalibrationQEPix::gkDefaultAverageQE);
     508        disp37.SetUsed(i);
    505509      }
    506510   
     
    733737      gPad->SetBorderMode(0);
    734738      gPad->SetTicks();
    735       MHCamera *obj7=(MHCamera*)disp35.DrawCopy("hist");
     739      MHCamera *obj7=(MHCamera*)disp37.DrawCopy("hist");
    736740      //
    737741      // for the datacheck, fix the ranges!!
    738742      //
    739       obj7->SetMinimum(fConvFADC2PhotMin);
    740       obj7->SetMaximum(fConvFADC2PhotMax);
     743      obj7->SetMinimum(fConvFADC2PheMin);
     744      obj7->SetMaximum(fConvFADC2PheMax);
    741745      //
    742746      // Set the datacheck sizes:
     
    855859      pave->SetTextSize(0.05);
    856860      pave->AddText("  ");
    857       TText *t1 = pave->AddText(Form("Signal smaller 3 Pedestal RMS:                 %3i pixels",
     861      TText *t1 = pave->AddText(Form("Signal smaller 4.5 Pedestal RMS:                 %3i pixels",
    858862                                       CountBadPixels(&disp24,1)));
    859863      t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol + 1.)));
     
    887891      t11->SetTextColor(gStyle->GetColorPalette(Int_t(8./max*numcol + 1.)));
    888892      t11->SetTextAlign(12);
    889       TText *t12= pave->AddText(Form("Previously Excluded:                                    %3i pixels",
    890                                        CountBadPixels(&disp24,9)));
     893      TText *t12= pave->AddText(Form("Presumably dead from Ped. Rms:              %3i pixels",
     894                                       CountBadPixels(&disp24,9 )));
    891895      t12->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol + 1.)));
    892896      t12->SetTextAlign(12);
     897      TText *t13= pave->AddText(Form("Fluctuating Pulse Arrival Times:                 %3i pixels",
     898                                       CountBadPixels(&disp24,10)));
     899      t13->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol + 1.)));
     900      t13->SetTextAlign(12);
     901      TText *t14= pave->AddText(Form("Previously Excluded:                                   %3i pixels",
     902                                       CountBadPixels(&disp24,11)));
     903      t14->SetTextColor(gStyle->GetColorPalette(Int_t(11./max*numcol + 1.)));
     904      t14->SetTextAlign(12);
    893905      pave->Draw();
    894906
     
    909921      // for the datacheck, fix the ranges!!
    910922      //
    911       const Double_t max2 = 8.;
     923      const Double_t max2 = 9.;
    912924      obj9->SetMinimum(0.);
    913925      obj9->SetMaximum(max2);
     
    927939      TText *t3 = pave2->AddText(Form("Signal Sigma smaller Pedestal RMS:      %3i pixels",
    928940                                       CountBadPixels(&disp25,1)));
    929       t3->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol + 1.)));
     941      t3->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol + 1.)));
    930942      t3->SetTextAlign(12);
    931943
     
    12501262      break;
    12511263    case  1:
    1252       l1 = line.DrawLine(0, fRefConvFADC2PhotInner, x, fRefConvFADC2PhotInner);     
     1264      l1 = line.DrawLine(0, fRefConvFADC2PheInner, x, fRefConvFADC2PheInner);
    12531265      break;
    12541266    case  2:
    1255       l1 = line.DrawLine(0, fRefConvFADC2PheInner, x, fRefConvFADC2PheInner );
     1267      l1 = line.DrawLine(0, fRefFADC2PheInner, x, fRefFADC2PheInner );
    12561268      break;
    12571269    case  3:
     
    12811293          break;
    12821294        case 1:
    1283           line.DrawLine(x2, fRefConvFADC2PhotOuter, 398, fRefConvFADC2PhotOuter );     
     1295          line.DrawLine(x2, fRefConvFADC2PheOuter, 398, fRefConvFADC2PheOuter );
    12841296          break;
    12851297        case 2:
    1286           line.DrawLine(x2, fRefConvFADC2PheOuter, 398, fRefConvFADC2PheOuter);
     1298          line.DrawLine(x2, fRefFADC2PheOuter, 398, fRefFADC2PheOuter);
    12871299          break;
    12881300        case 3:
     
    14371449    fTimeResolutionMax      = refenv.GetValue("TimeResolutionMax",fTimeResolutionMax);
    14381450                                                               
     1451    fRefFADC2PheInner       = refenv.GetValue("RefFADC2PheInner",fRefFADC2PheInner);
     1452    fRefFADC2PheOuter       = refenv.GetValue("RefFADC2PheOuter",fRefFADC2PheOuter);
     1453    fRefConvFADC2PhotInner  = refenv.GetValue("RefConvFADC2PhotInner",fRefConvFADC2PhotInner);
     1454    fRefConvFADC2PhotOuter  = refenv.GetValue("RefConvFADC2PhotOuter",fRefConvFADC2PhotOuter);
    14391455    fRefConvFADC2PheInner   = refenv.GetValue("RefConvFADC2PheInner",fRefConvFADC2PheInner);
    14401456    fRefConvFADC2PheOuter   = refenv.GetValue("RefConvFADC2PheOuter",fRefConvFADC2PheOuter);
    1441     fRefConvFADC2PhotInner  = refenv.GetValue("RefConvFADC2PhotInner",fRefConvFADC2PhotInner);
    1442     fRefConvFADC2PhotOuter  = refenv.GetValue("RefConvFADC2PhotOuter",fRefConvFADC2PhotOuter);
    14431457    fRefQEInner             = refenv.GetValue("RefQEInner",fRefQEInner);
    14441458    fRefQEOuter             = refenv.GetValue("RefQEOuter",fRefQEOuter);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r6979 r7013  
    7979  Double_t fTimeResolutionMax;             //! Histogram maximum for time resolutions
    8080                                           
    81   Float_t  fRefConvFADC2PheInner;          //! Reference value for the conversion factor to phes - inner
    82   Float_t  fRefConvFADC2PheOuter;          //! Reference value for the conversion factor to phes - outer
     81  Float_t  fRefFADC2PheInner;              //! Reference value for the ratio phes/charge - inner
     82  Float_t  fRefFADC2PheOuter;              //! Reference value for the ratio phes/charge - outer
    8383  Float_t  fRefConvFADC2PhotInner;         //! Reference value for the conversion factor to phs - inner
    8484  Float_t  fRefConvFADC2PhotOuter;         //! Reference value for the conversion factor to phs - outer
     85  Float_t  fRefConvFADC2PheInner;          //! Reference value for the conversion factor to phs - inner
     86  Float_t  fRefConvFADC2PheOuter;          //! Reference value for the conversion factor to phs - outer
    8587  Float_t  fRefQEInner;                    //! Reference value for the quantum eff. cascades - inner
    8688  Float_t  fRefQEOuter;                    //! Reference value for the quantum eff. cascades - outer
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r7005 r7013  
    8383#include "MRawEvtData.h"
    8484#include "MGeomApply.h"
     85#include "MTriggerPatternDecode.h"
    8586#include "MBadPixelsMerge.h"
    8687#include "MFillH.h"
     
    944945    // data file will be processed. In any case there are no interleaved
    945946    // calibration events in such data, so this is fine.
     947    MTriggerPatternDecode decode;
    946948    MFTriggerPattern fcalib("CalibFilter");
    947949    fcalib.SetDefault(kFALSE);
     
    950952
    951953    if (fIsPulsePosCheck)
    952       {
     954    {
    953955        fillpul.SetFilter(&fcalib);
     956        tlist.AddToList(&decode);
     957        tlist.AddToList(&fcalib);
    954958        tlist.AddToList(&fillpul);
    955       }
     959    }
    956960
    957961    // ----------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r6553 r7013  
    6060//
    6161MJob::MJob(const char *name, const char *title) : fEnv(0), fEnvDebug(0), fOverwrite(kFALSE), fMaxEvents(0)
    62  
    6362{
    6463    fName  = name  ? name  : "MJob";
     
    300299    return WriteContainer(cont);
    301300}
     301
     302TString MJob::ExpandPath(TString fname)
     303{
     304    // empty
     305    if (fname.IsNull())
     306        return fname;
     307
     308    // Expand path using environment
     309    gSystem->ExpandPathName(fname);
     310
     311    // Absolute path
     312    if (fname[0]=='/')
     313        return fname;
     314
     315    // relative path to file and file could be found
     316    if (!gSystem->AccessPathName(fname, kFileExists))
     317        return fname;
     318
     319    // Now check gEnv and MARSSYS. gEnv can overwrite MARSSYS
     320    TString path(gEnv ? gEnv->GetValue("Mars.Path", "$MARSSYS") : "$MARSSYS");
     321
     322    // Expand path using environment
     323    gSystem->ExpandPathName(path);
     324
     325    // check if path ends with a slash
     326    if (!path.EndsWith("/"))
     327        path += "/";
     328
     329    // compile full qualified path
     330    path += fname;
     331
     332    // return new path
     333    return path;
     334}
  • trunk/MagicSoft/Mars/mjobs/MJob.h

    r6553 r7013  
    7575    MStatusDisplay *GetDisplay() { return fDisplay; }
    7676
     77    static TString ExpandPath(TString fname);
     78
    7779    ClassDef(MJob, 0) // Bas class for Jobs
    7880};
  • trunk/MagicSoft/Mars/mjobs/calibrationref.rc

    r6718 r7013  
    4242# Converstion factors:
    4343#
    44 RefConvFADC2PheInner:     0.14
    45 RefConvFADC2PheOuter:     0.4
     44RefFADC2PheInner:         0.14
     45RefFADC2PheOuter:         0.4
    4646RefConvFADC2PhotInner:    0.8
    4747RefConvFADC2PhotOuter:    3.8
     48RefConvFADC2PheInner:     0.14
     49RefConvFADC2PheOuter:     0.56
    4850#
    4951# Quantum Efficiencies:
  • trunk/MagicSoft/Mars/mjobs/calibrationref_Dec04.rc

    r6913 r7013  
    4242# Converstion factors:
    4343#
    44 RefConvFADC2PheInner:     0.3
    45 RefConvFADC2PheOuter:     0.6
     44RefFADC2PheInner:         0.3
     45RefFADC2PheOuter:         0.6
    4646RefConvFADC2PhotInner:    1.7
    4747RefConvFADC2PhotOuter:    6.55
     48RefConvFADC2PheInner:     0.31
     49RefConvFADC2PheOuter:     1.26
    4850#
    4951# Quantum Efficiencies:
  • trunk/MagicSoft/Mars/mjobs/calibrationref_Nov04.rc

    r6718 r7013  
    4242# Converstion factors:
    4343#
    44 RefConvFADC2PheInner:     0.13
    45 RefConvFADC2PheOuter:     0.33
     44RefFADC2PheInner:         0.13
     45RefFADC2PheOuter:         0.33
    4646RefConvFADC2PhotInner:    0.71.
    4747RefConvFADC2PhotOuter:    2.8
     48RefConvFADC2PheInner:     0.135
     49RefConvFADC2PheOuter:     0.53
    4850#
    4951# Quantum Efficiencies:
Note: See TracChangeset for help on using the changeset viewer.