CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoParticleFlow/PFClusterTools/src/PFResolutionMapManager.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFClusterTools/interface/PFResolutionMapManager.h"
00002 #include <iostream>
00003 #include <TFile.h>
00004 
00005 using namespace std;
00006 
00007 PFResolutionMapManager::PFResolutionMapManager(const char * mapfile){
00008   TFile f(mapfile);
00009   TH2D *hSEtaC = (TH2D*)f.Get("Sigma_Eta_WithECorrection");
00010   TH2D *hSEta = (TH2D*)f.Get("Sigma_Eta");
00011   TH2D *hSPhiC = (TH2D*)f.Get("Sigma_Phi_WithECorrection");
00012   TH2D *hSPhi = (TH2D*)f.Get("Sigma_Phi");
00013 
00014   M1 = PFResolutionMap(*hSEtaC);
00015   M2 = PFResolutionMap(*hSEta);
00016   M3 = PFResolutionMap(*hSPhiC);
00017   M4 = PFResolutionMap(*hSPhi);
00018 }
00019 
00020 const PFResolutionMap& PFResolutionMapManager::GetResolutionMap(bool MapEta,bool Corr){
00021   if(MapEta){
00022     if(Corr) return M1;
00023     else return M2;
00024   }
00025   else{
00026     if(Corr) return M3;
00027     else return M4;
00028   }
00029 }