Changeset 85ad2b9 in git
- Timestamp:
- Sep 29, 2016, 2:50:28 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 933e560
- Parents:
- 5348ed9
- Location:
- examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/Validation.cpp
r5348ed9 r85ad2b9 1265 1265 if(logy) gPad->SetLogy(); 1266 1266 1267 1267 1268 //gPad->SetGridx(); 1268 1269 //gPad->SetGridy(); … … 1275 1276 1276 1277 1277 void Validation(const char *inputFilePion, const char *inputFileElectron, const char *inputFileMuon, const char *inputFilePhoton, const char *inputFileNeutralHadron, const char *inputFileJet, const char *inputFileBJet, const char *inputFileCJet, const char *inputFileTauJet, const char *outputFile) 1278 void Validation(const char *inputFilePion, 1279 const char *inputFileElectron, 1280 const char *inputFileMuon, 1281 const char *inputFilePhoton, 1282 const char *inputFileNeutralHadron, 1283 const char *inputFileJet, 1284 const char *inputFileBJet, 1285 const char *inputFileCJet, 1286 const char *inputFileTauJet, 1287 const char *outputFile, 1288 const char *version) 1278 1289 { 1279 1290 … … 1379 1390 figPath.Remove(lastSlash+1,sizePath); 1380 1391 1392 TString header = pdfOutput; 1393 header.ReplaceAll(".pdf", ""); 1394 header.ReplaceAll("validation_", ""); 1395 lastSlash = header.Last('/'); 1396 sizePath = header.Length(); 1397 header.Remove(0,lastSlash+1); 1398 1399 TString vrs(version); 1400 1401 TPaveText *pave = new TPaveText(0.0, 0.89, 0.94, 0.94,"NDC"); 1402 pave->SetTextAlign(kHAlignRight); 1403 pave->SetTextFont(132); 1404 pave->SetBorderSize(0); 1405 pave->SetShadowColor(0); 1406 pave->SetFillColor(0); 1407 pave->SetFillStyle(0); 1408 pave->AddText("Delphes "+vrs+" - "+header); 1409 1381 1410 TString s_etaMin, s_etaMax, s_eta, s_pt, s_e; 1382 1411 … … 1474 1503 DrawAxis(mg_trkpi_res_pt, leg_trkpi_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true); 1475 1504 leg_trkpi_res_pt->Draw(); 1505 pave->Draw(); 1476 1506 1477 1507 c_trkpi_res_pt->Print(pdfOutput+"(","pdf"); … … 1484 1514 DrawAxis(mg_trkpi_res_eta, leg_trkpi_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true); 1485 1515 leg_trkpi_res_eta->Draw(); 1516 pave->Draw(); 1486 1517 1487 1518 c_trkpi_res_eta->Print(pdfOutput,"pdf"); … … 1494 1525 DrawAxis(mg_trkpi_eff_pt, leg_trkpi_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false); 1495 1526 leg_trkpi_eff_pt->Draw(); 1527 pave->Draw(); 1496 1528 1497 1529 c_trkpi_eff_pt->Print(pdfOutput,"pdf"); … … 1504 1536 DrawAxis(mg_trkpi_eff_eta, leg_trkpi_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false); 1505 1537 leg_trkpi_eff_eta->Draw(); 1538 pave->Draw(); 1539 1506 1540 1507 1541 c_trkpi_eff_eta->Print(pdfOutput,"pdf"); … … 1571 1605 DrawAxis(mg_trkele_res_pt, leg_trkele_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true); 1572 1606 leg_trkele_res_pt->Draw(); 1607 pave->Draw(); 1573 1608 1574 1609 c_trkele_res_pt->Print(pdfOutput,"pdf"); … … 1581 1616 DrawAxis(mg_trkele_res_eta, leg_trkele_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true); 1582 1617 leg_trkele_res_eta->Draw(); 1618 pave->Draw(); 1583 1619 1584 1620 c_trkele_res_eta->Print(pdfOutput,"pdf"); … … 1591 1627 DrawAxis(mg_trkele_eff_pt, leg_trkele_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false); 1592 1628 leg_trkele_eff_pt->Draw(); 1629 pave->Draw(); 1593 1630 1594 1631 c_trkele_eff_pt->Print(pdfOutput,"pdf"); … … 1601 1638 DrawAxis(mg_trkele_eff_eta, leg_trkele_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false); 1602 1639 leg_trkele_eff_eta->Draw(); 1640 pave->Draw(); 1603 1641 1604 1642 c_trkele_eff_eta->Print(pdfOutput,"pdf"); … … 1671 1709 DrawAxis(mg_trkmu_res_pt, leg_trkmu_res_pt, ptMin, ptMax, 0.01, 100, "p_{T} [GeV]", "(track resolution in p_{T})/p_{T} (%)", true, true); 1672 1710 leg_trkmu_res_pt->Draw(); 1711 pave->Draw(); 1673 1712 1674 1713 c_trkmu_res_pt->Print(pdfOutput,"pdf"); … … 1681 1720 DrawAxis(mg_trkmu_res_eta, leg_trkmu_res_eta, etaMin, etaMax, 0.01, 100, " #eta ", "(track resolution in p_{T})/p_{T} (%)", false, true); 1682 1721 leg_trkmu_res_eta->Draw(); 1722 pave->Draw(); 1683 1723 1684 1724 c_trkmu_res_eta->Print(pdfOutput,"pdf"); … … 1691 1731 DrawAxis(mg_trkmu_eff_pt, leg_trkmu_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "tracking efficiency (%)", true, false); 1692 1732 leg_trkmu_eff_pt->Draw(); 1733 pave->Draw(); 1693 1734 1694 1735 c_trkmu_eff_pt->Print(pdfOutput,"pdf"); … … 1701 1742 DrawAxis(mg_trkmu_eff_eta, leg_trkmu_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "tracking efficiency (%)", false, false); 1702 1743 leg_trkmu_eff_eta->Draw(); 1744 pave->Draw(); 1703 1745 1704 1746 c_trkmu_eff_eta->Print(pdfOutput,"pdf"); … … 1758 1800 DrawAxis(mg_ecal_res_e, leg_ecal_res_e, ptMin, ptMax, 0.0, 20, "E [GeV]", "(ECAL resolution in E)/E (%)", true, false); 1759 1801 leg_ecal_res_e->Draw(); 1802 pave->Draw(); 1760 1803 1761 1804 c_ecal_res_e->Print(pdfOutput,"pdf"); … … 1769 1812 DrawAxis(mg_ecal_res_eta, leg_ecal_res_eta, etaMin, etaMax, 0.0, 20, " #eta ", "(ECAL resolution in E)/E (%)", false, false); 1770 1813 leg_ecal_res_eta->Draw(); 1814 pave->Draw(); 1771 1815 1772 1816 c_ecal_res_eta->Print(pdfOutput,"pdf"); … … 1827 1871 DrawAxis(mg_hcal_res_e, leg_hcal_res_e, ptMin, ptMax, 0.0, 50, "E [GeV]", "(HCAL resolution in E)/E (%)", true, false); 1828 1872 leg_hcal_res_e->Draw(); 1873 pave->Draw(); 1829 1874 1830 1875 c_hcal_res_e->Print(pdfOutput,"pdf"); … … 1838 1883 DrawAxis(mg_hcal_res_eta, leg_hcal_res_eta, etaMin, etaMax, 0.0, 50, " #eta ", "(HCAL resolution in E)/E (%)", false, false); 1839 1884 leg_hcal_res_eta->Draw(); 1885 pave->Draw(); 1840 1886 1841 1887 c_hcal_res_eta->Print(pdfOutput,"pdf"); … … 1889 1935 DrawAxis(mg_pfele_res_e[k], leg_pfele_res_e[k], ptMin, ptMax, 0.0, 20, "E [GeV]", "(resolution in E)/E (%)", true, false); 1890 1936 leg_pfele_res_e[k]->Draw(); 1937 pave->Draw(); 1891 1938 1892 1939 TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_"; … … 1927 1974 DrawAxis(mg_pfele_res_eta[k], leg_pfele_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false); 1928 1975 leg_pfele_res_eta[k]->Draw(); 1976 pave->Draw(); 1929 1977 1930 1978 TString s_ptrange = Form("pt_%.0f_",ptVals.at(k)); … … 1982 2030 DrawAxis(mg_pfpi_res_e[k], leg_pfpi_res_e[k], ptMin, ptMax, 0.1, 50, "E [GeV]", "(resolution in E)/E (%)", true, false); 1983 2031 leg_pfpi_res_e[k]->Draw(); 2032 pave->Draw(); 1984 2033 1985 2034 TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_"; … … 2019 2068 DrawAxis(mg_pfpi_res_eta[k], leg_pfpi_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false); 2020 2069 leg_pfpi_res_eta[k]->Draw(); 2070 pave->Draw(); 2021 2071 2022 2072 TString s_ptrange = Form("pt_%.0f_",ptVals.at(k)); … … 2084 2134 DrawAxis(mg_pfjet_res_e[k], leg_pfjet_res_e[k], 10, ptMax, 0.0, 30, "E [GeV]", "(resolution in E)/E (%)", true, false); 2085 2135 leg_pfjet_res_e[k]->Draw(); 2136 pave->Draw(); 2086 2137 2087 2138 TString s_etarange = "eta_"+s_etaMin+"_"+s_etaMax+"_"; … … 2125 2176 DrawAxis(mg_pfjet_res_eta[k], leg_pfjet_res_eta[k], etaMin, etaMax, 0.0, 50, "#eta", "(resolution in E)/E (%)", false, false); 2126 2177 leg_pfjet_res_eta[k]->Draw(); 2178 pave->Draw(); 2127 2179 2128 2180 TString s_ptrange = Form("pt_%.0f_",ptVals.at(k)); … … 2162 2214 2163 2215 leg_met_res_ht->Draw(); 2164 2216 pave->Draw(); 2165 2217 c_met_res_ht->Print(pdfOutput,"pdf"); 2166 2218 c_met_res_ht->Print(figPath+"img_met_res_ht.pdf","pdf"); … … 2215 2267 DrawAxis(mg_recele_eff_pt, leg_recele_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false); 2216 2268 leg_recele_eff_pt->Draw(); 2269 pave->Draw(); 2217 2270 2218 2271 c_recele_eff_pt->Print(pdfOutput,"pdf"); … … 2225 2278 DrawAxis(mg_recele_eff_eta, leg_recele_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false); 2226 2279 leg_recele_eff_eta->Draw(); 2280 pave->Draw(); 2227 2281 2228 2282 c_recele_eff_eta->Print(pdfOutput,"pdf"); … … 2278 2332 DrawAxis(mg_recmu_eff_pt, leg_recmu_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false); 2279 2333 leg_recmu_eff_pt->Draw(); 2334 pave->Draw(); 2280 2335 2281 2336 c_recmu_eff_pt->Print(pdfOutput,"pdf"); … … 2288 2343 DrawAxis(mg_recmu_eff_eta, leg_recmu_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false); 2289 2344 leg_recmu_eff_eta->Draw(); 2345 pave->Draw(); 2290 2346 2291 2347 c_recmu_eff_eta->Print(pdfOutput,"pdf"); … … 2341 2397 DrawAxis(mg_recpho_eff_pt, leg_recpho_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "reconstruction efficiency (%)", true, false); 2342 2398 leg_recpho_eff_pt->Draw(); 2399 pave->Draw(); 2343 2400 2344 2401 c_recpho_eff_pt->Print(pdfOutput,"pdf"); … … 2351 2408 DrawAxis(mg_recpho_eff_eta, leg_recpho_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "reconstruction efficiency (%)", false, false); 2352 2409 leg_recpho_eff_eta->Draw(); 2410 pave->Draw(); 2353 2411 2354 2412 c_recpho_eff_eta->Print(pdfOutput,"pdf"); … … 2403 2461 DrawAxis(mg_recbjet_eff_pt, leg_recbjet_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "b - tag efficiency (%)", true, false); 2404 2462 leg_recbjet_eff_pt->Draw(); 2463 pave->Draw(); 2405 2464 2406 2465 c_recbjet_eff_pt->Print(pdfOutput,"pdf"); … … 2413 2472 DrawAxis(mg_recbjet_eff_eta, leg_recbjet_eff_eta, etaMin, etaMax, 0.0, 100, " #eta ", "b - tag efficiency (%)", false, false); 2414 2473 leg_recbjet_eff_eta->Draw(); 2474 pave->Draw(); 2415 2475 2416 2476 c_recbjet_eff_eta->Print(pdfOutput,"pdf"); … … 2465 2525 DrawAxis(mg_recbjet_cmis_pt, leg_recbjet_cmis_pt, ptMin, ptMax, 0.0, 20, "p_{T} [GeV]", "c - mistag rate (%)", true, false); 2466 2526 leg_recbjet_cmis_pt->Draw(); 2527 pave->Draw(); 2467 2528 2468 2529 c_recbjet_cmis_pt->Print(pdfOutput,"pdf"); … … 2475 2536 DrawAxis(mg_recbjet_cmis_eta, leg_recbjet_cmis_eta, etaMin, etaMax, 0.0, 20, " #eta ", "c - mistag rate (%)", false, false); 2476 2537 leg_recbjet_cmis_eta->Draw(); 2538 pave->Draw(); 2477 2539 2478 2540 c_recbjet_cmis_eta->Print(pdfOutput,"pdf"); … … 2525 2587 DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.1, "p_{T} [GeV]", "light - mistag rate (%)", true, false); 2526 2588 leg_recbjet_lmis_pt->Draw(); 2589 pave->Draw(); 2527 2590 2528 2591 c_recbjet_lmis_pt->Print(pdfOutput,"pdf"); … … 2535 2598 DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.1, " #eta ", "light - mistag rate (%)", false, false); 2536 2599 leg_recbjet_lmis_eta->Draw(); 2600 pave->Draw(); 2537 2601 2538 2602 c_recbjet_lmis_eta->Print(pdfOutput,"pdf"); … … 2589 2653 DrawAxis(mg_rectaujet_eff_pt, leg_rectaujet_eff_pt, ptMin, ptMax, 0.0, 100, "p_{T} [GeV]", "#tau - tag efficiency (%)", true, false); 2590 2654 leg_rectaujet_eff_pt->Draw(); 2655 pave->Draw(); 2591 2656 2592 2657 c_rectaujet_eff_pt->Print(pdfOutput,"pdf"); … … 2599 2664 DrawAxis(mg_rectaujet_eff_eta, leg_rectaujet_eff_eta, etaMin, etaMax, 0.0000001, 100, " #eta ", "#tau - tag efficiency (%)", false, true); 2600 2665 leg_rectaujet_eff_eta->Draw(); 2666 pave->Draw(); 2601 2667 2602 2668 c_rectaujet_eff_eta->Print(pdfOutput,"pdf"); … … 2650 2716 DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 10., "p_{T} [GeV]", "#tau - mistag(%)", true, false); 2651 2717 leg_rectaujet_mis_pt->Draw(); 2718 pave->Draw(); 2652 2719 2653 2720 c_rectaujet_mis_pt->Print(pdfOutput,"pdf"); … … 2660 2727 DrawAxis(mg_rectaujet_mis_eta, leg_rectaujet_mis_eta, etaMin, etaMax, 0.0, 5., " #eta ", "#tau - mistag (%)", false, false); 2661 2728 leg_rectaujet_mis_eta->Draw(); 2729 pave->Draw(); 2662 2730 2663 2731 c_rectaujet_mis_eta->Print(pdfOutput+")","pdf"); … … 2731 2799 char *appName = "Validation"; 2732 2800 2733 if(argc != 1 1)2801 if(argc != 12) 2734 2802 { 2735 2803 cout << " Usage: " << appName << " input_file_electron input_file_muon input_file_photon input_file_jet input_file_bjet input_file_taujet output_file" << endl; … … 2744 2812 cout << " input_file_taujet - input file in ROOT format ('Delphes' tree)," << endl; 2745 2813 cout << " output_file - output file in ROOT format" << endl; 2814 cout << " delphes version" << endl; 2815 2746 2816 return 1; 2747 2817 } … … 2753 2823 TApplication app(appName, &appargc, appargv); 2754 2824 2755 Validation(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10] );2825 Validation(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], argv[11]); 2756 2826 } 2757 2827 -
examples/validation.sh
r5348ed9 r85ad2b9 16 16 # 17 17 # Note that the more events you specify, the more accurate the controls plots will be ... 18 # This said, 500k events should be ok for most cases. 18 19 # 19 20 ############################################################################################ … … 31 32 fi 32 33 33 card=$(basename $1) 34 cardbase=$(basename $1) 35 carddir=$(dirname $1) 34 36 nEvents=$2 35 validationCard=cards/validation_$card 36 output=validation_${card%.*}.root 37 mainoutputdir=report_${card%.*} 38 outputroot=report_${card%.*}/root 39 cardlabel=${card%.*} 37 validationCard=$carddir/validation_$cardbase 38 output=validation_${cardbase%.*}.root 39 mainoutputdir=report_${cardbase%.*} 40 outputroot=report_${cardbase%.*}/root 41 cardlabel=${cardbase%.*} 42 version=$(cat VERSION) 43 outpdf=$mainoutputdir/${output%.*}.pdf 44 40 45 41 46 mkdir -p $outputroot 42 47 mkdir -p $mainoutputdir/www/fig 43 48 44 sed 's/delphes_card_CMS.tcl/'$card '/g' cards/validation_card.tcl > $validationCard49 sed 's/delphes_card_CMS.tcl/'$cardbase'/g' cards/validation_card.tcl > $validationCard 45 50 46 51 function runParticleGun { … … 65 70 runParticleGun taujet 15 66 71 67 ./Validation $outputroot/particleGun_pion_$cardlabel.root $outputroot/particleGun_electron_$cardlabel.root $outputroot/particleGun_muon_$cardlabel.root $outputroot/particleGun_photon_$cardlabel.root $outputroot/particleGun_neutron_$cardlabel.root $outputroot/particleGun_jet_$cardlabel.root $outputroot/particleGun_bjet_$cardlabel.root $outputroot/particleGun_cjet_$cardlabel.root $outputroot/particleGun_taujet_$cardlabel.root $mainoutputdir/$output 72 ./Validation $outputroot/particleGun_pion_$cardlabel.root $outputroot/particleGun_electron_$cardlabel.root $outputroot/particleGun_muon_$cardlabel.root $outputroot/particleGun_photon_$cardlabel.root $outputroot/particleGun_neutron_$cardlabel.root $outputroot/particleGun_jet_$cardlabel.root $outputroot/particleGun_bjet_$cardlabel.root $outputroot/particleGun_cjet_$cardlabel.root $outputroot/particleGun_taujet_$cardlabel.root $mainoutputdir/$output $version 73 74 echo $outpdf 75 if grep -q SimpleCalorimeter "$1"; then 76 ./CaloGrid $1 ECal 77 ./CaloGrid $1 HCal 78 gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=tmp/tmp1.pdf $outpdf ECal.pdf 79 gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$outpdf tmp/tmp1.pdf HCal.pdf 80 mv ECal.pdf $mainoutputdir/www/fig/img_ecal.pdf 81 mv ECal.png $mainoutputdir/www/fig/img_ecal.png 82 mv HCal.pdf $mainoutputdir/www/fig/img_hcal.pdf 83 mv HCal.png $mainoutputdir/www/fig/img_hcal.png 84 else 85 ./CaloGrid $1 Calorimeter 86 gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=tmp/tmp1.pdf $outpdf Calorimeter.pdf 87 mv Calorimeter.pdf $mainoutputdir/www/fig/img_ecal.pdf 88 mv Calorimeter.png $mainoutputdir/www/fig/img_ecal.png 89 fi 90 91 92 93
Note:
See TracChangeset
for help on using the changeset viewer.