Fork me on GitHub

Changeset cb159ed in git for examples


Ignore:
Timestamp:
Oct 13, 2016, 6:52:29 PM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
44b481d
Parents:
06a83b3
Message:

fixed tracks in pf plots vs e instead of pt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/Validation.cpp

    r06a83b3 rcb159ed  
    250250      eta = TMath::Abs(genMomentum.Eta());
    251251
     252
    252253      if(eta > etamax || eta < etamin ) continue;
    253254
     255      //cout<<"b parton: "<<pt<<endl;
    254256      if (particle->PID == pdgID && genMomentum.Pt() > ptmin && genMomentum.Pt() < ptmax )
    255257      {
     
    279281            if( !(jet->BTag & (1 << 0)) ) continue;
    280282          }
    281        
    282           if(TMath::Abs(pdgID) == 1)
     283
     284            if(TMath::Abs(pdgID) == 1)
    283285          {
    284286            Jet *jet = (Jet *)recoObj;
     
    299301          }
    300302        }
    301 
    302303        histGenPt->Fill(pt);
    303         if(deltaR < 0.3) { histRecoPt->Fill(pt); }
     304        if(deltaR < 0.3 && bestRecoMomentum.Pt()> 0.20*pt ) { histRecoPt->Fill(pt);}
    304305
    305306      }
     
    13521353  TClonesArray *branchCaloJet = treeReaderJet->UseBranch("CaloJet");
    13531354  TClonesArray *branchJet = treeReaderJet->UseBranch("Jet");
    1354  
     1355
    13551356  TClonesArray *branchParticleBJet = treeReaderBJet->UseBranch("Particle");
    13561357  TClonesArray *branchPFBJet = treeReaderBJet->UseBranch("Jet");
     
    14391440  const int n_ptbins = ptVals.size();
    14401441
    1441 
    14421442  //////////////////////////
    14431443  // Tracking performance //
     
    19061906  TGraphErrors gr_pfele_res_eta[n_ptbins];
    19071907
     1908  TGraphErrors gr_trkele_res_e[n_etabins];
     1909  TGraphErrors gr_trkele_res_eeta[n_ptbins];
     1910
    19081911  std::vector<resolPlot> plots_pfele_res_e[n_etabins], plots_pfele_res_eta[n_ptbins];
     1912  std::vector<resolPlot> plots_trkele_res_e[n_etabins], plots_trkele_res_eeta[n_ptbins];
    19091913
    19101914  TCanvas *c_pfele_res_e[n_etabins];
     
    19221926     gr_pfele_res_e[k] = EresGraph(&plots_pfele_res_e[k]);
    19231927
     1928     HistogramsCollection(&plots_trkele_res_e[k], TMath::Log10(ptMin), TMath::Log10(ptMax), "trkele");
     1929     GetEres<Track>(&plots_trkele_res_e[k], branchTrackElectron, branchParticleElectron, 11, etaVals.at(k), etaVals.at(k+1), treeReaderElectron);
     1930     gr_trkele_res_e[k] = EresGraph(&plots_trkele_res_e[k]);
     1931
    19241932     s_etaMin = Form("%.1f",etaVals.at(k));
    19251933     s_etaMax = Form("%.1f",etaVals.at(k+1));
     
    19301938
    19311939     addResoGraph(mg_pfele_res_e[k], &gr_ecal_res_e[k], leg_pfele_res_e[k], markerStyles.at(0), colors.at(0), "ECAL");
    1932      addResoGraph(mg_pfele_res_e[k], &gr_trkele_res_pt[k], leg_pfele_res_e[k], markerStyles.at(1), colors.at(1), "Track");
     1940     addResoGraph(mg_pfele_res_e[k], &gr_trkele_res_e[k], leg_pfele_res_e[k], markerStyles.at(1), colors.at(1), "Track");
    19331941     addResoGraph(mg_pfele_res_e[k], &gr_pfele_res_e[k], leg_pfele_res_e[k], markerStyles.at(2), colors.at(2), "Particle-flow");
    19341942
     
    19611969     gr_pfele_res_eta[k] = EresGraphVsEta(&plots_pfele_res_eta[k]);
    19621970
     1971     HistogramsCollectionVsEta(&plots_trkele_res_eeta[k], etaMin, etaMax, 0.5*ptVals.at(k), 2.0*ptVals.at(k), "trkele", 0.0, 2.0);
     1972     GetEresVsEta<Track>(&plots_trkele_res_eeta[k], branchTrackElectron, branchParticleElectron, 11, 0.5*ptVals.at(k), 2.0*ptVals.at(k), treeReaderElectron);
     1973     gr_trkele_res_eeta[k] = EresGraphVsEta(&plots_trkele_res_eeta[k]);
     1974
    19631975     s_e = Form("e^{ #pm}, E = %.0f GeV",ptVals.at(k));
    19641976     if(ptVals.at(k) >= 1000.) s_e = Form("e^{ #pm}, E = %.0f TeV",ptVals.at(k)/1000.);
     
    19691981
    19701982     addResoGraph(mg_pfele_res_eta[k], &gr_ecal_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(0), colors.at(0), "ECAL");
    1971      addResoGraph(mg_pfele_res_eta[k], &gr_trkele_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
     1983     addResoGraph(mg_pfele_res_eta[k], &gr_trkele_res_eeta[k], leg_pfele_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
    19721984     addResoGraph(mg_pfele_res_eta[k], &gr_pfele_res_eta[k], leg_pfele_res_eta[k], markerStyles.at(2), colors.at(2), "Particle-flow");
    19731985
     
    20012013  TGraphErrors gr_pfpi_res_eta[n_ptbins];
    20022014
     2015  TGraphErrors gr_trkpi_res_e[n_etabins];
     2016  TGraphErrors gr_trkpi_res_eeta[n_ptbins];
     2017
    20032018  std::vector<resolPlot> plots_pfpi_res_e[n_etabins], plots_pfpi_res_eta[n_ptbins];
     2019  std::vector<resolPlot> plots_trkpi_res_e[n_etabins], plots_trkpi_res_eeta[n_ptbins];
    20042020
    20052021  TCanvas *c_pfpi_res_e[n_etabins];
     
    20172033     gr_pfpi_res_e[k] = EresGraph(&plots_pfpi_res_e[k]);
    20182034
     2035     HistogramsCollection(&plots_trkpi_res_e[k], TMath::Log10(ptMin), TMath::Log10(ptMax), "trkpi");
     2036     GetEres<Track>(&plots_trkpi_res_e[k], branchTrackPion, branchParticlePion, 211, etaVals.at(k), etaVals.at(k+1), treeReaderPion);
     2037     gr_trkpi_res_e[k] = EresGraph(&plots_trkpi_res_e[k]);
     2038
     2039
    20192040     s_etaMin = Form("%.1f",etaVals.at(k));
    20202041     s_etaMax = Form("%.1f",etaVals.at(k+1));
     
    20252046
    20262047     addResoGraph(mg_pfpi_res_e[k], &gr_hcal_res_e[k], leg_pfpi_res_e[k], markerStyles.at(0), colors.at(0), "HCAL");
    2027      addResoGraph(mg_pfpi_res_e[k], &gr_trkpi_res_pt[k], leg_pfpi_res_e[k], markerStyles.at(1), colors.at(1), "Track");
     2048     addResoGraph(mg_pfpi_res_e[k], &gr_trkpi_res_e[k], leg_pfpi_res_e[k], markerStyles.at(1), colors.at(1), "Track");
    20282049     addResoGraph(mg_pfpi_res_e[k], &gr_pfpi_res_e[k], leg_pfpi_res_e[k], markerStyles.at(2), colors.at(2), "Particle-flow");
    20292050
     
    20562077     gr_pfpi_res_eta[k] = EresGraphVsEta(&plots_pfpi_res_eta[k]);
    20572078
     2079     HistogramsCollectionVsEta(&plots_trkpi_res_eeta[k], etaMin, etaMax, 0.5*ptVals.at(k), 2.0*ptVals.at(k), "trkpi", 0.0, 2.0);
     2080     GetEresVsEta<Track>(&plots_trkpi_res_eeta[k], branchPion, branchParticlePion, 211, 0.5*ptVals.at(k), 2.0*ptVals.at(k), treeReaderPion);
     2081     gr_trkpi_res_eeta[k] = EresGraphVsEta(&plots_trkpi_res_eeta[k]);
     2082
     2083
    20582084     s_e = Form("#pi^{ #pm}, E = %.0f GeV",ptVals.at(k));
    20592085     if(ptVals.at(k) >= 1000.) s_e = Form("#pi^{ #pm}, E = %.0f TeV",ptVals.at(k)/1000.);
     
    20632089
    20642090     addResoGraph(mg_pfpi_res_eta[k], &gr_hcal_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(0), colors.at(0), "HCAL");
    2065      addResoGraph(mg_pfpi_res_eta[k], &gr_trkpi_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
     2091     addResoGraph(mg_pfpi_res_eta[k], &gr_trkpi_res_eeta[k], leg_pfpi_res_eta[k], markerStyles.at(1), colors.at(1), "Track");
    20662092     addResoGraph(mg_pfpi_res_eta[k], &gr_pfpi_res_eta[k], leg_pfpi_res_eta[k], markerStyles.at(2), colors.at(2), "Particle-flow");
    20672093
     
    24182444    c_recpho_eff_eta->Print(figPath+"img_recpho_eff_eta.png","png");
    24192445
     2446
    24202447    /////////////////////////////////////////
    24212448    // B-jets  Efficiency/ mistag rates   ///
     
    24822509    c_recbjet_eff_eta->Print(figPath+"img_recbjet_eff_eta.png","png");
    24832510
    2484 
    2485 
    24862511    // ------ c - mistag  ------
    24872512
     
    25602585    for (k = 0; k < etaVals.size()-1; k++)
    25612586    {
    2562        
     2587
    25632588       h_recbjet_lmis_pt = GetEffPt<Jet>(branchJet, branchParticleJet, "Jet", 1, ptMin, ptMax, etaVals.at(k), etaVals.at(k+1), treeReaderJet);
    25642589       gr_recbjet_lmis_pt[k] = TGraphErrors(h_recbjet_lmis_pt);
     
    25892614
    25902615    mg_recbjet_lmis_pt->Draw("APE");
    2591     DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.005, "p_{T} [GeV]", "light - mistag rate (%)", true, false);
     2616    DrawAxis(mg_recbjet_lmis_pt, leg_recbjet_lmis_pt, ptMin, ptMax, 0.0, 0.5, "p_{T} [GeV]", "light - mistag rate (%)", true, false);
    25922617    leg_recbjet_lmis_pt->Draw();
    25932618    pave->Draw();
     
    26002625
    26012626    mg_recbjet_lmis_eta->Draw("APE");
    2602     DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.005, " #eta ", "light - mistag rate (%)", false, false);
     2627    DrawAxis(mg_recbjet_lmis_eta, leg_recbjet_lmis_eta, etaMin, etaMax, 0.0, 0.5, " #eta ", "light - mistag rate (%)", false, false);
    26032628    leg_recbjet_lmis_eta->Draw();
    26042629    pave->Draw();
     
    27182743
    27192744    mg_rectaujet_mis_pt->Draw("APE");
    2720     DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 10., "p_{T} [GeV]", "#tau - mistag(%)", true, false);
     2745    DrawAxis(mg_rectaujet_mis_pt, leg_rectaujet_mis_pt, ptMin, ptMax, 0.0, 5., "p_{T} [GeV]", "#tau - mistag(%)", true, false);
    27212746    leg_rectaujet_mis_pt->Draw();
    27222747    pave->Draw();
     
    27502775       plots_trkpi_res_pt[k].at(bin).resolHist->Write();
    27512776       plots_trkele_res_pt[k].at(bin).resolHist->Write();
    2752            plots_trkmu_res_pt[k].at(bin).resolHist->Write();
     2777       plots_trkmu_res_pt[k].at(bin).resolHist->Write();
    27532778       plots_ecal_res_e[k].at(bin).resolHist->Write();
    27542779       plots_hcal_res_e[k].at(bin).resolHist->Write();
     
    27802805
    27812806  fout->Write();
     2807
     2808
     2809
    27822810
    27832811  cout << "** Exiting..." << endl;
Note: See TracChangeset for help on using the changeset viewer.