Changeset 7122


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7121 r7122  
    3333     - added MJOptimizeCuts
    3434     - added MJOptimizeEnergy
     35
     36   * showplot.cc:
     37     - set window name to input file name
     38
     39   * mcalib/MCalibColorSet.cc:
     40     - changed order of checks so that an explicit color is
     41       prior to any automatic detection.
     42
     43   * mcalib/MCalibrateData.[h,cc]:
     44     - implemented setting a possible additional scale factor
     45       (for MC it is always reset to 1)
     46
     47   * mfilter/MFCosmics.cc:
     48     - don't count saturated hi-gain pixels at all. It should
     49       not be necessary, because such pixels should have a value
     50       high enough in the high-gains but it seems sometimes they don't
     51
     52   * mhflux/MHAlpha.[h,cc]:
     53     - changed some orders in header
     54     - made some private data members protected
     55     - Call GetVal() if fMap[0]<0. This is necessary if the fill
     56       value is calculated on-the-fly (like ThetaSq)
     57     - made InitMapping virtual
     58
     59   * mhflux/MHDisp.cc:
     60     - removed 'Get-Entries' workarund
     61     - changed the function integartion for the significance
     62
     63   * mhflux/MHThetaSq.[h,cc]:
     64     - overwrite InitMapping because ThetaSq should be read from
     65       the parlist always
     66
     67   * mimage/MHHillas.cc:
     68     - set histogram minimum of Delta to 0
     69
     70   * mpedestal/MPedPhotCam.cc:
     71     - check for unsuitable pixels when calculating the means not
     72       only for the UnsuitableRun ones
     73
     74   * msignal/MExtractor.cc:
     75     - replaced wrong %2d by %2f
    3576
    3677
  • trunk/MagicSoft/Mars/NEWS

    r7121 r7122  
    1515     correctly.
    1616
     17   - shoplot now displays the filename in the title bar of the window
     18
    1719   - merpp: new options: --auto-time-start --auto-time-stop which
    1820     allow to cut updating with slow-control at the start- or
     
    3234     Wrongly the calibration_UV weights were used instead
    3335     of the cosmics weights set in callisto.rc.
     36
     37   - callisto: should allow ct1 pulser data when the color is
     38     explicitly set also for pretty new runs
     39
     40   - callisto: a new option (MCalibrateData.ScaleFactor) allows
     41     to introduce an additional scale factor (should be around 1)
     42     to adapt for slight deviations in different extractors from
     43     the MC calibration. For MC calibrations the scale factor
     44     is fixed to 1
     45
     46   - callisto: MFCosmics should handle very high signals a bit
     47     more accurate now
     48
     49   - callisto: when calculating the mean pedestal rms for different
     50     pixel sizes or sectors also kUnsuitableEvt is now taken into
     51     account - not only kUnsuitableRun
    3452
    3553   - star: fixed a bug which caused the first bin of the histograms
  • 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
  • trunk/MagicSoft/Mars/mfilter/MFCosmics.cc

    r7046 r7122  
    185185            continue;
    186186
    187         const MExtractedSignalPix &sig =  (*fSignals)[idx];
    188         const MPedestalPix        &ped =  (*fPedestals)[idx];
     187        const MExtractedSignalPix &sig = (*fSignals)[idx];
     188
     189        //
     190        // Check whether the pixel has a saturating hi-gain. In
     191        // this case the extracted hi-gain might be empty.
     192        //
     193        if (sig.GetNumHiGainSaturated()>0)
     194            continue;
     195
     196        const MPedestalPix  &ped = (*fPedestals)[idx];
    189197
    190198        const Float_t pedrms = ped.GetPedestalRms()*fSqrtHiGainSamples;
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r7064 r7122  
    8383    : fNameParameter("MHillasSrc"), fParameter(0),
    8484    fOffData(0), fResult(0), /*fExcess(0),*/ fEnergy(0), fHillas(0),
    85     fPointPos(0), fTimeEffOn(0), fTime(0),
    86     fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE), fSkipHistEnergy(kFALSE),
    87     fForceUsingSize(kFALSE), fNumTimeBins(10), fMatrix(0)
    88 
     85    fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10),
     86    fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE),
     87    fSkipHistEnergy(kFALSE), fForceUsingSize(kFALSE)
    8988{
    9089    //
     
    449448    if (fMatrix)
    450449    {
    451         alpha  = (*fMatrix)[fMap[0]];
     450        alpha  = fMap[0]<0 ? GetVal() : (*fMatrix)[fMap[0]];
    452451        energy = fMap[1]<0 ? -1 : (*fMatrix)[fMap[1]];
    453452        size   = fMap[2]<0 ? -1 : (*fMatrix)[fMap[2]];
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.h

    r7064 r7122  
    5252    MTime    fLastTime;         //! Last fTimeEffOn
    5353
     54    UShort_t fNumTimeBins;      // Number of time bins to fill together
     55    UShort_t fNumRebin;         //!
     56
     57    //const TString fNameProjAlpha;  //! This should make sure, that gROOT doen't confuse the projection with something else
     58protected:
     59    MHMatrix *fMatrix;          //!
     60    Int_t fMap[5];              //!
     61
    5462    Bool_t fSkipHistTime;
    5563    Bool_t fSkipHistTheta;
     
    5765    Bool_t fForceUsingSize;
    5866
    59     UShort_t fNumTimeBins;      // Number of time bins to fill together
    60     UShort_t fNumRebin;         //!
    61 
    62     //const TString fNameProjAlpha;  //! This should make sure, that gROOT doen't confuse the projection with something else
    63 
    64     MHMatrix *fMatrix;          //!
    65     Int_t fMap[5];              //!
    66 
    67     Float_t FitEnergyBins(Bool_t paint=kFALSE);
     67private:
     68     Float_t FitEnergyBins(Bool_t paint=kFALSE);
    6869    void FitThetaBins(Bool_t paint=kFALSE);
    6970
     
    127128    void DrawAll(); //*MENU*
    128129
    129     void InitMapping(MHMatrix *mat, Int_t type=0);
     130    virtual void InitMapping(MHMatrix *mat, Int_t type=0);
    130131    void StopMapping();
    131132
  • trunk/MagicSoft/Mars/mhflux/MHDisp.cc

    r7115 r7122  
    197197            return kFALSE;
    198198        }
    199         const Double_t m3l = fHilExt->GetM3Long()*TMath::Sign(1.0f, hsrc.GetCosDeltaAlpha())*fMm2Deg;
     199        const Double_t m3l = fHilExt->GetM3Long()*TMath::Sign(fMm2Deg, hsrc.GetCosDeltaAlpha());
    200200
    201201        gweight = m3l>fM3lCut ? 1 : 0;
     
    217217    }
    218218
    219     // Workaround: Number-of-entries
    220     if (gweight>0.25)
    221         fHist.Fill(pos1.X(), pos1.Y(), 0.0, w*gweight);
    222     if (gweight<0.75)
    223         fHist.Fill(pos2.X(), pos2.Y(), 0.0, w*(1-gweight));
     219    fHist.Fill(pos1.X(), pos1.Y(), 0.0, w*gweight);
     220    fHist.Fill(pos2.X(), pos2.Y(), 0.0, w*(1-gweight));
    224221
    225222    return kTRUE;
     
    273270        const Double_t x0 = h1->GetXaxis()->GetBinCenter(ix);
    274271        const Double_t y0 = h1->GetYaxis()->GetBinCenter(iy);
     272        const Double_t w0 = h1->GetXaxis()->GetBinWidth(1);
    275273
    276274        for (int x=0; x<h1->GetNbinsX(); x++)
     
    294292        h2->Fit(&func, "IMQ", "", 0, 1.0);
    295293
    296         const Double_t r0 = 2*func.GetParameter(2);
    297         const Double_t e  = func.Integral(0, r0)/h1->GetBinWidth(1);
    298         func.SetParameter(0, 0);
    299         const Double_t b  = func.Integral(0, r0)/h1->GetBinWidth(1);
     294        // No wintegrate the function f(x) per Delta Area
     295        // which is f(x)/(pi*delta r*(2*r+delta r))
     296        TF1 func2("fcn2", Form("(gaus + [3]*x*x + [4])/(2*x+%.5f)", w0));
     297        for (int i=0; i<5; i++)
     298            func2.SetParameter(i, func.GetParameter(i));
     299
     300        const Double_t r0 = 2*func2.GetParameter(2);
     301        const Double_t e  = func2.Integral(0, r0)/(w0*TMath::Pi());
     302        func2.SetParameter(0, 0);
     303        const Double_t b  = func2.Integral(0, r0)/(w0*TMath::Pi());
    300304        const Double_t s  = MMath::SignificanceLiMa(e, b);
    301305
  • trunk/MagicSoft/Mars/mimage/MHHillas.cc

    r6977 r7122  
    9090    fDistC->SetYTitle("Counts");
    9191    fDelta->SetYTitle("Counts");
     92
     93    fDistC->SetMinimum(0);
    9294
    9395    MBinning bins;
  • trunk/MagicSoft/Mars/mjobs/MJOptimizeCuts.cc

    r7121 r7122  
    315315Bool_t MJOptimizeCuts::RunOnOff(const char *fname, MFilter *filter, MAlphaFitter *fit, const char *tree)
    316316{
    317     MHAlpha *histon = CreateNewHist();
    318     MHAlpha *histof = CreateNewHist("MHAlphaOff");
     317    MHAlpha *histon = CreateNewHist("Hist");
     318    MHAlpha *histof = CreateNewHist("HistOff");
    319319
    320320    const Bool_t rc = RunOnOffCore(*histon, *histof, fname, filter, fit, tree);
  • trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc

    r7109 r7122  
    273273    for (int i=0; i<np; i++)
    274274    {
    275         if (bad && (*bad)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
    276             continue; //was: .IsBad()
     275        if (bad && (*bad)[i].IsUnsuitable())
     276            continue;
    277277
    278278        // Create sums for areas and sectors
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r7070 r7122  
    433433    *fLog << " Gain Overlap to Lo: " << Form("%2d", fHiLoLast)        << endl;
    434434    *fLog << " Saturation Lim:     " << Form("%3d", fSaturationLimit) << endl;
    435     *fLog << " Num Samples Hi/Lo:  " << Form("%2d %2d", fNumHiGainSamples, fNumLoGainSamples) << endl;
     435    *fLog << " Num Samples Hi/Lo:  " << Form("%2.1f %2.1f", fNumHiGainSamples, fNumLoGainSamples) << endl;
    436436    if (fPedestals)
    437437        *fLog << " Pedestals:          " << fPedestals->GetName() << ", " << fPedestals << endl;
  • trunk/MagicSoft/Mars/showplot.cc

    r7001 r7122  
    177177    // From now on each 'Exit' means: Terminate the application
    178178    d->SetTitle(kInput);
     179    d->SetWindowName(kInput);
     180
    179181    d->Open(kInput);
    180182
Note: See TracChangeset for help on using the changeset viewer.