Changeset 2899


Ignore:
Timestamp:
01/23/04 20:02:02 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2896 r2899  
    1010   * mcalib/MCalibrate.cc, manalysis/MExtractSignal.cc
    1111     - Added support (using AddSerialNumber) for stereo MC files.
     12
     13
    1214
    1315 2004/01/23: Thomas Bretz
     
    4042   * mhist/MHCamera.[h,cc]:
    4143     - removed obsolete member function SetPix
     44
     45   * mbase/MStatusDisplay.[h,cc]:
     46     - added EventInfo member function
     47     - implemented preliminary redirection of GetObjectInfo to
     48       StatusLine2 -> An own status line for this is missing
     49
     50   * manalysis/MExtractSignal.[h,cc]:
     51     - implemented StreamPrimitive
     52     - changed deafults to be static const data members
     53     
     54   * manalysis/MGeomApply.[h,cc]:
     55     - implemented StreamPrimitive
    4256
    4357
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2896 r2899  
    1616!
    1717!
    18 !   Author(s): Markus Gaug  09/2003 <mailto:markus@ifae.es>
    19 !
    20 !   Copyright: MAGIC Software Development, 2000-2001
     18!   Author(s): Markus Gaug, 09/2003 <mailto:markus@ifae.es>
     19!
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    2424
    2525//////////////////////////////////////////////////////////////////////////////
    26 //                                                                          //
    27 //   MExtractSignal                                                         //
    28 //                                                                          //
     26//
     27//   MExtractSignal
     28//
    2929//////////////////////////////////////////////////////////////////////////////
    30 
    3130#include "MExtractSignal.h"
     31
     32#include <fstream>
     33
     34#include "MLog.h"
     35#include "MLogManip.h"
     36
     37#include "MParList.h"
     38#include "MGeomCam.h"
     39
     40#include "MRawEvtData.h"
     41#include "MRawEvtPixelIter.h"
     42
     43#include "MPedestalCam.h"
     44#include "MPedestalPix.h"
    3245
    3346#include "MExtractedSignalCam.h"
    3447#include "MExtractedSignalPix.h"
    3548
    36 #include "MPedestalCam.h"
    37 #include "MPedestalPix.h"
    38 
    39 #include "MGeomCam.h"
    40 
    41 #include "MLog.h"
    42 #include "MLogManip.h"
    43 
    44 #include "MParList.h"
    45 
    46 #include "MRawEvtData.h"
    47 #include "MRawEvtPixelIter.h"
    48 
    49 #include "TMath.h"
    50 
    5149ClassImp(MExtractSignal);
    5250
    5351using namespace std;
     52
     53const Byte_t MExtractSignal::fgSaturationLimit = 254;
     54const Byte_t MExtractSignal::fgFirst =  3;
     55const Byte_t MExtractSignal::fgLast  = 10;
     56
    5457// --------------------------------------------------------------------------
    5558//
     
    5760//
    5861MExtractSignal::MExtractSignal(const char *name, const char *title)
    59   : fSaturationLimit(254)
     62  : fSaturationLimit(fgSaturationLimit)
    6063{
    6164
     
    240243    return kTRUE;
    241244}
     245
     246// --------------------------------------------------------------------------
     247//
     248// Implementation of SavePrimitive. Used to write the call to a constructor
     249// to a macro. In the original root implementation it is used to write
     250// gui elements to a macro-file.
     251//
     252void MExtractSignal::StreamPrimitive(ofstream &out) const
     253{
     254    out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
     255    out << "\"" << fName << "\", \"" << fTitle << "\");" << endl;
     256
     257    if (fSaturationLimit!=fgSaturationLimit)
     258    {
     259        out << "   " << GetUniqueName() << ".SetSaturationLimit(";
     260        out << (int)fSaturationLimit << ");" << endl;
     261    }
     262
     263    const Bool_t arg4 = fNumLoGainSamples+fLoGainFirst-1 != fgLast;
     264    const Bool_t arg3 = arg4 || fLoGainFirst != fgFirst;
     265    const Bool_t arg2 = arg3 || fNumHiGainSamples+fHiGainFirst-1 != fgLast;
     266    const Bool_t arg1 = arg2 || fHiGainFirst != fgFirst;
     267
     268    if (!arg1)
     269        return;
     270
     271    out << "   " << GetUniqueName() << ".SetRange(";
     272    out << (int)fLoGainFirst;
     273    if (arg2)
     274    {
     275        out << ", " << (int)(fNumHiGainSamples+fHiGainFirst-1);
     276        if (arg3)
     277        {
     278            out << ", " << (int)fLoGainFirst;
     279            if (arg4)
     280                out << ", " << (int)(fNumLoGainSamples+fLoGainFirst-1);
     281        }
     282    }
     283    out << ");" << endl;
     284}
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.h

    r2797 r2899  
    2424{
    2525private:
     26    static const Byte_t fgSaturationLimit;
     27    static const Byte_t fgFirst;
     28    static const Byte_t fgLast;
    2629
    27   MPedestalCam             *fPedestals;    // Pedestals of all pixels in the camera
    28   MExtractedSignalCam      *fSignals;      // Extracted signal of all pixels in the camera
     30    MPedestalCam             *fPedestals;    // Pedestals of all pixels in the camera
     31    MExtractedSignalCam      *fSignals;      // Extracted signal of all pixels in the camera
    2932
    30   MRawEvtData              *fRawEvt;       // raw event data (time slices)
    31   MRawRunHeader            *fRunHeader;    // RunHeader information
     33    MRawEvtData              *fRawEvt;       // raw event data (time slices)
     34    MRawRunHeader            *fRunHeader;    // RunHeader information
    3235
    33   Byte_t fHiGainFirst;
    34   Byte_t fLoGainFirst;
     36    Byte_t fHiGainFirst;
     37    Byte_t fLoGainFirst;
    3538
    36   Byte_t fNumHiGainSamples;
    37   Byte_t fNumLoGainSamples;
     39    Byte_t fNumHiGainSamples;
     40    Byte_t fNumLoGainSamples;
    3841
    39   Float_t fSqrtHiGainSamples;
    40   Float_t fSqrtLoGainSamples;
     42    Float_t fSqrtHiGainSamples;
     43    Float_t fSqrtLoGainSamples;
    4144
    42   Byte_t  fSaturationLimit;
     45    Byte_t  fSaturationLimit;
    4346
    44   Bool_t ReInit(MParList *pList);
    45   Int_t  PreProcess(MParList *pList);
    46   Int_t  Process();
    47  
     47    Bool_t ReInit(MParList *pList);
     48    Int_t  PreProcess(MParList *pList);
     49    Int_t  Process();
     50    void   StreamPrimitive(ofstream &out) const;
     51
    4852public:
     53    MExtractSignal(const char *name=NULL, const char *title=NULL);
    4954
    50   MExtractSignal(const char *name=NULL, const char *title=NULL);
     55    void SetRange(Byte_t hifirst=fgFirst, Byte_t hilast=fgLast, Byte_t lofirst=fgFirst, Byte_t lolast=fgLast);
     56    void SetSaturationLimit(Byte_t lim) { fSaturationLimit = lim; }
    5157
    52   void SetRange(Byte_t hifirst=3, Byte_t hilast=10, Byte_t lofirst=3, Byte_t lolast=10);
    53   void SetSaturationLimit(Byte_t lim)      { fSaturationLimit = lim; }
    54 
    55   ClassDef(MExtractSignal, 0) // Task to fill the Extracted Signal Containers from raw data
     58    ClassDef(MExtractSignal, 0) // Task to fill the Extracted Signal Containers from raw data
    5659};
    5760
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.cc

    r2749 r2899  
    1818!   Author(s): Thomas Bretz, 09/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    4949//////////////////////////////////////////////////////////////////////////////
    5050#include "MGeomApply.h"
     51
     52#include <fstream>
    5153
    5254#include "MLog.h"
     
    134136    return kTRUE;
    135137}
     138
     139// --------------------------------------------------------------------------
     140//
     141// Implementation of SavePrimitive. Used to write the call to a constructor
     142// to a macro. In the original root implementation it is used to write
     143// gui elements to a macro-file.
     144//
     145void MGeomApply::StreamPrimitive(ofstream &out) const
     146{
     147    out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
     148    out << "\"" << fName << "\", \"" << fTitle << "\");" << endl;
     149
     150    if (fGeomName.IsNull())
     151        return;
     152
     153    out << "   " << GetUniqueName() << ".SetGeometry(\"";
     154    out << fGeomName << "\");" << endl;
     155}
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.h

    r2438 r2899  
    77
    88class MParList;
    9 class MGeomCam;
    109
    1110class MGeomApply : public MTask
    1211{
    1312private:
    14     const MGeomCam *fGeom;
    15     TString   fGeomName;
     13    TString fGeomName; // Name of geometry class
    1614
    1715    Int_t  PreProcess(MParList *plist);
    1816    Bool_t ReInit(MParList *pList);
     17    void   StreamPrimitive(ofstream &out) const;
    1918
    2019public:
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r2898 r2899  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz, 4/2003 <mailto:tbretz@astro-uni-wuerzburg.de>
     18!   Author(s): Thomas Bretz, 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2003
     20!   Copyright: MAGIC Software Development, 2003-2004
    2121!
    2222!
Note: See TracChangeset for help on using the changeset viewer.