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

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.