-- SeoKonKang - 11 Oct 2010

{
 gROOT->Reset();

 gROOT->ProcessLine(".L TrackFlatnessAlgo.cc");
 gStyle->SetPalette(1);

 TFile* f = new TFile("../TrkEtaPhi.root","READ");
 TH2F* Track = (TH2F*)f.Get("trkEtaPhi");
 TCanvas* can1 = new TCanvas("can1","can1",600,600);
 Track->Draw("colz");

 int etaNbins = Track->GetNbinsX();
 int phiNbins = Track->GetNbinsY();
 double firstX = Track->GetXaxis()->GetBinLowEdge(1);
 double lastX = Track->GetXaxis()->GetBinUpEdge(etaNbins);
 double firstY = Track->GetYaxis()->GetBinLowEdge(1);
 double lastY = Track->GetYaxis()->GetBinUpEdge(phiNbins);
 int firstSetBins = (firstX*(-1)-2.1)*(etaNbins/(lastX-firstX));
 int firstSetBins = 1;

 TH2F* wTable = new TH2F("TrkWeight","Weight table for 2#sigma correction",etaNbins,firstX,lastX,phiNbins,firstY,lastY);

 TH2F* corrTrack=flattedtrack(Track);
 corrTrack->SetTitle("CorrectedTracks");

 TCanvas* can2 = new TCanvas("can2","can2",600,600);
 corrTrack->Draw("colz");

 ofstream fout("wTableTrk.txt");

 for(int i=1;iGetBinContent(i,j);
       double corr_value = corrTrack->GetBinContent(i,j);
        if(value==0) double w=1.;
        else double w = corr_value/value;
        fout << w << "\t";
       wTable->SetBinContent(i,j,w);
    }
        fout << endl;
 }
 fout.close();

 TCanvas* can3 = new TCanvas("can3","can3",600,600);
 can3->SetLogz();
 wTable->Draw("colz");
 TFile* CorrTrk = new TFile("FixedTrk.root","RECREATE");
 CorrTrk->cd();
 Track->Write();
 corrTrack->Write();
 wTable->Write();
}

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-10-11 - SeoKonKang
 
KOREA-CMS
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding KoreaCmsWiki? Send feedback