Changeset 7099 for trunk/MagicSoft


Ignore:
Timestamp:
05/27/05 16:33:19 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/NEWS

    r7094 r7099  
    55   - general: MMcEvt now derived from MMcEvtBasic which should
    66     have no influence on compatibility with older camera files
     7
     8   - callisto: changed default of fgFallTimeHiGain in
     9     MExtractTimeAndChargeSpline from 1.5 to 0.5. 0.5 was
     10     already set as default in callisto_Dec04Jan05.rc
     11
     12   - callisto: the digital filter (MExtractTimeAndChargeDigitalFilter)
     13     now changes the filename for new weights automatically for
     14     cosmics, MC and for different calibration colors.
     15
     16   - callisto: a problem with the order of some code cause the
     17     name of the weights file in MPedestalY2 to be ignored.
     18     Wrongly the calibration_UV weights were used instead
     19     of the cosmics weights set in callisto.rc.
    720
    821   - sponde: The input MC spectrum can now be weighted to fake a
     
    90103
    91104   - callisto: new setup read from callisto.rc
    92      + MCalibCalcFromPast.fNuMEventsDump
     105     + MCalibCalcFromPast.fNumEventsDump
    93106     + MHCalibrationChargeCam.NumHiGainSaturationLimit
    94107     + MHCalibrationChargeCam.NumLoGainSaturationLimit
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r7053 r7099  
    135135using namespace std;
    136136
    137 const Float_t MCalibrateData::fgCalibConvMinLimit = 0.01;
    138 const Float_t MCalibrateData::fgCalibConvMaxLimit = 5.;
     137const Float_t MCalibrateData::gkCalibConvMinLimit = 0.01;
     138const Float_t MCalibrateData::gkCalibConvMaxLimit = 5.;
     139
     140const MCalibrateData::CalibrationMode_t MCalibrateData::gkDefault = kFfactor;
     141
    139142// --------------------------------------------------------------------------
    140143//
     
    441444{
    442445
    443     *fLog << inf << GetDescriptor()
    444           << ": Updating Conversion Factors... " << endl;
     446    *fLog << inf << GetDescriptor() << ": Updating Conversion Factors... " << endl;
    445447   
    446448    fCalibConsts.Reset();
     
    495497            if (updatecam)
    496498              {
    497                 MCalibrationChargePix &upix = (MCalibrationChargePix&)(*updatecam)[pixidx];
     499                const MCalibrationChargePix &upix = (MCalibrationChargePix&)(*updatecam)[pixidx];
     500
    498501                //
    499502                // Correct for the possible change in amplification of the individual pixels chain
    500503                //
    501504                const Float_t pixmean = upix.GetConvertedMean();
    502                 calibUpdate = (pixmean == 0.) ? 1. : pix.GetConvertedMean() / pixmean;
     505                calibUpdate = pixmean==0 ? 1 : pix.GetConvertedMean()/pixmean;
     506
    503507                //
    504508                // Correct for global shifts in light emission
    505509                //
    506                 MCalibrationChargePix &ugpix = (MCalibrationChargePix&)updatecam->GetAverageArea(0);
     510                const MCalibrationChargePix &ugpix = (MCalibrationChargePix&)updatecam->GetAverageArea(0);
    507511
    508512                const Float_t globmean = avpix.GetConvertedMean();
    509                 calibUpdate = (globmean == 0.) ? 1. : ugpix.GetConvertedMean() / globmean;
    510 
    511                 MBadPixelsPix         &ubad  = (MBadPixelsPix&)        updatecam->GetAverageBadArea(0);
     513                calibUpdate = globmean==0 ? 1 : ugpix.GetConvertedMean()/globmean;
     514
     515                MBadPixelsPix &ubad  = (MBadPixelsPix&)updatecam->GetAverageBadArea(0);
    512516                if (ubad.IsUncalibrated(MBadPixelsPix::kChargeIsPedestal))
    513517                  {
     
    581585                calibUpdate = 1.;
    582586                break;
     587
     588              default:
     589                  break;
    583590              } /* switch calibration mode */
    584591          } /* if(fCalibrationMode!=kNone) */
     
    755762        out << "   " << GetUniqueName() << ".EnablePedestalType(MCalibrateData::kRun)" << endl;
    756763
    757     if (fCalibrationMode != kDefault)
     764    if (fCalibrationMode != gkDefault)
    758765    {
    759766        out << "   " << GetUniqueName() << ".SetCalibrationMode(MCalibrateData::";
     
    865872    {
    866873      *fLog << all
    867             << Form("%s%3i","Pixel: ",pixidx)
    868             << Form("%s%4.2f","  CalibConst: ",fCalibConsts[pixidx])
    869             << Form("%s%4.2f","  F-Factor: ",fCalibFFactors[pixidx])
    870             << Form("%s%4.2f","  HiLoConv: ",fHiLoConv[pixidx])
     874            << "Pixel: " << Form("%3i",pixidx)
     875            << "  CalibConst: " << Form("%4.2f",fCalibConsts[pixidx])
     876            << "  F-Factor: "   << Form("%4.2f",fCalibFFactors[pixidx])
     877            << "  HiLoConv: "   << Form("%4.2f",fHiLoConv[pixidx])
    871878            << endl;
    872879    }
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r6855 r7099  
    2323class MCalibrateData : public MTask
    2424{
     25public:
     26    enum CalibrationMode_t
     27    {
     28        kSkip       =  0,
     29        kNone       =  1,
     30        kFlatCharge =  2,
     31        kBlindPixel =  3,
     32        kFfactor    =  4,
     33        kPinDiode   =  5,
     34        kCombined   =  6,
     35        kDummy      =  7
     36    };
     37
     38    enum PedestalType_t
     39    {
     40        kNo    = BIT(0),
     41        kRun   = BIT(1),
     42        kEvent = BIT(2)
     43    };
     44
     45    enum SignalType_t
     46    {
     47        kPhe,
     48        kPhot
     49    };
     50
     51    static const CalibrationMode_t gkDefault;
     52
    2553private:
    26 
    27   static const Float_t  fgCalibConvMinLimit; //! Minimum limit for conv. factor
    28   static const Float_t  fgCalibConvMaxLimit; //! Maximum limit for conv. factor
     54  static const Float_t gkCalibConvMinLimit; //! Minimum limit for conv. factor
     55  static const Float_t gkCalibConvMaxLimit; //! Maximum limit for conv. factor
    2956
    3057  Float_t  fCalibConvMinLimit;           // Minimum limit for conv. factor
     
    3966  MCalibConstCam        *fCalibConstCam; //! Temporary calib consts storage
    4067 
    41   UShort_t fCalibrationMode;             // Flag defining the calibration mode (CalibrationMode_t)
     68  CalibrationMode_t fCalibrationMode;    // Flag defining the calibration mode (CalibrationMode_t)
    4269  Byte_t   fPedestalFlag;                // Flags defining to calibrate the pedestal each event or each run
    4370  Byte_t   fSignalType;                  // Flag defining the signal type (kphot or kphe)
     
    6390 
    6491public:
    65 
    66     enum CalibrationMode_t
    67     {
    68         kSkip       =  0,
    69         kNone       =  1,
    70         kFlatCharge =  2,
    71         kBlindPixel =  3,
    72         kFfactor    =  4,
    73         kPinDiode   =  5,
    74         kCombined   =  6,
    75         kDummy      =  7
    76     };
    77 
    78   static const CalibrationMode_t kDefault = kFfactor;
    79  
    80   enum PedestalType_t
    81   {
    82       kNo    = BIT(0),
    83       kRun   = BIT(1),
    84       kEvent = BIT(2)
    85   };
    86  
    87   enum SignalType_t
    88   {
    89       kPhe,
    90       kPhot
    91   };
    92  
    93   MCalibrateData(CalibrationMode_t calmode=kDefault,
    94                  const char *name=NULL, const char *title=NULL);
     92    MCalibrateData(CalibrationMode_t calmode=gkDefault,
     93                   const char *name=NULL, const char *title=NULL);
    9594 
    9695  void   AddPedestal(const char *name="Cam");
     
    106105  Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
    107106 
    108   void   SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
     107  void   SetCalibrationMode ( CalibrationMode_t calmode=gkDefault) { fCalibrationMode=calmode; }
    109108  void   SetSignalType      ( SignalType_t      sigtype=kPhe    ) { fSignalType     =sigtype; } 
    110109
    111   void   SetCalibConvMinLimit( const Float_t f=fgCalibConvMinLimit ) { fCalibConvMinLimit = f; }
    112   void   SetCalibConvMaxLimit( const Float_t f=fgCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
     110  void   SetCalibConvMinLimit( const Float_t f=gkCalibConvMinLimit ) { fCalibConvMinLimit = f; }
     111  void   SetCalibConvMaxLimit( const Float_t f=gkCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
    113112   
    114113  Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
     
    118117
    119118#endif   /* MCalibrateData */
    120 
    121 
    122 
    123 
    124 
    125 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r7069 r7099  
    181181//  ClassVersion 2:
    182182//   - Float_t fPheErrLimit;
    183 //   + Float_t fPheErrLowerLimit;                   // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
    184 //   + Float_t fPheErrUpperLimit;                   // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     183//   + Float_t fPheErrLowerLimit; // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     184//   + Float_t fPheErrUpperLimit; // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     185//
     186//  ClassVersion 3:
     187//   + Bool_t  fUseExtractorRes;  // Include extractor resolution in F-Factor method
    185188//
    186189//////////////////////////////////////////////////////////////////////////////
     
    280283//
    281284MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title)
    282     : fGeom(NULL), fSignal(NULL), fCalibPattern(NULL)
     285    : fUseExtractorRes(kFALSE),
     286    fGeom(NULL), fSignal(NULL), fCalibPattern(NULL), fExtractor(NULL)
    283287{
    284288       
     
    661665      return kTRUE;
    662666  }
    663  
     667
    664668  if (fNumProcessed == 0)
    665669    return kTRUE;
     
    10171021            << endl;
    10181022      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1023      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     1024      return kFALSE;
     1025    }
     1026
     1027  if (cal.GetPheFFactorMethod() < 0.)
     1028    {
     1029      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1030      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     1031      cal.SetFFactorMethodValid(kFALSE);
     1032      return kFALSE;
     1033    }
     1034
     1035  if (!cal.CalcConvFFactor())
     1036    {
     1037      *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in ";
     1038      *fLog << what << ":           " << Form("%4i", cal.GetPixId()) << endl;
     1039      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1040      return kFALSE;
     1041    }
     1042
     1043  if (!fUseExtractorRes)
     1044    return kTRUE;
     1045
     1046  if (!fExtractor)
     1047    {
     1048      *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate" << endl;
     1049      return kFALSE;
     1050    }
     1051
     1052  const Float_t resinphes = cal.IsHiGainSaturation()
     1053    ? cal.GetPheFFactorMethod()*fExtractor->GetResolutionPerPheLoGain()
     1054    : cal.GetPheFFactorMethod()*fExtractor->GetResolutionPerPheHiGain();
     1055
     1056  Float_t resinfadc = cal.IsHiGainSaturation()
     1057    ? resinphes/cal.GetMeanConvFADC2Phe()/cal.GetConversionHiLo()
     1058    : resinphes/cal.GetMeanConvFADC2Phe();
     1059
     1060  if (resinfadc > 1.5*cal.GetPedRms() )
     1061    {
     1062      *fLog << warn << " Extractor Resolution: " << resinfadc << " bigger than Pedestal RMS " << cal.GetPedRms() << endl;
     1063      resinfadc = cal.GetPedRms();
     1064    }
     1065
     1066  if (!cal.CalcReducedSigma(resinfadc))
     1067    {
     1068        *fLog << warn << "Could not calculate the reduced sigma in " << what;
     1069        *fLog << ":                        " << Form("%4i",cal.GetPixId()) << endl;
     1070        bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
     1071        return kFALSE;
     1072    }
     1073
     1074  if (!cal.CalcFFactor())
     1075    {
     1076        *fLog << warn << "Could not calculate the F-Factor in " << what;
     1077        *fLog << ":                             " << Form("%4i",cal.GetPixId()) << endl;
     1078      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1079      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
    10191080      return kFALSE;
    10201081    }
     
    22992360      rc = kTRUE;
    23002361    }
     2362  if (IsEnvDefined(env, prefix, "UseExtractorRes", print))
     2363    {
     2364      SetUseExtractorRes(GetEnvValue(env, prefix, "UseExtractorRes", fUseExtractorRes));
     2365      rc = kTRUE;
     2366    }
    23012367
    23022368  return rc;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r7028 r7099  
    22#define MARS_MCalibrationChargeCalc
    33
    4 /////////////////////////////////////////////////////////////////////////////
    5 //                                                                         //
    6 // MCalibrationChargeCalc                                                   //
    7 //                                                                         //
    8 // Integrates the time slices of the all pixels of a calibration event     //
    9 // and substract the pedestal value                                        //
    10 //                                                                         //
    11 /////////////////////////////////////////////////////////////////////////////
    12 
    134#ifndef MARS_MTask
    145#include "MTask.h"
    156#endif
    167
     8#ifndef ROOT_TArrayC
     9#include <TArrayC.h>
     10#endif
     11
    1712#ifndef MARS_MBadPixelsPix
    1813#include "MBadPixelsPix.h"
     
    2116#ifndef MARS_MCalibrationCam
    2217#include "MCalibrationCam.h"
    23 #endif
    24 
    25 #ifndef ROOT_TArrayC
    26 #include <TArrayC.h>
    2718#endif
    2819
     
    4435class MBadPixelsIntensityCam;
    4536class MBadPixelsCam;
     37class MExtractor;
    4638
    4739class MCalibrationChargeCalc : public MTask
     
    9183
    9284  Int_t   fNumProcessed;                       // Number of processed events (for Intensity calibration)
     85  Bool_t  fUseExtractorRes;                    // Include extractor resolution in F-Factor method
    9386 
    9487  // Pointers
     
    108101  MCalibrationPattern            *fCalibPattern;   //! Calibration DM pattern
    109102  MPedestalCam                   *fPedestals;      //! Pedestals all pixels (calculated previously from ped.file)
     103  MExtractor                     *fExtractor;      //! Signal Extractor
    110104
    111105  // enums
     
    211205      : CLRBIT(fFlags, kDebug); }
    212206
     207  void SetExtractor(MExtractor   *ext) { fExtractor=ext; }
    213208  void SetPedestals(MPedestalCam *cam) { fPedestals=cam; }
    214209                                                                         
     
    223218  void SetPheErrUpperLimit  ( const Float_t f=fgPheErrUpperLimit       ) { fPheErrUpperLimit  = f;     }
    224219  void SetPulserColor       ( const MCalibrationCam::PulserColor_t col ) { fPulserColor       = col;   }
    225 
    226   ClassDef(MCalibrationChargeCalc, 2)   // Task calculating Calibration Containers and Quantum Efficiencies
     220  void SetUseExtractorRes(Bool_t b=kTRUE) { fUseExtractorRes = b; }
     221
     222  ClassDef(MCalibrationChargeCalc, 3)   // Task calculating Calibration Containers and Quantum Efficiencies
    227223};
    228224
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc

    r7013 r7099  
    674674// in GetRSigma() and GetRSigmaErr()
    675675//
    676 Bool_t MCalibrationChargePix::CalcReducedSigma()
     676Bool_t MCalibrationChargePix::CalcReducedSigma(const Float_t extractorres)
    677677{
    678678
     
    687687  const Float_t pedRmsSquare    = IsHiGainSaturation() ? fLoGainPedRmsSquare    : fPedRms*fPedRms;
    688688  const Float_t pedRmsSquareVar = IsHiGainSaturation() ? fLoGainPedRmsSquareVar : 0.25*fPedVar*pedRmsSquare;
     689  const Float_t extractorresVar = extractorres * extractorres;
    689690
    690691  if (IsDebug())
     
    696697            << " PedRmsSquare: " << pedRmsSquare
    697698            << " pedRmsSquareVar: " << pedRmsSquareVar
     699            << " extractorresVar: " << extractorresVar
    698700            << endl;
    699701    }
     
    705707  // Calculate the reduced sigmas
    706708  //
    707   fRSigmaSquare = sigmaSquare - pedRmsSquare;
     709  fRSigmaSquare = sigmaSquare - pedRmsSquare - extractorresVar;
    708710
    709711  if (IsDebug())
     
    764766Bool_t MCalibrationChargePix::CalcFFactor()
    765767{
    766 
    767   if (fRSigmaSquare < 0.)
    768     return kFALSE;
     768    SetFFactorMethodValid(kFALSE);
     769
     770    if (fRSigmaSquare < 0.)
     771        return kFALSE;
    769772 
    770773  //
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h

    r7013 r7099  
    5353
    5454  MCalibrationChargePix(const char *name=NULL, const char *title=NULL);
    55   ~MCalibrationChargePix() {}
    5655 
    5756  void Clear(Option_t *o="");
     
    111110
    112111  // Calculations
    113   void   CalcLoGainPedestal       ( const Float_t logainsamples);
    114   Bool_t CalcReducedSigma  (  );
    115   Bool_t CalcFFactor       (  );
    116   Bool_t CalcConvFFactor   (  ); 
    117   Bool_t CalcMeanFFactor   ( const Float_t nphotons, const Float_t nphotonsrelvar );
     112  void   CalcLoGainPedestal(const Float_t logainsamples);
     113  Bool_t CalcReducedSigma(const Float_t extractorres=0);
     114  Bool_t CalcFFactor();
     115  Bool_t CalcConvFFactor();
     116  Bool_t CalcMeanFFactor(const Float_t nphotons, const Float_t nphotonsrelvar);
    118117 
    119118  ClassDef(MCalibrationChargePix, 3)    // Container Charge Calibration Results Pixel
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r7071 r7099  
    777777    SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
    778778
     779    // Setup an environment task
    779780    MTaskEnv tenv("ExtractSignal");
    780781    tenv.SetDefault(fExtractor);
    781782
    782     if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug()>2)==kERROR)
     783    // check the resource file for it
     784    if (CheckEnv(tenv)==kERROR)
    783785        return kFALSE;
    784786
     787//    if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug()>2)==kERROR)
     788//        return kFALSE;
     789
     790    // If the resource file didn't change the default we are done
    785791    if (fExtractor==tenv.GetTask())
    786792        return kTRUE;
    787793
     794    // If it changed the default check its inheritance...
    788795    if (!tenv.GetTask()->InheritsFrom(MExtractor::Class()))
    789796    {
     
    792799    }
    793800
     801    // ..and store it
    794802    SetExtractor((MExtractor*)tenv.GetTask());
    795803
     
    973981    }
    974982
    975     *fLog << inf;
    976     fLog->Separator(GetDescriptor());
    977     *fLog << "Calculate pedestal from Sequence #";
    978     *fLog << fSequence.GetSequence() << endl << endl;
    979 
    980     if (!CheckEnv())
    981         return kFALSE;
    982 
    983983    // --------------------------------------------------------------------------------
    984984
     
    992992
    993993    // --------------------------------------------------------------------------------
     994
     995    if (!CheckEnv())
     996        return kFALSE;
    994997
    995998    MParList  plist;
     
    10871090            return kFALSE;
    10881091
     1092        // The requested setup might have been overwritten
     1093        if (CheckEnv(*fExtractor)==kERROR)
     1094            return kFALSE;
     1095
    10891096        *fLog << all;
    1090         *fLog << underline << "Signal Extractor found in calibration file:" << endl;
     1097        *fLog << underline << "Signal Extractor found in calibration file and setup:" << endl;
    10911098        fExtractor->Print();
    10921099        *fLog << endl;
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r7094 r7099  
    170170    fLog->Separator("Initialize energy weighting");
    171171
    172     MParList l;
    173     l.AddToList(&w);
    174     if (!CheckEnv(l))
     172    if (!CheckEnv(w))
    175173    {
    176174        *fLog << err << "ERROR - Reading resources for MMcSpectrumWeight failed." << endl;
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r7096 r7099  
    4747#include "MLogManip.h"
    4848
     49#include "MParList.h"
    4950#include "MEvtLoop.h"
    5051
     
    195196}
    196197
     198//------------------------------------------------------------------------
     199//
     200// Returns the result of c.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug>2)
     201// By adding the container first to a MParList it is ensured that
     202// all levels are checked.
     203//
    197204Bool_t MJob::CheckEnv(MParContainer &c) const
    198205{
     
    200207        return kTRUE;
    201208
    202     return c.ReadEnv(*fEnv, fEnvPrefix, fEnvDebug>2);
     209    // Make sure that all levels are checked
     210    MParList l;
     211    l.AddToList(&c);
     212    return l.ReadEnv(*fEnv, fEnvPrefix+".", fEnvDebug>2);
    203213}
    204214
  • trunk/MagicSoft/Mars/mjobs/Makefile

    r6993 r7099  
    2323           -I../mbadpixels -I../msignal -I../mraw -I../mpedestal -I../mtools \
    2424           -I../mimage -I../mpointing -I../mastro -I../mfbase -I../mhvstime \
    25            -I../mtrigger -I../mmuon
     25           -I../mtrigger -I../mmuon -I../mmc
    2626
    2727SRCFILES = MSequence.cc \
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r7098 r7099  
    635635    {
    636636        SetNameWeightsFile(GetEnvValue(env, prefix, "WeightsFile", ""));
    637         *fLog << all << "**********> " << fNameWeightsFile << endl;
    638637        rc = kTRUE;
    639638    }
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h

    r6840 r7099  
    1717class TH2F;
    1818class MPedestalPix;
     19class MCalibrationPattern;
     20
    1921class MExtractTimeAndChargeDigitalFilter : public MExtractTimeAndCharge
    2022{
    2123private:
    22 
    2324  static const Byte_t fgHiGainFirst;             //! Default for fHiGainFirst       (now set to: 0)
    2425  static const Byte_t fgHiGainLast;              //! Default for fHiGainLast        (now set to:14)
     
    3435  static const Float_t fgOffsetLoGain;           //! Default for fOffsetLoGain (now set to 1.7)
    3536  static const Float_t fgLoGainStartShift;       //! Default for fLoGainStartShift (now set to -1.8)
     37
     38  MCalibrationPattern  *fCalibPattern;          //! Calibration DM pattern
    3639 
    3740  MArrayF fHiGainSignal;                        //! Need fast access to the signals in a float way
     
    5962  MArrayF fTimeWeightsLoGain;                   //! Time weights Low-Gain (from weights file)
    6063
    61   TString fNameWeightsFile;                     //  Name of the weights file
    62   Bool_t  fWeightsSet;                          //! Flag if weights have alreayd been set
     64  TString fNameWeightsFile;                     // Name of the weights file
     65  Bool_t  fAutomaticWeights;                    // Flag whether weight should be determined automatically
     66  TString fNameWeightsFileSet;                  //! Flag if weights have alreayd been set
    6367  Int_t   fRandomIter;                          //! Counter used to randomize weights for noise calculation
    6468
    65   Bool_t  InitArrays();
     69  // MExtractTimeAndChargeDigitalFilter
     70  void    CalcBinningResArrays();
     71  Bool_t  ReadAutomaticWeightsFile();
    6672
    67   void CalcBinningResArrays();
     73  // MExtractTimeAndCharge
     74  Bool_t InitArrays();
     75
     76  // MTask
     77  Int_t PreProcess(MParList *pList);
    6878
    6979protected:
    70  
    71   Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     80  // MParContainer
     81  Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    7282
    7383public:
     84  MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL);
     85  ~MExtractTimeAndChargeDigitalFilter() { }
    7486
    75   MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL); 
    76   ~MExtractTimeAndChargeDigitalFilter() { }
     87  Bool_t ReadWeightsFile(TString filename);
    7788 
    7889  Bool_t WriteWeightsFile(TString filename,
     
    8091                          TH1F *shapelo=NULL, TH2F *autocorrlo=NULL );
    8192
    82   Bool_t ReadWeightsFile(TString filename);
    8393
    84   void SetNameWeightsFile( TString s = fgNameWeightsFile )   { fNameWeightsFile = s; }
     94  void SetNameWeightsFile(TString s="") { fNameWeightsFile = s; fNameWeightsFileSet=""; }
     95  void EnableAutomaticWeights(Bool_t b=kTRUE) { fAutomaticWeights = b; }
    8596
    8697  void SetBinningResolution(const Int_t rh=fgBinningResolutionHiGain, const Int_t rl=fgBinningResolutionLoGain)  {
     
    100111  const char* GetNameWeightsFile() const  { return fNameWeightsFile.Data(); }
    101112
    102   void Print(Option_t *o="") const;
    103 
    104   Bool_t IsWeightsSet() const  { return fWeightsSet;  }
     113  void Print(Option_t *o="") const; //*MENU*
    105114
    106115  void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum,
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc

    r7061 r7099  
    157157const Float_t MExtractTimeAndChargeSpline::fgResolution       = 0.05;
    158158const Float_t MExtractTimeAndChargeSpline::fgRiseTimeHiGain   = 0.5;
    159 const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain   = 1.5;
     159const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain   = 0.5;
    160160const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch    = 1.5;
    161161const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain     = 1.7;  // 5 ns
  • trunk/MagicSoft/Mars/msignal/Makefile

    r6856 r7099  
    2020#
    2121INCLUDES =  -I. -I../mbase -I../mgui -I../mraw -I../manalysis \
    22             -I../mgeom -I../mtools -I../mpedestal -I../mbadpixels
     22            -I../mgeom -I../mtools -I../mpedestal -I../mbadpixels \
     23            -I../mcalib
    2324
    2425# mgui (MCamEvent):         MExtractSignalCam
Note: See TracChangeset for help on using the changeset viewer.