Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:12

0001 void printGctValidationHistos()
0002 {
0003   TFile *f = new TFile("gctValidationPlots.root");
0004 
0005   TPDF *outf = new TPDF("gctValidationHistos.pdf");
0006 
0007   TCanvas *c1 = new TCanvas;
0008 
0009   gStyle->SetPalette(1);
0010 
0011   c1->Divide(2,2);
0012   c1->cd(1); Plot(f,"l1GctValidation/L1GctEtSums/SumEtInGeV","Total Et (GeV)"); c1->Update();
0013   c1->cd(2); Plot(f,"l1GctValidation/L1GctEtSums/SumHtInGeV","Total Ht (GeV)"); c1->Update();
0014   c1->cd(3); Plot(f,"l1GctValidation/L1GctEtSums/SumEtInLsb","Total Et (L1 units)"); c1->Update();
0015   c1->cd(4); Plot(f,"l1GctValidation/L1GctEtSums/SumHtInLsb","Total Ht (L1 units)"); c1->Update();
0016 
0017   c1->Clear();
0018 
0019   c1->Divide(2,2);
0020   c1->cd(1); Plot(f,"l1GctValidation/L1GctEtSums/SumEtVsInputRegions","Total Et (GeV)", "Total Et from input regions"); c1->Update();
0021   c1->cd(2); Plot(f,"l1GctValidation/L1GctEtSums/MissEtMagVsInputRegions","Missing Et (GeV)", "Missing Et from input regions"); c1->Update();
0022   c1->cd(3); Plot(f,"l1GctValidation/L1GctEtSums/MissEtAngleVsInputRegions","Mising Et phi", "Missing Et phi from input regions"); c1->Update();
0023   c1->cd(4); Plot(f,"l1GctValidation/L1GctEtSums/MissHtMagVsInputRegions","Missing Ht", "Missing Et from input regions"); c1->Update();
0024 
0025   c1->Clear();
0026 
0027   ((TH1*) f->Get("l1GctValidation/L1GctEtSums/MissEtAngle"))->SetMinimum(0);
0028 
0029   c1->Divide(3,4);
0030   c1->cd(1);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtInGeV","Missing Et (GeV)"); c1->Update();
0031   c1->cd(2);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtAngle","Missing Et phi (radians)"); c1->Update();
0032   c1->cd(4);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtInLsb","Missing Et (L1 units)"); c1->Update();
0033   c1->cd(5);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtVector","Missing Ex (GeV)", "Missing Ey (GeV)", "col"); c1->Update();
0034   c1->cd(7);  Plot(f,"l1GctValidation/L1GctEtSums/MissHtInGeV","Missing Et (GeV)"); c1->Update();
0035   c1->cd(8);  Plot(f,"l1GctValidation/L1GctEtSums/MissHtAngle","Missing Et phi (radians)"); c1->Update();
0036   c1->cd(10); Plot(f,"l1GctValidation/L1GctEtSums/MissHtInLsb","Missing Et (L1 units)"); c1->Update();
0037   c1->cd(11); Plot(f,"l1GctValidation/L1GctEtSums/MissHtVector","Missing Ex (GeV)", "Missing Ey (GeV)", "col"); c1->Update();
0038 
0039   c1->cd(3);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtVsMissHt","Missing Et (GeV)", "Missing Ht (GeV)", "col"); c1->Update();
0040   c1->cd(6);  Plot(f,"l1GctValidation/L1GctEtSums/MissEtVsMissHtAngle","Missing Et phi", "Missing Ht phi", "col"); c1->Update();
0041   c1->cd(9);  Plot(f,"l1GctValidation/L1GctEtSums/theDPhiVsMissEt","(Met phi)-(Mht phi)", "Missing Et mag", "col"); c1->Update();
0042   c1->cd(12); Plot(f,"l1GctValidation/L1GctEtSums/theDPhiVsMissHt","(Met phi)-(Mht phi)", "Missing Ht mag", "col"); c1->Update();
0043 
0044   c1->Clear();
0045 
0046   c1->Divide(3,2);
0047   c1->cd(1); Plot(f,"l1GctValidation/L1GctEtSums/HtVsInternalJetsSum","Total Ht", "Scalar sum of jet Et"); c1->Update();
0048   c1->cd(2); Plot(f,"l1GctValidation/L1GctEtSums/MissHtVsInternalJetsSum","Missing Ht", "Vector sum of jet Et"); c1->Update();
0049   c1->cd(3); Plot(f,"l1GctValidation/L1GctEtSums/MissHtPhiVsInternalJetsSum","Missing Ht", "Vector sum of jet Et"); c1->Update();
0050   c1->cd(4); Plot(f,"l1GctValidation/L1GctEtSums/MissHxVsInternalJetsSum","x component of missing Ht", "Sum of jet Ex"); c1->Update();
0051   c1->cd(5); Plot(f,"l1GctValidation/L1GctEtSums/MissHyVsInternalJetsSum","y component of missing Ht", "Sum of jet Ey"); c1->Update();
0052 
0053   c1->Clear();
0054 
0055   gStyle->SetOptLogy(1);
0056   c1->Divide(4,2);
0057   c1->cd(1); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing0EtSumPositiveEta","Hf Inner Ring Et"); c1->Update();
0058   c1->cd(2); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing0EtSumNegativeEta","Hf Inner Ring Et"); c1->Update();
0059   c1->cd(3); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing1EtSumPositiveEta","Hf Inner Ring Et"); c1->Update();
0060   c1->cd(4); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing1EtSumNegativeEta","Hf Inner Ring Et"); c1->Update();
0061   c1->cd(5); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing0CountPositiveEta","Hf feature bits"); c1->Update();
0062   c1->cd(6); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing0CountNegativeEta","Hf feature bits"); c1->Update();
0063   c1->cd(7); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing1CountPositiveEta","Hf feature bits"); c1->Update();
0064   c1->cd(8); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/HfRing1CountNegativeEta","Hf feature bits"); c1->Update();
0065   gStyle->SetOptLogy(0);
0066 
0067 //   c1->Clear();
0068 
0069 //   c1->Divide(2,3);
0070 
0071 //   //gPad->SetLogy(1);
0072 //   c1->cd(1); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#0","Count"); c1->Update();
0073 //   c1->cd(2); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#1","Count"); c1->Update();
0074 //   c1->cd(3); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#2","Count"); c1->Update();
0075 //   c1->cd(4); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#3","Count"); c1->Update();
0076 //   c1->cd(5); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#4","Count"); c1->Update();
0077 //   c1->cd(6); Plot(f,"l1GctValidation/L1GctHfSumsAndJetCounts/JetCount#5","Count"); c1->Update();
0078 
0079   outf->Close();
0080 
0081 }
0082 
0083 void Plot(TFile* f, TString Hist, TString XAxisLabel, TString YAxisLabel="Events", TString Opt="")
0084 {
0085 
0086   // Get the histograms from the files
0087   TH1D *H   = (TH1D*)f->Get(Hist);
0088 
0089   // Add the X axis label
0090   H->GetXaxis()->SetTitle(XAxisLabel);
0091   H->GetYaxis()->SetTitle(YAxisLabel);
0092 
0093   H->SetFillColor(kRed);
0094   //H->SetMinimum(0);
0095   //H->GetXaxis()->SetRangeUser(0.0, 200.0);
0096 
0097   // plot 
0098   H->Draw(Opt);
0099 
0100 }