Ignore:
Timestamp:
09/14/04 12:13:07 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhbase/MFillH.cc

    r4058 r4991  
    1818!   Author(s): Thomas Bretz, 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2004
    2121!
    2222!
     
    2424
    2525//////////////////////////////////////////////////////////////////////////////
    26 //                                                                          //
    27 //  MFillH                                                                  //
    28 //                                                                          //
    29 //  This is a common interface (task) to fill mars histograms. Every mars   //
    30 //  histogram which is derived from MH can be filled with this task.        //
    31 //                                                                          //
    32 //  There are two options to use:                                           //
    33 //                                                                          //
    34 //  1) You specifiy the parameter container with which data the             //
    35 //     histogram container should be filled, and the histogram container    //
    36 //     which has to be filled. This can be done by either specifing the     //
    37 //     name of the objects in the parameter list or by specifiing a pointer //
    38 //     to the object. (s. Constructor)                                      //
    39 //                                                                          //
    40 //  2) You specify the name and/or type of the histogram to become filled.  //
    41 //     Any other action imust be taken by the histogram class.              //
    42 //                                                                          //
    43 //  PreProcess: In the preprocessing of this task we setup all pointers     //
    44 //              to instances which are needed and call FillSetup of the     //
    45 //              histogram class with the parameter list as an argument.     //
    46 //                                                                          //
    47 //  Process: The process function calls the Fill member function of the     //
    48 //           histogram class instance (inheriting from MH) with either      //
    49 //           a NULL pointer or a pointer to the corresponding container     //
    50 //           as an argument.                                                //
    51 //                                                                          //
    52 // To use a weight for each event filled in a histogram call                //
    53 // SetWeight(). You can eithe use the name of a MWeight container stored    //
    54 // in the parameter list or a pointer to it as an argument.                 //
    55 //                                                                          //
    56 //                                                                          //
    57 //  WARNING:                                                                //
    58 //   Because MFillH is a generalized task to fill histograms it doesn't     //
    59 //   know about which branches from a file are necessary to fill the        //
    60 //   histograms. If you are reading data from a file which is directly      //
    61 //   filled into a histogram via MFillH, please call either                 //
    62 //   MReadTree::DisableAutoScheme() or enable the necessary branches by     //
    63 //   yourself, using MReadTree::EnableBranch()                              //
    64 //                                                                          //
    65 //   Checkout the Warning in MTaskList.                                     //
    66 //                                                                          //
    67 //  Input Containers:                                                       //
    68 //   A parameter container                                                  //
    69 //                                                                          //
    70 //  Output Containers:                                                      //
    71 //   A histogram container                                                  //
    72 //                                                                          //
     26//
     27//  MFillH
     28//
     29//  This is a common interface (task) to fill mars histograms. Every mars
     30//  histogram which is derived from MH can be filled with this task.
     31//
     32//  There are two options to use:
     33//
     34//  1) You specifiy the parameter container with which data the
     35//     histogram container should be filled, and the histogram container
     36//     which has to be filled. This can be done by either specifing the
     37//     name of the objects in the parameter list or by specifiing a pointer
     38//     to the object. (s. Constructor)
     39//
     40//  2) You specify the name and/or type of the histogram to become filled.
     41//     Any other action imust be taken by the histogram class.
     42//
     43//  PreProcess: In the preprocessing of this task we setup all pointers
     44//              to instances which are needed and call FillSetup of the
     45//              histogram class with the parameter list as an argument.
     46//
     47//  Process: The process function calls the Fill member function of the
     48//           histogram class instance (inheriting from MH) with either
     49//           a NULL pointer or a pointer to the corresponding container
     50//           as an argument.
     51//
     52// To use a weight for each event filled in a histogram call
     53// SetWeight(). You can eithe use the name of a MWeight container stored
     54// in the parameter list or a pointer to it as an argument.
     55//
     56//
     57//  WARNING:
     58//   Because MFillH is a generalized task to fill histograms it doesn't
     59//   know about which branches from a file are necessary to fill the
     60//   histograms. If you are reading data from a file which is directly
     61//   filled into a histogram via MFillH, please call either
     62//   MReadTree::DisableAutoScheme() or enable the necessary branches by
     63//   yourself, using MReadTree::EnableBranch()
     64//
     65//   Checkout the Warning in MTaskList.
     66//
     67//  Version 2:
     68//  ----------
     69//   - added fNumExcutions
     70//
     71//
     72//  Input Containers:
     73//   A parameter container
     74//
     75//  Output Containers:
     76//   A histogram container
     77//
    7378//////////////////////////////////////////////////////////////////////////////
    7479#include "MFillH.h"
     
    457462    //
    458463    fH->SetSerialNumber(GetSerialNumber());
     464    fH->SetNumExecutions(0);
    459465    if (!fH->SetupFill(pList))
    460466    {
     
    519525     ((MHArray*)fH)->SetIndex(idx);
    520526     */
    521 
     527/*
    522528    TVirtualPad *save = gPad;
    523529    if (fCanvas)
    524530        fCanvas->cd();
    525 
     531  */
    526532    const Bool_t rc = fH->Fill(fParContainer, fWeight?fWeight->GetWeight():1);
    527 
     533    fH->SetNumExecutions(GetNumExecutions()+1);
     534/*
    528535    if (save && fCanvas)
    529536        save->cd();
    530 
     537  */
    531538    return rc;
    532539}
Note: See TracChangeset for help on using the changeset viewer.