Changeset 2470 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
11/04/03 17:08:27 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
1 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2469 r2470  
    8484   * mraw/MRawFileWrite.cc:
    8585     - automatically add .root extension
     86
     87   * star.cc:
     88     - added
    8689
    8790
  • trunk/MagicSoft/Mars/Makefile

    r2263 r2470  
    2020#
    2121
    22 PROGRAMS = readraw merpp mars
     22PROGRAMS = readraw merpp star mars
    2323SOLIB    = mars.so
    2424CINT     = M
  • trunk/MagicSoft/Mars/macros/star.C

    r2423 r2470  
    4747    plist.AddToList(&tlist);
    4848
    49     MSrcPosCam src;
    50     src.SetReadyToSave();
    51     plist.AddToList(&src);
    52 
    5349    //
    5450    // Now setup the tasks and tasklist:
     
    7672    // ------------- user change -----------------
    7773    MWriteRootFile write("starfile.root");
    78     write.AddContainer("MMcEvt",        "Events");
    79     write.AddContainer("MSigmabar",     "Events");
    80     write.AddContainer("MHillas",       "Events");
    81     write.AddContainer("MHillasExt",    "Events");
    82     write.AddContainer("MHillasSrc",    "Events");
    83     write.AddContainer("MNewImagePar",  "Events");
    84     write.AddContainer("MRawRunHeader", "RunHeaders");
    85     write.AddContainer("MMcRunHeader",  "RunHeaders");
    86     write.AddContainer("MSrcPosCam",    "RunHeaders");
    8774
    8875    tlist.AddToList(&read);
     
    9784    tlist.AddToList(&scalc);
    9885    tlist.AddToList(&write);
     86
     87    // ------------- user change -----------------
     88    // You may use the "UPDATE" option in the constructor
     89    // of MWriteRootFile to update an existing file.
     90    //
     91    // tlist.SetSerialNumber(1); // Serial number of telescope
     92
     93    write.AddContainer(write.AddSerialNumber("MMcEvt"),       "Events");
     94    write.AddContainer(write.AddSerialNumber("MSigmabar"),    "Events");
     95    write.AddContainer(write.AddSerialNumber("MHillas"),      "Events");
     96    write.AddContainer(write.AddSerialNumber("MHillasExt"),   "Events");
     97    write.AddContainer(write.AddSerialNumber("MHillasSrc"),   "Events");
     98    write.AddContainer(write.AddSerialNumber("MNewImagePar"), "Events");
     99    write.AddContainer(write.AddSerialNumber("MSrcPosCam"),   "RunHeaders");
     100    write.AddContainer("MRawRunHeader", "RunHeaders");
     101    write.AddContainer("MMcRunHeader",  "RunHeaders");
    99102
    100103    //
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc

    r2377 r2470  
    5959//
    6060//  Input Containers:
    61 //   MCerPhotEvt[, MBlindPixels]
     61//   MCerPhotEvt
     62//   [MBlindPixels]
    6263//
    6364//  Output Containers:
    64 //   MCerPhotEvt, MBlindPixels
     65//   MCerPhotEvt
     66//   MBlindPixels
    6567//
    6668/////////////////////////////////////////////////////////////////////////////
     
    112114{
    113115    if (TESTBIT(fFlags, kUseBlindPixels))
    114         fPixels = (MBlindPixels*)pList->FindObject("MBlindPixels");
     116        fPixels = (MBlindPixels*)pList->FindObject(AddSerialNumber("MBlindPixels"));
    115117    else
    116         fPixels = (MBlindPixels*)pList->FindCreateObj("MBlindPixels");
     118        fPixels = (MBlindPixels*)pList->FindCreateObj(AddSerialNumber("MBlindPixels"));
    117119    if (!fPixels)
    118120        return kFALSE;
    119121   
    120     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     122    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
    121123    if (!fEvt)
    122124    {
     
    124126        return kFALSE;
    125127    }
    126     fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
     128    fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    127129    if (!fEvt)
    128130    {
     
    131133    }
    132134
    133     fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
     135    fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    134136    if (!fGeomCam)
    135137        *fLog << warn << dbginf << "No camera geometry available... can't use interpolation." << endl;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r2424 r2470  
    3535//
    3636//  Input Containers:
    37 //   MRawRunHeader, MRawEvtData, MPedestalCam
     37//   MRawEvtData
     38//   MPedestalCam
     39//   [MRawRunHeader]
    3840//
    3941//  Output Containers:
     
    99101    }
    100102
    101     fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
     103    fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
    102104    if (!fRawEvt)
    103105    {
     
    106108    }
    107109
    108     fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     110    fPedestals = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam"));
    109111    if (!fPedestals)
    110112    {
     
    113115    }
    114116
    115     fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
     117    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt"));
    116118    if (!fCerPhotEvt)
    117119        return kFALSE;
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.cc

    r2438 r2470  
    4444//
    4545//  Output Containers:
    46 //   MPedestalCam, MBlindPixels
     46//   [MPedestalCam]
     47//   [MBlindPixels]
    4748//
    4849//////////////////////////////////////////////////////////////////////////////
     
    7980Int_t MGeomApply::PreProcess(MParList *pList)
    8081{
    81     MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     82    MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    8283    if (cam)
    8384        return kTRUE;
    8485
    85     cam = (MGeomCam*)pList->FindCreateObj(fGeomName, "MGeomCam");
     86    cam = (MGeomCam*)pList->FindCreateObj(AddSerialNumber(fGeomName), "MGeomCam");
    8687
    8788    return cam ? kTRUE : kFALSE;
     
    9798Bool_t MGeomApply::ReInit(MParList *pList)
    9899{
    99     MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     100    MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    100101    if (!cam)
    101102    {
     
    104105    }
    105106
    106     MPedestalCam *ped = (MPedestalCam*)pList->FindObject("MPedestalCam");
     107    MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    107108    if (ped)
    108109        ped->InitSize(cam->GetNumPixels());
    109110
    110     MBlindPixels *bnd = (MBlindPixels*)pList->FindObject("MBlindPixels");
     111    MBlindPixels *bnd = (MBlindPixels*)pList->FindObject(AddSerialNumber("MBlindPixels"));
    111112    if (bnd)
    112113        bnd->InitSize(cam->GetNumPixels());
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r2454 r2470  
    3333//  Input Containers:
    3434//   MMcFadcHeader
     35//   [MMcRunHeader]
     36//   [MRawRunHeader]
    3537//
    3638//  Output Containers:
     
    104106    // to be done only if this is a MC file.
    105107    //
    106     MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     108    MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject(AddSerialNumber("MMcFadcHeader"));
     109    if (!fadc)
     110    {
     111        *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
     112        return kFALSE;
     113    }
     114
     115    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam"));
    107116    if (!pedcam)
    108117        return kFALSE;
     
    111120    if (!mcrun)
    112121        *fLog << warn << dbginf << "MMcRunHeader not found... assuming camera<0.7" << endl;
    113 
    114     MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    115     if (!fadc)
    116     {
    117         *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
    118         return kFALSE;
    119     }
    120122
    121123    const int num = pedcam->GetSize();
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r2454 r2470  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //  MMcPedestalNSBAdd                                                      //
    28 //  -----------------                                                      //
    29 //                                                                         //
    30 //  This Task adds the contribution of the diffuse NSB to the FADC         //
    31 //  pedestals. We assume that NSB introduces larger fluctuation but does   //
    32 //  not change the mean value.                                             //
    33 //  To be precise we add quadratically to the rms, which is already in     //
    34 //  MPedestalCam, the NSB contribution.                                    //
    35 //  The number of photons from the diffuse NSB follows a poisson           //
    36 //  distribution with expected mean value X, then its standard deviation   //
    37 //  is sqrt(X).                                                            //
    38 //  X is the number of phe per ns so we have to convert in FADC counts per //
    39 //  slice:                                                                 //
    40 //                                                                         //
    41 //  Y = sqrt(X * FADC_time / Number_of_slices * pixel_size)                //
    42 //      * Amp_single_phe_response                                          //
    43 //                                                                         //
    44 //  Input Containers:                                                      //
    45 //   MMcFadcHeader                                                         //
    46 //   MMcRunHeader                                                          //
    47 //   MRawRunHeader                                                         //
    48 //                                                                         //
    49 //  Output Containers:                                                     //
    50 //   MPedestalCam                                                          //
    51 //                                                                         //
     26//
     27//  MMcPedestalNSBAdd
     28//  -----------------
     29//
     30//  This Task adds the contribution of the diffuse NSB to the FADC
     31//  pedestals. We assume that NSB introduces larger fluctuation but does
     32//  not change the mean value.
     33//  To be precise we add quadratically to the rms, which is already in
     34//  MPedestalCam, the NSB contribution.
     35//  The number of photons from the diffuse NSB follows a poisson
     36//  distribution with expected mean value X, then its standard deviation
     37//  is sqrt(X).
     38//  X is the number of phe per ns so we have to convert in FADC counts per
     39//  slice:
     40//
     41//  Y = sqrt(X * FADC_time / Number_of_slices * pixel_size)
     42//      * Amp_single_phe_response
     43//
     44//  Input Containers:
     45//   MMcFadcHeader
     46//   MRawRunHeader
     47//   [MMcRunHeader]
     48//
     49//  Output Containers:
     50//   MPedestalCam
     51//
    5252/////////////////////////////////////////////////////////////////////////////
    5353#include "MMcPedestalNSBAdd.h"
     
    186186    // is correct.
    187187    //
    188     MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     188    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam"));
    189189    if (!pedcam)
    190190        return kFALSE;
    191191
    192     MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     192    MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject(AddSerialNumber("MMcFadcHeader"));
    193193    if (!fadc)
    194194    {
     
    197197    }
    198198
    199     MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
     199    MGeomCam *geom = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    200200    if (!geom)
    201201    {
  • trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc

    r2209 r2470  
    2525
    2626/////////////////////////////////////////////////////////////////////////////
    27 //                                                                         //
    28 //  MSigmabarCalc                                                          //
    29 //                                                                         //
    30 //  This task calculates Sigmabar using the MSigmabar container and stores //
    31 //  its extremal values together with the corresponding Theta values       //
    32 //  in MSigmabarParam. For the time being, Theta is taken from a Monte     //
    33 //  Carlo container. This is preliminary and to be changed ASAP.           //
    34 //                                                                         //
     27//
     28//  MSigmabarCalc
     29//
     30//  This task calculates Sigmabar using the MSigmabar container and stores
     31//  its extremal values together with the corresponding Theta values       
     32//  in MSigmabarParam. For the time being, Theta is taken from a Monte
     33//  Carlo container. This is preliminary and to be changed ASAP.
     34//
     35//  Input Containers:
     36//   MGeomCam
     37//   MPedestalCam
     38//   MRawRunHeader
     39//   MMcEvt  (FIXME: Must be replaced by a 'real-data' container)
     40//   MCerPhotEvt
     41//
     42//  Output Containers:
     43//   MSigmabar
     44//   MSigmabarParam
     45//
    3546/////////////////////////////////////////////////////////////////////////////
    3647#include "MSigmabarCalc.h"
     
    7283Int_t MSigmabarCalc::PreProcess(MParList *pList)
    7384{
    74     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
     85    fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    7586    if (!fCam)
    7687    {
     
    7990    }
    8091
    81     fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
     92    fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    8293    if (!fPed)
    8394    {
     
    94105
    95106    // This is needed for determining min/max Theta
    96     fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     107    fMcEvt = (MMcEvt*)pList->FindObject(AddSerialNumber("MMcEvt"));
    97108    if (!fMcEvt)
    98109    {
     
    102113    }
    103114
    104     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     115    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
    105116    if (!fEvt)
    106117      {
     
    109120      }
    110121
    111     fSig = (MSigmabar*)pList->FindCreateObj("MSigmabar");
     122    fSig = (MSigmabar*)pList->FindCreateObj(AddSerialNumber("MSigmabar"));
    112123    if (!fSig)
    113124        return kFALSE;
    114125
    115     fSigParam = (MSigmabarParam*)pList->FindCreateObj("MSigmabarParam");
     126    // FIXME: This might have to change in a
     127    //        'more-than-one-telescope-environment'
     128    fSigParam = (MSigmabarParam*)pList->FindCreateObj(AddSerialNumber("MSigmabarParam"));
    116129    if (!fSigParam)
    117130        return kFALSE;
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r2416 r2470  
    163163// --------------------------------------------------------------------------
    164164//
     165// Returns the name of the object. If the name of the object is not the
     166// class name it returns the object name and in []-brackets the class name.
     167//
     168const char *MParContainer::GetDescriptor() const
     169{
     170    //
     171    // Because it returns a (const char*) we cannot return a casted
     172    // local TString. The pointer would - immediatly after return -
     173    // point to a random memory segment, because the TString has gone.
     174    //
     175    return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName());
     176}
     177
     178// --------------------------------------------------------------------------
     179//
    165180//  Return a unique name for this container. It is created from
    166181//  the container name and the unique Id. (This is mostly used
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r2416 r2470  
    7474    virtual void        FillBuffer(char *&buffer);
    7575
    76     virtual const char   *GetDescriptor() const { return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName()); }
     76    virtual const char   *GetDescriptor() const;
    7777    virtual const TString GetUniqueName() const;
    7878    virtual const char   *GetName() const       { return fName.Data(); }
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r2206 r2470  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //   MTask                                                                 //
    28 //                                                                         //
    29 //   Base class for all tasks which can perfomed in a tasklist             //
    30 //   For each event processed in the eventloop all the different           //
    31 //   tasks in the tasklist will be processed.                              //
    32 //                                                                         //
    33 //   So all tasks must inherit from this baseclass.                        //
    34 //                                                                         //
    35 //   The inheritance from MInputStreamID is used to indicate the           //
    36 //   type of event that this task is for. If it is "All" it is executed    //
    37 //   independantly of the actual ID of the task list.                      //
    38 //                                                                         //
    39 //   Inside this abstract class, there are three fundamental function:     //
    40 //                                                                         //
    41 //   - PreProcess():   executed before the eventloop starts. Here you      //
    42 //                     can initiate different things, open files, etc.     //
    43 //                     As an argument this function gets a pointer to the  //
    44 //                     parameter list. You can stop the execution by       //
    45 //                     returning kFALSE instead of kTRUE. If an error      //
    46 //                     occured and you return kFALSE make sure, that       //
    47 //                     any action is closed correctly and all newly        //
    48 //                     created object are deleted. The PostProcess in      //
    49 //                     such a case won't be executed by the Tasklist or    //
    50 //                     Eventloop.                                          //
    51 //                                                                         //
    52 //   - Process():      executed for each event in the eventloop. Do it     //
    53 //                     one task after the other (as they occur in the      //
    54 //                     tasklist). Only the tasks with a Stream ID          //
    55 //                     which matches the actual ID of the tasklist         //
    56 //                     are executed. A task can return kFALSE to           //
    57 //                     stop the execuition of the tasklist or              //
    58 //                     kCONTINUE to skip the pending tasks. If you want    //
    59 //                     to stop the eventloop and wants the eventloop to    //
    60 //                     return the status 'failed' return kERROR.           //
    61 //                                                                         //
    62 //   - PostProcess():  executed after the eventloop. Here you can close    //
    63 //                     output files, start display of the run parameter,   //
    64 //                     etc. PostProcess is only executed in case of        //
    65 //                     PreProcess was successfull (returned kTRUE)         //
    66 //                                                                         //
     26//
     27//   MTask
     28//
     29//   Base class for all tasks which can perfomed in a tasklist
     30//   For each event processed in the eventloop all the different
     31//   tasks in the tasklist will be processed.
     32//
     33//   So all tasks must inherit from this baseclass.
     34//
     35//   The inheritance from MInputStreamID is used to indicate the
     36//   type of event that this task is for. If it is "All" it is executed
     37//   independantly of the actual ID of the task list.
     38//
     39//   Inside this abstract class, there are three fundamental function:
     40//
     41//   - PreProcess():   executed before the eventloop starts. Here you
     42//                     can initiate different things, open files, etc.
     43//                     As an argument this function gets a pointer to the
     44//                     parameter list. You can stop the execution by
     45//                     returning kFALSE instead of kTRUE. If an error
     46//                     occured and you return kFALSE make sure, that
     47//                     any action is closed correctly and all newly
     48//                     created object are deleted. The PostProcess in
     49//                     such a case won't be executed by the Tasklist or
     50//                     Eventloop.
     51//
     52//   - Process():      executed for each event in the eventloop. Do it
     53//                     one task after the other (as they occur in the
     54//                     tasklist). Only the tasks with a Stream ID
     55//                     which matches the actual ID of the tasklist
     56//                     are executed. A task can return kFALSE to
     57//                     stop the execuition of the tasklist or
     58//                     kCONTINUE to skip the pending tasks. If you want
     59//                     to stop the eventloop and wants the eventloop to
     60//                     return the status 'failed' return kERROR.
     61//
     62//   - PostProcess():  executed after the eventloop. Here you can close
     63//                     output files, start display of the run parameter,
     64//                     etc. PostProcess is only executed in case of
     65//                     PreProcess was successfull (returned kTRUE)
     66//
     67//  Version 1:
     68//  ----------
     69//   - first version
     70//
     71//  Version 2:
     72//  ----------
     73//   - added fSerialNumber
     74//
    6775/////////////////////////////////////////////////////////////////////////////
    6876#include "MTask.h"
     
    286294{
    287295    return kTRUE;
     296}
     297
     298// --------------------------------------------------------------------------
     299//
     300// Returns the name of the object. If the name of the object is not the
     301// class name it returns the object name and in []-brackets the class name.
     302// If a serial number is set (!=0) the serial number is added to the
     303// name (eg. ;1)
     304//
     305const char *MTask::GetDescriptor() const
     306{
     307    //
     308    // Because it returns a (const char*) we cannot return a casted
     309    // local TString. The pointer would - immediatly after return -
     310    // point to a random memory segment, because the TString has gone.
     311    //
     312    if (fName==ClassName())
     313        return fSerialNumber==0 ? ClassName() : Form("%s;%d", ClassName(), fSerialNumber);
     314
     315    return fSerialNumber>0 ?
     316        Form("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) :
     317        Form("%s [%s]", fName.Data(), ClassName());
    288318}
    289319
     
    327357     fFilter->SavePrimitive(out);
    328358     */
    329      out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
     359    out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
     360    if (fSerialNumber>0)
     361        out << "   " << GetUniqueName() << ".SetSerialNumber(" << fSerialNumber <<");" << endl;
    330362}
    331363
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r2454 r2470  
    2525
    2626    MFilter *fFilter;       // Filter for conditional task execution
     27    Byte_t   fSerialNumber; // Serial number having more than one detector of the same type
    2728
    2829    Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList)
     
    6869    const MFilter *GetFilter() const      { return fFilter; }
    6970    MFilter *GetFilter()  { return fFilter; } // for MContinue only
     71
    7072    void SetDisplay(MStatusDisplay *d);
    7173    virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
     74
     75    virtual void SetSerialNumber(Byte_t num) { fSerialNumber = num; }
     76    Byte_t  GetSerialNumber() const { return fSerialNumber; }
     77    TString AddSerialNumber(const char *str) const { TString s(str); if (fSerialNumber==0) return s; s += ";"; s += fSerialNumber; return s; }
     78    TString AddSerialNumber(const TString &str) const { return AddSerialNumber((const char*)str); }
     79
     80    const char *GetDescriptor() const;
    7281
    7382    UInt_t GetNumExecutions() const { return fNumExecutions; }
     
    8594    void SavePrimitive(ofstream &out, Option_t *o="");
    8695
    87     ClassDef(MTask, 1) //Abstract base class for a task
     96    ClassDef(MTask, 2) //Abstract base class for a task
    8897};
    8998
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r2454 r2470  
    145145}
    146146
     147// --------------------------------------------------------------------------
     148//
     149//  Set the display for the all tasks in the list and the tasklist itself.
     150//
    147151void MTaskList::SetDisplay(MStatusDisplay *d)
    148152{
    149153    fTasks->ForEach(MTask, SetDisplay)(d);
    150154    MTask::SetDisplay(d);
     155}
     156
     157// --------------------------------------------------------------------------
     158//
     159//  Set the serial number for the all tasks in the list and the tasklist
     160//  itself.
     161//
     162void MTaskList::SetSerialNumber(Byte_t num)
     163{
     164    fTasks->ForEach(MTask, SetSerialNumber)(num);
     165    MTask::SetSerialNumber(num);
    151166}
    152167
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r2206 r2470  
    4747    Bool_t AddToList(MTask *task, const char *tType="All");
    4848
     49    void SetSerialNumber(Byte_t num);
     50
    4951    Bool_t RemoveFromList(MTask *task);
    5052
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r2296 r2470  
    779779        if (!c) continue;
    780780        if ((*c)->InheritsFrom(MRawEvtData::Class()))
    781             ((MRawEvtData*)(*c))->DeletePixels(kFALSE);
     781            static_cast<MRawEvtData*>(*c)->DeletePixels(kFALSE);
    782782
    783783    }
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r2377 r2470  
    5353static const TString gsDefName  = "MWriteRootFile";
    5454static const TString gsDefTitle = "Task which writes a root-output file";
     55
    5556// --------------------------------------------------------------------------
    5657//
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h

    r2130 r2470  
    8383        kFillTree  = BIT(14),
    8484        // TBranch::kAutoDelete = BIT(15)
    85         kIsNewTree = BIT(16)
     85        // TBranchElement::kDeleteObject = BIT(16)
     86        kIsNewTree = BIT(17)
    8687    };
    8788
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r2463 r2470  
    2424\* ======================================================================== */
    2525
    26 ///////////////////////////////////////////////////////////////////////
     26/////////////////////////////////////////////////////////////////////////////
    2727//
    2828// MGeomCam
     
    3232// interface of how to acccess the geometry information.
    3333//
     34// We use a TObjArray for possible future usage (it is much more flexible
     35// than a TClonesArray so that it can store more types of pixels (eg
     36// fake pixels which are not really existing)
    3437//
    3538// Version 1:
     
    4245//  - added fPixRatioSqrt
    4346//
    44 //
    45 ///////////////////////////////////////////////////////////////////////
     47/////////////////////////////////////////////////////////////////////////////
    4648#include "MGeomCam.h"
    4749
     
    5759using namespace std;
    5860
     61// --------------------------------------------------------------------------
     62//
     63// Default Constructor
     64//
    5965MGeomCam::MGeomCam()
    6066    : fNumPixels(0), fCamDist(0), fConvMm2Deg(0)
     
    6268}
    6369
    64 
    65 
    6670// --------------------------------------------------------------------------
    6771//
     
    8690}
    8791
     92// --------------------------------------------------------------------------
     93//
     94// Returns a reference of the i-th entry (the pixel with the software idx i)
     95// The access is unchecked (for speed reasons!) accesing non existing
     96// entries may crash the program!
     97//
    8898MGeomPix &MGeomCam::operator[](Int_t i)
    8999{
     
    91101}
    92102
     103// --------------------------------------------------------------------------
     104//
     105// Returns a reference of the i-th entry (the pixel with the software idx i)
     106// The access is unchecked (for speed reasons!) accesing non existing
     107// entries may crash the program!
     108//
    93109MGeomPix &MGeomCam::operator[](Int_t i) const
    94110{
     
    208224}
    209225
     226// --------------------------------------------------------------------------
     227//
     228//  Create a clone of this container. This is very easy, because we
     229//  simply have to create a new object of the same type.
     230//
    210231TObject *MGeomCam::Clone(const char *newname) const
    211232{
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.cc

    r2463 r2470  
    4545//
    4646//
    47 // FIXME: According to an agreement we have to change the name 'Id'
    48 //        to 'idx'
     47// FIXME: According to an agreement we have to change the name 'Id' to 'idx'
    4948//
    5049////////////////////////////////////////////////////////////////////////////
     
    127126{
    128127    //   information about a pixel
    129     *fLog << all << "MPixGeom:  x= " << fX
    130         << "  y= " << fY
    131         << "  d= " << fD
    132         << "  A= " << fA
    133         << endl ;
     128    *fLog << all << "MPixGeom:  x= " << fX << "mm  y= " << fY << "mm ";
     129    *fLog << "d= " << fD << "mm  A= " << fA << "mm²" << endl;
    134130}
    135 
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.cc

    r2455 r2470  
    4848//
    4949//  Input Containers:
    50 //   MCerPhotEvt, MGeomCam[, MHillas]
     50//   MCerPhotEvt
     51//   MGeomCam
     52//   [MHillas]
    5153//
    5254//  Output Containers:
    53 //   [MHillas,] MHillasExt, MNewImagePar
     55//   [MHillas]
     56//   MHillasExt
     57//   MNewImagePar
    5458//
    5559/////////////////////////////////////////////////////////////////////////////
     
    9397{
    9498    // necessary
    95     fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     99    fCerPhotEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
    96100    if (!fCerPhotEvt)
    97101    {
     
    101105
    102106    // necessary
    103     fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
     107    fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    104108    if (!fGeomCam)
    105109    {
     
    110114    // depend on whether MHillas is an in- or output container
    111115    if (TestFlag(kCalcHillas))
    112         fHillas = (MHillas*)pList->FindCreateObj("MHillas", fHilName);
     116        fHillas = (MHillas*)pList->FindCreateObj("MHillas", AddSerialNumber(fHilName));
    113117    else
    114118    {
    115         fHillas = (MHillas*)pList->FindObject(fHilName, "MHillas");
     119        fHillas = (MHillas*)pList->FindObject(AddSerialNumber(fHilName), "MHillas");
    116120        *fLog << err << fHilName << " [MHillas] not found... aborting." << endl;
    117121    }
     
    122126    if (TestFlag(kCalcHillasExt))
    123127    {
    124         fHillasExt = (MHillasExt*)pList->FindCreateObj("MHillasExt", fHilExtName);
     128        fHillasExt = (MHillasExt*)pList->FindCreateObj("MHillasExt", AddSerialNumber(fHilExtName));
    125129        if (!fHillasExt)
    126130            return kFALSE;
     
    130134    if (TestFlag(kCalcNewImagePar))
    131135    {
    132         fNewImgPar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", fImgParName);
     136        fNewImgPar = (MNewImagePar*)pList->FindCreateObj("MNewImagePar", AddSerialNumber(fImgParName));
    133137        if (!fNewImgPar)
    134138            return kFALSE;
  • trunk/MagicSoft/Mars/mimage/MHillasSrcCalc.cc

    r2209 r2470  
    2929//
    3030// Task to calculate the source dependant part of the hillas parameters
     31//
     32// FIXME: Merge with MHillasCalc
     33//
     34//  Input Containers:
     35//   MHillas
     36//   [MSrcPosCam]
     37//
     38//  Output Containers:
     39//   MHillasSrc
    3140//
    3241//////////////////////////////////////////////////////////////////////////////
     
    7483Int_t MHillasSrcCalc::PreProcess(MParList *pList)
    7584{
    76     fHillas = (MHillas*)pList->FindObject(fHillasInput, "MHillas");
     85    fHillas = (MHillas*)pList->FindObject(AddSerialNumber(fHillasInput), "MHillas");
    7786    if (!fHillas)
    7887    {
     
    8190    }
    8291
    83     fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
     92    fSrcPos = (MSrcPosCam*)pList->FindObject(AddSerialNumber(fSrcName), "MSrcPosCam");
    8493    if (!fSrcPos)
    8594    {
    86         *fLog << warn << fSrcName << " [MSrcPosCam] not found... creating default MSrcPosCam." << endl;
    87         fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", fSrcName);
     95        *fLog << warn << AddSerialNumber(fSrcName) << " [MSrcPosCam] not found... creating default container." << endl;
     96        fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcName));
    8897        if (!fSrcPos)
    8998            return kFALSE;
    9099    }
    91100
    92     fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", fHillasName);
     101    fHillasSrc = (MHillasSrc*)pList->FindCreateObj("MHillasSrc", AddSerialNumber(fHillasName));
    93102    if (!fHillasSrc)
    94103        return kFALSE;
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r2465 r2470  
    244244//
    245245//  Input Containers:
    246 //   MGeomCam, MCerPhotEvt, MSigmabar
     246//   MGeomCam
     247//   MCerPhotEvt
     248//   [MSigmabar]
    247249//
    248250//  Output Containers:
     
    646648Int_t MImgCleanStd::PreProcess (MParList *pList)
    647649{
    648     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
     650    fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
    649651    if (!fCam)
    650652    {
     
    653655    }
    654656
    655     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     657    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
    656658    if (!fEvt)
    657659    {
     
    662664    if (fCleaningMethod == kDemocratic)
    663665    {
    664         fSgb = (MSigmabar*)pList->FindObject("MSigmabar");
     666        fSgb = (MSigmabar*)pList->FindObject(AddSerialNumber("MSigmabar"));
    665667        if (!fSgb)
    666668        {
     
    671673    else
    672674    {
    673         fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
     675        fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    674676        if (!fPed)
    675677        {
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc

    r2207 r2470  
    7373    // Open a rootfile
    7474    //
    75     fOut = new TFile(fname, opt, ftitle, comp);
     75    TString str(fname);
     76    if (!str.EndsWith(".root", TString::kIgnoreCase))
     77        str += ".root";
     78
     79    fOut = new TFile(str, opt, ftitle, comp);
    7680}
    7781
Note: See TracChangeset for help on using the changeset viewer.