Changeset 5701


Ignore:
Timestamp:
01/05/05 14:29:59 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5694 r5701  
    2020
    2121                                                 -*-*- END OF LINE -*-*-
     22
     23 2005/01/05 Thomas Bretz
     24
     25   * mbase/MStatusDisplay.cc:
     26     - fixed some lines in pulldown-menus
     27     - add TPads to ListOfCleanups in ClonePad (workaround!)
     28
     29   * mcalib/MCalibrationBlindPix.cc, mcalib/MCalibrationChargeCalc.cc,
     30     mhcalib/MHCalibrationRelTimeCam.cc:
     31     - made some output lines fit into convinience window of 80 col
     32
     33   * mhist/MHCamEvent.cc:
     34     - make sure that x-axis has correct title
     35
     36   * msignal/MArrivalTimePix.cc:
     37     - init error to -1 which is a obviously non valid value
     38     - fixed IsValid() which gave wrong results
     39
     40   * msignal/MExtractTimeAndCharge.cc, msignal/MExtractedSignalPix.cc:
     41     - made sure that LoGain is flagged non-valid if no lo-gain exists
     42     - push time back at the edge of the allowed limits if outside
     43
     44
    2245
    2346
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r5620 r5701  
    188188    filemenu->AddEntry("New &Browser",  kFileBrowser);
    189189    filemenu->AddSeparator();
    190     filemenu->AddEntry("Save As status.&ps",   kFileSaveAsPS);
    191     filemenu->AddEntry("Save As status.&gif",  kFileSaveAsGIF);
    192     filemenu->AddEntry("Save As status.&C",    kFileSaveAsC);
    193     filemenu->AddEntry("Save As status.&root", kFileSaveAsRoot);
     190    filemenu->AddEntry("Save status.&ps",   kFileSaveAsPS);
     191    filemenu->AddEntry("Save status.&gif",  kFileSaveAsGIF);
     192    filemenu->AddEntry("Save status.&C",    kFileSaveAsC);
     193    filemenu->AddEntry("Save status.&root", kFileSaveAsRoot);
    194194    filemenu->AddSeparator();
    195195    filemenu->AddEntry("&Open...",             kFileOpen);
     
    212212    tabmenu->AddEntry("Previous [&-]",       kTabPrevious);
    213213    tabmenu->AddSeparator();
    214     tabmenu->AddEntry("Save As tab-i.&ps",   kTabSaveAsPS);
    215     tabmenu->AddEntry("Save As tab-i.&gif",  kTabSaveAsGIF);
    216     tabmenu->AddEntry("Save As tab-i.&C",    kTabSaveAsC);
    217     tabmenu->AddEntry("Save As tab-i.&root", kTabSaveAsRoot);
     214    tabmenu->AddEntry("Save tab-i.&ps",   kTabSaveAsPS);
     215    tabmenu->AddEntry("Save tab-i.&gif",  kTabSaveAsGIF);
     216    tabmenu->AddEntry("Save tab-i.&C",    kTabSaveAsC);
     217    tabmenu->AddEntry("Save tab-i.&root", kTabSaveAsRoot);
    218218    tabmenu->AddSeparator();
    219     tabmenu->AddEntry("Save &As...",         kTabSaveAs);
     219    tabmenu->AddEntry("Save tab &As...",         kTabSaveAs);
    220220    tabmenu->AddSeparator();
    221221    tabmenu->AddEntry("Re&move",             kTabRemove);
     
    16251625        // Now make sure that the clones are deleted at a later time
    16261626        clone->SetBit(kCanDelete);
     1627
     1628        // FIXME: This is a workaround for the problem with the MAstroCatalog in
     1629        // MHFalseSource. It doesn't harm. We'll still try to find the reason
     1630        if (clone->IsA()==TPad::Class())
     1631            gROOT->GetListOfCleanups()->Add(clone);
    16271632
    16281633        // Add the clone and its draw-option to the current pad
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindPix.cc

    r5384 r5701  
    6262
    6363using namespace std;
     64
    6465const Float_t MCalibrationBlindPix::fgArea       = 100;
    6566const Float_t MCalibrationBlindPix::fgAttGreen   = 1.97;
     
    8182const Float_t MCalibrationBlindPix::fgCollEffCT1   = 0.90;
    8283const Float_t MCalibrationBlindPix::fgCollEffErr   = 0.05;
     84
    8385// --------------------------------------------------------------------------
    8486//
     
    226228  pix.fPixId      = fPixId;
    227229  pix.fFlags      = fFlags;
    228   pix.fArea       = fArea;                     
     230  pix.fArea       = fArea;
    229231  pix.fAreaErr    = fAreaErr;                     
    230232  pix.fColor      = fColor;
     
    233235  // Copy arrays
    234236  //
    235   pix.fAtt        = fAtt;   
    236   pix.fAttErr     = fAttErr;           
    237   pix.fQE         = fQE;                       
    238   pix.fQEErr      = fQEErr;                   
    239   pix.fCollEff    = fCollEff;                 
    240   pix.fCollEffErr = fCollEffErr;               
    241  
    242   pix.fLambda                  = fLambda;                   
    243   pix.fLambdaCheck             = fLambdaCheck;             
    244   pix.fLambdaCheckErr          = fLambdaCheckErr;           
    245   pix.fLambdaVar               = fLambdaVar;               
    246   pix.fFluxInsidePlexiglass    = fFluxInsidePlexiglass;     
    247   pix.fFluxInsidePlexiglassVar = fFluxInsidePlexiglassVar; 
    248   pix.fMu0       = fMu0;                     
    249   pix.fMu0Err    = fMu0Err;                   
    250   pix.fMu1       = fMu1;                     
    251   pix.fMu1Err    = fMu1Err;                   
    252   pix.fSigma0    = fSigma0;                   
    253   pix.fSigma0Err = fSigma0Err;               
    254   pix.fSigma1    = fSigma1;                   
    255   pix.fSigma1Err = fSigma1Err;               
    256  
     237  pix.fAtt        = fAtt;
     238  pix.fAttErr     = fAttErr;
     239  pix.fQE         = fQE;
     240  pix.fQEErr      = fQEErr;
     241  pix.fCollEff    = fCollEff;
     242  pix.fCollEffErr = fCollEffErr;
     243
     244  pix.fLambda                  = fLambda;
     245  pix.fLambdaCheck             = fLambdaCheck;
     246  pix.fLambdaCheckErr          = fLambdaCheckErr;
     247  pix.fLambdaVar               = fLambdaVar;
     248  pix.fFluxInsidePlexiglass    = fFluxInsidePlexiglass;
     249  pix.fFluxInsidePlexiglassVar = fFluxInsidePlexiglassVar;
     250  pix.fMu0       = fMu0;
     251  pix.fMu0Err    = fMu0Err;
     252  pix.fMu1       = fMu1;
     253  pix.fMu1Err    = fMu1Err;
     254  pix.fSigma0    = fSigma0;
     255  pix.fSigma0Err = fSigma0Err;
     256  pix.fSigma1    = fSigma1;
     257  pix.fSigma1Err = fSigma1Err;
     258
    257259}
    258260
     
    523525
    524526  *fLog << inf << GetDescriptor()
    525         << ": Blind Pixel Nr. " << fPixId << ": Photon flux [ph/mm^2] inside Plexiglass: "
    526         << Form("%5.3f%s%5.3f",fFluxInsidePlexiglass," +- ",GetFluxInsidePlexiglassErr()) << endl;
     527      << ": BlindPix #" << fPixId << ": Flux [ph/mm^2] inside Plexiglass: "
     528      << Form("%5.3f +- %5.3f",fFluxInsidePlexiglass, GetFluxInsidePlexiglassErr()) << endl;
    527529
    528530  return kTRUE;
     
    533535 
    534536  *fLog << all << GetDescriptor()
    535         << Form("%s%3i","BlindPixel: "       ,GetPixId())
    536         << Form("%s%4.2f%s%4.2f","  Lambda: ",GetLambda(),"+-",GetLambdaErr())
    537         << Form("%s%4.2f%s%4.2f","  Mu0: "   ,GetMu0(),   "+-",GetMu0Err())
    538         << Form("%s%4.2f%s%4.2f","  Mu1: "   ,GetMu1(),   "+-",GetMu1Err())
    539         << Form("%s%4.2f%s%4.2f","  Sigma0: ",GetSigma0(),"+-",GetSigma0Err())
    540         << Form("%s%4.2f%s%4.2f","  Sigma1: ",GetSigma1(),"+-",GetSigma1Err())
     537        << Form("BlindPixel: %3i"         ,GetPixId())
     538        << Form("  Lambda: %4.2f +- %4.2f",GetLambda(),GetLambdaErr())
     539        << Form("  Mu0: %4.2f +- %4.2f"   ,GetMu0(),   GetMu0Err())
     540        << Form("  Mu1: %4.2f +- %4.2f"   ,GetMu1(),   GetMu1Err())
     541        << Form("  Sigma0: %4.2f +- %4.2f",GetSigma0(),GetSigma0Err())
     542        << Form("  Sigma1: %4.2f +- %4.2f",GetSigma1(),GetSigma1Err())
    541543        << endl;
    542544  *fLog << all
    543545        << " Pedestal Fit OK? :" << IsPedestalFitOK()
    544         << Form("%s%4.2f%s%4.2f","  Lambda (Check): " ,GetLambdaCheck(),"+-",GetLambdaCheckErr())
     546        << Form("  Lambda (Check): %4.2f +- %4.2f",GetLambdaCheck(),GetLambdaCheckErr())
    545547        << endl;
    546548  *fLog << all
    547549        << " Flux available? :" << IsFluxInsidePlexiglassAvailable()
    548         << Form("%s%4.2f%s%4.2f","  Flux: " ,GetFluxInsidePlexiglass(),"+-",GetFluxInsidePlexiglassErr())
     550        << Form("  Flux: %4.2f +- %4.2f",GetFluxInsidePlexiglass(),GetFluxInsidePlexiglassErr())
    549551        << endl;
    550552}
    551 
    552 
    553 
    554 
    555 
    556 
    557 
    558 
    559 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r5682 r5701  
    810810                    Form("%s%2.1f%s","Signal Error bigger than ",fChargeRelErrLimit," times Mean Signal:   "));
    811811  PrintUncalibrated(MBadPixelsPix::kLoGainSaturation,   
    812                     "Pixels with Low Gain Saturation:                  ");
     812                    "Low Gain Saturation:                             ");
    813813  PrintUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin,
    814814                    Form("%s%2.1f%s","Mean Abs. Arr. Time in First ",1.," Bin(s):          "));
     
    824824
    825825  PrintUncalibrated(MBadPixelsPix::kChargeSigmaNotValid,
    826                     "Signal Sigma smaller than Pedestal RMS:           ");
     826                    "Signal Sigma smaller than Pedestal RMS: ");
    827827  PrintUncalibrated(MBadPixelsPix::kHiGainOscillating,   
    828                     "Pixels with changing Hi Gain signal over time:    ");
     828                    "Changing Hi Gain signal over time:      ");
    829829  PrintUncalibrated(MBadPixelsPix::kLoGainOscillating,   
    830                     "Pixels with changing Lo Gain signal over time:    ");
     830                    "Changing Lo Gain signal over time:      ");
    831831  PrintUncalibrated(MBadPixelsPix::kHiGainNotFitted,     
    832                     "Pixels with unsuccesful Gauss fit to the Hi Gain: ");
     832                    "Unsuccesful Gauss fit to the Hi Gain:  ");
    833833  PrintUncalibrated(MBadPixelsPix::kLoGainNotFitted,     
    834                     "Pixels with unsuccesful Gauss fit to the Lo Gain: ");
     834                    "Unsuccesful Gauss fit to the Lo Gain:  ");
    835835  PrintUncalibrated(MBadPixelsPix::kDeviatingNumPhes,   
    836                     "Pixels with deviating number of phes:             ");
     836                    "Deviating number of phes:               ");
    837837  PrintUncalibrated(MBadPixelsPix::kDeviatingFFactor,   
    838                     "Pixels with deviating F-Factor:                   ");
     838                    "Deviating F-Factor:                     ");
    839839
    840840  if (!fOutputFile.IsNull())
     
    12181218        }
    12191219     
    1220       *fLog << inf << GetDescriptor() << ": Mean number of photo-electrons "
    1221             << "with area idx " << i << ": "
     1220      *fLog << inf << GetDescriptor() << ": Mean number of phes with area idx " << i << ": "
    12221221            << Form("%7.2f+-%6.2f",mean,sigma) << endl;
    12231222
     
    12651264      if ( nphe < lowlim[aidx] || nphe > upplim[aidx] )
    12661265        {
    1267           *fLog << warn << GetDescriptor() << ": Number of phes: "
     1266          *fLog << warn << "Number of phes: "
    12681267                << Form("%7.2f out of %3.1f sigma limit: ",nphe,fPheErrLimit)
    12691268                << Form("[%7.2f,%7.2f] pixel%4i",lowlim[aidx],upplim[aidx],i) << endl;
     
    13211320     
    13221321      *fLog << inf << GetDescriptor()
    1323             << ": Average total number phes in area idx " << aidx << ": "
     1322            << ": Average total phes for area idx " << aidx << ": "
    13241323            << Form("%7.2f +- 6.2f",areaphes[aidx],TMath::Sqrt(areaweights[aidx])) << endl;
    13251324                   
     
    13561355        {
    13571356          *fLog << warn << GetDescriptor()
    1358                 <<": Mean number phes per area for sector " << sector << " could not be calculated: "
     1357                <<": Mean number phes/area for sector " << sector << " could not be calculated: "
    13591358                << " Mean: "  << sectorphes[sector]
    13601359                << " Variance: "             << sectorweights[sector]    << endl;
     
    13641363
    13651364      *fLog << inf << GetDescriptor()
    1366             << ": Average number phes per area in sector " << sector << ": "
    1367             << Form("%5.3f+-%4.3f  [phe/mm^2]",sectorphes[sector],TMath::Sqrt(sectorweights[sector]))
     1365            << ": Avg number phes/mm^2 in sector " << sector << ": "
     1366            << Form("%5.3f+-%4.3f",sectorphes[sector],TMath::Sqrt(sectorweights[sector]))
    13681367            << endl;
    13691368
     
    17581757      if ( ffactor < lowlim[aidx] || ffactor > upplim[aidx] )
    17591758        {
    1760           *fLog << warn << GetDescriptor() << ": Overall F-Factor "
     1759          *fLog << warn << "Overall F-Factor "
    17611760                << Form("%5.2f",ffactor) << " out of range ["
    1762                 << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "] pixel " << i << endl;
     1761                << Form("%5.2f,%5.2f",lowlim[aidx],upplim[aidx]) << "] Pixel " << i << endl;
    17631762
    17641763          bad.SetUncalibrated( MBadPixelsPix::kDeviatingFFactor );
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r5560 r5701  
    176176        fSum->SetBit(MHCamera::kVariance);
    177177
     178    fSum->SetXTitle("Pixel Idx");
     179
    178180    return kTRUE;
    179181}
  • trunk/MagicSoft/Mars/msignal/MArrivalTimePix.cc

    r3899 r5701  
    5353//
    5454MArrivalTimePix::MArrivalTimePix(const char* name, const char* title)
    55   : fArrivalTimeHiGain(gkSignalInitializer),
    56     fArrivalTimeHiGainError(gkSignalInitializer),
    57     fArrivalTimeLoGain(gkSignalInitializer),
    58     fArrivalTimeLoGainError(gkSignalInitializer),
    59     fNumHiGainSaturated(0),
    60     fNumLoGainSaturated(0)
    6155{
    6256  fName  = name  ? name  : "MArrivalTimePix";
    6357  fTitle = title ? title : "Container of the Extracted Signals";
     58
     59  Clear();
    6460}
    6561
     
    7167{
    7268  fArrivalTimeHiGain      = gkSignalInitializer;
    73   fArrivalTimeHiGainError = gkSignalInitializer;
     69  fArrivalTimeHiGainError = -1;
    7470  fArrivalTimeLoGain      = gkSignalInitializer;
    75   fArrivalTimeLoGainError = gkSignalInitializer;
     71  fArrivalTimeLoGainError = -1;
    7672 
    7773  fNumHiGainSaturated = 0;
     
    9692Bool_t MArrivalTimePix::IsValid() const
    9793{
    98     return fArrivalTimeHiGain >= 0. || fArrivalTimeHiGainError >= 0.;
     94    return (!IsLoGainUsed() && fArrivalTimeHiGainError >= 0) || (IsLoGainUsed() && fArrivalTimeLoGainError >= 0);
    9995}
    10096
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc

    r5601 r5701  
    171171      // Find signal in hi- and lo-gain
    172172      //
    173       Float_t sumhi =0., deltasumhi =0.;
    174       Float_t timehi=0., deltatimehi=0.;
     173      Float_t sumhi =0., deltasumhi =0; // Set hi-gain of MExtractedSignalPix valid
     174      Float_t timehi=0., deltatimehi=0; // Set hi-gain of MArrivalTimePix valid
    175175      Byte_t sathi=0;
    176176
    177       const Int_t pixid = pixel.GetPixelId();
    178       const MPedestalPix  &ped = (*fPedestals)[pixid];
     177      const Int_t pixidx = pixel.GetPixelId();
     178      const MPedestalPix  &ped = (*fPedestals)[pixidx];
    179179      const Bool_t higainabflag = pixel.HasABFlag();
    180180
     
    183183                              timehi, deltatimehi,
    184184                              sathi, ped, higainabflag);
     185
     186      // Make sure that in cases the time couldn't be correctly determined
     187      // more meaningfull default values are assigned
     188      if (timehi<0)
     189          timehi = -1;
     190      if (timehi>pixel.GetNumHiGainSamples())
     191          timehi = pixel.GetNumHiGainSamples();
    185192     
    186       Float_t sumlo =0., deltasumlo =0.;
    187       Float_t timelo=0., deltatimelo=0.;
     193      Float_t sumlo =0., deltasumlo =-1.; // invalidate logain of MExtractedSignalPix
     194      Float_t timelo=0., deltatimelo=-1;  // invalidate logain of MArrivalTimePix
    188195      Byte_t satlo=0;
    189196     
     
    192199      //
    193200      if (pixel.HasLoGain())
    194         {
     201      {
     202          deltasumlo  = 0; // make logain of MExtractedSignalPix valid
     203          deltatimelo = 0; // make logain of MArrivalTimePix valid
     204
    195205          fLoGainFirstSave = fLoGainFirst;
    196206          const Byte_t logainstart = (Byte_t)(timehi+fLoGainStartShift);
    197207          if (!sathi)
    198             fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave;
    199        
    200           if ( fLoGainFirst < fLoGainLast )
    201             {
     208              fLoGainFirst = logainstart > fLoGainFirstSave ? logainstart : fLoGainFirstSave;
     209
     210          if (fLoGainFirst < fLoGainLast)
     211          {
    202212              const Bool_t logainabflag = (higainabflag + pixel.GetNumHiGainSamples()) & 0x1;
    203               FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst, 
    204                                       sumlo, deltasumlo, 
    205                                       timelo, deltatimelo, 
     213              FindTimeAndChargeLoGain(pixel.GetLoGainSamples()+fLoGainFirst,
     214                                      sumlo, deltasumlo,
     215                                      timelo, deltatimelo,
    206216                                      satlo, ped, logainabflag);
    207             }
    208           fLoGainFirst     = fLoGainFirstSave;
    209         }
    210      
    211       MExtractedSignalPix &pix = (*fSignals)[pixid];
    212       MArrivalTimePix     &tix = (*fArrTime)[pixid];     
     217          }
     218          fLoGainFirst = fLoGainFirstSave;
     219
     220          // Make sure that in cases the time couldn't be correctly determined
     221          // more meaningfull default values are assigned
     222          if (timelo<0)
     223              timelo = -1;
     224          if (timelo>pixel.GetNumLoGainSamples())
     225              timelo = pixel.GetNumLoGainSamples();
     226      }
     227
     228      MExtractedSignalPix &pix = (*fSignals)[pixidx];
     229      MArrivalTimePix     &tix = (*fArrTime)[pixidx];
    213230
    214231      pix.SetExtractedSignal(sumhi, deltasumhi,sumlo, deltasumlo);
    215232      pix.SetGainSaturation(sathi, sathi, satlo);
    216      
     233
    217234      tix.SetArrivalTime(timehi, deltatimehi, timelo-fOffsetLoGain, deltatimelo);
    218235      tix.SetGainSaturation(sathi, sathi, satlo);
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r5570 r5701  
    517517  {
    518518    const Int_t   idx = fBinningResolutionLoGain*sample + fBinningResolutionHalfLoGain + t_iter;
    519     const Int_t   ids = max_p + sample;;
     519    const Int_t   ids = max_p + sample;
    520520    const Float_t pex = ids < 0 ? 0. : ( ids >= range ? 0. : fLoGainSignal[ids]);
    521521    sum              += fAmpWeightsLoGain [idx]*pex;
  • trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc

    r3306 r5701  
    5353//
    5454MExtractedSignalPix::MExtractedSignalPix(const char* name, const char* title)
    55   : fExtractedSignalHiGain(gkSignalInitializer),
    56     fExtractedSignalHiGainError(gkSignalInitializer),
    57     fExtractedSignalLoGain(gkSignalInitializer),
    58     fExtractedSignalLoGainError(gkSignalInitializer),
    59     fLoGainUsed(kFALSE),
    60     fNumHiGainSaturated(0),
    61     fNumLoGainSaturated(0)
    6255{
    6356  fName  = name  ? name  : "MExtractedSignalPix";
    6457  fTitle = title ? title : "Container of the Extracted Signals";
     58
     59  Clear();
    6560}
    6661
     
    7267{
    7368  fExtractedSignalHiGain      = gkSignalInitializer;
    74   fExtractedSignalHiGainError = gkSignalInitializer;
     69  fExtractedSignalHiGainError = -1;
    7570  fExtractedSignalLoGain      = gkSignalInitializer;
    76   fExtractedSignalLoGainError = gkSignalInitializer;
     71  fExtractedSignalLoGainError = -1;
    7772 
    7873  fLoGainUsed = kFALSE;
     
    9994Bool_t MExtractedSignalPix::IsValid() const
    10095{
    101     return fExtractedSignalHiGain >= 0. || fExtractedSignalHiGainError >= 0.;
     96    return (!IsLoGainUsed() && fExtractedSignalHiGainError >= 0) || (IsLoGainUsed() && fExtractedSignalLoGainError >= 0);
    10297}
    10398
Note: See TracChangeset for help on using the changeset viewer.