Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:21

0001 #include <iostream>
0002 #include <fstream>
0003 #include <iomanip>
0004 #include <string>
0005 #include <list>
0006 
0007 #include <math.h>
0008 #include <vector>
0009 
0010 #include "Rtypes.h"
0011 #include "TROOT.h"
0012 #include "TRint.h"
0013 #include "TObject.h"
0014 #include "TFile.h"
0015 // #include "TTree.h"
0016 #include "TH1F.h"
0017 #include "TCanvas.h"
0018 #include "TApplication.h"
0019 #include "TRefArray.h"
0020 #include "TStyle.h"
0021 #include "TGraph.h"
0022 #include "TLegend.h"
0023 
0024 void plotKine( std::string topology )
0025 {
0026 
0027    gStyle->SetOptStat(0);
0028    
0029    std::string fnamePy6 = "GenJets_MG_Py6_" + topology + ".root";
0030    std::string fnamePy8 = "GenJets_MG_Py8_" + topology + ".root";
0031    
0032    TFile* f1 = new TFile( fnamePy6.c_str() );
0033    TFile* f2 = new TFile( fnamePy8.c_str() );
0034    
0035    TLegend* leg1 = new TLegend(0.6, 0.70, 0.9, 0.9);
0036    TLegend* leg2 = new TLegend(0.5, 0.70, 0.9, 0.9);
0037    TLegend* leg3 = new TLegend(0.5, 0.70, 0.9, 0.9);
0038    TLegend* leg4 = new TLegend(0.5, 0.70, 0.9, 0.9);
0039    
0040    // Py6
0041    //
0042    f1->cd("test");
0043 
0044    NJets->SetMarkerStyle(21);
0045    NJets->SetMarkerColor(kBlue);
0046    NJets->SetMarkerSize(0.9);
0047 
0048    NJetsAboveQCut->SetLineColor(kBlue);
0049    NJetsAboveQCut->SetLineWidth(2);
0050    
0051    LeadingJetPt->SetLineColor(kBlue);
0052    LeadingJetPt->SetLineWidth(2);
0053    Next2LeadingJetPt->SetLineColor(kBlue);
0054    Next2LeadingJetPt->SetLineWidth(2);
0055    LowestJetHt->SetLineColor(kBlue);
0056    LowestJetHt->SetLineWidth(2);     
0057      
0058    f2->cd("test");
0059 
0060    
0061    NJets->SetMarkerStyle(21);
0062    NJets->SetMarkerColor(kRed);
0063    NJets->SetMarkerSize(0.9);
0064 
0065    NJetsAboveQCut->SetLineColor(kRed);
0066    NJetsAboveQCut->SetLineWidth(2);
0067 
0068    LeadingJetPt->SetLineColor(kRed);
0069    LeadingJetPt->SetLineWidth(2);
0070    Next2LeadingJetPt->SetLineColor(kRed);
0071    Next2LeadingJetPt->SetLineWidth(2);
0072    LowestJetHt->SetLineColor(kRed);
0073    LowestJetHt->SetLineWidth(2);     
0074 
0075       
0076    TCanvas* myc1 = new TCanvas( "myc1", topology.c_str(), 800, 600 );
0077    myc1->Divide(2,1);
0078 
0079 //   TPad* p2 = new TPad( "p2", "", 0.01, 0.34, 0.49, 0.66 );
0080 //   TPad* p1 = new TPad( "p1", "", 0.01, 0.66, 0.99, 0.99 );
0081 //   TPad* p3 = new TPad( "p3", "", 0.51, 0.34, 0.99, 0.66 );
0082 //   TPad* p4 = new TPad( "p4", "", 0.01, 0.01, 0.49, 0.33 );
0083 //   TPad* p5 = new TPad( "p5", "", 0.51, 0.01, 0.99, 0.33 );
0084    
0085 //   p1->Draw();
0086 //   p2->Draw();
0087 //   p3->Draw();
0088 //   p4->Draw();
0089 //   p5->Draw();
0090 
0091 //   p1->cd();
0092 
0093    myc1->cd(1);
0094    f1->cd("test");
0095    NJets->Draw("pe");
0096    leg1->AddEntry( NJets, "Pythia6", "p");
0097    f2->cd("test");
0098    NJets->Draw("pesame"); //pesame");
0099    leg1->AddEntry( NJets, "Pythia8", "p");
0100    leg1->Draw();
0101    
0102    float scale = 1.;
0103    
0104    myc1->cd(2);
0105    f1->cd("test");
0106 //   scale = 1./NJets->Integral();
0107 //   NJets->DrawNormalized("p", scale);
0108    leg2->SetTextSize(0.05);
0109    leg2->AddEntry( "", "Normalized", "" );
0110    leg2->AddEntry( NJets, "Pythia6", "p");
0111    f2->cd("test");
0112    scale = 1./NJets->Integral();
0113    NJets->DrawNormalized("p", scale);
0114    leg2->AddEntry( NJets, "Pythia8", "p");
0115    f1->cd("test");
0116    scale = 1./NJets->Integral();
0117    NJets->DrawNormalized("psame", scale);
0118    leg2->Draw();
0119       
0120    TCanvas* myc2 = new TCanvas( "myc2", topology.c_str(), 800, 600 );
0121    myc2->Divide(2,1);
0122 
0123    float scale1 = 1.;
0124    float scale2 = 1.;
0125    
0126    myc2->cd(1);
0127    f1->cd("test");
0128    NJetsAboveQCut->Draw(); 
0129    leg3->AddEntry( NJetsAboveQCut, "Pythia6" ); 
0130    f2->cd("test");
0131    NJetsAboveQCut->Draw("same"); 
0132    leg3->AddEntry( NJetsAboveQCut, "Pythia8" ); 
0133    //f1->cd("test");
0134    //NJetsAboveQCut->Draw("same"); 
0135    leg3->Draw();
0136    
0137    myc2->cd(2);
0138    f1->cd("test");
0139    //scale1 = 1./NJetsAboveQCut->Integral();
0140    //NJetsAboveQCut->DrawNormalized("", scale1);
0141    leg4->SetTextSize(0.05);
0142    leg4->AddEntry( "", "Normalized", "" );
0143    leg4->AddEntry( NJetsAboveQCut, "Pythia6" ); 
0144    f2->cd("test");
0145    scale2 = 1./NJetsAboveQCut->Integral();
0146    leg4->AddEntry( NJetsAboveQCut, "Pythia8" );
0147    NJetsAboveQCut->DrawNormalized("", scale2);
0148    f1->cd("test");
0149    scale1 = 1./NJetsAboveQCut->Integral();
0150    NJetsAboveQCut->DrawNormalized("same", scale1);
0151    leg4->Draw();
0152       
0153    TCanvas* myc3 = new TCanvas( "myc3", topology.c_str(), 1200, 600 );
0154    myc3->Divide(3,1);
0155 
0156 //   p2->cd();
0157 
0158    myc3->cd(1);
0159    f2->cd("test");
0160    LeadingJetPt->DrawNormalized("",scale2);
0161    f1->cd("test");
0162    LeadingJetPt->DrawNormalized("same",scale1);
0163    leg4->Draw();
0164    
0165    myc3->cd(2);
0166    f2->cd("test");
0167    Next2LeadingJetPt->DrawNormalized("",scale2);
0168    f1->cd("test");
0169    Next2LeadingJetPt->DrawNormalized("same",scale1);
0170    leg4->Draw();
0171    
0172    myc3->cd(3);
0173    f2->cd("test");
0174    LowestJetHt->DrawNormalized("",scale2);
0175    f1->cd("test");
0176    LowestJetHt->DrawNormalized("same",scale1);
0177    leg4->Draw();
0178      
0179    myc3->cd();
0180    
0181    return;
0182 
0183 }