Changeset 5690 for trunk/MagicSoft


Ignore:
Timestamp:
12/27/04 13:13:32 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5688 r5690  
    2222
    2323
     24 2004/12/27 Thomas Bretz
     25
     26   * macros/CCDataCheck.C:
     27     - fixed some warnings: Wrong data access operator
     28
     29   * manalysis/MCerPhotPix.h:
     30     - added to possibility to reset the core-flag
     31
     32   * mcalib/MCalibColorSet.[h,cc]:
     33     - moved some common code to a new function CheckAndSet for
     34       simplicity of the color decoding
     35     - added an include for stdlib.h (needed for some compilers and atoi)
     36
     37   * mcalib/MCalibrationIntensityChargeCam.cc:
     38     - fixed a warning about a invalid escape sequence -- seems that
     39       not all compilers do display this warning...
     40     - corrected order of includes
     41
     42   * mfbase/MFEventSelector2.[h,cc]:
     43     - some cosmetic fixes
     44     - some adpations to standard output (eg. Separator() instead of ***)
     45     - added a check whether 'filter' inherits from MFilter
     46     - fixed the return of ReadDistribution
     47     - made comments for data members in cleass header 'one line'
     48
     49   * mimage/MImgCleanStd.[h,cc]:
     50     - added fNameGeomCam for parameter list access
     51     - added fNameCerPhotEvt for parameter list access
     52     - fixed a typo in an output
     53     - NO change to ANY algorithm!
     54     - changed class version from 1 to 2
     55
     56   * mjobs/MJCalibrateSignal.cc:
     57     - added a rule to replace .raw by .root in MWriteRootFile
     58
     59   * mranforest/MRanForestCalc.[h,cc]:
     60     - fixed missing data member initialization in constructor
     61     - added ReadEnv which is able to read a random forest from a file
     62     - added an owner flag for the random forest tree
     63
     64
     65
    2466 2004/12/22 Markus Gaug
    2567
    26     * mraw/MRawEvtHeader.[h,cc]
     68    * mraw/MRawEvtHeader.[h,cc]:
    2769      - added some new Getter-functions for the calibration conf.
    2870        pattern
    29     * mcalib/MCalibrationChargeCalc.[h,cc]
    30     * mcalib/MCalibrationRelTimeCalc.[h,cc]
    31     * mcalib/MCalibrationColorSteer.cc
     71 
     72    * mcalib/MCalibrationChargeCalc.[h,cc],
     73      mcalib/MCalibrationRelTimeCalc.[h,cc],
     74      mcalib/MCalibrationColorSteer.cc:
    3275      - use the new functions
    3376
    34     * mhcalib/MHCalibrationCam.[h,cc]
    35     * mhcalib/MHCalibrationRelTimeCam.[h,cc]
    36     * mhcalib/MHCalibrationChargeCam.[h,cc]
     77    * mhcalib/MHCalibrationCam.[h,cc],
     78      mhcalib/MHCalibrationRelTimeCam.[h,cc],
     79      mhcalib/MHCalibrationChargeCam.[h,cc]:
    3780      - centralize the decision about the probability limit to be
    3881        taken inside these classes.
     
    4184      - fix a bug in the calculation of outliers. Standard analyses 
    4285        not affected!
     86
    4387
    4488
     
    91135
    92136
     137
    93138 2004/12/22: Eva Domingo (for Wolfgang Wittek)
    94139
     
    102147
    103148
     149
    104150 2004/12/22: Abelardo Moralejo
    105151
     
    112158
    113159
     160
    114161 2004/12/17: Markus Gaug
    115162
     
    117164     - added missing runs where run number does not appear any more in
    118165       project-name and is not yet set in the digital modules.
    119    * mcalib/MCalibrationIntensityCam.[h,cc]
    120    * mcalib/MCalibrationIntensityChargeCam.[h,cc]
    121    * mcalib/MCalibrationIntensityRelTimeCam.[h,cc]
     166
     167   * mcalib/MCalibrationIntensityCam.[h,cc],
     168     mcalib/MCalibrationIntensityChargeCam.[h,cc],
     169     mcalib/MCalibrationIntensityRelTimeCam.[h,cc]:
    122170     - added some new functions to display the results of the intensity
    123171       calibration
     172
     173
    124174
    125175 2004/12/17: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/CCDataCheck.C

    r3866 r5690  
    509509  // Drive report (pointing.C from T. Bretz)
    510510  //
     511  TCanvas *c1;
    511512  if ((d = evtloop.GetDisplay()))
    512     TCanvas &c1 = d.AddTab("DRIVE SYSTEM");
     513      c1 = &d->AddTab("DRIVE SYSTEM");
    513514  else
    514     TCanvas *c1 = new TCanvas();
     515      c1 = new TCanvas();
     516
    515517  // ************* Plot the telescope tracking positions on the sky ***********
    516518  TGraph *g1 = hZd.GetGraph();
     
    563565  gStyle->SetStatFormat(".2g");
    564566  mh3 = (MH3*)hError.DrawClone("nonew");
    565   mh3->GetHist()->SetXTitle("\\Delta [arcmin]");
    566   mh3->GetHist()->SetYTitle("");
    567   mh3->GetHist()->SetTitle("Control deviation of the motors");
    568   mh3->GetHist()->SetStats(1);
    569   mh3->GetHist()->SetLabelSize(0.06,"X");
    570   mh3->GetHist()->SetLabelSize(0.06,"Y");
    571   mh3->GetHist()->SetTitleSize(0.06,"X");
     567  mh3->GetHist().SetXTitle("\\Delta [arcmin]");
     568  mh3->GetHist().SetYTitle("");
     569  mh3->GetHist().SetTitle("Control deviation of the motors");
     570  mh3->GetHist().SetStats(1);
     571  mh3->GetHist().SetLabelSize(0.06,"X");
     572  mh3->GetHist().SetLabelSize(0.06,"Y");
     573  mh3->GetHist().SetTitleSize(0.06,"X");
    572574  TLine ln;
    573575  ln.SetLineColor(kGreen);
    574   ln.DrawLine(0.5*360*60/16384., 0, 0.5*360*60/16384., hError.GetHist()->GetMaximum());
     576  ln.DrawLine(0.5*360*60/16384., 0, 0.5*360*60/16384., hError.GetHist().GetMaximum());
    575577  ln.SetLineColor(kYellow);
    576   ln.DrawLine(1.0*360*60/16384., 0, 1.0*360*60/16384., hError.GetHist()->GetMaximum());
     578  ln.DrawLine(1.0*360*60/16384., 0, 1.0*360*60/16384., hError.GetHist().GetMaximum());
    577579  ln.SetLineColor(kRed);
    578   ln.DrawLine(2.0*360*60/16384., 0, 2.0*360*60/16384., hError.GetHist()->GetMaximum());
     580  ln.DrawLine(2.0*360*60/16384., 0, 2.0*360*60/16384., hError.GetHist().GetMaximum());
    579581  // ---------------------- Plot the drive status vs time ---------------------
    580582  c1->cd();
     
    616618  gStyle->SetStatFormat(".2g");
    617619  mh3 = (MH3*)hError2.DrawClone("nonew");
    618   mh3->GetHist()->SetXTitle("Zd [\\circ]");
    619   mh3->GetHist()->SetYTitle("\\Delta [arcmin]");
    620   mh3->GetHist()->SetTitle("Control deviation of the motors");
    621   mh3->GetHist()->SetLabelSize(0.06,"X");
    622   mh3->GetHist()->SetLabelSize(0.06,"Y");
    623   mh3->GetHist()->SetTitleSize(0.06,"X");
    624   mh3->GetHist()->SetTitleSize(0.06,"Y");
    625   mh3->GetHist()->SetStats(1);
    626   mh3->GetHist()->Draw("box");
     620  mh3->GetHist().SetXTitle("Zd [\\circ]");
     621  mh3->GetHist().SetYTitle("\\Delta [arcmin]");
     622  mh3->GetHist().SetTitle("Control deviation of the motors");
     623  mh3->GetHist().SetLabelSize(0.06,"X");
     624  mh3->GetHist().SetLabelSize(0.06,"Y");
     625  mh3->GetHist().SetTitleSize(0.06,"X");
     626  mh3->GetHist().SetTitleSize(0.06,"Y");
     627  mh3->GetHist().SetStats(1);
     628  mh3->GetHist().Draw("box");
    627629  // -------------------------- Zenith angle vs time --------------------------
    628630  c1->cd();
  • trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h

    r4702 r5690  
    4242    Short_t GetRing() const             { return fRing;}
    4343
    44     void    SetPixelCore()              { fIsCore = kTRUE; }
     44    void    SetPixelCore(Bool_t b=kTRUE){ fIsCore = b; }
    4545    Bool_t  IsPixelCore() const         { return fIsCore;  }
    4646
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc

    r5677 r5690  
    3939#include "MCalibColorSet.h"
    4040
    41 #include "TRegexp.h"
     41#include <stdlib.h>   // needed for atoi on some platforms
     42
     43#include <TRegexp.h>
    4244
    4345#include "MLog.h"
     
    5153ClassImp(MCalibColorSet);
    5254
    53 
    5455using namespace std;
    5556
    56 const Int_t MCalibColorSet::gkIFAEBoxInaugurationRun = 20113;
    57 const Int_t MCalibColorSet::gkMCRunLimit             = 1000;
    58 const UInt_t MCalibColorSet::gkFirstRunWithFinalBits = 45626;
     57const Int_t  MCalibColorSet::gkIFAEBoxInaugurationRun = 20113;
     58const Int_t  MCalibColorSet::gkMCRunLimit             = 1000;
     59const UInt_t MCalibColorSet::gkFirstRunWithFinalBits  = 45626;
     60
    5961// --------------------------------------------------------------------------
    6062//
     
    9597
    9698  return kTRUE;
     99}
     100
     101// --------------------------------------------------------------------------
     102//
     103// Check if str contains regexp.
     104// If so or pat to pattern and set color to col.
     105// Otherwise do nothing.
     106//
     107// Normally this function is much to simple (more arguments than lines!)
     108// but in this particular case it is worth to have it to avois chaotic
     109// repitions of the same piece of code for many many times.
     110//
     111void MCalibColorSet::CheckAndSet(const TString &str, const char *regexp, UInt_t &pattern, UInt_t pat, Int_t &color, Int_t col) const
     112{
     113    if (!str.Contains(TRegexp(regexp)))
     114        return;
     115
     116    pattern |= pat;
     117    color = col;
    97118}
    98119
     
    295316 
    296317  if (color!=kNONE)
    297     {
     318  {
    298319      *fLog << inf << "Color determined from the run-number... ";
    299320      switch (color)
    300         {
    301         case kGREEN: *fLog << "Green."; fPattern |= k5LedGreen; break;
    302         case kBLUE:  *fLog << "Blue.";  fPattern |= k5LedBlue1; break;
    303         case kUV:    *fLog << "UV.";    fPattern |= k10LedUV; break;
    304         }
     321      {
     322      case kGREEN: *fLog << "Green."; fPattern |= k5LedGreen; break;
     323      case kBLUE:  *fLog << "Blue.";  fPattern |= k5LedBlue1; break;
     324      case kUV:    *fLog << "UV.";    fPattern |= k10LedUV;  break;
     325      }
    305326      *fLog << endl;
    306327      fIsValid  = kTRUE;
    307328      return kTRUE;
    308     }
    309   else
    310     {
    311 
    312       TString proj = header->GetProjectName();
    313       proj.ToLower();
    314 
    315       // Possible green combinations
    316       TRegexp gre0("0.1led[sS]?gree");
    317       if (proj.Contains(gre0))
    318         { fPattern |= k01LedGreen; color = kGREEN;    }
    319       TRegexp gre1("1led[sS]?gree");
    320       if (proj.Contains(gre1))
    321         { fPattern |= k1LedGreen; color = kGREEN;    }
    322       TRegexp gre2("2led[sS]?gree");
    323       if (proj.Contains(gre2))
    324         { fPattern |= k2LedGreen; color = kGREEN;    }
    325       TRegexp gre3("3led[sS]?gree");
    326       if (proj.Contains(gre3))
    327         { fPattern |= k3LedGreen; color = kGREEN;    }
    328       TRegexp gre5("5led[sS]?gree");
    329       if (proj.Contains(gre5))
    330         { fPattern |= k5LedGreen; color = kGREEN;    }
    331       TRegexp gre6("6led[sS]?gree");
    332       if (proj.Contains(gre6))
    333         { fPattern |= k6LedGreen; color = kGREEN;    }
    334       TRegexp gre7("7led[sS]?gree");
    335       if (proj.Contains(gre7))
    336         { fPattern |= k7LedGreen; color = kGREEN;    }
    337       TRegexp gre8("8led[sS]?gree");
    338       if (proj.Contains(gre8))
    339         { fPattern |= k8LedGreen; color = kGREEN;    }
    340 
    341       // Possible blue combinations
    342       TRegexp blu0("0.1led[sS]?blue");
    343       if (proj.Contains(blu0))
    344         { fPattern |= k01LedBlue; color = kBLUE;    }
    345       TRegexp blu1("1led[sS]?blue");
    346       if (proj.Contains(blu1))
    347         { fPattern |= k1LedBlue; color = kBLUE;    }
    348       TRegexp blu2("2led[sS]?blue");
    349       if (proj.Contains(blu2))
    350         { fPattern |= k2LedBlue; color = kBLUE;    }
    351       TRegexp blu3("3led[sS]?blue");
    352       if (proj.Contains(blu3))
    353         { fPattern |= k3LedBlue; color = kBLUE;    }
    354       TRegexp blu5("5led[sS]?blue");
    355       if (proj.Contains(blu5))
    356         { fPattern |= k5LedBlue1; color = kBLUE;    }
    357       TRegexp blu6("6led[sS]?blue");
    358       if (proj.Contains(blu6))
    359         { fPattern |= k6LedBlue; color = kBLUE;    }
    360       TRegexp blu7("7led[sS]?blue");
    361       if (proj.Contains(blu7))
    362         { fPattern |= k7LedBlue; color = kBLUE;    }
    363       TRegexp blu8("8led[sS]?blue");
    364       if (proj.Contains(blu8))
    365         { fPattern |= k8LedBlue; color = kBLUE;    }
    366       TRegexp blu10("10led[sS]?blue");
    367       if (proj.Contains(blu10))
    368         { fPattern |= k10LedBlue; color = kBLUE;    }
    369       TRegexp blu15("15led[sS]?blue");
    370       if (proj.Contains(blu15))
    371         { fPattern |= k15LedBlue; color = kBLUE;    }
    372       TRegexp blu20("20led[sS]?blue");
    373       if (proj.Contains(blu20))
    374         { fPattern |= k20LedBlue; color = kBLUE;    }
    375       TRegexp blu21("21led[sS]?blue");
    376       if (proj.Contains(blu21))
    377         { fPattern |= k21LedBlue; color = kBLUE;    }
    378       TRegexp blu22("22led[sS]?blue");
    379       if (proj.Contains(blu22))
    380         { fPattern |= k22LedBlue; color = kBLUE;    }
    381       TRegexp blu23("23led[sS]?blue");
    382       if (proj.Contains(blu23))
    383         { fPattern |= k23LedBlue; color = kBLUE;    }
    384 
    385       // Possible UV combinations
    386       TRegexp uv1("1led[sS]?uv");
    387       if (proj.Contains(uv1))
    388         { fPattern |= k1LedUV; color = kUV;    }
    389       TRegexp uv2("2led[sS]?uv");
    390       if (proj.Contains(uv2))
    391         { fPattern |= k2LedUV; color = kUV;    }
    392       TRegexp uv3("3led[sS]?uv");
    393       if (proj.Contains(uv3))
    394         { fPattern |= k3LedUV; color = kUV;    }
    395       TRegexp uv5("5led[sS]?uv");
    396       if (proj.Contains(uv5))
    397         { fPattern |= k5LedUV1; color = kUV;    }
    398       TRegexp uv6("6led[sS]?uv");
    399       if (proj.Contains(uv6))
    400         { fPattern |= k6LedUV; color = kUV;    }
    401       TRegexp uv7("7led[sS]?uv");
    402       if (proj.Contains(uv7))
    403         { fPattern |= k7LedUV; color = kUV;    }
    404       TRegexp uv8("8led[sS]?uv");
    405       if (proj.Contains(uv8))
    406         { fPattern |= k8LedUV; color = kUV;    }
    407       TRegexp uv10("10led[sS]?uv");
    408       if (proj.Contains(uv10))
    409         { fPattern |= k10LedUV; color = kUV;    }
    410       TRegexp uv11("11led[sS]?uv");
    411       if (proj.Contains(uv11))
    412         { fPattern |= k11LedUV; color = kUV;    }
    413       TRegexp uv12("12led[sS]?uv");
    414       if (proj.Contains(uv12))
    415         { fPattern |= k12LedUV; color = kUV;    }
    416       TRegexp uv13("13led[sS]?uv");
    417       if (proj.Contains(uv13))
    418         { fPattern |= k13LedUV; color = kUV;    }
    419 
    420       // Possible slot combinations
    421       TRegexp slot("slot");
    422       if (proj.Contains(slot))
    423         {
    424           proj.ReplaceAll("slot","");
    425           UInt_t nr = 0;
    426           TRegexp slotnr("^[0-9]");
    427          
    428           if (proj.Contains(slotnr))
    429             { fPattern = 0; proj.Replace(2,99,"");
    430             proj.ReplaceAll("u","");
    431             proj.ReplaceAll("v","");
    432             proj.ReplaceAll("g","");
    433             nr = atoi(proj.Data())-1;
    434             fPattern |= BIT(nr);
    435             color = nr < 2 ? kGREEN :
    436               ( nr < 3 ) ? kBLUE :
    437               ( nr < 5 ) ? kUV :
    438               ( nr < 11 ) ? kBLUE :
    439               ( nr < 13 ) ? kUV :
    440               ( nr < 14 ) ? kBLUE :
    441               ( nr < 16 ) ? kGREEN :
    442               kCT1;   
    443             }
    444         }
    445      
     329  }
     330
     331  TString proj = header->GetProjectName();
     332  proj.ToLower();
     333
     334  // Possible green combinations
     335  CheckAndSet(proj, "0.1led[sS]?gree", fPattern, k01LedGreen, color, kGREEN);
     336  CheckAndSet(proj, "1led[sS]?gree",   fPattern, k1LedGreen,  color, kGREEN);
     337  CheckAndSet(proj, "2led[sS]?gree",   fPattern, k2LedGreen,  color, kGREEN);
     338  CheckAndSet(proj, "3led[sS]?gree",   fPattern, k3LedGreen,  color, kGREEN);
     339  CheckAndSet(proj, "5led[sS]?gree",   fPattern, k5LedGreen,  color, kGREEN);
     340  CheckAndSet(proj, "6led[sS]?gree",   fPattern, k6LedGreen,  color, kGREEN);
     341  CheckAndSet(proj, "7led[sS]?gree",   fPattern, k7LedGreen,  color, kGREEN);
     342  CheckAndSet(proj, "8led[sS]?gree",   fPattern, k8LedGreen,  color, kGREEN);
     343
     344  // Possible blue combinations
     345  CheckAndSet(proj, "0.1led[sS]?blue", fPattern, k01LedBlue,  color, kBLUE);
     346  CheckAndSet(proj, "1led[sS]?blue",   fPattern, k1LedBlue,   color, kBLUE);
     347  CheckAndSet(proj, "2led[sS]?blue",   fPattern, k2LedBlue,   color, kBLUE);
     348  CheckAndSet(proj, "3led[sS]?blue",   fPattern, k3LedBlue,   color, kBLUE);
     349  CheckAndSet(proj, "5led[sS]?blue",   fPattern, k5LedBlue1,  color, kBLUE);
     350  CheckAndSet(proj, "6led[sS]?blue",   fPattern, k6LedBlue,   color, kBLUE);
     351  CheckAndSet(proj, "7led[sS]?blue",   fPattern, k7LedBlue,   color, kBLUE);
     352  CheckAndSet(proj, "8led[sS]?blue",   fPattern, k8LedBlue,   color, kBLUE);
     353  CheckAndSet(proj, "10led[sS]?blue",  fPattern, k10LedBlue,  color, kBLUE);
     354  CheckAndSet(proj, "15led[sS]?blue",  fPattern, k15LedBlue,  color, kBLUE);
     355  CheckAndSet(proj, "20led[sS]?blue",  fPattern, k20LedBlue,  color, kBLUE);
     356  CheckAndSet(proj, "21led[sS]?blue",  fPattern, k21LedBlue,  color, kBLUE);
     357  CheckAndSet(proj, "22led[sS]?blue",  fPattern, k22LedBlue,  color, kBLUE);
     358  CheckAndSet(proj, "23led[sS]?blue",  fPattern, k23LedBlue,  color, kBLUE);
     359
     360  // Possible UV combinations
     361  CheckAndSet(proj, "1led[sS]?uv",     fPattern, k1LedUV,    color,  kUV);
     362  CheckAndSet(proj, "2led[sS]?uv",     fPattern, k2LedUV,    color,  kUV);
     363  CheckAndSet(proj, "3led[sS]?uv",     fPattern, k3LedUV,    color,  kUV);
     364  CheckAndSet(proj, "5led[sS]?uv",     fPattern, k5LedUV1,   color,  kUV);
     365  CheckAndSet(proj, "6led[sS]?uv",     fPattern, k6LedUV,    color,  kUV);
     366  CheckAndSet(proj, "7led[sS]?uv",     fPattern, k7LedUV,    color,  kUV);
     367  CheckAndSet(proj, "8led[sS]?uv",     fPattern, k8LedUV,    color,  kUV);
     368  CheckAndSet(proj, "10led[sS]?uv",    fPattern, k10LedUV,   color,  kUV);
     369  CheckAndSet(proj, "11led[sS]?uv",    fPattern, k11LedUV,   color,  kUV);
     370  CheckAndSet(proj, "12led[sS]?uv",    fPattern, k12LedUV,   color,  kUV);
     371  CheckAndSet(proj, "13led[sS]?uv",    fPattern, k13LedUV,   color,  kUV);
     372
     373  // Possible slot combinations
     374  TRegexp slot("slot");
     375  if (proj.Contains(slot))
     376  {
     377      proj.ReplaceAll("slot","");
     378      UInt_t nr = 0;
     379      TRegexp slotnr("^[0-9]");
     380
     381      if (proj.Contains(slotnr))
     382      {
     383          fPattern = 0;
     384          proj.Replace(2,99,"");
     385          proj.ReplaceAll("u","");
     386          proj.ReplaceAll("v","");
     387          proj.ReplaceAll("g","");
     388          nr = atoi(proj.Data())-1;
     389
     390          fPattern |= BIT(nr);
     391
     392          color = nr < 2 ? kGREEN :
     393              ( nr < 3 ) ? kBLUE :
     394              ( nr < 5 ) ? kUV :
     395              ( nr < 11 ) ? kBLUE :
     396              ( nr < 13 ) ? kUV :
     397              ( nr < 14 ) ? kBLUE :
     398              ( nr < 16 ) ? kGREEN :
     399              kCT1;
     400      }
     401  }
     402
     403  if (color == kNONE)
     404  {
     405      CheckAndSet(proj, "gree", fPattern, k5LedGreen, color, kGREEN);
     406      CheckAndSet(proj, "blue", fPattern, k5LedBlue1, color, kBLUE);
     407      CheckAndSet(proj, "uv",   fPattern, k5LedUV1,   color, kUV);
     408      CheckAndSet(proj, "ct1",  fPattern, kCT1Pulser, color, kCT1);
     409
    446410      if (color != kNONE)
    447         *fLog << inf << "Color and Intensity determined from project-name (" << proj << ")... ";         
     411          *fLog << inf << "Color determined from project-name (" << proj << ")... ";
    448412      else
    449         {
    450           if (proj.Contains("gree",TString::kIgnoreCase))
    451             { fPattern |= k5LedGreen; color = kGREEN; }
    452           if (proj.Contains("blue",TString::kIgnoreCase))
    453             { fPattern |=k5LedBlue1; color = kBLUE;}
    454           if (proj.Contains("uv",TString::kIgnoreCase))
    455             { fPattern |=k5LedUV1  ; color = kUV;  }
    456           if (proj.Contains("ct1",TString::kIgnoreCase))
    457             { fPattern |=kCT1Pulser; color = kCT1; }
    458           if (color != kNONE)
    459             *fLog << inf << "Color determined from project-name (" << proj << ")... ";
    460           else if (proj.Contains("cl",TString::kIgnoreCase))
    461             {
    462               *fLog << warn << "This run has been taken with the continuous light source." << endl;
    463               *fLog << warn
    464                     << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
     413          if (proj.Contains("cl",TString::kIgnoreCase))
     414          {
     415              *fLog << warn;
     416              *fLog << "This run has been taken with the continuous light source." << endl;
     417              *fLog << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
    465418              fPattern = 0;
    466419              fIsValid = kTRUE;
    467420              return kTRUE;
    468             }
    469         }
    470     }
    471  
    472   if (color==kNONE)
    473     {
    474       *fLog << err << "Sorry, calibration run " << num << " was taken before the events could be" << endl;
     421          }
     422
     423      *fLog << err;
     424      *fLog << "Sorry, calibration run " << num << " was taken before the events could be" << endl;
    475425      *fLog << "flagged with a color by the digital modul and no color" << endl;
    476426      *fLog << "could be determined... abort." << endl;
    477427      return kFALSE;
    478     }
    479  
     428  }
     429
     430  *fLog << inf << "Color and Intensity determined from project-name (" << proj << ")... ";
     431
    480432  switch (color)
    481     {
    482     case kGREEN: *fLog << "Green.";  break;
    483     case kBLUE:  *fLog << "Blue.";   break;
    484     case kUV:    *fLog << "UV.";     break;
    485     case kCT1:   *fLog << "CT1.";    break;
    486     }
     433  {
     434  case kGREEN: *fLog << "Green.";  break;
     435  case kBLUE:  *fLog << "Blue.";   break;
     436  case kUV:    *fLog << "UV.";     break;
     437  case kCT1:   *fLog << "CT1.";    break;
     438  }
    487439  *fLog << endl;
    488  
     440
    489441  fIsValid = kTRUE;
    490  
     442
    491443  return kTRUE;
    492444}
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h

    r5621 r5690  
    2121  UInt_t fPattern;                            //  Current pulse pattern
    2222  Bool_t fIsValid;                            //  Have to set the pulse pattern?
    23  
     23
     24  void CheckAndSet(const TString &str, const char *regexp, UInt_t &pattern, UInt_t pat, Int_t &color, Int_t col) const;
     25
    2426  Bool_t ReInit(MParList *pList);
    2527  Int_t  PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc

    r5660 r5690  
    4040/////////////////////////////////////////////////////////////////////////////
    4141#include "MCalibrationIntensityChargeCam.h"
     42
     43#include <TF1.h>
     44#include <TH2.h>
     45#include <TGraphErrors.h>
     46#include <TOrdCollection.h>
     47
     48#include "MLog.h"
     49
     50#include "MGeomCam.h"
     51#include "MGeomPix.h"
     52
    4253#include "MCalibrationChargeCam.h"
    4354#include "MCalibrationChargePix.h"
    44 
    45 #include "MGeomCam.h"
    46 #include "MGeomPix.h"
    47 
    48 #include "MLog.h"
    49 
    50 #include <TOrdCollection.h>
    51 #include <TGraphErrors.h>
    52 #include <TH2F.h>
    53 #include <TF1.h>
    5455
    5556ClassImp(MCalibrationIntensityChargeCam);
     
    428429      const Float_t qe = pix.GetConvertedMeanErr();
    429430      oneoverq   [i] = 1./q;
    430       oneoverqerr[i] = qe / q / q;
     431      oneoverqerr[i] = qe / (q * q);
    431432    }
    432433 
     
    436437  gr->SetTitle(Form("%s%3i","Pixel ",pixid));
    437438  gr->GetXaxis()->SetTitle("1/Q [FADC counts^{-1}]");
    438   gr->GetYaxis()->SetTitle("\sigma_{red}^{2}/Q^{2} [1]");     
     439  gr->GetYaxis()->SetTitle("\\sigma_{red}^{2}/Q^{2} [1]");
    439440  return gr;
    440441}
  • trunk/MagicSoft/Mars/mfbase/MFEventSelector2.cc

    r5667 r5690  
    116116#include "MH3.h"            // MH3
    117117#include "MRead.h"          // MRead
    118 //#include "MProgressBar.h"   //
    119118#include "MEvtLoop.h"       // MEvtLoop
    120119#include "MTaskList.h"      // MTaskList
     
    158157//     events outside these ranges won't be accepted).
    159158//
     159//  Set default name of filter to be applied when determining the original
     160//  distribution for all data on the input file to "FilterSelector2"
     161//
    160162MFEventSelector2::MFEventSelector2(MH3 &hist, const char *name, const char *title)
    161 : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL),
    162   fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')),
    163   fDataZ(hist.GetRule('z')), fNumMax(-1), fHistIsProbability(kFALSE),
    164   fUseOrigDist(kTRUE)
     163    : fHistOrig(NULL), fHistNom(&hist), fHistRes(NULL),
     164    fDataX(hist.GetRule('x')), fDataY(hist.GetRule('y')),
     165    fDataZ(hist.GetRule('z')), fNumMax(-1), fCanvas(0),
     166    fFilterName("FilterSelector2"), fHistIsProbability(kFALSE),
     167    fUseOrigDist(kTRUE)
    165168{
    166169    fName  = name  ? (TString)name  : gsDefName;
    167170    fTitle = title ? (TString)title : gsDefTitle;
    168 
    169     // name of filter to be applied when determining the original distribution
    170     // for all data on the input file
    171     fFilterName = "FilterSelector2";
    172171}
    173172
     
    216215    }
    217216
    218     *fLog << inf << underline << endl;
    219     *fLog << "MFEventSelector2::ReadDistribution:" << endl;
    220     *fLog << "**********************" << endl;
    221     *fLog << " - Start of eventloop to generate the original distribution..."
    222           << endl;
     217    *fLog << inf;
     218    fLog->Separator("MFEventSelector2::ReadDistribution");
     219    *fLog << " - Start of eventloop to generate the original distribution..." << endl;
    223220
    224221    if (filter != NULL)
    225     {
    226       *fLog << "                      filter used : " << filter->GetName()
    227             << endl;
    228     }
     222        *fLog << " - filter used: " << filter->GetDescriptor() << endl;
    229223
    230224
    231225    MEvtLoop run("ReadDistribution");
    232     //MProgressBar bar;
    233     //run.SetProgressBar(&bar);
    234226
    235227    MParList plist;
     
    264256    if (!run.Eventloop())
    265257    {
    266         *fLog << err << dbginf
    267               << "Evtloop in MFEventSelector2::ReadDistribution failed."
    268               << endl;
    269         return kFALSE;
    270     }
    271 
    272     tlist.PrintStatistics(0, kTRUE);
     258        *fLog << err << dbginf << "Evtloop failed... abort." << endl;
     259        return kFALSE;
     260    }
     261
     262    tlist.PrintStatistics();
    273263
    274264    *fLog << inf;
    275265    *fLog << "MFEventSelector2::ReadDistribution:" << endl;
    276     *fLog << " - Original distribution has "
    277           << fHistOrig->GetHist().GetEntries() << " entries." << endl;
    278     *fLog << " - End of eventloop to generate the original distribution."
    279           << endl;
    280     *fLog << "**********************" << endl;
     266    *fLog << " - Original distribution has " << fHistOrig->GetHist().GetEntries() << " entries." << endl;
     267    *fLog << " - End of eventloop to generate the original distribution." << endl;
     268    fLog->Separator();
    281269
    282270    return read.Rewind();
     
    447435    if (!read)
    448436    {
    449         *fLog << err << "MRead not found... abort." << endl;
     437        *fLog << err << "MRead not found in tasklist... abort." << endl;
    450438        return kFALSE;
    451439    }
    452440
    453441    MFilter *filter = (MFilter*)tasklist->FindObject(fFilterName);
    454     if (!filter)
    455     {
    456       *fLog << inf
    457             << "No filter will be used when making the original distribution"
    458             << endl;
    459       filter = NULL;
    460     }
    461 
     442    if (!filter || !filter->InheritsFrom(MFilter::Class()))
     443    {
     444        *fLog << inf << "No filter will be used when making the original distribution" << endl;
     445        filter = NULL;
     446    }
    462447
    463448    if (!ReadDistribution(*read, filter))
    464449        return kFALSE;
    465 
    466450
    467451    // Prepare histograms and arrays for selection
    468452    PrepareHistograms();
    469453
    470     *fLog << "MFEventSelector2::PreProcess; call PreProcess() for read and filter object again"
    471           << endl;
    472     Int_t rcr = read->CallPreProcess(parlist);
    473     Int_t rcf = filter->CallPreProcess(parlist);
    474 
    475     *fLog << "rcr, rcf = " << rcr << ",  " << rcf << endl;
    476 
    477     return rcf*rcr;
     454    *fLog << all << "PreProcess..." << flush;
     455    const Int_t rcf = filter->CallPreProcess(parlist);
     456    if (rcf!=kTRUE)
     457        return rcf;
     458
     459    const Int_t rcr = read->CallPreProcess(parlist);
     460    return rcr;
    478461}
    479462
  • trunk/MagicSoft/Mars/mfbase/MFEventSelector2.h

    r5667 r5690  
    4141    TCanvas   *fCanvas;   //! canvas for online display
    4242
    43     TString    fFilterName; // name of the MFilter object to be used
    44                             // when determining the original distribution
     43    TString    fFilterName; // name of the MFilter object to be used when determining the original distribution
    4544
    4645    Bool_t fResult;
    4746    Bool_t fHistIsProbability;
    48     Bool_t fUseOrigDist;    // flag indicating that in the selection the
    49                             // original distribution is not changed
     47    Bool_t fUseOrigDist;    // flag indicating that in the selection the original distribution is not changed
    5048
    5149    Int_t  fCounter[3];
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r5557 r5690  
    325325
    326326const TString MImgCleanStd::gsNamePedPhotCam="MPedPhotCam"; // default name of the 'MPedPhotCam' container
     327const TString MImgCleanStd::gsNameCerPhotEvt="MCerPhotEvt"; // default name of the 'MCerPhotEvt' container
     328const TString MImgCleanStd::gsNameGeomCam   ="MGeomCam";    // default name of the 'MGeomCam' container
    327329
    328330// --------------------------------------------------------------------------
     
    337339                           const char *name, const char *title)
    338340    : fCleaningMethod(kStandard), fCleanLvl1(lvl1),
    339       fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotCam(gsNamePedPhotCam)
     341    fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotCam(gsNamePedPhotCam),
     342    fNameGeomCam(gsNameGeomCam), fNameCerPhotEvt(gsNameCerPhotEvt)
    340343
    341344{
     
    540543Int_t MImgCleanStd::PreProcess (MParList *pList)
    541544{
    542     fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
     545    fCam = (MGeomCam*)pList->FindObject(AddSerialNumber(fNameGeomCam), "MGeomCam");
    543546    if (!fCam)
    544547    {
    545         *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
     548        *fLog << err << fNameGeomCam << " [MGeomCam] not found (no geometry information available)... aborting." << endl;
    546549        return kFALSE;
    547550    }
    548551
    549     fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
     552    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber(fNameCerPhotEvt), "MCerPhotEvt");
    550553    if (!fEvt)
    551554    {
    552         *fLog << err << "MCerPhotEvt not found... aborting." << endl;
     555        *fLog << err << fNameCerPhotEvt << " [MCerPhotEvt] not found... aborting." << endl;
    553556        return kFALSE;
    554557    }
     
    557560    if (!fPed)
    558561    {
    559         *fLog << err << "MPedPhotCam not found... aborting." << endl;
     562        *fLog << err << fNamePedPhotCam << " [MPedPhotCam] not found... aborting." << endl;
    560563        return kFALSE;
    561564    }
     
    755758    case kImgCleanLvl1:
    756759        fCleanLvl1 = lvl;
    757         *fLog << "Cleaning level 1 set to " << lvl << " sigma." << endl;
     760        *fLog << "Cleaning level 1 set to " << lvl << endl;
    758761        return kTRUE;
    759762
    760763    case kImgCleanLvl2:
    761764        fCleanLvl2 = lvl;
    762         *fLog << "Cleaning level 2 set to " << lvl << " sigma." << endl;
     765        *fLog << "Cleaning level 2 set to " << lvl << endl;
    763766        return kTRUE;
    764767    }
     
    805808    if (gsNamePedPhotCam!=fNamePedPhotCam)
    806809        out << "   " << GetUniqueName() << ".SetNamePedPhotCam(\"" << fNamePedPhotCam << "\");" << endl;
     810    if (gsNameGeomCam!=fNameGeomCam)
     811        out << "   " << GetUniqueName() << ".SetNameGeomCam(\"" << fNameGeomCam << "\");" << endl;
     812    if (gsNameCerPhotEvt!=fNameCerPhotEvt)
     813        out << "   " << GetUniqueName() << ".SetNameCerPhotEvt(\"" << fNameCerPhotEvt << "\");" << endl;
    807814}
    808815
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r4838 r5690  
    2929private:
    3030    static const TString gsNamePedPhotCam; // default name of the 'MPedPhotCam' container
     31    static const TString gsNameGeomCam;    // default name of the 'MGeomCam' container
     32    static const TString gsNameCerPhotEvt; // default name of the 'MCerPhotEvt' container
    3133
    3234    const MGeomCam     *fCam;  //!
     
    4446
    4547    TString  fNamePedPhotCam; // name of the 'MPedPhotCam' container
     48    TString  fNameGeomCam;    // name of the 'MGeomCam' container
     49    TString  fNameCerPhotEvt; // name of the 'MCerPhotEvt' container
    4650
    4751
     
    7377
    7478    Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
     79
    7580    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
     81    void SetNameCerPhotEvt(const char *name)  { fNameCerPhotEvt = name; }
     82    void SetNameGeomCam(const char *name)     { fNameGeomCam = name; }
    7683
    77     ClassDef(MImgCleanStd, 2)    // task doing the image cleaning
     84    ClassDef(MImgCleanStd, 3)    // task doing the image cleaning
    7885};
    7986
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r5601 r5690  
    388388    MFillH fill7(&evt7, "MArrivalTime",        "FillTimes");
    389389
    390     MWriteRootFile write(2, Form("%s{s/_D_/_Y_}", fPathOut.Data()), fOverwrite);
     390    // The second rule is for the case reading raw-files!
     391    MWriteRootFile write(2, Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()), fOverwrite);
    391392    // Run Header
    392393    write.AddContainer("MRawRunHeader",       "RunHeaders");
  • trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc

    r3238 r5690  
    7272//
    7373MRanForestCalc::MRanForestCalc(const char *name, const char *title)
    74     : fNum(100), fHadronnessName("MHadronness"), fData(NULL)
     74    : fNum(100), fHadronnessName("MHadronness"), fData(NULL), fRanForest(0), fRanTree(0)
    7575{
    7676    //
     
    8787MRanForestCalc::~MRanForestCalc()
    8888{
    89     //    delete fData;
     89    if (!IsOwner())
     90        return;
     91
     92    delete fRanForest;
     93    delete fRanTree;
    9094}
    9195
     
    103107Int_t MRanForestCalc::PreProcess(MParList *plist)
    104108{
    105     fRanForest = (MRanForest*)plist->FindObject("MRanForest");
    106109    if (!fRanForest)
    107110    {
    108         *fLog << err << dbginf << "MRanForest not found... aborting." << endl;
    109         return kFALSE;
    110     }
    111 
    112     fRanTree = (MRanTree*)plist->FindObject("MRanTree");
     111        fRanForest = (MRanForest*)plist->FindObject("MRanForest");
     112        if (!fRanForest)
     113        {
     114            *fLog << err << dbginf << "MRanForest not found... aborting." << endl;
     115            return kFALSE;
     116        }
     117    }
     118
    113119    if (!fRanTree)
    114120    {
    115         *fLog << err << dbginf << "MRanTree not found... aborting." << endl;
    116         return kFALSE;
    117     }
    118 
    119     /*if(!fRanForest->GetCurTree())
    120     {
    121         *fLog << err << dbginf << "MRanForest does not contain trees... aborting." << endl;
    122         return kFALSE;
    123     }*/
     121        fRanTree = (MRanTree*)plist->FindObject("MRanTree");
     122        if (!fRanTree)
     123        {
     124            *fLog << err << dbginf << "MRanTree not found... aborting." << endl;
     125            return kFALSE;
     126        }
     127    }
    124128
    125129    fData = fRanTree->GetRules();
     
    253257    return kTRUE;
    254258}
     259
     260Int_t MRanForestCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     261{
     262    if (!IsEnvDefined(env, prefix, "File",     print))
     263        return kFALSE;
     264
     265    TString fname = GetEnvValue(env, prefix, "File", "RF.root");
     266    TString tname = GetEnvValue(env, prefix, "Tree", "Tree");
     267    const Int_t   num   = GetEnvValue(env, prefix, "NumTrees", 100);
     268    const Bool_t  debug = GetEnvValue(env, prefix, "Debug", kFALSE);
     269
     270    fname.ReplaceAll("\015", "");
     271    tname.ReplaceAll("\015", "");
     272
     273    *fLog << dbginf << "Reading " << num << " trees " << tname << " from file " << fname << endl;
     274
     275    gLog.SetNullOutput(!debug);
     276    MEvtLoop evtloop;
     277    MParList  plist;
     278    evtloop.SetParList(&plist);
     279    MLog l;
     280    l.SetNullOutput(!debug);
     281    evtloop.SetLogStream(&l);
     282    gLog.SetNullOutput(debug);
     283
     284    if (IsOwner())
     285    {
     286        delete fRanForest;
     287        delete fRanTree;
     288    }
     289    fRanForest = new MRanForest;
     290    fRanTree   = new MRanTree;
     291    SetOwner();
     292
     293    plist.AddToList(fRanForest);
     294    plist.AddToList(fRanTree);
     295
     296    MTaskList tlist;
     297    plist.AddToList(&tlist);
     298
     299    MReadTree read(tname, fname);
     300    read.DisableAutoScheme();
     301
     302    MRanForestFill rffill;
     303    rffill.SetNumTrees(num);
     304
     305    tlist.AddToList(&read);
     306    tlist.AddToList(&rffill);
     307
     308    if (!evtloop.Eventloop())
     309    {
     310        *fLog << err << "ERROR - Reading " << tname << " from file " << fname << endl;
     311        return kERROR;
     312    }
     313
     314    return kTRUE;
     315}
  • trunk/MagicSoft/Mars/mranforest/MRanForestCalc.h

    r2862 r5690  
    3131    Int_t Process();
    3232
     33    enum { kIsOwner = BIT(14) };
     34
     35    Bool_t IsOwner() const { return TestBit(kIsOwner); }
     36    void SetOwner() { SetBit(kIsOwner); }
     37
    3338public:
    3439    MRanForestCalc(const char *name=NULL, const char *title=NULL);
    3540    ~MRanForestCalc();
     41
     42    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
    3643
    3744    void SetHadronnessName(const TString name) { fHadronnessName = name; }
Note: See TracChangeset for help on using the changeset viewer.