Changeset 5156


Ignore:
Timestamp:
10/01/04 16:41:51 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

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

    r5133 r5156  
     1
    12/* ======================================================================== *\
    23!
     
    955956  if (cal.GetMean() < fChargeLimit*cal.GetPedRms())
    956957    {
    957       *fLog << warn << GetDescriptor()
    958             << Form(": Fitted Charge: %5.2f is smaller than %2.1f",cal.GetMean(),fChargeLimit)
    959             << Form("  Pedestal RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
     958      *fLog << warn
     959            << Form("Fitted Charge: %5.2f < %2.1f",cal.GetMean(),fChargeLimit)
     960            << Form(" * Pedestal RMS %5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
    960961      bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal);
    961962    }
     
    963964   if (cal.GetMean() < fChargeRelErrLimit*cal.GetMeanErr())
    964965    {
    965       *fLog << warn << GetDescriptor()
    966             << Form(": Fitted Charge: %4.2f is smaller than %2.1f",cal.GetMean(),fChargeRelErrLimit)
    967             << Form(" times its error: %4.2f in %s%4i",cal.GetMeanErr(),what,cal.GetPixId()) << endl;
     966      *fLog << warn
     967            << Form("Fitted Charge: %4.2f < %2.1f",cal.GetMean(),fChargeRelErrLimit)
     968            << Form(" * its error %4.2f in %s%3i",cal.GetMeanErr(),what,cal.GetPixId()) << endl;
    968969      bad.SetUncalibrated( MBadPixelsPix::kChargeRelErrNotValid );
    969970    }
     
    971972  if (cal.GetSigma() < cal.GetPedRms())
    972973    {
    973       *fLog << warn << GetDescriptor()
    974             << Form(": Sigma of Fitted Charge: %6.2f is smaller than",cal.GetSigma())
    975             << Form(" Ped. RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
     974      *fLog << warn
     975            << Form("Sigma of Fitted Charge: %6.2f <",cal.GetSigma())
     976            << Form(" Ped. RMS=%5.2f in %s%3i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
    976977      bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
    977978      return kFALSE;
     
    980981  if (!cal.CalcReducedSigma())
    981982    {
    982       *fLog << warn << GetDescriptor()
    983             << Form(": Could not calculate the reduced sigma in %s:               ",what)
     983      *fLog << warn
     984            << Form("Could not calculate the reduced sigma in %s:               ",what)
    984985            << Form("         %4i",cal.GetPixId())
    985986            << endl;
     
    990991  if (!cal.CalcFFactor())
    991992    {
    992       *fLog << warn << GetDescriptor()
    993             << Form(": Could not calculate the F-Factor in %s:                    ",what)
     993      *fLog << warn
     994            << Form("Could not calculate the F-Factor in %s:                    ",what)
    994995            << Form("         %4i",cal.GetPixId())
    995996            << endl;
     
    10001001  if (!cal.CalcConvFFactor())
    10011002    {
    1002       *fLog << warn << GetDescriptor()
    1003             << Form(": Could not calculate the Conv. FADC counts to Phes in %s:  ",what)
     1003      *fLog << warn
     1004            << Form("Could not calculate the Conv. FADC counts to Phes in %s:  ",what)
    10041005            << Form("         %4i",cal.GetPixId())
    10051006            << endl;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc

    r5134 r5156  
    418418      if ( res < lowlim[aidx] || res > upplim[aidx] )
    419419        {
    420           *fLog << warn << GetDescriptor() << ": Deviating time resolution: "
    421             << Form("%4.2f",res) << " out of accepted limits: ["
    422                 << Form("%4.2f%s%4.2f",lowlim[aidx],",",upplim[aidx]) << "] in pixel " << i << endl;
     420          *fLog << warn << "Deviating time resolution: "
     421            << Form("%4.2f",res) << " out of accepted limits ["
     422                << Form("%4.2f,%4.2f",lowlim[aidx],upplim[aidx]) << "] in pixel " << i << endl;
    423423          bad.SetUncalibrated( MBadPixelsPix::kDeviatingTimeResolution);
    424424          pix.SetExcluded();
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r5151 r5156  
    923923      if (overflow > 0.1)
    924924        {
    925           *fLog << warn << GetDescriptor()
    926                 << ": HiGain Histogram Overflow occurred " << overflow
    927                 << " times in pixel: " << i << " (without saturation!) " << endl;
     925          *fLog << warn
     926                << "HiGain Hist-overflow " << overflow
     927                << " times in pix: " << i << " (w/o saturation!) " << endl;
    928928          bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );
    929929        }
     
    932932      if (overflow > 0.1)
    933933        {
    934           *fLog << warn << GetDescriptor()
    935                 << ": HiGain Histogram Underflow occurred " << overflow
    936                 << " times in pixel: " << i << " (without saturation!) " << endl;
     934          *fLog << warn
     935                << "HiGain Hist-underflow " << overflow
     936                << " times in pix: " << i << " (w/o saturation!) " << endl;
    937937          bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );
    938938        }
     
    965965        if (overflow > 0.1)
    966966          {
    967             *fLog << warn << GetDescriptor()
    968                   << ": LoGain Histogram Overflow occurred " << overflow
    969                   << " times in pixel: " << i << " (without saturation!) " << endl;
     967              *fLog << warn
     968                  << "LoGain Hist-overflow " << overflow
     969                  << " times in pix: " << i << " (w/o saturation!) " << endl;
    970970            bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow );
    971971          }
     
    974974        if (overflow > 0.1)
    975975          {
    976             *fLog << warn << GetDescriptor()
    977                   << ": LoGain Histogram Underflow occurred " << overflow
    978                   << " times in pixel: " << i << " (without saturation!) " << endl;
     976            *fLog << warn
     977                  << "LoGain Hist-underflow " << overflow
     978                  << " times in pix: " << i << " (w/o saturation!) " << endl;
    979979            bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow );
    980980          }
     
    11081108  if ( mean < lowerlimit)
    11091109    {
    1110       *fLog << warn << GetDescriptor()
    1111             << Form("%s%3.1f%s%2.1f%s%s",": Mean ArrivalTime: ",mean," smaller than ",fTimeLowerLimit,
    1112                     " FADC slices from lower edge in pixel ",hist.GetName()) << endl;
     1110      *fLog << warn
     1111            << Form("%s%3.1f%s%2.1f%s%s","Mean ArrivalTime=",mean," < ",fTimeLowerLimit,
     1112                    " slices from lower edge in pixel ",hist.GetName()) << endl;
    11131113      bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );
    11141114    }
     
    11161116  if ( mean  > upperlimit )
    11171117    {
    1118       *fLog << warn << GetDescriptor()
    1119             << Form("%s%3.1f%s%2.1f%s%s",": Mean ArrivalTime: ",mean," greater than ",fTimeUpperLimit,
    1120                     " FADC slices from upper edge in pixel ",hist.GetName()) << endl;
     1118      *fLog << warn
     1119            << Form("%s%3.1f%s%2.1f%s%s","Mean ArrivalTime=",mean," > ",fTimeUpperLimit,
     1120                    " slices from upper edge in pixel ",hist.GetName()) << endl;
    11211121      bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );
    11221122    }
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc

    r5137 r5156  
    436436      if (overflow > 0.1)
    437437        {
    438           *fLog << warn << GetDescriptor()
    439                 << ": HiGain Histogram Overflow occurred " << overflow
    440                 << " times in pixel: " << i << " (without saturation!) " << endl;
     438          *fLog << warn << "HiGain Hist-overflow occurred " << overflow
     439                << " times in pix: " << i << " (w/o saturation!) " << endl;
    441440          //          bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );
    442441        }
     
    445444      if (overflow > 0.1)
    446445        {
    447           *fLog << warn << GetDescriptor()
    448                 << ": HiGain Histogram Underflow occurred " << overflow
    449                 << " times in pixel: " << i << " (without saturation!) " << endl;
     446          *fLog << warn << "HiGain Hist-underflow occurred " << overflow
     447                << " times in pix: " << i << " (w/o saturation!) " << endl;
    450448          //          bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );
    451449        }
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r5143 r5156  
    3030// currents or enything else derived from MCamEvent
    3131//
     32// Setup
     33// =====
     34//
    3235// To plot the variance instead of the rms use:
    3336//    MHCamEvent::SetBit(MHCamera::kVariance);
     37//  or
     38//    MHCamEvent::EnableVariance()
     39//
     40// To count how often a certain pixel is above or below a threshold do:
     41//    MHCamEvent::SetThreshold(5.5);  // Default=LowerBound
     42//    MHCamEvent::SetThreshold(5.5, MHCamEvent::kIsUpperBound);
     43//
    3444//
    3545// Axis titles
     
    4757//   MHCamEvent myhist("Titele;;y [cm]");
    4858//
    49 //
    5059/////////////////////////////////////////////////////////////////////////////
    5160#include "MHCamEvent.h"
     
    8897//
    8998MHCamEvent::MHCamEvent(const char *name, const char *title)
    90     : fSum(NULL), fEvt(NULL), fType(0)
     99    : fSum(NULL), fEvt(NULL), fType(0), fThreshold(0), fUseThreshold(0)
    91100{
    92101    Init(name, title);
     
    98107//
    99108MHCamEvent::MHCamEvent(Int_t type, const char *name, const char *title)
    100     : fSum(NULL), fEvt(NULL), fType(type)
     109    : fSum(NULL), fEvt(NULL), fType(type), fThreshold(0), fUseThreshold(0)
    101110{
    102111    Init(name, title);
     
    111120    if (fSum)
    112121        delete fSum;
     122}
     123
     124// --------------------------------------------------------------------------
     125//
     126// use this to display the variance instead of the rms.
     127//
     128void MHCamEvent::EnableVariance(Bool_t b)
     129{
     130    b ? SetBit(MHCamera::kVariance) : ResetBit(MHCamera::kVariance);
    113131}
    114132
     
    140158    }
    141159
     160    // Delete a posible old histogram from a previous loop
    142161    if (fSum)
    143162        delete (fSum);
    144163
     164    // combine name
    145165    const TString name = fNameEvt.IsNull() ? fName : fNameEvt;
    146166
     167    // create and setup MHCamera
    147168    fSum = new MHCamera(*cam, name+";avg");
    148169    if (fTitle!=gsDefTitle)
     
    169190        return kFALSE;
    170191    }
    171     fSum->AddCamContent(*evt, fType);
     192    if (fUseThreshold)
     193        fSum->CntCamContent(*evt, fThreshold, fType, fUseThreshold>0);
     194    else
     195        fSum->AddCamContent(*evt, fType);
    172196    return kTRUE;
    173197}
     
    274298    MHCamera *cam = new MHCamera(*fSum->GetGeometry());
    275299    cam->SetName(Form("Err_%p", this));
    276     cam->SetTitle(TestBit(MHCamera::kVariance)?"Variance":"Root Mean Squared (rms)");
     300    cam->SetTitle(fSum->TestBit(MHCamera::kVariance)?"Variance":"Root Mean Squared (rms)");
    277301    cam->SetYTitle(fSum->GetYaxis()->GetTitle());
    278302    cam->SetCamContent(*fSum, 1);
     
    292316    h->Draw();
    293317}
     318
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r5143 r5156  
    1515    static const TString gsDefTitle;
    1616
    17     MHCamera  *fSum; // storing the sum
    18     MCamEvent *fEvt; //! the current event
     17    MHCamera  *fSum;       // storing the sum
     18    MCamEvent *fEvt;       //! the current event
    1919
    20     TString fNameEvt;
     20    TString fNameEvt;      // Nameof MCamEvent to fill into histogram
    2121
    22     Int_t fType;
     22    Int_t fType;           // Type to used for calling GetPixelContent
     23
     24    Float_t fThreshold;    // Count pixel above/below this threshold
     25    Char_t fUseThreshold;  // Use a threshold? Which direction has it?
    2326
    2427    void Init(const char *name, const char *title);
     
    2831
    2932public:
     33    enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 };
     34
    3035    MHCamEvent(const char *name=NULL, const char *title=NULL);
    3136    MHCamEvent(Int_t type, const char *name=NULL, const char *title=NULL);
     
    4247    void PrintOutliers(Float_t s) const;
    4348
     49    void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
     50    void EnableVariance(Bool_t b=kTRUE);
     51
    4452    ClassDef(MHCamEvent, 1) // Histogram to sum camera events
    4553};
  • trunk/MagicSoft/Mars/mhist/MHCamEventRot.cc

    r3786 r5156  
    7171//
    7272MHCamEventRot::MHCamEventRot(const char *name, const char *title)
    73     : fTime(0), fPointPos(0), fObservatory(0), fType(0), fNameTime("MTime")
     73    : fTime(0), fPointPos(0), fObservatory(0), fType(0), fNameTime("MTime"),
     74    fThreshold(0), fUseThreshold(kNoBound)
    7475{
    7576    //
     
    192193
    193194            // Fill histogram
    194             fHist.Fill(cx[ix], cy[iy], val);
     195            if (fUseThreshold!=kNoBound)
     196            {
     197                if (val>fThreshold && fUseThreshold==kIsLowerBound ||
     198                    val<fThreshold && fUseThreshold==kIsUpperBound)
     199                    fHist.Fill(cx[ix], cy[iy]);
     200            }
     201            else
     202                fHist.Fill(cx[ix], cy[iy], val);
    195203        }
    196204    }
  • trunk/MagicSoft/Mars/mhist/MHCamEventRot.h

    r3786 r5156  
    2828    TH2D    fHist;               // Alpha vs. x and y
    2929
    30     Int_t fType;
     30    Int_t fType;                 // Type to used for calling GetPixelContent
    3131
    3232    Double_t fRa;
     
    3535    TString fNameTime;
    3636
     37    Float_t fThreshold;          // Count pixel above/below this threshold
     38    Char_t fUseThreshold;        // Use a threshold? Which direction has it?
     39
    3740    TObject *GetCatalog();
    3841
    3942public:
     43    enum { kIsLowerBound=1, kIsUpperBound=-1, kNoBound=0 };
     44
    4045    MHCamEventRot(const char *name=NULL, const char *title=NULL);
    4146
     
    4954    void Draw(Option_t *option="");
    5055
     56    void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
     57
    5158    ClassDef(MHCamEventRot, 1) //2D-histogram in MCamEvent data (derotated)
    5259};
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r5143 r5156  
    12571257// 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE)
    12581258//
     1259// in unused pixel is not counted if it didn't fullfill the condition.
     1260//
    12591261void MHCamera::CntCamContent(const MCamEvent &event, Double_t threshold, Int_t type, Bool_t isabove)
    12601262{
     
    12671269        Double_t val=threshold;
    12681270        if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/)
     1271        {
    12691272            SetUsed(idx);
    12701273
    1271         if (val>threshold && isabove)
    1272             Fill(idx);
    1273         if (val<threshold && !isabove)
    1274             Fill(idx);
     1274            if (isabove && val>threshold)
     1275                Fill(idx);
     1276            if (!isabove && val<threshold)
     1277                Fill(idx);
     1278        }
    12751279    }
    12761280    fEntries++;
     
    12831287// 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE)
    12841288//
     1289// in unused pixel is not counted if it didn't fullfill the condition.
     1290//
    12851291void MHCamera::CntCamContent(const MCamEvent &event, TArrayD threshold, Int_t type, Bool_t isabove)
    12861292{
     
    12931299        Double_t val=threshold[idx];
    12941300        if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/)
     1301        {
    12951302            SetUsed(idx);
    12961303
    1297         if (val>threshold[idx] && isabove)
    1298             Fill(idx);
    1299         if (val<threshold[idx] && !isabove)
    1300             Fill(idx);
     1304            if (val>threshold[idx] && isabove)
     1305                Fill(idx);
     1306            if (val<threshold[idx] && !isabove)
     1307                Fill(idx);
     1308        }
    13011309    }
    13021310    fEntries++;
     
    13151323    for (Int_t idx=0; idx<fNcells-2; idx++)
    13161324    {
    1317         if (const_cast<TArrayD&>(event)[idx]>threshold)
     1325        if (event[idx]>threshold)
    13181326            Fill(idx);
    13191327
Note: See TracChangeset for help on using the changeset viewer.