Changeset 6536 for trunk/MagicSoft


Ignore:
Timestamp:
02/16/05 17:05:33 (20 years ago)
Author:
hengsteb
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc

    r6530 r6536  
    3131#include "MRFEnergyEst.h"
    3232
    33 #include <TFile.h>
    34 #include <TList.h>
    35 
    36 #include <TH1F.h>
    37 #include <TH2F.h>
    38 #include <TStyle.h>
    39 #include <TCanvas.h>
    40 #include <TVector.h>
    41 
    42 #include "MHMatrix.h"
    43 
    4433#include "MLog.h"
    4534#include "MLogManip.h"
     
    5342#include "MRanForestGrow.h"
    5443#include "MData.h"
    55 #include "MEnergyEst.h"
     44#include "TFile.h"
     45#include "TList.h"
     46
     47#include "TH1F.h"
     48#include "TH2F.h"
     49#include "TStyle.h"
     50#include "TCanvas.h"
    5651
    5752ClassImp(MRFEnergyEst);
     
    274269    {
    275270        Double_t e_true = (*mptr)(i,ncols-1);
    276         Double_t e_est = -1;
    277         Double_t hmax  = -1;
     271        Double_t e_est = 0;
     272        Double_t hmax  = 0;
     273        Double_t hsum  = 0;
     274
    278275        for(Int_t j=0;j<nbins;j++)
    279276        {
     
    281278            Double_t h = ((MRanForest*) (fEForests[j]))->CalcHadroness(v);
    282279            Double_t e = atof((fEForests[j])->GetTitle());
    283             if(h>=hmax)
     280            /*if(h>=hmax)
    284281            {
    285282                hmax=h;
    286283                e_est=pow(10.,e);
    287             }
     284            }*/
     285            hsum+=h;
     286            e_est+=h*e;
    288287        }
     288        e_est/=hsum;
     289        e_est=pow(10.,e_est);
    289290
    290291        if(e_true>80.) hres.Fill((e_est-e_true)/e_true);
     
    406407    *fData >> event;
    407408
    408     Double_t e_est = -1;
    409     Double_t hmax  = -1;
     409    Double_t e_est = 0;
     410    Double_t hmax  = 0;
     411    Double_t hsum  = 0;
    410412       
    411413    for(Int_t j=0;j<fEForests.GetSize();j++)
     
    413415        Double_t h = ((MRanForest*) (fEForests[j]))->CalcHadroness(event);
    414416        Double_t e = atof((fEForests[j])->GetTitle());
    415         if(h>=hmax)
     417        /*if(h>=hmax)
    416418        {
    417419            hmax=h;
    418420            e_est=pow(10.,e);
    419         }
    420     }
     421        }*/
     422        hsum+=h;
     423        e_est+=h*e;
     424    }
     425    e_est/=hsum;
     426    e_est=pow(10.,e_est);
    421427
    422428    fEnergyEst->SetEnergy(e_est);
Note: See TracChangeset for help on using the changeset viewer.