Changeset 8279


Ignore:
Timestamp:
01/30/07 14:16:45 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8278 r8279  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2007/01/30 Thomas Bretz
     22
     23   * mbadpixels/MBadPixelsCam.[h,cc]:
     24     - added function to return the uncalibrated and unsuitable
     25       pixels as TArrayC (to be used in MHCamera)
     26
     27   * mhcalib/MHCalibrationChargeCam.cc:
     28     - added a FIXME-comment
     29
     30   * mhist/MHCamEvent.[h,cc]:
     31     - added an option to change the kind of error which is displayed
     32     - consequently increased version number by 1
     33
     34   * mhist/MHCamera.[h,cc]:
     35     - added a new bit to allow the error to be switched between
     36       mean and spread
     37
     38
    2039
    2140 2007/01/27 Thomas Bretz
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc

    r8165 r8279  
    11/* ======================================================================== *\
     2! $Name: not supported by cvs2svn $:$Id: MBadPixelsCam.cc,v 1.48 2007-01-30 14:16:44 tbretz Exp $
     3! --------------------------------------------------------------------------
    24!
    35! *
     
    1719!
    1820!   Author(s): Thomas Bretz 1/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
    19 !             Markus Gaug  3/2004 <mailto:markus@ifae.es>
     21!   Author(s): Markus Gaug  3/2004 <mailto:markus@ifae.es>
    2022!
    2123!   Copyright: MAGIC Software Development, 2000-2004
     
    3638#include <iostream>
    3739
     40#include <TArrayC.h>
    3841#include <TClonesArray.h>
    3942
     
    525528  PrintBadPixels(MBadPixelsPix::kRelTimeOscillating ,"Relative Arr. Times Oscillation");
    526529  PrintBadPixels(MBadPixelsPix::kDeviatingFFactor   ,"Deviating global F-Factor");
     530}
     531
     532TArrayC MBadPixelsCam::GetUnsuitable(MBadPixelsPix::UnsuitableType_t typ) const
     533{
     534    TArrayC rc(GetSize());
     535
     536    for (Int_t i=0; i<rc.GetSize(); i++)
     537        rc[i] = (*this)[i].IsUnsuitable(typ) ? 0 : 1;
     538
     539    return rc;
     540}
     541
     542TArrayC MBadPixelsCam::GetUncalibrated(MBadPixelsPix::UncalibratedType_t typ) const
     543{
     544    TArrayC rc(GetSize());
     545
     546    for (Int_t i=0; i<rc.GetSize(); i++)
     547        rc[i] = (*this)[i].IsUncalibrated(typ) ? 0 : 1;
     548
     549    return rc;
    527550}
    528551
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h

    r8149 r8279  
     1/* ======================================================================== *\
     2!  $Name: not supported by cvs2svn $:$Id: MBadPixelsCam.h,v 1.11 2007-01-30 14:16:44 tbretz Exp $
     3\* ======================================================================== */
    14#ifndef MARS_MBadPixelsCam
    25#define MARS_MBadPixelsCam
     
    912#endif
    1013
     14class TArrayC;
     15class TClonesArray;
     16
    1117class MGeomPix;
    12 class TClonesArray;
    1318
    1419class MBadPixelsCam : public MParContainer, public MCamEvent
     
    5055    Short_t GetNumMaxCluster(const MGeomCam &geom, Int_t aidx=-1) { return GetNumMaxCluster(MBadPixelsPix::kUnsuitableRun, geom, aidx); }
    5156
     57    TArrayC GetUnsuitable(MBadPixelsPix::UnsuitableType_t typ=MBadPixelsPix::kUnsuitable) const;
     58    TArrayC GetUncalibrated(MBadPixelsPix::UncalibratedType_t typ) const;
     59
    5260    void   AsciiRead(istream &fin);
    5361    Bool_t AsciiWrite(ostream &out) const;
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r8243 r8279  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.48 2007-01-11 14:14:37 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.49 2007-01-30 14:16:45 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    11421142    const Float_t upperlimit = (Float_t)last ;// - fTimeUpperLimit;
    11431143
     1144    // FIXME: instead of checking whether the maximum is in the first or
     1145    //        last extracted slice we should check whether the extractor
     1146    //        was able to properly extract the signal!!!
     1147
    11441148    if (mean<lowerlimit)
    11451149    {
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r7832 r8279  
    9090//
    9191MHCamEvent::MHCamEvent(const char *name, const char *title)
    92     : fSum(NULL), fEvt(NULL), fType(0), fThreshold(0), fUseThreshold(0)
     92    : fSum(NULL), fEvt(NULL), fType(0), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
    9393{
    9494    Init(name, title);
     
    100100//
    101101MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title)
    102     : fSum(NULL), fEvt(NULL), fType(type), fThreshold(0), fUseThreshold(0)
     102    : fSum(NULL), fEvt(NULL), fType(type), fErrorSpread(kTRUE), fThreshold(0), fUseThreshold(0)
    103103{
    104104    Init(name, title);
     
    156156        fSum->SetYTitle("a.u.");
    157157    fSum->SetBit(MHCamera::kProfile);
     158    if (!fErrorSpread)
     159        fSum->SetBit(MHCamera::kErrorMean);
    158160
    159161    fSum->SetXTitle("Pixel Idx");
     
    282284    MHCamera *cam = new MHCamera(*fSum->GetGeometry());
    283285    cam->SetName(Form("%s;err", fName.Data()));
    284     cam->SetTitle("Sqrt(Variance)");
     286    cam->SetTitle(fErrorSpread?"Sqrt(Variance)":"Sqrt(Variance)/Sqrt(n_{i})");
    285287    cam->SetYTitle(fSum->GetYaxis()->GetTitle());
    286288    cam->SetCamContent(*fSum, 1);
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r7035 r8279  
    2323
    2424    Int_t fType;           // Type to used for calling GetPixelContent
     25    Bool_t fErrorSpread;   // kFALSE==mean, kTRUE==spread
    2526
    2627    Float_t fThreshold;    // Count pixel above/below this threshold
     
    5152
    5253    void SetThreshold(Float_t f=0, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
     54    void SetErrorSpread(Bool_t b=kTRUE) { fErrorSpread = b; }
    5355
    54     ClassDef(MHCamEvent, 1) // Histogram to sum camera events
     56    ClassDef(MHCamEvent, 2) // Histogram to sum camera events
    5557};
    5658
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r8106 r8279  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.95 2006-10-17 17:16:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.96 2007-01-30 14:16:45 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    13331333}
    13341334
     1335// ------------------------------------------------------------------------
     1336//
     1337// In the case the kProfile flag is set the spread of the bin is returned.
     1338// If you want to have the mean error instead set the kErrorMean bit via
     1339//  SetBit(kErrorMean) first.
     1340//
    13351341Stat_t MHCamera::GetBinError(Int_t bin) const
    13361342{
     
    13461352    const Double_t val = fArray[bin]        / n;
    13471353
    1348     return sqr>val*val ? TMath::Sqrt(sqr - val*val) / n : 0;
     1354    const Double_t spread = sqr>val*val ? TMath::Sqrt(sqr - val*val);
     1355
     1356    return TestBit(kErrorMean) ? spread/TMath::Sqrt(n) : spread;
    13491357
    13501358    /*
Note: See TracChangeset for help on using the changeset viewer.