// This file provides a fix for the efficiency issue related to // the "smile" curve in the efficiency plot. The fix is to just // fill the denominator with events for which there is at least // one hit in the CDC or FDC. The problem that causes the inefficieny // is internal to GEANT and has to do with it not tracking through // any sensitive detectors (a bug). // // The first part of the fix was create a new tree that had Ncdc and // Nfdc fields that are filled for every event, regardless whether // a track was reconstructed or not. The orginial tree filled // these only with the hits used on a reconstructed track which // made a cut on them biased. The new tree was created using the // tmp_tree plugin. void mk_eff_denominator_nhits(void) { gROOT->Reset(); // Open input file for correct denominator TFile *f = new TFile("hd_root_nhits.root"); f->cd("TRACKING"); TTree *trkeff = (TTree*)gROOT->FindObject("trkeff"); // Open input file for correct numerators TFile *f2 = new TFile("hd_res_charged.root"); TH2D *eff_numerator = (TH2D*)gROOT->FindObject("eff_numerator"); TH2D *eff_numerator_wb = (TH2D*)gROOT->FindObject("eff_numerator_wb"); // Open output file TFile *of = new TFile("eff_denominator_nhits.root","RECREATE"); TH2D *eff_denominator_nhits_cut = (TH2D*)eff_numerator->Clone("eff_denominator_nhits_cut"); TH2D *eff_denominator_nohits = (TH2D*)eff_numerator->Clone("eff_denominator_nohits"); // Project onto denominator histo trkeff->Project("eff_denominator_nhits_cut", "E.pthrown.Mag():E.pthrown.Theta()*TMath::RadToDeg()", "(Ncdc+Nfdc)>0"); trkeff->Project("eff_denominator_nohits", "E.pthrown.Mag():E.pthrown.Theta()*TMath::RadToDeg()", "(Ncdc+Nfdc)<1"); // Create efficiency histos eff_vs_p_vs_theta = (TH2D*)eff_numerator->Clone("eff_vs_p_vs_theta"); eff_vs_p_vs_theta->Divide(eff_denominator_nhits_cut); eff_vs_p_vs_theta->SetTitle("Tracking Efficiency vs. total momentum and #theta angle"); eff_vs_p_vs_theta_wb = (TH2D*)eff_numerator_wb->Clone("eff_vs_p_vs_theta_wb"); eff_vs_p_vs_theta_wb->Divide(eff_denominator_nhits_cut); eff_vs_p_vs_theta_wb->SetTitle("Wire-based Tracking Efficiency vs. total momentum and #theta angle"); // Close output file of->Write(); delete of; }