Changeset 1574


Ignore:
Timestamp:
11/04/02 10:06:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 added
65 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1572 r1574  
    11                                                                  -*-*- END -*-*-
     2 2002/11/04: Thomas Bretz
     3
     4   * macros/estimate.C, macros/estfit.C:
     5     - added
     6     
     7   * mfileio/structures.h, mfileio/defines.h:
     8     - added from CT1 PreProc 0.5
     9
     10   * mfileio/MCT1ReadPreProc.[h,cc]:
     11     - added
     12
     13   * mhist/MHArray.[h,cc]:
     14     - added
     15
     16   * Makefile:
     17     - changed the order of the libs to make the linker happy
     18     
     19   * manalysis/MBlindPixelCalc.[h,cc]:
     20     - changed to be able to use also an existing MBlindPixels from the
     21       parlist
     22     - changed to use the pixel Id instead of its index number from the evt
     23
     24   * manalysis/MCameraSmooth.cc:
     25     - changed to use the pixel Id instead of its index number from the evt
     26       
     27   * manalysis/MCerPhotEvt.[h,cc]:
     28     - added GetPixById member function
     29
     30   * manalysis/MCompProbCalc.[h,cc]:
     31     - changed Hadroness to Hadronness
     32   
     33   * manalysis/MHillasExt.cc:
     34     - fixed a typo in a comment
     35
     36   * mbase/MParContainer.[h,cc]:
     37     - added New-virtual member function
     38
     39   * mbase/MTask.[h,cc]:
     40     - changed AddToBranchList so that it also accepts comma seperated
     41       lists (only when using TString)
     42       
     43   * mdata/MData.[h,cc], mdata/MDataArray.[h,cc], mdata/MDataChain.[h,cc],
     44     mdata/MDataElement.[h,cc], mdata/MDataList.[h,cc]
     45     - updated comments
     46     - added new GetDataMember member function
     47     
     48   * mdata/MDataArray.[h,cc]:
     49     - added new member function AddEntry(MData*)
     50     
     51   * mfileio/FileIOLinkDef.h, mfileio/Makefile:
     52     - added MCT1ReadPreProc
     53     
     54   * mfileio/MCT1ReadAscii.cc:
     55     - removed fNphot->Clear() (automatically called for each event by
     56       Reset();
     57       
     58   * mhist/HistLinkDef.h, mhist/Makefile:
     59     - added MHArray
     60     
     61   * mhist/MFillH.[h,cc]:
     62     - made work with arrays of histograms (MHArray) the mapping is
     63       done by a preliminary class MMap
     64       
     65   * mhist/MH.[h,cc]:
     66     - implemented GetHistByName virtual function
     67     - implemented GetDataMember virtual function
     68     - small changes to debug output
     69     
     70   * mhist/MH3.[h,cc]:
     71     - implemented usage of GetDataMember for AddBranchToList
     72     - implemented GetHistByName
     73     - implemented New to be used in MHArray
     74
     75   * mhist/MHAlphaEnergyTheta.h, mhist/MHAlphaEnergyTime.h,
     76     mhist/MHEnergyTheta.h, mhist/MHEnergyTime.h,
     77     mhist/MHHillas.[h,cc], mhist/MHHillasExt.[h,cc],
     78     mhist/MHHillasSrc.[h,cc], mhist/MHMcDifRate.h,
     79     mhist/MHMcEfficiency.h, mhist/MHMcEfficiencyEnergy.h,
     80     mhist/MHMcEfficiencyImpact.h, mhist/MHMcEnergy.[h,cc],
     81     mhist/MHMcEnergyImpact.h, mhist/MHMcEnergyMigration.h,
     82     mhist/MHMcIntRate.h, mhist/MHStarMap.h, mhist/MHThetabarTheta.h,
     83     mhist/MHThetabarTime.h, mhist/MHTimeDiffTheta.h,
     84     mhist/MHTimeDiffTime.h:
     85     - implemented GetHistByName
     86   
     87   * mhist/MHHadronness.[h,cc]:
     88     - some small changes and checks
     89     - changed histogram io from standard pointer to '->'
     90
     91   * mhist/MHMatrix.cc:
     92     - updated comments
     93     - implemented GetDataMembers
     94
     95
     96
    297 2002/10/31: Thomas Bretz
    398
  • trunk/MagicSoft/Mars/Makefile

    r1539 r1574  
    3636#
    3737SUBDIRS = mmain       \
     38          mbase       \
     39          mfileio     \
     40          manalysis   \
    3841          mmc         \
    39           manalysis   \
    40           mfileio     \
    41           mbase       \
    4242          meventdisp  \
    4343          mdatacheck  \
  • trunk/MagicSoft/Mars/NEWS

    r1543 r1574  
    8181
    8282   - Introduced more output to the camera displays
     83
     84   - Added an array of histograms (eg one hist per run), MHArray
     85
     86   - Added a _preliminary_ version of the reader for CT1 PreProc files
     87     (MCT1ReadPreProc)
    8388
    8489
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc

    r1496 r1574  
    9393Bool_t MBlindPixelCalc::PreProcess (MParList *pList)
    9494{
    95     fPixels = (MBlindPixels*)pList->FindCreateObj("MBlindPixels");
     95    if (TESTBIT(fFlags, kUseBlindPixels))
     96        fPixels = (MBlindPixels*)pList->FindObject("MBlindPixels");
     97    else
     98        fPixels = (MBlindPixels*)pList->FindCreateObj("MBlindPixels");
    9699    if (!fPixels)
    97100        return kFALSE;
     
    106109    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
    107110    if (!fGeomCam)
    108         *fLog << warn << dbginf << "No camera geometry available... can't ude interpolation." << endl;
     111        *fLog << warn << dbginf << "No camera geometry available... can't use interpolation." << endl;
     112
     113    if (TESTBIT(fFlags, kUseBlindPixels))
     114        return kTRUE;
    109115
    110116    const UShort_t size = fPixelsID.GetSize();
     
    162168        Int_t num = TESTBIT(fFlags, kUseCentralPixel) ? 1 : 0;
    163169
    164         nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetNumPhotons() : 0;
    165         perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetErrorPhot()  : 0;
     170        nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0;
     171        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
    166172        for (int j=0; j<n; j++)
    167173        {
     
    171177                continue;
    172178
    173             nphot[i] += (*fEvt)[nid].GetNumPhotons();
    174             perr[i]  += (*fEvt)[nid].GetErrorPhot();
    175 
     179            const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     180            if (evtpix)
     181            {
     182                nphot[i] += evtpix->GetNumPhotons();
     183                perr[i]  += evtpix->GetErrorPhot();
     184            }
    176185            num++;
    177186        }
     
    253262Bool_t MBlindPixelCalc::ReInit(MParList *pList)
    254263{
     264    if (TESTBIT(fFlags, kUseBlindPixels))
     265        return kTRUE;
     266
    255267    //
    256268    // If pixels are given by the user, we are already done
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h

    r1572 r1574  
    2828    {
    2929        kUseInterpolation = 1,
    30         kUseCentralPixel  = 2
     30        kUseCentralPixel  = 2,
     31        kUseBlindPixels   = 3
    3132    };
    3233
     
    4647        b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel);
    4748    }
     49    void SetUseBlindPixels(Bool_t b=kTRUE)
     50    {
     51        b ? SETBIT(fFlags, kUseBlindPixels) : CLRBIT(fFlags, kUseBlindPixels);
     52    }
    4853
    4954    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/manalysis/MCameraSmooth.cc

    r1568 r1574  
    111111            const Int_t n = gpix.GetNumNeighbors();
    112112
    113             photons[i] = fUseCentralPixel ? (*fEvt)[id].GetNumPhotons() : 0;
    114             errors[i]  = fUseCentralPixel ? (*fEvt)[id].GetErrorPhot()  : 0;
     113            Int_t num  = fUseCentralPixel ? 1 : 0;
     114            photons[i] = fUseCentralPixel ? pix.GetNumPhotons() : 0;
     115            errors[i]  = fUseCentralPixel ? pix.GetErrorPhot()  : 0;
     116
    115117            for (int j=0; j<n; j++)
    116118            {
    117119                const UShort_t nid = gpix.GetNeighbor(j);
    118120
    119                 photons[i] += (*fEvt)[nid].GetNumPhotons();
    120                 errors[i]  += (*fEvt)[nid].GetErrorPhot();
     121                const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     122                if (evtpix)
     123                {
     124                    photons[i] += evtpix->GetNumPhotons();
     125                    errors[i]  += evtpix->GetErrorPhot();
     126                }
     127                num++;
    121128            }
    122129
    123             photons[i] /= fUseCentralPixel ? n+1 : n;
    124             errors[i]  /= fUseCentralPixel ? n+1 : n;
     130            photons[i] /= num;
     131            errors[i]  /= num;
    125132        }
    126133
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r1540 r1574  
    306306}
    307307
     308// --------------------------------------------------------------------------
     309//
     310// Return a pointer to the pixel with the requested id. NULL if it doesn't
     311// exist.
     312//
     313MCerPhotPix *MCerPhotEvt::GetPixById(int id) const
     314{
     315    TIter Next(fPixels);
     316    MCerPhotPix *pix = NULL;
     317
     318    while ((pix=(MCerPhotPix*)Next()))
     319        if (pix->GetPixId()==id)
     320            return pix;
     321
     322    return NULL;
     323}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r1540 r1574  
    4747    MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); }
    4848
     49    MCerPhotPix *GetPixById(int id) const;
     50
    4951    void Reset();
    5052
  • trunk/MagicSoft/Mars/manalysis/MCompProbCalc.cc

    r1571 r1574  
    7777//  - MHCompProb
    7878//  - all data values which were used to build the MHCompProb
    79 //  - MHadroness
     79//  - MHadronness
    8080//
    8181Bool_t MCompProbCalc::PreProcess(MParList *plist)
     
    136136//  - For all data members multiply the probabilities.
    137137//  - For normalization take the n-th root of the result.
    138 //  - This is the hadroness stored in the MHadroness container
     138//  - This is the hadroness stored in the MHadronness container
    139139//
    140140Bool_t MCompProbCalc::Process()
  • trunk/MagicSoft/Mars/manalysis/MCompProbCalc.h

    r1571 r1574  
    1313{
    1414private:
    15     MHadronness *fHadronness; //! Output container (Hadroness)
     15    MHadronness *fHadronness; //! Output container (Hadronness)
    1616
    1717    TList *fData;           //! List of MDataChains to be used
  • trunk/MagicSoft/Mars/manalysis/MHillasExt.cc

    r1540 r1574  
    3939//
    4040// WARNING: Before you can use fAsym, fM3Long and fM3Trans you must
    41 //          multiply by the sign of MHillasSrc::fCosAlphaDelta
     41//          multiply by the sign of MHillasSrc::fCosDeltaAlpha
    4242//
    4343////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r1526 r1574  
    435435    arr.Compress();
    436436}
     437
     438// --------------------------------------------------------------------------
     439//
     440// Creates a new instance of this class. The idea is to create a clone of
     441// this class in its initial state.
     442//
     443MParContainer *MParContainer::New() const
     444{
     445    return (MParContainer*)IsA()->New();
     446}
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r1525 r1574  
    7070    virtual void        SavePrimitive(ofstream &out, Option_t *o="");
    7171
     72    virtual MParContainer *New() const;
    7273    virtual void   SetLogStream(MLog *lg) { fLog = lg; }
    7374    virtual void   Reset() { }
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1540 r1574  
    122122// --------------------------------------------------------------------------
    123123//
     124// Using this overloaded member function you may cascade several branches
     125// in acomma seperated list, eg: "MMcEvt.fTheta,MMcEvt.fEnergy"
     126//
     127// For moredetailed information see AddToBranchList(const char *b);
     128//
     129void MTask::AddToBranchList(const TString &str)
     130{
     131    TString s = str;
     132
     133    while (1)
     134    {
     135        Int_t fst = s.First(',');
     136
     137        if (fst<0)
     138            return;
     139
     140        AddToBranchList(TString(s(0, fst)));
     141
     142        s.Remove(0, fst+1);
     143    }
     144}
     145
     146// --------------------------------------------------------------------------
     147//
    124148// Copy constructor.
    125149//
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r1501 r1574  
    3535protected:
    3636    void AddToBranchList(const char *b);
    37     void AddToBranchList(const TString &str)
    38     {
    39         AddToBranchList((const char*)str);
    40     }
     37    void AddToBranchList(const TString &str);
    4138    void AddToBranchList(const char *master, const char *sub, const UInt_t first, const UInt_t last)
    4239    {
  • trunk/MagicSoft/Mars/mdata/MData.cc

    r1476 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
     
    4444//      from the parlist.
    4545//
     46//    - TString GetRule()
     47//      returns the rule as a text which would recreate the same structure
     48//      when used in a MDataChain
     49//
     50//    - TString GetDataMember()
     51//      returns the names (seperated by a comma) used by this class. This
     52//      is mainly used for the AutoScheme when reading data from a file.
     53//      (s.MReadTree)
     54//
     55//   The 'must' ist represented by the =0 in the class header. In the C++
     56//   language this is called an abstract member function. Because the
     57//   class contains abstract member function which makes it impossible
     58//   to create an instance of this class one calls it also:
     59//   abstract base class
     60//
    4661/////////////////////////////////////////////////////////////////////////////
    4762
  • trunk/MagicSoft/Mars/mdata/MData.h

    r1474 r1574  
    2121    virtual Bool_t   PreProcess(const MParList *plist) = 0;
    2222    virtual TString  GetRule() const = 0;
     23    virtual TString  GetDataMember() const { return ""; }
    2324
    2425    Double_t operator()() { return GetValue(); }
  • trunk/MagicSoft/Mars/mdata/MDataArray.cc

    r1499 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  08/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  08/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
     
    2626//
    2727//   MDataArray
     28//
     29//   An Array of MData derived classes.
     30//   It can be used, eg, in MHMatrix for description of the columns.
    2831//
    2932/////////////////////////////////////////////////////////////////////////////
     
    4245static const TString gsDefTitle = "Array to store MData cntainers";
    4346
     47// --------------------------------------------------------------------------
     48//
     49// Constructor
     50//
    4451MDataArray::MDataArray(const char *name, const char *title)
    4552{
     
    4855}
    4956
     57// --------------------------------------------------------------------------
     58//
     59// Add a new data rule as a new entry (MDataChain)
     60//
    5061void MDataArray::AddEntry(const TString rule)
    5162{
     
    5566}
    5667
     68// --------------------------------------------------------------------------
     69//
     70// Add a new data as a new entry (MData). If the destructor of MDataArray
     71// should delete the object set its bit kCanDelete
     72//
     73void MDataArray::AddEntry(MData *data)
     74{
     75    fList.Add(data);
     76}
     77
     78// --------------------------------------------------------------------------
     79//
     80// Return the i-th entry
     81//
    5782MData &MDataArray::operator[](Int_t i) const
    5883{
     
    6085}
    6186
     87// --------------------------------------------------------------------------
     88//
     89// Return the data value of the i-th entry
     90//
    6291Double_t MDataArray::operator()(Int_t i)
    6392{
     
    6594}
    6695
     96// --------------------------------------------------------------------------
     97//
     98// PreProcesses all members in the list
     99//
    67100Bool_t MDataArray::PreProcess(const MParList *plist)
    68101{
     
    82115}
    83116
     117// --------------------------------------------------------------------------
     118//
     119// Print the rules for all entries of the array
     120//
    84121void MDataArray::Print(Option_t *opt) const
    85122{
     
    102139}
    103140
     141// --------------------------------------------------------------------------
     142//
     143// Implementation of SavePrimitive. Used to write the call to a constructor
     144// to a macro. In the original root implementation it is used to write
     145// gui elements to a macro-file.
     146//
    104147void MDataArray::StreamPrimitive(ofstream &out) const
    105148{
     
    119162        out << "   " << GetUniqueName() << ".AddEntry(\"" << data->GetRule() << "\");" << endl;
    120163}
     164
     165// --------------------------------------------------------------------------
     166//
     167// Return the data members existing in this array in a comma-seperated list
     168// (This is mainly used for MTask::AddToBranchList)
     169//
     170TString MDataArray::GetDataMember() const
     171{
     172    TString str;
     173
     174    TIter Next(&fList);
     175    MData *data = NULL;
     176    while ((data=(MData*)Next()))
     177    {
     178        if (data->GetDataMember().IsNull())
     179            continue;
     180
     181        str += ",";
     182        str += data->GetDataMember();
     183    }
     184    return str;
     185}
  • trunk/MagicSoft/Mars/mdata/MDataArray.h

    r1488 r1574  
    2828
    2929    void AddEntry(const TString rule);
     30    void AddEntry(MData *data);
    3031
    3132    MData &operator[](Int_t i) const;
     
    3334
    3435    Bool_t PreProcess(const MParList *plist);
     36
     37    TString GetDataMember() const;
    3538
    3639    void Print(Option_t *opt = "") const;
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r1524 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
     
    9595ClassImp(MDataChain);
    9696
     97// --------------------------------------------------------------------------
     98//
     99//  Constructor which takes a rule and a surrounding operator as argument
     100//
    97101MDataChain::MDataChain(const char *rule, OperatorType_t op)
    98102    : fOperatorType(op)
     
    104108}
    105109
     110// --------------------------------------------------------------------------
     111//
     112//  Default constructor
     113//
    106114MDataChain::MDataChain()
    107115    : fMember(NULL), fOperatorType(kENoop)
     
    109117}
    110118
     119// --------------------------------------------------------------------------
     120//
     121// Constructor taking a rule as an argument. For more details see
     122// class description
     123//
    111124MDataChain::MDataChain(const char *rule, const char *name, const char *title)
    112125    : fOperatorType(kENoop)
     
    220233}
    221234
     235// --------------------------------------------------------------------------
     236//
     237// Core of the data chain. Here the chain is constructed out of the rule.
     238//
    222239MData *MDataChain::ParseString(TString txt, Int_t level)
    223240{
     
    420437}
    421438
     439// --------------------------------------------------------------------------
     440//
     441// Returns the value described by the rule
     442//
    422443Double_t MDataChain::GetValue() const
    423444{
     
    498519        */
    499520
     521// --------------------------------------------------------------------------
     522//
     523// Builds a rule from all the chain members. This is a rule which could
     524// be used to rebuild the chain.
     525//
    500526TString MDataChain::GetRule() const
    501527{
     
    541567    return str;
    542568}
     569
     570// --------------------------------------------------------------------------
     571//
     572// Return a comma seperated list of all data members used in the chain.
     573// This is mainly used in MTask::AddToBranchList
     574//
     575TString MDataChain::GetDataMember() const
     576{
     577    return fMember->GetDataMember();
     578}
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r1524 r1574  
    6666
    6767    TString GetRule() const;
     68    TString GetDataMember() const;
    6869
    6970    ClassDef(MDataChain, 1) // A chain/concatenation of MData objects
  • trunk/MagicSoft/Mars/mdata/MDataElement.cc

    r1524 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
  • trunk/MagicSoft/Mars/mdata/MDataList.cc

    r1481 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
     
    182182}
    183183
     184// --------------------------------------------------------------------------
     185//
     186// PreProcesses all members in the list
     187//
    184188Bool_t MDataList::PreProcess(const MParList *plist)
    185189{
     
    259263    */
    260264
     265// --------------------------------------------------------------------------
     266//
     267// Builds a rule from all the list members. This is a rule which could
     268// be used to rebuild the list using the constructor of a MDataChain
     269//
    261270TString MDataList::GetRule() const
    262271{
     
    306315    return str;
    307316}
     317
     318// --------------------------------------------------------------------------
     319//
     320// Return a comma seperated list of all data members used in the chain.
     321// This is mainly used in MTask::AddToBranchList
     322//
     323TString MDataList::GetDataMember() const
     324{
     325    TString str;
     326
     327    TIter Next(&fMembers);
     328
     329    MData *member=(MData*)Next();
     330
     331    if (!member->GetDataMember().IsNull())
     332        str += member->GetDataMember();
     333
     334    while ((member=(MData*)Next()))
     335    {
     336        if (!member->GetDataMember().IsNull())
     337        {
     338            str += ",";
     339            str += member->GetDataMember();
     340        }
     341    }
     342
     343    return str;
     344}
  • trunk/MagicSoft/Mars/mdata/MDataList.h

    r1481 r1574  
    4949//    void Print(Option_t *opt = "") const;
    5050    TString GetRule() const;
     51    TString GetDataMember() const;
    5152
    5253    ClassDef(MDataList, 1) // A concatenation of MData objects by one operator
  • trunk/MagicSoft/Mars/mdata/MDataMember.cc

    r1481 r1574  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2002
     
    170170*/
    171171
     172// --------------------------------------------------------------------------
     173//
     174// Builds a rule which cn be used in a MDataChain to describe this object
     175//
    172176TString MDataMember::GetRule() const
    173177{
    174178    return fDataMember;
    175179}
     180
     181// --------------------------------------------------------------------------
     182//
     183// Returns the data member.
     184// This is mainly used in MTask::AddToBranchList
     185//
     186TString MDataMember::GetDataMember() const
     187{
     188    return fDataMember;
     189}
  • trunk/MagicSoft/Mars/mdata/MDataMember.h

    r1481 r1574  
    3737    //void Print(Option_t *opt = "") const;
    3838    TString GetRule() const;
     39    TString GetDataMember() const;
    3940
    4041    ClassDef(MDataMember, 1) // MData object corresponding to a single data member of a Mars container
  • trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h

    r1472 r1574  
    1616
    1717#pragma link C++ class MCT1ReadAscii+;
     18#pragma link C++ class MCT1ReadPreProc+;
    1819
    1920#endif
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc

    r1540 r1574  
    216216void MCT1ReadAscii::ReadData()
    217217{
    218     //
    219     // clear the list of cerphot-events
    220     //
    221     fNphot->Clear();
     218    /*
     219     //
     220     // clear the list of cerphot-events
     221     //
     222     fNphot->Clear();
     223     */
    222224
    223225    //
  • trunk/MagicSoft/Mars/mfileio/Makefile

    r1472 r1574  
    2020# @endcode
    2121
    22 INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis
     22INCLUDES = -I. -I../mbase -I../mraw -I../mmc -I../mdata -I../manalysis -I../mgeom
    2323
    2424# @code
     
    3737           MWriteAsciiFile.cc \
    3838           MWriteRootFile.cc \
    39            MCT1ReadAscii.cc
     39           MCT1ReadAscii.cc \
     40           MCT1ReadPreProc.cc
    4041
    4142SRCS    = $(SRCFILES)
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r1557 r1574  
    88
    99#pragma link C++ class MH+;
     10#pragma link C++ class MHArray+;
    1011#pragma link C++ class MH3+;
    1112
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1502 r1574  
    7171#include <fstream.h>
    7272
     73#include <TClass.h>
     74
     75#include "MDataChain.h"
     76
    7377#include "MLog.h"
    7478#include "MLogManip.h"
    7579
    7680#include "MH.h"
     81#include "MHArray.h"
     82
    7783#include "MParList.h"
    7884
    7985ClassImp(MFillH);
     86
     87//////////////////////////////////////////////////////////////////////////////
     88//
     89// MMap
     90//
     91// This class maps a key-value to a given value. In its simple versions it
     92// maps a key to an index.
     93//
     94//////////////////////////////////////////////////////////////////////////////
     95#include <TArrayI.h>
     96
     97class MMap
     98{
     99private:
     100    TArrayI fKeys;
     101    TArrayI fValues;
     102
     103    Int_t K(Int_t i) const { return ((TArrayI)fKeys)[i]; }
     104    Int_t V(Int_t i) const { return ((TArrayI)fValues)[i]; }
     105
     106public:
     107    // --------------------------------------------------------------------------
     108    //
     109    // Get the value which corresponds to the given key-value
     110    //
     111    Int_t GetValue(Int_t key) const
     112    {
     113        const Int_t n = fKeys.GetSize();
     114        for (int i=0; i<n; i++)
     115        {
     116            if (K(i)==key)
     117                return V(i);
     118        }
     119        return -1;
     120    }
     121
     122    // --------------------------------------------------------------------------
     123    //
     124    // Adds a new pair key-value. While the key is the key to the value.
     125    // if the key already exists the pair is ignored.
     126    //
     127    void Add(Int_t key, Int_t value)
     128    {
     129        if (GetValue(key)>=0)
     130            return;
     131
     132        const Int_t n = fKeys.GetSize();
     133
     134        fKeys.Set(n+1);
     135        fValues.Set(n+1);
     136
     137        fKeys[n] = key;
     138        fValues[n] = value;
     139    }
     140
     141    // --------------------------------------------------------------------------
     142    //
     143    // Adds a new pair key-value. While the key is the key to the value.
     144    // In this case the value is an automatically sequential created index.
     145    // if the key already exists the pair is ignored.
     146    //
     147    Int_t Add(Int_t key)
     148    {
     149        const Int_t k = GetValue(key);
     150        if (k>=0)
     151            return k;
     152
     153        const Int_t n = fKeys.GetSize();
     154
     155        fKeys.Set(n+1);
     156        fValues.Set(n+1);
     157
     158        fKeys[n] = key;
     159        fValues[n] = n;
     160
     161        return n;
     162    }
     163};
    80164
    81165// --------------------------------------------------------------------------
     
    91175    fH            = NULL;
    92176    fParContainer = NULL;
     177
     178    fIndex  = NULL;
     179    fMapIdx = new MMap;
    93180}
    94181
     
    194281    fParContainerName = par;
    195282
     283    AddToBranchList(fH->GetDataMember());
     284
    196285    if (title)
    197286        return;
     
    222311    fParContainerName = par->GetName();
    223312
     313    AddToBranchList(fH->GetDataMember());
     314
    224315    if (!title)
    225316        fTitle = (TString)"Fill " + hist->GetDescriptor() + " from " + par->GetDescriptor();
    226317}
    227318
     319// --------------------------------------------------------------------------
     320//
     321// Destructor. Delete fData if existing and kCanDelete is set.
     322//
     323MFillH::~MFillH()
     324{
     325    if (fIndex)
     326        if (fIndex->TestBit(kCanDelete))
     327            delete fIndex;
     328
     329    delete fMapIdx;
     330}
     331
     332// --------------------------------------------------------------------------
     333//
     334// If the histogram to be filles is a MHArray you can specify a 'rule'
     335// This rule is used to create an MDataChain. The return value of the chain
     336// is casted to int. Each int acts as a key. For each (new) key a new
     337// histogram is created in the array. (eg for the rule
     338// "MRawEvtHeader::fRunNumber" you would get one histogram per run-number)
     339//
     340void MFillH::SetRuleForIdx(const TString rule)
     341{
     342    fIndex = new MDataChain(rule);
     343    fIndex->SetBit(kCanDelete);
     344}
     345
     346// --------------------------------------------------------------------------
     347//
     348// If the histogram to be filles is a MHArray you can specify a MData-object
     349// The return value of the object is casted to int. Each int acts as a key.
     350// For each (new) key a new histogram is created in the array. (eg for
     351// MDataMember("MRawEvtHeader::fRunNumber") you would get one histogram per
     352// run-number)
     353//
     354void MFillH::SetRuleForIdx(MData *data)
     355{
     356    fIndex = data;
     357}
     358
     359// --------------------------------------------------------------------------
     360//
     361// Extracts the name of the histogram from the MFillH argument
     362//
    228363TString MFillH::ExtractName(const char *name) const
    229364{
     
    239374}
    240375
     376// --------------------------------------------------------------------------
     377//
     378// Extracts the class-name of the histogram from the MFillH argument
     379//
    241380TString MFillH::ExtractClass(const char *name) const
    242381{
     
    265404Bool_t MFillH::PreProcess(MParList *pList)
    266405{
     406    if (fIndex)
     407    {
     408        if (!fIndex->PreProcess(pList))
     409        {
     410            *fLog << all << "PreProcessing of Index rule failed... aborting." << endl;
     411            return kFALSE;
     412        }
     413
     414        if (!fIndex->IsValid())
     415        {
     416            *fLog << all << "Given Index rule invalid... aborting." << endl;
     417            return kFALSE;
     418        }
     419    }
     420
    267421    //
    268422    // Try to get the histogram container with name fHName from list
     
    293447        // 'type'.
    294448        //
    295         if (!obj->InheritsFrom(MH::Class()))
     449        TClass *tcls = fIndex ? MHArray::Class() : MH::Class();
     450        if (!obj->InheritsFrom(tcls))
    296451        {
    297452            *fLog << err << dbginf << obj->GetName() << " doesn't inherit ";
    298             *fLog << "from MH - cannot be used for MFillH... aborting." << endl;
     453            *fLog << "from " << tcls->GetName() << " - cannot be used for MFillH...";
     454            *fLog << "aborting." << endl;
    299455            return kFALSE;
    300456        }
     
    343499Bool_t MFillH::Process()
    344500{
     501    if (fIndex)
     502    {
     503        const Int_t key = (Int_t)fIndex->GetValue();
     504        const Int_t idx = fMapIdx->Add(key);
     505        ((MHArray*)fH)->SetIndex(idx);
     506    }
     507
    345508    return fH->Fill(fParContainer);
    346509}
     
    396559
    397560    out << ");" << endl;
    398 }
     561
     562    if (!fIndex)
     563        return;
     564
     565    out << "   " << GetUniqueName() << ".SetRuleForIdx(\"";
     566    out << fIndex->GetRule() << "\");" << endl;
     567}
  • trunk/MagicSoft/Mars/mhist/MFillH.h

    r1477 r1574  
    77
    88class MH;
     9class MData;
    910class MParList;
     11
     12class MMap;
    1013
    1114class MFillH : public MTask
     
    1518    TString fParContainerName;
    1619
    17     MH* fH;                   
     20    MH* fH;
    1821    TString fHName;
     22
     23    MData *fIndex;    // MData object describing the 'key' to an automatic index for an MHArray
     24    MMap  *fMapIdx;   //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
    1925
    2026    TString ExtractName(const char *name) const;
     
    3238    MFillH(MH *hist,         MParContainer *par,   const char *name=NULL, const char *title=NULL);
    3339
     40    ~MFillH();
     41
     42    void SetRuleForIdx(const TString rule);
     43    void SetRuleForIdx(MData *rule);
     44
    3445    Bool_t PreProcess(MParList *pList);
    3546    Bool_t Process();
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r1572 r1574  
    4545//  the histogram(s) by the data of a corresponding parameter container.    //
    4646//                                                                          //
     47//  Remark: the static member function (eg MakeDefCanvas) can be called     //
     48//          from everywhere using: MH::MakeDefCanvas(...)                   //
     49//                                                                          //
    4750//////////////////////////////////////////////////////////////////////////////
    4851
     
    9396Bool_t MH::Fill(const MParContainer *par)
    9497{
    95     *fLog << GetDescriptor() << ": Fill not overloaded! Can't be used!" << endl;
     98    *fLog << warn << GetDescriptor() << ": Fill not overloaded! Can't be used!" << endl;
    9699    return kFALSE;
     100}
     101
     102// --------------------------------------------------------------------------
     103//
     104// This virtual function is ment as a generalized interface to retrieve
     105// a pointer to a root histogram from the MH-derived class.
     106//
     107TH1 *MH::GetHistByName(const TString name)
     108{
     109    *fLog << warn << GetDescriptor() << ": GetHistByName not overloaded! Can't be used!" << endl;
     110    return NULL;
    97111}
    98112
     
    665679    l.Draw();
    666680}
     681
  • trunk/MagicSoft/Mars/mhist/MH.h

    r1504 r1574  
    2424    virtual Bool_t Fill(const MParContainer *par);
    2525    virtual Bool_t Finalize() { return kTRUE; }
     26
     27    virtual TString GetDataMember() const { return ""; }
     28
     29    virtual TH1 *GetHistByName(const TString name);
    2630
    2731    static TCanvas *MakeDefCanvas(TString name="", const char *title="",
  • trunk/MagicSoft/Mars/mhist/MH3.cc

    r1555 r1574  
    8383static const TString gsDefTitle = "Container for a %dD Mars Histogram";
    8484
     85// --------------------------------------------------------------------------
     86//
     87// Default constructor.
     88//
    8589MH3::MH3() : fDimension(0), fHist(NULL)
    8690{
     
    179183        if (fData[i])
    180184            delete fData[i];
     185}
     186
     187// --------------------------------------------------------------------------
     188//
     189// Return the data members used by the data chain to be used in
     190// MTask::AddBranchToList
     191//
     192TString MH3::GetDataMember() const
     193{
     194    TString str=fData[0]->GetDataMember();
     195    if (fData[1])
     196    {
     197        str += ";";
     198        str += fData[1]->GetDataMember();
     199    }
     200    if (fData[2])
     201    {
     202        str += ";";
     203        str += fData[2]->GetDataMember();
     204    }
     205    return str;
    181206}
    182207
     
    526551    }
    527552}
     553
     554// --------------------------------------------------------------------------
     555//
     556// Used to rebuild a MH3 object of the same type (data members,
     557// dimension, ...)
     558//
     559MParContainer *MH3::New() const
     560{
     561    MH3 *h = NULL;
     562    switch (fDimension)
     563    {
     564    case 1:
     565        h=new MH3(fData[0]->GetRule());
     566        break;
     567    case 2:
     568        h=new MH3(fData[0]->GetRule(), fData[1]->GetRule());
     569        break;
     570    case 3:
     571        h=new MH3(fData[0]->GetRule(), fData[1]->GetRule(), fData[2]->GetRule());
     572        break;
     573    }
     574    switch (fDimension)
     575    {
     576    case 3:
     577        h->SetScaleZ(fScale[2]);
     578    case 2:
     579        h->SetScaleY(fScale[1]);
     580    case 1:
     581        h->SetScaleX(fScale[0]);
     582    }
     583    return h;
     584}
  • trunk/MagicSoft/Mars/mhist/MH3.h

    r1524 r1574  
    5151    Bool_t Fill(const MParContainer *par);
    5252
     53    TString GetDataMember() const;
     54
    5355    TH1 &GetHist() { return *fHist; }
    5456    const TH1 &GetHist() const { return *fHist; }
     57
     58    TH1 *GetHistByName(const TString name) { return fHist; }
    5559
    5660    void SetColors() const;
     
    5862    TObject *DrawClone(Option_t *opt=NULL) const;
    5963
     64    MParContainer *New() const;
     65
    6066    ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables
    6167};
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h

    r1415 r1574  
    3939    const TH3D *GetHist() const { return &fHist; }
    4040
     41    TH1 *GetHistByName(const TString name) { return &fHist; }
     42
    4143    void Draw(Option_t *option="");
    4244    TObject *DrawClone(Option_t *option="") const;
  • trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h

    r1414 r1574  
    2929    TH3D    fHist;
    3030
    31 
    3231public:
    3332    MHAlphaEnergyTime(const char *name=NULL, const char *title=NULL);
     
    3837    const TH3D *GetHist()       { return &fHist; }
    3938    const TH3D *GetHist() const { return &fHist; }
     39
     40    TH1 *GetHistByName(const TString name) { return &fHist; }
    4041
    4142    void Draw(Option_t *option="");
  • trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h

    r1213 r1574  
    3232    const TH2D *GetHist() const { return &fHist; }
    3333
     34    TH1 *GetHistByName(const TString name) { return &fHist; }
     35
    3436    void Divide(const TH2D *h1, const TH2D *h2);
    3537    void Divide(const MHEnergyTheta *h1, const MHEnergyTheta *h2)
  • trunk/MagicSoft/Mars/mhist/MHEnergyTime.h

    r1213 r1574  
    3333    const TH2D *GetHist() const { return &fHist; }
    3434
     35    TH1 *GetHistByName(const TString name) { return &fHist; }
     36
    3537    void Divide(const TH2D *h1, const TH2D *h2);
    3638    void Divide(const MHEnergyTime *h1, const MHEnergyTime *h2)
  • trunk/MagicSoft/Mars/mhist/MHHadronness.cc

    r1557 r1574  
    4343//    - red:   histogram of all hadronesses for non gammas
    4444//  * Upper Right Corner:
    45 //    - black: acceptance of gammas vs. the hadroness
    46 //    - red:   acceptance of non gammas vs. the hadroness
     45//    - black: acceptance of gammas (Ag) vs. the hadroness
     46//    - red:   acceptance of non gammas (Ah) vs. the hadroness
    4747//    - blue:  2D distance of (acceptance_hadrons, acceptances_gammas)
    4848//             to optimum (0, 1)
     
    221221    }
    222222
    223     return val1y - (val2y-val1y)/(val2x-val1x) * (0.5-val1x);
     223    return val1y - (val2y-val1y)/(val2x-val1x) * (val1x-0.5);
    224224}
    225225
     
    265265    }
    266266
    267     fQfac->SetMaximum(max+1);
     267    fQfac->SetMaximum(max*1.05);
    268268
    269269    return kTRUE;
     
    342342    *fLog << "Hadronness histograms:" << endl;
    343343    *fLog << "---------------------" << endl;
     344
     345    if (fGraph->GetN()==0)
     346    {
     347        *fLog << " <No Entries>" << endl;
     348        return;
     349    }
     350
    344351    *fLog << "Used " << fGhness->GetEntries() << " Gammas and " << fPhness->GetEntries() << " Hadrons." << endl;
    345352    *fLog << "Acc Gammas @  1% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.01)*100) << "%" << endl;
     
    368375TObject *MHHadronness::DrawClone(Option_t *opt) const
    369376{
     377    if (fGraph->GetN()==0)
     378        return NULL;
     379
    370380    TCanvas &c = *MakeDefCanvas("Hadronness", fTitle);
    371381    c.Divide(2, 2);
     
    435445void MHHadronness::Draw(Option_t *)
    436446{
    437     if (!gPad)
     447   if (fGraph->GetN()==0)
     448        return;
     449
     450   if (!gPad)
    438451        MakeDefCanvas("Hadronness", fTitle);
    439452
  • trunk/MagicSoft/Mars/mhist/MHHadronness.h

    r1557 r1574  
    1818    const MHadronness *fHadronness;    //!
    1919
    20     TH1D* fPhness;        // Hadrons Hadronness
    21     TH1D* fGhness;        // Gammas Hadronness
    22     TH1D* fIntPhness;     // Hadrons Acceptance
    23     TH1D* fIntGhness;     // Gammas Acceptance
    24     TH1D* fMinDist;       // Minimum Distance to optimum acceptance
     20    TH1D* fPhness;        //-> Hadrons Hadronness
     21    TH1D* fGhness;        //-> Gammas Hadronness
     22    TH1D* fIntPhness;     //-> Hadrons Acceptance
     23    TH1D* fIntGhness;     //-> Gammas Acceptance
     24    TH1D* fMinDist;       //-> Minimum Distance to optimum acceptance
    2525
    26     TGraph *fQfac;        // Quality factor
    27     TGraph *fGraph;       // gamma acceptance vs. hadron acceptance
     26    TGraph *fQfac;        //-> Quality factor
     27    TGraph *fGraph;       //-> gamma acceptance vs. hadron acceptance
    2828
    2929public:
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r1524 r1574  
    365365    gPad->Update();
    366366}
     367
     368TH1 *MHHillas::GetHistByName(const TString name)
     369{
     370    if (name.Contains("Width", TString::kIgnoreCase))
     371        return fWidth;
     372    if (name.Contains("Length", TString::kIgnoreCase))
     373        return fLength;
     374    if (name.Contains("Size", TString::kIgnoreCase))
     375        return fSize;
     376    if (name.Contains("Core", TString::kIgnoreCase))
     377        return fCorePix;
     378    if (name.Contains("Used", TString::kIgnoreCase))
     379        return fUsedPix;
     380    if (name.Contains("Delta", TString::kIgnoreCase))
     381        return fDelta;
     382    if (name.Contains("DistC", TString::kIgnoreCase))
     383        return fDistC;
     384    if (name.Contains("Center", TString::kIgnoreCase))
     385        return fCenter;
     386
     387    return NULL;
     388}
  • trunk/MagicSoft/Mars/mhist/MHHillas.h

    r1490 r1574  
    4141    Bool_t Fill(const MParContainer *par);
    4242
     43    TH1 *GetHistByName(const TString name);
     44
    4345    TH1F *GetHistLength() { return fLength; }
    4446    TH1F *GetHistWidth()  { return fWidth; }
  • trunk/MagicSoft/Mars/mhist/MHHillasExt.cc

    r1504 r1574  
    312312    gPad->Update();
    313313}
     314
     315TH1 *MHHillasExt::GetHistByName(const TString name)
     316{
     317    if (name.Contains("Conc", TString::kIgnoreCase))
     318        return &fHConc;
     319    if (name.Contains("Conc1", TString::kIgnoreCase))
     320        return &fHConc1;
     321    if (name.Contains("Asym", TString::kIgnoreCase))
     322        return &fHAsym;
     323    if (name.Contains("M3Long", TString::kIgnoreCase))
     324        return &fHM3Long;
     325    if (name.Contains("M3Trans", TString::kIgnoreCase))
     326        return &fHM3Trans;
     327
     328    return NULL;
     329}
  • trunk/MagicSoft/Mars/mhist/MHHillasExt.h

    r1490 r1574  
    3535    Bool_t Fill(const MParContainer *par);
    3636
     37    TH1 *GetHistByName(const TString name);
     38
    3739    void Draw(Option_t *opt=NULL);
    3840    TObject *DrawClone(Option_t *opt=NULL) const;
  • trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc

    r1540 r1574  
    271271    gPad->Update();
    272272}
     273
     274TH1 *MHHillasSrc::GetHistByName(const TString name)
     275{
     276    if (name.Contains("Alpha", TString::kIgnoreCase))
     277        return fAlpha;
     278    if (name.Contains("Dist", TString::kIgnoreCase))
     279        return fDist;
     280    if (name.Contains("HeadTail", TString::kIgnoreCase))
     281        return fHeadTail;
     282    if (name.Contains("CosDA", TString::kIgnoreCase))
     283        return fCosDA;
     284
     285    return NULL;
     286}
  • trunk/MagicSoft/Mars/mhist/MHHillasSrc.h

    r1463 r1574  
    3030    Bool_t Fill(const MParContainer *par);
    3131
     32    TH1 *GetHistByName(const TString name);
     33
    3234    TH1F *GetHistAlpha()         { return fAlpha; }
    3335    TH1F *GetHistDist()          { return fDist; }
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r1567 r1574  
    487487}
    488488
     489// --------------------------------------------------------------------------
     490//
     491// Implementation of SavePrimitive. Used to write the call to a constructor
     492// to a macro. In the original root implementation it is used to write
     493// gui elements to a macro-file.
     494//
    489495void MHMatrix::StreamPrimitive(ofstream &out) const
    490496{
     
    583589    return kTRUE;
    584590}
     591
     592// --------------------------------------------------------------------------
     593//
     594// Return a comma seperated list of all data members used in the matrix.
     595// This is mainly used in MTask::AddToBranchList
     596//
     597TString MHMatrix::GetDataMember() const
     598{
     599    return fData ? fData->GetDataMember() : TString("");
     600}
  • trunk/MagicSoft/Mars/mhist/MHMatrix.h

    r1524 r1574  
    8787    Bool_t Fill(MParList *plist, MTask *read);
    8888
     89    TString GetDataMember() const;
     90
    8991    ClassDef(MHMatrix, 1) // Multidimensional Matrix to store events
    9092};
  • trunk/MagicSoft/Mars/mhist/MHMcDifRate.h

    r1306 r1574  
    3131    const TH1D *GetHist() const { return &fHist; }
    3232
     33    TH1 *GetHistByName(const TString name) { return &fHist; }
     34
    3335    void Draw(Option_t* option = "");
    3436    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHMcEfficiency.h

    r1306 r1574  
    3030    const TH2D *GetHist() const { return &fHist; }
    3131
     32    TH1 *GetHistByName(const TString name) { return &fHist; }
     33
    3234    void Draw(Option_t* option = "");
    3335    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHMcEfficiencyEnergy.h

    r1306 r1574  
    3030    const TH1D *GetHist() const { return &fHist; }
    3131
     32    TH1 *GetHistByName(const TString name) { return &fHist; }
     33
    3234    void Draw(Option_t* option = "");
    3335    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHMcEfficiencyImpact.h

    r1306 r1574  
    3030    const TH1D *GetHist() const { return &fHist; }
    3131
     32    TH1 *GetHistByName(const TString name) { return &fHist; }
     33
    3234    void Draw(Option_t* option = "");
    3335    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r1082 r1574  
    260260}
    261261
     262TH1 *MHMcEnergy::GetHistByName(const TString name)
     263{
     264    return fHist;
     265}
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.h

    r1015 r1574  
    66#endif
    77
     8class TH1;
    89class TH1F;
    910class TF1;
     
    4546    void SetNumBins(Int_t nbins = 100);
    4647
     48    TH1 *GetHistByName(const TString name);
     49
    4750    void Draw(Option_t* option = "");
    4851    TObject *DrawClone(Option_t* option = "") const;
     52
    4953    void Print(Option_t* option = NULL) const;
    5054
  • trunk/MagicSoft/Mars/mhist/MHMcEnergyImpact.h

    r1306 r1574  
    2929    const TH2D *GetHist() const { return &fHist; }
    3030
     31    TH1 *GetHistByName(const TString name) { return &fHist; }
     32
    3133    void Draw(Option_t* option = "");
    3234    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHMcEnergyMigration.h

    r1322 r1574  
    2323    MMcEvt      *fMcEvt;
    2424    MEnergyEst  *fEnergy;
     25
    2526    TH3D        fHist;
    2627
     
    3334    const TH3D *GetHist() { return &fHist; }
    3435    const TH3D *GetHist() const { return &fHist; }
     36
     37    TH1 *GetHistByName(const TString name) { return &fHist; }
    3538
    3639    void Draw(Option_t *option="");
  • trunk/MagicSoft/Mars/mhist/MHMcIntRate.h

    r1228 r1574  
    2929    const TH1D *GetHist() const { return &fHist; }
    3030
     31    TH1 *GetHistByName(const TString name) { return &fHist; }
     32
    3133    void Draw(Option_t* option = "");
    3234    TObject *DrawClone(Option_t* option = "") const;
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r1283 r1574  
    3333    Bool_t Fill(const MParContainer *par);
    3434
     35    TH1 *GetHistByName(const TString name) { return fStarMap; }
     36
    3537    TH2F *GetHist() { return fStarMap; }
    3638
  • trunk/MagicSoft/Mars/mhist/MHThetabarTheta.h

    r1322 r1574  
    3131    const TProfile *GetHist() const { return &fHist; }
    3232
     33    TH1 *GetHistByName(const TString name) { return &fHist; }
     34
    3335    void Draw(Option_t *option="");
    3436    TObject *DrawClone(Option_t *option="") const;
  • trunk/MagicSoft/Mars/mhist/MHThetabarTime.h

    r1321 r1574  
    3434    const TProfile *GetHist() const { return &fHist; }
    3535
     36    TH1 *GetHistByName(const TString name) { return &fHist; }
     37
    3638    void Draw(Option_t *option="");
    3739    TObject *DrawClone(Option_t *option="") const;
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h

    r1295 r1574  
    3232    const TH2D *GetHist() const { return &fHist; }
    3333
     34    TH1 *GetHistByName(const TString name) { return &fHist; }
     35
    3436    void Draw(Option_t *option="");
    3537    TObject *DrawClone(Option_t *option="") const;
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h

    r1295 r1574  
    3030    const TH2D *GetHist() const { return &fHist; }
    3131
     32    TH1 *GetHistByName(const TString name) { return &fHist; }
     33
    3234    void Draw(Option_t *option="");
    3335    TObject *DrawClone(Option_t *option="") const;
  • trunk/MagicSoft/Mars/mhist/Makefile

    r1557 r1574  
    3232           MBinning.cc \
    3333           MH.cc \
     34           MHArray.cc \
    3435           MH3.cc \
    3536           MHMatrix.cc \
Note: See TracChangeset for help on using the changeset viewer.