Changeset 9314


Ignore:
Timestamp:
02/11/09 11:57:57 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstro.cc

    r9305 r9314  
    338338// --------------------------------------------------------------------------
    339339//
    340 // Convert a mjd to a number yymmdd. The century is just cuts away, e.g.
     340// Convert a mjd to a number yymmdd. The century is just cut away, e.g.
    341341//   54393 -->  71020   (2007/10/20)
    342342//   50741 --> 971020   (1997/10/20)
     
    355355//
    356356// Convert a yymmdd number to mjd. The century is defined as 2000 for
    357 // yy<70, 1900 elsewise.
     357// yy<70, 1900 otherwise.
    358358//    71020 --> 54393 (2007/10/20)
    359359//   971020 --> 50741 (1997/10/20)
  • trunk/MagicSoft/Mars/mbase/MEnv.cc

    r8907 r9314  
    6060
    6161#include "MArgs.h"
     62#include "MString.h"
    6263
    6364ClassImp(MEnv);
     
    541542
    542543    if (style>3999 && style<4101)
    543         val = Form("%d%%", style-4000);
     544        val = MString::Format("%d%%", style-4000);
    544545
    545546    switch (style)
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r8907 r9314  
    233233    // This does not reset the counter!
    234234    fStopwatch->Reset();
    235     fNumExecutions = 0;
    236     fNumExec0 = GetNumExecutionsTotal();
     235    fNumExec0 = fNumExecutions;
    237236
    238237    *fLog << all << GetDescriptor() << "... " << flush;
     
    400399UInt_t MTask::GetNumExecutions() const
    401400{
    402     return GetNumExecutionsTotal()-fNumExec0;
    403 }
    404 
    405 // --------------------------------------------------------------------------
    406 //
    407 //  Return the total number of calls to Process(). If Process() was not
     401    return fNumExecutions-fNumExec0;
     402}
     403
     404// --------------------------------------------------------------------------
     405//
     406//  Return the total number of calls to Process() ever. If Process() was not
    408407//  called due to a set filter this is not counted.
    409408//
    410409UInt_t MTask::GetNumExecutionsTotal() const
    411410{
    412     return fNumExecutions-1;
     411    return fNumExecutions;
    413412}
    414413
     
    467466    *fLog << GetDescriptor();
    468467
    469     if (GetNumExecutions()!=(UInt_t)-1)
     468    if (GetNumExecutions()>0)
    470469        *fLog << "\t" << dec << GetNumExecutions();
    471470
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPatternDecode.cc

    r7194 r9314  
    3434// Input:
    3535//   MRawEvtData
     36//   MRawRunHeader
    3637//
    3738// Output:
     
    6869Int_t MCalibrationPatternDecode::PreProcess(MParList *pList)
    6970{
    70     fRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader");
     71    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    7172    if (!fRunHeader)
    7273    {
     
    8485    fPattern = (MCalibrationPattern*)pList->FindCreateObj("MCalibrationPattern");
    8586    if (!fPattern)
    86     {
    87         *fLog << err << "MCalibratinPattern not found... abort." << endl;
    8887        return kFALSE;
    89     }
    9088
    9189    return kTRUE;
     
    102100    // been called just before
    103101    if (fRunHeader->GetFormatVersion()<5)
    104       return kTRUE;
     102        return kTRUE;
    105103
    106     UInt_t pattern = fEvtHeader->GetCalibrationPattern();
     104    // Get calibration pattern from event header
     105    const UInt_t pattern = fEvtHeader->GetCalibrationPattern();
    107106
    108     fPattern->fCLStrength = pattern & 0xff;
    109     fPattern->fCLColor    = (MCalibrationPattern::CLColor_t)((pattern>>8)&0xf);
    110    
    111     const UInt_t pulserpattern = (pattern >> 16) & 0xffff;
     107    const UInt_t str = (pattern    ) & 0x00ff;
     108    const UInt_t col = (pattern>> 8) & 0x000f;
     109    const UInt_t pat = (pattern>>16) & 0xffff;
    112110
    113     fPattern->fPulserColor =  MCalibrationCam::kNONE;   
     111    fPattern->fCLStrength = str;
     112    fPattern->fCLColor    = (MCalibrationPattern::CLColor_t)col;
    114113
    115     if ((pulserpattern & kGreenAndBlue) || (pulserpattern & kBlueAndUV) || (pulserpattern & kGreenAndUV))
    116       fPattern->fPulserColor =  MCalibrationCam::kNONE;
    117     if (pulserpattern & kCT1Pulser)
    118       fPattern->fPulserColor =  MCalibrationCam::kCT1;
    119     if (pulserpattern & kAnyUV)
    120       fPattern->fPulserColor =  MCalibrationCam::kUV;
    121     if (pulserpattern & kAnyGreen)
    122       fPattern->fPulserColor =  MCalibrationCam::kGREEN;
    123     if (pulserpattern & kAnyBlue)
    124       fPattern->fPulserColor =  MCalibrationCam::kBLUE;
     114    // Set a default pattern
     115    fPattern->fPulserColor =  MCalibrationCam::kNONE;
    125116
    126     Float_t strength = 0.;
     117    // Check the pattern
     118    if ((pat & kGreenAndBlue) || (pat & kBlueAndUV) || (pat & kGreenAndUV))
     119        fPattern->fPulserColor =  MCalibrationCam::kNONE;
     120
     121    if (pat & kCT1Pulser)
     122        fPattern->fPulserColor =  MCalibrationCam::kCT1;
     123
     124    if (pat & kAnyUV)
     125        fPattern->fPulserColor =  MCalibrationCam::kUV;
     126
     127    if (pat & kAnyGreen)
     128        fPattern->fPulserColor =  MCalibrationCam::kGREEN;
     129
     130    if (pat & kAnyBlue)
     131        fPattern->fPulserColor =  MCalibrationCam::kBLUE;
     132
     133    // Now decode the strength
     134    fPattern->fPulserStrength = 0.;
    127135
    128136    switch (fPattern->fPulserColor)
    129       {
     137    {
    130138      case MCalibrationCam::kNONE:
    131         break;
     139          break;
     140
    132141      case MCalibrationCam::kGREEN:
    133         if (pulserpattern & kSlot1Green)
    134           strength += 5.;
    135         if (pulserpattern & kSlot2Green)
    136           strength += 2.;
    137         if (pulserpattern & kSlot15Green)
    138           strength += 1.;
    139         if (pulserpattern & kSlot16AttGreen)
    140           strength += 0.2;
    141         break;     
     142          if (pat & kSlot1Green)
     143              fPattern->fPulserStrength += 5.0;
     144          if (pat & kSlot2Green)
     145              fPattern->fPulserStrength += 2.0;
     146          if (pat & kSlot15Green)
     147              fPattern->fPulserStrength += 1.0;
     148          if (pat & kSlot16AttGreen)
     149              fPattern->fPulserStrength += 0.2;
     150          break;
     151
    142152      case MCalibrationCam::kBLUE:
    143         if (pulserpattern & kSlot3Blue)
    144           strength += 5.1;
    145         if (pulserpattern & kSlot6Blue)
    146           strength += 5.2;
    147         if (pulserpattern & kSlot7Blue)
    148           strength += 5.4;
    149         if (pulserpattern & kSlot8Blue)
    150           strength += 2.;
    151         if (pulserpattern & kSlot9AttBlue)
    152           strength += 0.25;
    153         if (pulserpattern & kSlot10Blue)
    154           strength += 0.;
    155         if (pulserpattern & kSlot11Blue)
    156           strength += 1.;
    157         if (pulserpattern & kSlot14Blue)
    158           strength += 5.8;
    159         break;     
     153          if (pat & kSlot3Blue)
     154              fPattern->fPulserStrength += 5.1;
     155          if (pat & kSlot6Blue)
     156              fPattern->fPulserStrength += 5.2;
     157          if (pat & kSlot7Blue)
     158              fPattern->fPulserStrength += 5.4;
     159          if (pat & kSlot8Blue)
     160              fPattern->fPulserStrength += 2.0;
     161          if (pat & kSlot9AttBlue)
     162              fPattern->fPulserStrength += 0.25;
     163          if (pat & kSlot10Blue)
     164              fPattern->fPulserStrength += 0.0;
     165          if (pat & kSlot11Blue)
     166              fPattern->fPulserStrength += 1.0;
     167          if (pat & kSlot14Blue)
     168              fPattern->fPulserStrength += 5.8;
     169          break;
     170
    160171      case MCalibrationCam::kUV:
    161         if (pulserpattern & kSlot4UV)
    162           strength += 1.;
    163         if (pulserpattern & kSlot5UV)
    164           strength += 2.;
    165         if (pulserpattern & kSlot12UV)
    166           strength += 5.1;
    167         if (pulserpattern & kSlot13UV)
    168           strength += 5.2;
    169         break;     
     172          if (pat & kSlot4UV)
     173              fPattern->fPulserStrength += 1.0;
     174          if (pat & kSlot5UV)
     175              fPattern->fPulserStrength += 2.0;
     176          if (pat & kSlot12UV)
     177              fPattern->fPulserStrength += 5.1;
     178          if (pat & kSlot13UV)
     179              fPattern->fPulserStrength += 5.2;
     180          break;
     181
    170182      case MCalibrationCam::kCT1:
    171         strength = 20.;
    172         break;     
    173       }
    174  
    175     fPattern->fPulserStrength = strength;
     183          fPattern->fPulserStrength = 20.;
     184          break;
     185    }
    176186
    177187    return kTRUE;
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRead.cc

    r9212 r9314  
    218218        if (fDisplay)
    219219        {
     220            // Show the number of the last event after
     221            // which we now open a new file
    220222            TString txt = GetFileName();
    221223            txt += " @ ";
Note: See TracChangeset for help on using the changeset viewer.