Ignore:
Timestamp:
12/17/03 16:54:33 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfilter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfilter/MFEventSelector2.cc

    r2588 r2693  
    136136//     would result in redistributing cos(Theta).
    137137//
    138 //  If 'fUseOrigDistribution' is set to kTRUE (by SetUseOrigDistribution())
     138//  If the reference distribution doesn't contain entries (GetEntries()==0)
    139139//     the original distribution will be used as the nominal distribution;
    140140//     note that also in this case a dummy nominal distribution has to be
     
    150150    fName  = name  ? (TString)name  : gsDefName;
    151151    fTitle = title ? (TString)title : gsDefTitle;
    152  
    153     fUseOrigDistribution = kFALSE;
    154152}
    155153
     
    162160    if (fHistRes)
    163161        delete fHistRes;
    164 }
    165 
    166 // --------------------------------------------------------------------------
    167 //
    168 //
    169 //
    170 void MFEventSelector2::SetUseOrigDistribution(Bool_t b)
    171 {
    172     fUseOrigDistribution = b;
    173 
    174     *fLog << inf;
    175     *fLog << "MFEventSelector2 set ";
    176     if (!b)
    177         *fLog << "not ";
    178     *fLog << "to use the distribution from the input file as target distribution." << endl;
    179162}
    180163
     
    268251    // set the nominal distribution equal to the original distribution
    269252
    270     TH1 *hnp = fUseOrigDistribution ? (TH1*)(fHistOrig->GetHist()).Clone() : &fHistNom->GetHist();
     253    const Bool_t useorigdist = fHistNom->GetHist().GetEntries()==0;
     254    TH1 *hnp =  useorigdist ? (TH1*)(fHistOrig->GetHist()).Clone() : &fHistNom->GetHist();
    271255
    272256    TH1 &hn = *hnp;
     
    336320    }
    337321
    338     if (fUseOrigDistribution)
     322    if (useorigdist)
    339323      delete hnp;
    340324}
  • trunk/MagicSoft/Mars/mfilter/MFEventSelector2.h

    r2587 r2693  
    4141    TCanvas   *fCanvas;   //! canvas for online display
    4242
    43     Bool_t fUseOrigDistribution;
    44 
    4543    Bool_t fResult;
    4644    Int_t  fCounter[2];
     
    6058    ~MFEventSelector2();
    6159
    62     void SetUseOrigDistribution(Bool_t b=kTRUE);
    63     MH3 *GetHistOrig()                       { return fHistOrig; }
     60    MH3 *GetHistOrig() { return fHistOrig; }
    6461
    6562    void SetNumMax(Long_t max=-1) { fNumMax = max; }
Note: See TracChangeset for help on using the changeset viewer.