Changeset 2440


Ignore:
Timestamp:
10/29/03 13:35:42 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2438 r2440  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3  2003/10/29: Thomas Bretz
     4 
     5   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     6     - removed MMcPedestalRead
     7
     8   * manalysis/MMcPedestalCopy.[h,cc]:
     9     - merged functionality of MMcPedestalRead into it
     10     - do not remove itself from the tasklist, but check
     11       the file type for each file again.
     12       
     13   * manalysis/MMcPedestalNSBAdd.cc:
     14     - don't do something if camera file version is < 0.7
     15     - do not remove itself from the tasklist, but check
     16       the file type for each file again.
     17     
     18   * mgui/MCamEvent.cc:
     19     - added a comment
     20     
     21   * mimage/MHillasCalc.[h,cc]:
     22     - replaced the fixed size array fErrors by a dynamic size array
     23       (TArrayC) to make sure, that people get a warning on the
     24       screen if the reprogram the error handling and write
     25       into an unallowed index.
     26
     27
    228
    329  2003/10/28: Thomas Bretz
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r2437 r2440  
    88#pragma link C++ class MCerPhotEvt+;
    99#pragma link C++ class MCerPhotAnal+;
     10#pragma link C++ class MCerPhotAnal2+;
    1011#pragma link C++ class MCerPhotCalc+;
     12
     13//#pragma link C++ class MRelSignal+;
    1114
    1215#pragma link C++ class MBlindPixels+;
     
    5760#pragma link C++ class MMinuitInterface+;
    5861#pragma link C++ class MFiltercutsCalc+;
    59 #pragma link C++ class MMcPedestalRead+;
    60 
    6162
    6263#endif
    63 
    64 
    65 
    66 
    67 
    68 
    69 
    70 
    71 
    72 
    73 
    74 
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r2399 r2440  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //  MMcPedestalCopy                                                        //
    28 //                                                                         //
    29 //  This task looks for the ìnformation about FADC pedestals in            //
    30 //  MMcFadcHeader and translates it to the pedestal values in              //
    31 //  MPedestalCam                                                           //
    32 //                                                                         //
    33 //  Input Containers:                                                      //
    34 //   MMcFadcHeader                                                         //
    35 //                                                                         //
    36 //  Output Containers:                                                     //
    37 //   MPedestalCam                                                          //
    38 //                                                                         //
     26//
     27//  MMcPedestalCopy
     28//
     29//  This task looks for the ìnformation about FADC pedestals in
     30//  MMcFadcHeader and translates it to the pedestal values in
     31//  MPedestalCam
     32//
     33//  Input Containers:
     34//   MMcFadcHeader
     35//
     36//  Output Containers:
     37//   MPedestalCam
     38//
    3939/////////////////////////////////////////////////////////////////////////////
    40 
    4140#include "MMcPedestalCopy.h"
    4241
     
    5049
    5150#include "MRawRunHeader.h"
     51#include "MMcRunHeader.hxx"
    5252#include "MMcFadcHeader.hxx"
    5353
     
    8989// --------------------------------------------------------------------------
    9090//
    91 // Check runtype and search for MPedestalCam and MMcFadcHeader.
    92 // If the runtype check fails the task is removed from the task list.
     91// Search for MPedestalCam and MMcFadcHeader.
    9392//
    9493Int_t MMcPedestalCopy::PreProcess(MParList *pList)
    9594{
    96     if (!CheckRunType(pList))
    97     {
    98         *fLog << warn << dbginf << " MMcPedestalCopy is for Monte Carlo files only... ";
    99         *fLog << "removing task from list." << endl;
    100         return kSKIP;
    101     }
     95    fMcRun = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     96    if (!fMcRun)
     97        *fLog << warn << dbginf << "MMcRunHeader not found... assuming camera<0.7" << endl;
    10298
    10399    fPedCam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     
    108104    if (!fMcPed)
    109105    {
    110         *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl;
     106        *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
    111107        return kFALSE;
    112108    }
     
    128124    const int num = fPedCam->GetSize();
    129125
     126    const Bool_t camver70 = fMcRun && fMcRun->GetCamVersion()>=70;
     127
    130128    for (int i=0; i<num; i++)
    131129    {
     
    136134
    137135        const Float_t pedest = fMcPed->GetPedestal(i);
    138         //const Float_t pedrms = pedest/sqrt((float)num);
     136        const Float_t sigma  = camver70 ? fMcPed->GetPedestalRmsHigh(i) : fMcPed->GetElecNoise(i);
    139137
    140         const Float_t sigma  = fMcPed->GetElecNoise(i);
    141         //const Float_t sigrms = sigma/sqrt(num*2.);
    142 
    143         //pix.SetPedestalRms(pedrms, sigrms);
    144138        pix.Set(pedest, sigma);
    145139    }
    146140
     141    if (camver70)
     142        fPedCam->SetReadyToSave();
     143
    147144    return kTRUE;
    148145}
    149 
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.h

    r2206 r2440  
    77
    88class MMcFadcHeader;
     9class MMcRunHeader;
    910class MPedestalCam;
    1011
     
    1314private:
    1415    const MMcFadcHeader *fMcPed;
     16    const MMcRunHeader  *fMcRun;
     17
    1518    MPedestalCam *fPedCam;
    1619
    1720    Bool_t CheckRunType(MParList *pList) const;
    1821
    19     Int_t PreProcess(MParList *pList);
     22    Int_t  PreProcess(MParList *pList);
    2023    Bool_t ReInit(MParList *pList);
    2124
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r2377 r2440  
    111111// --------------------------------------------------------------------------
    112112//
     113// Check for the camera version. This class should not be used with
     114// camera files >= 0.7
     115//
     116Bool_t MMcPedestalNSBAdd::CheckCamVersion(MParList *pList) const
     117{
     118    const MMcRunHeader *run = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     119    if (!run)
     120        *fLog << warn << dbginf << "MMcRunHeader not found... assuming camera<0.7" << endl;
     121
     122    return !run || run->GetCamVersion()<70;
     123}
     124
     125// --------------------------------------------------------------------------
     126//
    113127// - check whether we have a monte carlo file. if not skip this task
    114128// - try to get MMcFadcHeader, MGeomCam and MPedestalCam from the parameter
     
    118132Int_t MMcPedestalNSBAdd::PreProcess(MParList *pList)
    119133{
    120     if (!CheckRunType(pList))
    121     {
    122         *fLog << warn << dbginf << "Warning - MMcPedestalNSB is for Monte Carlo files only... removing this task from list." << endl;
    123         return kSKIP;
    124     }
    125 
    126134    fFadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    127135    if (!fFadc)
     
    141149    if (!fPedCam)
    142150        return kFALSE;
    143 
    144     const MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
    145     if (!mcrunheader && fDnsbPixel<0)
    146     {
    147         *fLog << err << dbginf << "Using the default argument only ";
    148         *fLog << "allowed if MMcRunHeader is available... aborting." << endl;
    149         return kFALSE;
    150     }
    151151
    152152    return kTRUE;
     
    202202        return kFALSE;
    203203
     204    if (!CheckCamVersion(pList))
     205        return kTRUE;
     206
    204207    const Float_t dnsbpix = GetDnsb(pList) * 50.0/15.0;
    205208
     
    220223    }
    221224
     225    fPedCam->SetReadyToSave();
     226
    222227    return kTRUE;
    223228}
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r2437 r2440  
    4949           MCerPhotEvt.cc \
    5050           MCerPhotAnal.cc \
     51           MCerPhotAnal2.cc \
    5152           MCerPhotCalc.cc \
    5253           MPedCalcPedRun.cc \
     
    6667           MMinuitInterface.cc \
    6768           MFiltercutsCalc.cc \
    68            MCT1PadONOFF.cc \
    69            MMcPedestalRead.cc
     69           MCT1PadONOFF.cc
    7070
     71#           MRelSignal.cc \
    7172
    7273SRCS    = $(SRCFILES)
  • trunk/MagicSoft/Mars/mgui/MCamEvent.cc

    r2264 r2440  
    2929// A base class describing an event in the camera.
    3030//
     31// If GetPixelContent returns kFALSE, it must not touch 'val'.
     32//
    3133//////////////////////////////////////////////////////////////////////////////
    3234#include "MCamEvent.h"
    3335
    3436ClassImp(MCamEvent);
    35 
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.cc

    r2209 r2440  
    7777MHillasCalc::MHillasCalc(const char *name, const char *title)
    7878    : fHilName("MHillas"), fHilExtName("MHillasExt"),
    79     fImgParName("MNewImagePar"), fFlags(0xff)
     79    fImgParName("MNewImagePar"), fErrors(5), fFlags(0xff)
    8080{
    8181    fName  = name  ? name  : "MHillasCalc";
     
    135135    }
    136136
    137     memset(fErrors, 0, sizeof(fErrors));
     137    memset(fErrors.GetArray(), 0, sizeof(Char_t)*fErrors.GetSize());
    138138
    139139    return kTRUE;
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.h

    r2209 r2440  
    1212#ifndef MARS_MTask
    1313#include "MTask.h"
     14#endif
     15#ifndef ROOT_TArrayC
     16#include <TArrayC.h>
    1417#endif
    1518
     
    3336    TString      fImgParName;
    3437
    35     Int_t        fErrors[5];
     38    TArrayC      fErrors;
    3639
    3740    Int_t        fFlags;
Note: See TracChangeset for help on using the changeset viewer.