Changeset 6536 for trunk/MagicSoft
- Timestamp:
- 02/16/05 17:05:33 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc
r6530 r6536 31 31 #include "MRFEnergyEst.h" 32 32 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 44 33 #include "MLog.h" 45 34 #include "MLogManip.h" … … 53 42 #include "MRanForestGrow.h" 54 43 #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" 56 51 57 52 ClassImp(MRFEnergyEst); … … 274 269 { 275 270 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 278 275 for(Int_t j=0;j<nbins;j++) 279 276 { … … 281 278 Double_t h = ((MRanForest*) (fEForests[j]))->CalcHadroness(v); 282 279 Double_t e = atof((fEForests[j])->GetTitle()); 283 if(h>=hmax)280 /*if(h>=hmax) 284 281 { 285 282 hmax=h; 286 283 e_est=pow(10.,e); 287 } 284 }*/ 285 hsum+=h; 286 e_est+=h*e; 288 287 } 288 e_est/=hsum; 289 e_est=pow(10.,e_est); 289 290 290 291 if(e_true>80.) hres.Fill((e_est-e_true)/e_true); … … 406 407 *fData >> event; 407 408 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; 410 412 411 413 for(Int_t j=0;j<fEForests.GetSize();j++) … … 413 415 Double_t h = ((MRanForest*) (fEForests[j]))->CalcHadroness(event); 414 416 Double_t e = atof((fEForests[j])->GetTitle()); 415 if(h>=hmax)417 /*if(h>=hmax) 416 418 { 417 419 hmax=h; 418 420 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); 421 427 422 428 fEnergyEst->SetEnergy(e_est);
Note:
See TracChangeset
for help on using the changeset viewer.