Changeset 9313 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9312 r9313  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2009/02/11 Thomas Bretz
     21
     22   * mcalib/MCalibColorSet.[h,cc]:
     23     - removed some obsolete break statements
     24     - removed obsolete gkMCRunLimit
     25     - fixed setting of signal strength for extremely old
     26       runs (I think we don't have them anyway)
     27
     28   * mcalib/MCalibrateData.cc:
     29     - improved output
     30
     31   * mcalib/MCalibrationChargeCalc.cc:
     32     - stop if no valid pulser colors have been found
     33
     34   * mcorsika/MCorsikaRunHeader.h:
     35     - some cosmetics
     36     - added some getter
     37
     38   * mhist/MHEvent.cc:
     39     - some improvements to output
     40
     41   * mmc/MMcEvtBasic.[h,cc]:
     42     - moved the getter returning a TString to the source file
     43     - replaced Form by MString::Format
     44
     45   * mraw/MRawRunHeader.cc:
     46     - initialize fSourceEpochChar[1]
     47     - initialize fNumEventsRead
     48     - suppress more output which has not been initialized
     49     - removed run-type from SetRunInfo
     50     - added new function SetRunType
     51     - use strncpy instead of memcpy
     52     - replaced const char[] arguments by TString
     53
     54   * msimreflector/MReflector.[h,cc]:
     55     - added Print
     56     - added a circle around the mirror showing fMaxR
     57
     58
     59
    2060 2009/02/10 Thomas Bretz
    2161
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc

    r7122 r9313  
    5757
    5858const Int_t  MCalibColorSet::gkIFAEBoxInaugurationRun = 20113;
    59 const Int_t  MCalibColorSet::gkMCRunLimit             = 1000;
    6059const UInt_t MCalibColorSet::gkFirstRunWithFinalBits  = 45626;
    6160
     
    193192      *fLog << inf << "Run taken before inauguration of IFAE-box... using CT1 pulser." << endl;
    194193      fColor    = MCalibrationCam::kCT1;
     194      fStrength = 10.;
    195195      fPattern->SetPulserColor(fColor);
    196196      fPattern->SetPulserStrength(fStrength);
    197       fStrength = 10.;
    198197      fIsValid  = kTRUE;
    199198      return kTRUE;
     
    341340      *fLog << err << "Sorry, run 27474 was taken with CLOSED LIDS. It should not be used! " << endl;
    342341      return kFALSE;
    343       break;
    344342
    345343    case 40493:
     
    351349      *fLog << err << "the camera. It cannot be used for the standard calibration " << endl;
    352350      return kFALSE;
    353       break;
    354351     
    355352    case 45605:
     
    357354      *fLog << err << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
    358355      return kFALSE;
    359       break;
    360356
    361357    case 45606:
     
    363359      *fLog << err << "It cannot be used for calibration. Try to run a pedestal extraction on it." << endl;
    364360      return kFALSE;
    365       break;
    366361
    367362    }
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.h

    r6231 r9313  
    1919
    2020  static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration (set to: 20113)
    21   static const Int_t gkMCRunLimit;             //! Maximum MC run number (now set to: 1000)
    2221  static const UInt_t gkFirstRunWithFinalBits; //! Run number of first functionning digital modules
    2322 
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r9036 r9313  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.72 2008-07-22 18:55:08 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.73 2009-02-11 10:48:24 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    683683    {
    684684        *fLog << err << GetDescriptor() << ": ERROR - ";
    685         *fLog << "GetConversionFactor has skipped more than 90% of the pixels... abort." << endl;
     685        *fLog << "GetConversionFactor has skipped more than 90% of the " << fGeomCam->GetNumPixels() <<  " pixels... abort." << endl;
    686686        return kFALSE;
    687687    }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r8907 r9313  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.184 2008-06-02 08:46:44 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.185 2009-02-11 10:48:24 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    665665  if (fPulserColor == MCalibrationCam::kNONE)
    666666  {
    667       *fLog << warn << "WARNING - No Pulse colour has been set or used at all..." << endl;
    668       return kTRUE;
     667      *fLog << err << "ERROR - No event was flagged with a pulser color... no calibration possible." << endl;
     668      return kFALSE;
    669669  }
    670670
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h

    r9312 r9313  
    4545    MCorsikaRunHeader(const char *name=NULL, const char *title=NULL);
    4646
     47    // Getter
     48    UInt_t GetRunNumber() const { return fRunNumber; }
     49    UInt_t GetParticleID() const { return fParticleID; }
     50    UInt_t GetNumEvents() const { return fNumEvents; }
     51
    4752    UInt_t GetFormatVersion() const { return (UInt_t)fProgramVersion; }
    48     Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
    49 
    50     UInt_t GetParticleID() const { return fParticleID; }
    5153
    5254    Float_t GetZdMin() const { return fZdMin; }
     
    6668
    6769    Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
     70    Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
    6871
    69     UInt_t GetNumEvents() const { return fNumEvents; }
    70 
    71     void Print(Option_t *t=NULL) const;
    72 
     72    // I/O
    7373    Bool_t ReadEvt(istream& fin);
    7474    Bool_t ReadEvtEnd(istream& fin);
    7575    Bool_t SeekEvtEnd(istream &fin);
    7676
     77    // TObject
     78    void Print(Option_t *t=NULL) const;
     79
    7780    ClassDef(MCorsikaRunHeader, 2)      // storage container for general info
    7881};
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r9224 r9313  
    291291
    292292    if (fRawEvtHeader && fRawRunHeader)
    293         s += " of ";
    294 
    295     if (fRawRunHeader)
     293        s += " FileId #";
     294
     295    if (fRawEvtHeader)
    296296        s += fRawRunHeader->GetStringID();
    297297
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r9312 r9313  
    193193    memset(fObservationMode, 0,  61);
    194194    fSourceEpochChar[0]=0;
     195    fSourceEpochChar[1]=0;
    195196    fSourceEpochDate=0;
    196197    fNumCrates=0;
     
    199200    fNumSamplesHiGain=0;
    200201    fNumEvents=0;
     202    fNumEventsRead=0;
    201203    fNumBytesPerSample=1;
    202204    fSamplingFrequency=300;
     
    931933    if (fFormatVersion>10)
    932934        *fLog << "Header sizes: " << fHeaderSizeRun << "b (run), " << fHeaderSizeEvt << "b (evt), " << fHeaderSizeCrate << "b (crate)" << endl;
    933     if (fFormatVersion>5)
    934         *fLog << "Telescope:    " << fTelescopeNumber << endl;
     935    if (fRunNumber>0)
     936    {
     937        if (fFormatVersion>5)
     938            *fLog << "Telescope:    " << fTelescopeNumber << endl;
     939        *fLog << "RunNumber:    " << fRunNumber;
     940        if (fFormatVersion>10)
     941            *fLog << "/" << fFileNumber << " (id=" << GetFileID() << ")";
     942        *fLog << " (Type=" << GetRunTypeStr() << ")" << endl;
     943    }
    935944    if (fFormatVersion>7)
    936945    {
     
    945954        *fLog << ")" << endl;
    946955    }
    947     *fLog << "RunNumber:    " << fRunNumber;
    948     if (fFormatVersion>10)
    949         *fLog << "/" << fFileNumber << " (id=" << GetFileID() << ")";
    950     *fLog << " (Type=" << GetRunTypeStr() << ")" << endl;
    951956    *fLog << "ProjectName: '" << fProjectName << "'" << endl;
    952957    if (fFormatVersion>5)
     
    11961201// Monte Carlo Interface
    11971202//
    1198 //  Set run-type, telescope number, run-number and file-number
    1199 //
    1200 void MRawRunHeader::SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file)
    1201 {
    1202     fRunType         = type;
     1203//  Set telescope number, run-number and file-number
     1204//
     1205void MRawRunHeader::SetRunInfo(UShort_t tel, UInt_t run, UInt_t file)
     1206{
    12031207    fTelescopeNumber = tel;
    12041208    fRunNumber       = run;
     
    12121216//  Set source-name, epoch (default J) and date (default 2000)
    12131217//
    1214 void MRawRunHeader::SetSourceInfo(const char src[80], char epoch, UShort_t date)
    1215 {
    1216     memcpy(fSourceName, src, 80);
     1218void MRawRunHeader::SetSourceInfo(const TString src, char epoch, UShort_t date)
     1219{
     1220    strncpy(fSourceName, src.Data(), 80);
    12171221
    12181222    fSourceEpochChar[0] = epoch;     // epoch char of the source
    1219     fSourceEpochChar[1] = 0;         // epoch char of the source
    1220 
    1221     fSourceEpochDate = date;         // epoch date of the source
     1223    fSourceEpochDate    = date;      // epoch date of the source
    12221224}
    12231225
     
    12401242//  Set project name and observation mode
    12411243//
    1242 void MRawRunHeader::SetObservation(const char mode[60], const char proj[100])
    1243 {
    1244     memcpy(fProjectName,     proj, 100);
    1245     memcpy(fObservationMode, mode,  60);
     1244void MRawRunHeader::SetObservation(const TString mode, const TString proj)
     1245{
     1246    strncpy(fProjectName,     proj.Data(), 100);
     1247    strncpy(fObservationMode, mode.Data(),  60);
    12461248}
    12471249
  • trunk/MagicSoft/Mars/msimreflector/MReflector.cc

    r9277 r9313  
    3737#include <TClass.h>
    3838#include <TSystem.h>
     39#include <TEllipse.h>
    3940
    4041#include "MQuaternion.h"
     
    4344#include "MLog.h"
    4445#include "MLogManip.h"
     46
     47#include "MH.h"
    4548
    4649ClassImp(MReflector);
     
    254257// --------------------------------------------------------------------------
    255258//
     259// Print the collection of mirrors
     260//
     261void MReflector::Print(Option_t *o) const
     262{
     263    *fLog << all << GetDescriptor() << " (" << GetNumMirrors() << "): " << endl;
     264
     265    fMirrors.Print(o);
     266}
     267
     268// --------------------------------------------------------------------------
     269//
    256270// Paint the collection of mirrors
    257271//
    258272void MReflector::Paint(Option_t *o)
    259273{
     274    if (!TString(o).Contains("same", TString::kIgnoreCase))
     275        MH::SetPadRange(-fMaxR*1.01, -fMaxR*1.01, fMaxR*1.01, fMaxR*1.01);
     276
    260277    fMirrors.Paint(o);
    261     /*
    262     TIter Next(&fMirrors);
    263     MMirror *m = 0;
    264 
    265     while ((m=static_cast<MMirror*>(Next())))
    266         m->Paint(o);*/
     278
     279    TEllipse e;
     280    e.SetFillStyle(0);
     281    e.SetLineColor(17);
     282    e.PaintEllipse(0, 0, fMaxR, fMaxR, 0, 360, 0);
    267283}
    268284
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc

    r9312 r9313  
    5252#include "MMcEvtBasic.h"
    5353
     54#include "MString.h"
     55
    5456#include "MLog.h"
    5557#include "MLogManip.h"
     
    124126    fTelescopeTheta = fTThet;
    125127}
     128
     129TString MMcEvtBasic::GetParticleName(Int_t id)
     130{
     131    switch (id)
     132    {
     133    case kUNDEFINED:  return "Undefined";
     134    case kGAMMA:      return "Gamma";
     135    case kPOSITRON:   return "Positron";
     136    case kELECTRON:   return "Electron";
     137    case kANTIMUON:   return "Anti-Muon";
     138    case kMUON:       return "Muon";
     139    case kPI0:        return "Pi-0";
     140    case kNEUTRON:    return "Neutron";
     141    case kPROTON:     return "Proton";
     142    case kHELIUM:     return "Helium";
     143    case kOXYGEN:     return "Oxygen";
     144    case kIRON:       return "Iron";
     145    case kArtificial: return "Artificial";
     146    case kNightSky:   return "NightSky";
     147    }
     148
     149    return MString::Format("Id:%d", id);
     150}
     151
     152TString MMcEvtBasic::GetParticleSymbol(Int_t id)
     153{
     154    switch (id)
     155    {
     156    case kUNDEFINED:return "N/A";
     157    case kGAMMA:    return "\\gamma";
     158    case kPOSITRON: return "e^{+}";
     159    case kELECTRON: return "e^{-}";
     160    case kANTIMUON: return "\\mu^{+}";
     161    case kMUON:     return "\\mu^{-}";
     162    case kPI0:      return "\\pi^{0}";
     163    case kNEUTRON:  return "n";
     164    case kPROTON:   return "p";
     165    case kHELIUM:   return "He";
     166    case kOXYGEN:   return "O";
     167    case kIRON:     return "Fe";
     168    case kNightSky: return "\\gamma_{NSB}";
     169    }
     170
     171    return MString::Format("Id:%d", id);
     172}
     173
     174TString MMcEvtBasic::GetEnergyStr(Float_t e)
     175{
     176    if (e>=1000)
     177        return MString::Format("%.1fTeV", e/1000);
     178
     179    if (e>=10)
     180        return MString::Format("%dGeV", (Int_t)(e+.5));
     181
     182    if (e>=1)
     183        return MString::Format("%.1fGeV", e);
     184
     185    return MString::Format("%dMeV", (Int_t)(e*1000+.5));
     186}
     187
    126188
    127189// --------------------------------------------------------------------------
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h

    r9312 r9313  
    5151  Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
    5252
    53   static TString GetParticleName(Int_t id)
    54   {
    55       switch (id)
    56       {
    57       case kUNDEFINED:  return "Undefined";
    58       case kGAMMA:      return "Gamma";
    59       case kPOSITRON:   return "Positron";
    60       case kELECTRON:   return "Electron";
    61       case kANTIMUON:   return "Anti-Muon";
    62       case kMUON:       return "Muon";
    63       case kPI0:        return "Pi-0";
    64       case kNEUTRON:    return "Neutron";
    65       case kPROTON:     return "Proton";
    66       case kHELIUM:     return "Helium";
    67       case kOXYGEN:     return "Oxygen";
    68       case kIRON:       return "Iron";
    69       case kArtificial: return "Artificial";
    70       case kNightSky:   return "NightSky";
    71       }
    72 
    73       return Form("Id:%d", id);
    74   }
    75 
    76   static TString GetParticleSymbol(Int_t id)
    77   {
    78       switch (id)
    79       {
    80       case kUNDEFINED:return "N/A";
    81       case kGAMMA:    return "\\gamma";
    82       case kPOSITRON: return "e^{+}";
    83       case kELECTRON: return "e^{-}";
    84       case kANTIMUON: return "\\mu^{+}";
    85       case kMUON:     return "\\mu^{-}";
    86       case kPI0:      return "\\pi^{0}";
    87       case kNEUTRON:  return "n";
    88       case kPROTON:   return "p";
    89       case kHELIUM:   return "He";
    90       case kOXYGEN:   return "O";
    91       case kIRON:     return "Fe";
    92       case kNightSky: return "\\gamma_{NSB}";
    93       }
    94 
    95       return Form("Id:%d", id);
    96   }
    97 
    98   static TString GetEnergyStr(Float_t e)
    99   {
    100       if (e>=1000)
    101           return Form("%.1fTeV", e/1000);
    102 
    103       if (e>=10)
    104           return Form("%dGeV", (Int_t)(e+.5));
    105 
    106       if (e>=1)
    107           return Form("%.1fGeV", e);
    108 
    109       return Form("%dMeV", (Int_t)(e*1000+.5));
    110   }
     53  static TString GetParticleName(Int_t id);
     54  static TString GetParticleSymbol(Int_t id);
     55  static TString GetEnergyStr(Float_t e);
    11156
    11257  TString GetParticleSymbol() const
Note: See TracChangeset for help on using the changeset viewer.