Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:11:22

0001 std::string getDate()
0002 {
0003     std::time_t t = std::time(0);   // get time now
0004     std::tm* now = std::localtime(&t);
0005 
0006     std::stringstream date;
0007     date << (now->tm_mon + 1) << '/'
0008          <<  now->tm_mday << '/'
0009          << (now->tm_year + 1900);
0010     return date.str();
0011 }
0012 
0013 void CutValueSystematics()
0014 {
0015   string sim_inFile_Xi = "/sphenix/user/rosstom/TrackingAnalysis/Physics_Val_TF/sim/pTComp/KFParticle_4Mcascade_nopTCut.root";
0016   TFile* sim_file_Xi = new TFile(sim_inFile_Xi.c_str());
0017   TTree* sim_tree_Xi = (TTree*)sim_file_Xi->Get("DecayTree");
0018 
0019   const int nBins_pT = 4;
0020   double pTbins[nBins_pT + 1] = {0.75, 1.07, 1.25, 1.49, 2.0};
0021 
0022   const int nBins_phi = 6;
0023   double phibins[nBins_phi + 1] = {-M_PI,-2.09439,-1.04719,0.0,1.04721,2.09441,M_PI};
0024 
0025   const int nBins_eta = 6;
0026   double etabins[nBins_eta + 1] = {-1.1,-0.733333,-0.366666,0.0,0.366668,0.733335,1.1};
0027 
0028   const int nBins_rap = 6;
0029   double rapbins[nBins_rap + 1] = {-1.0,-0.66,-0.33,0.0,0.33,0.66,1.0};
0030 
0031   float KS0_track_1_sigma = 0.0023;
0032   float KS0_track_1_sigma_xy = 0.0017;
0033   float KS0_track_2_sigma = 0.0025;
0034   float KS0_track_2_sigma_xy = 0.0017;
0035   float Xi_track_1_sigma = 0.0037;
0036   float Xi_track_1_sigma_xy = 0.0029;
0037   float Xi_track_2_sigma = 0.0035;
0038   float Xi_track_2_sigma_xy = 0.0029;
0039   float Xi_track_3_sigma = 0.0035;
0040   float Xi_track_3_sigma_xy = 0.0027;
0041 
0042   float KS0_PV_sigma = 0.0049;
0043   float KS0_PV_sigma_xy = 0.0035;
0044   float KS0_SV_sigma = 0.0027;
0045   float KS0_SV_sigma_xy = 0.0021;
0046   float Xi_PV_sigma = 0.0055;
0047   float Xi_PV_sigma_xy = 0.0039;
0048   float Xi_SV_sigma = 0.0037;
0049   float Xi_SV_sigma_xy = 0.0033;
0050   float L0_SV_sigma = 0.0051;
0051   float L0_SV_sigma_xy = 0.0039;
0052 
0053   std::string truthDataCut = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && Lambda0_track_1_charge == track_3_charge && Lambda0_track_1_INTT_nHits > 0 && Lambda0_track_2_INTT_nHits > 0 && track_3_INTT_nHits > 0 && Lambda0_track_1_TPC_nHits > 19 && Lambda0_track_2_TPC_nHits > 19 && track_3_TPC_nHits > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && Ximinus_decayLength_xy >= 0.15 && Lambda0_decayLength_xy >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && track_1_track_2_DCA <= 0.5 && track_1_track_3_DCA <= 0.5 && track_2_track_3_DCA <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && Lambda0_chi2/Lambda0_nDoF <= 50 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_pT >= 0.2 && Lambda0_track_2_pT >= 0.2 && track_3_pT >= 0.2";
0054   std::string truthDataCut_min = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && Lambda0_track_1_charge == track_3_charge && Lambda0_track_1_INTT_nHits > 0 && Lambda0_track_2_INTT_nHits > 0 && track_3_INTT_nHits > 0 && Lambda0_track_1_TPC_nHits > 19 && Lambda0_track_2_TPC_nHits > 19 && track_3_TPC_nHits > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && (Ximinus_decayLength_xy - " + std::to_string(Xi_PV_sigma_xy) + " - " +std::to_string( Xi_SV_sigma_xy) + ") >= 0.15 && (Lambda0_decayLength_xy - " + std::to_string(Xi_SV_sigma_xy) + " - " + std::to_string(L0_SV_sigma_xy) + ") >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && (track_1_track_2_DCA + " + std::to_string(Xi_track_1_sigma) + " + " + std::to_string(Xi_track_2_sigma) + ") <= 0.5 && (track_1_track_3_DCA + " + std::to_string(Xi_track_1_sigma) + " + " + std::to_string(Xi_track_3_sigma) + ") <= 0.5 && (track_2_track_3_DCA + " + std::to_string(Xi_track_2_sigma) + " + " + std::to_string(Xi_track_3_sigma) + ") <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && Lambda0_chi2/Lambda0_nDoF <= 50 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_pT >= 0.2 && Lambda0_track_2_pT >= 0.2 && track_3_pT >= 0.2";
0055   std::string truthDataCut_max = "abs(Lambda0_track_1_true_ID) == 211 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_1_true_track_history_PDG_ID) == 3312) > 0 && abs(Lambda0_track_2_true_ID) == 2212 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3122) > 0 && Sum$(abs(Lambda0_track_2_true_track_history_PDG_ID) == 3312) > 0 && abs(track_3_true_ID) == 211 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3312) > 0 && Sum$(abs(track_3_true_track_history_PDG_ID) == 3122) == 0 && Lambda0_track_1_MVTX_nHits > 0 && Lambda0_track_2_MVTX_nHits > 0 && track_3_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && Lambda0_track_1_charge == track_3_charge && Lambda0_track_1_INTT_nHits > 0 && Lambda0_track_2_INTT_nHits > 0 && track_3_INTT_nHits > 0 && Lambda0_track_1_TPC_nHits > 19 && Lambda0_track_2_TPC_nHits > 19 && track_3_TPC_nHits > 19 && abs(Lambda0_mass - 1.1157) <= 0.01 && (Ximinus_decayLength_xy + " + std::to_string(Xi_PV_sigma_xy) + " + " + std::to_string(Xi_SV_sigma_xy) + ") >= 0.15 && (Lambda0_decayLength_xy + " + std::to_string(Xi_SV_sigma_xy) + " + " + std::to_string(L0_SV_sigma_xy) + ") >= 0.01 && (Lambda0_track_1_chi2/Lambda0_track_1_nDoF) <= 400 && (Lambda0_track_2_chi2/Lambda0_track_2_nDoF) <= 400 && (track_3_chi2/track_3_nDoF) <= 400 && (track_1_track_2_DCA - " + std::to_string(Xi_track_1_sigma) + " - " + std::to_string(Xi_track_2_sigma) + ") <= 0.5 && (track_1_track_3_DCA - " + std::to_string(Xi_track_1_sigma) + " - " + std::to_string(Xi_track_3_sigma) + ") <= 0.5 && (track_2_track_3_DCA - " + std::to_string(Xi_track_2_sigma) + " - " + std::to_string(Xi_track_3_sigma) + ") <= 0.5 && Ximinus_chi2/Ximinus_nDoF <= 50 && Lambda0_chi2/Lambda0_nDoF <= 50 && abs(Ximinus_rapidity) <= 1.0 && Lambda0_track_1_pT >= 0.2 && Lambda0_track_2_pT >= 0.2 && track_3_pT >= 0.2";
0056 
0057   //TH1F* h_pT_truth = new TH1F("h_pT_truth",";#Xi^{-} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0058   TH1F* h_pT_base_Xi = new TH1F("h_pT_base_Xi",";#Xi^{-} p_{T} [GeV/c];Entries",nBins_pT,pTbins);
0059   TH1F* h_pT_base_Xi_max = new TH1F("h_pT_base_Xi_max",";#Xi^{-} p_{T} [GeV/c];Entries",nBins_pT,pTbins);
0060   TH1F* h_pT_base_Xi_min = new TH1F("h_pT_base_Xi_min",";#Xi^{-} p_{T} [GeV/c];Entries",nBins_pT,pTbins);
0061   
0062   //TH1F* h_eta_truth = new TH1F("h_eta_truth",";#Xi^{-} #eta;Cut Efficiency",nBins_eta,etabins);
0063   TH1F* h_eta_base_Xi = new TH1F("h_eta_base_Xi",";#Xi^{-} #eta;Entries",nBins_eta,etabins);
0064   TH1F* h_eta_base_Xi_max = new TH1F("h_eta_base_Xi_max",";#Xi^{-} #eta;Entries",nBins_eta,etabins);
0065   TH1F* h_eta_base_Xi_min = new TH1F("h_eta_base_Xi_min",";#Xi^{-} #eta;Entries",nBins_eta,etabins);
0066   
0067   //TH1F* h_phi_truth = new TH1F("h_phi_truth",";#Xi^{-} #phi;Cut Efficiency",nBins_phi,phibins);
0068   TH1F* h_phi_base_Xi = new TH1F("h_phi_base_Xi",";#Xi^{-} #phi;Entries",nBins_phi,phibins);
0069   TH1F* h_phi_base_Xi_max = new TH1F("h_phi_base_Xi_max",";#Xi^{-} #phi;Entries",nBins_phi,phibins);
0070   TH1F* h_phi_base_Xi_min = new TH1F("h_phi_base_Xi_min",";#Xi^{-} #phi;Entries",nBins_phi,phibins);
0071   
0072   //TH1F* h_y_truth = new TH1F("h_y_truth",";#Xi^{-} y;Cut Efficiency",nBins_rap,rapbins);
0073   TH1F* h_rap_base_Xi = new TH1F("h_rap_base_Xi",";#Xi^{-} y;Entries",nBins_rap,rapbins);
0074   TH1F* h_rap_base_Xi_max = new TH1F("h_rap_base_Xi_max",";#Xi^{-} y;Entries",nBins_rap,rapbins);
0075   TH1F* h_rap_base_Xi_min = new TH1F("h_rap_base_Xi_min",";#Xi^{-} y;Entries",nBins_rap,rapbins);
0076    
0077   //h_pT_truth->Sumw2();
0078   h_pT_base_Xi->Sumw2();
0079   h_pT_base_Xi_max->Sumw2();
0080   h_pT_base_Xi_min->Sumw2();
0081   //h_eta_truth->Sumw2();
0082   h_eta_base_Xi->Sumw2();
0083   h_eta_base_Xi_max->Sumw2();
0084   h_eta_base_Xi_min->Sumw2();
0085   //h_phi_truth->Sumw2();
0086   h_phi_base_Xi->Sumw2();
0087   h_phi_base_Xi_max->Sumw2();
0088   h_phi_base_Xi_min->Sumw2();
0089   //h_y_truth->Sumw2();
0090   h_rap_base_Xi->Sumw2();
0091   h_rap_base_Xi_max->Sumw2();
0092   h_rap_base_Xi_min->Sumw2();
0093 
0094   //sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_truth",truthCut.c_str());
0095   sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_base_Xi",truthDataCut.c_str());
0096   sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_base_Xi_max",truthDataCut_max.c_str());
0097   sim_tree_Xi->Draw("Ximinus_pT>>+h_pT_base_Xi_min",truthDataCut_min.c_str());
0098   //sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_truth",truthCut.c_str());
0099   sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_base_Xi",truthDataCut.c_str());
0100   sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_base_Xi_max",truthDataCut_max.c_str());
0101   sim_tree_Xi->Draw("Ximinus_pseudorapidity>>+h_eta_base_Xi_min",truthDataCut_min.c_str());
0102   //sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_truth",truthCut.c_str());
0103   sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_base_Xi",truthDataCut.c_str());
0104   sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_base_Xi_max",truthDataCut_max.c_str());
0105   sim_tree_Xi->Draw("Ximinus_phi>>+h_phi_base_Xi_min",truthDataCut_min.c_str());
0106   //sim_tree_Xi->Draw("Ximinus_rapidity>>+h_y_truth",truthCut.c_str());
0107   sim_tree_Xi->Draw("Ximinus_rapidity>>+h_rap_base_Xi",truthDataCut.c_str());
0108   sim_tree_Xi->Draw("Ximinus_rapidity>>+h_rap_base_Xi_max",truthDataCut_max.c_str());
0109   sim_tree_Xi->Draw("Ximinus_rapidity>>+h_rap_base_Xi_min",truthDataCut_min.c_str());
0110 
0111   string sim_inFile_KS0 = "/sphenix/user/cdean/software/analysis/LightFlavorRatios/geometric_acceptance/simulation/outputKFParticle_Kshort_reco.root";
0112   TFile* sim_file_KS0 = new TFile(sim_inFile_KS0.c_str());
0113   TTree* sim_tree_KS0 = (TTree*)sim_file_KS0->Get("DecayTree");
0114 
0115   std::string truthDataCut_KS0 = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && track_1_INTT_nHits > 0 && track_2_INTT_nHits > 0 && track_1_TPC_nHits > 19 && track_2_TPC_nHits > 19 && (track_1_chi2/track_1_nDoF) <= 300 && (track_2_chi2/track_2_nDoF) <= 300 && abs(track_1_IP_xy) >= 0.05 && abs(track_2_IP_xy) >= 0.05 && track_1_track_2_DCA <= 0.5 && track_1_track_2_DCA_xy <= 1.0 && K_S0_DIRA >= 0.99 && (K_S0_chi2/K_S0_nDoF) <= 20 && abs(K_S0_mass - 0.5) <= 0.1 && track_1_pT >= 0.2 && track_2_pT >= 0.2";
0116   std::string truthDataCut_KS0_min = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && track_1_INTT_nHits > 0 && track_2_INTT_nHits > 0 && track_1_TPC_nHits > 19 && track_2_TPC_nHits > 19 && (track_1_chi2/track_1_nDoF) <= 300 && (track_2_chi2/track_2_nDoF) <= 300 && (abs(track_1_IP_xy) - " + std::to_string(KS0_PV_sigma_xy) + " - " + std::to_string(KS0_track_1_sigma_xy) + ") >= 0.05 && (abs(track_2_IP_xy) - " + std::to_string(KS0_PV_sigma_xy) + " - " + std::to_string(KS0_track_2_sigma_xy) + ") >= 0.05 && (track_1_track_2_DCA + " + std::to_string(KS0_track_1_sigma) + " + " + std::to_string(KS0_track_2_sigma) + ") <= 0.5 && (track_1_track_2_DCA_xy + " + std::to_string(KS0_track_1_sigma_xy) + " + " + std::to_string(KS0_track_2_sigma_xy) + ") <= 1.0 && cos(acos(K_S0_DIRA) + atan(" + std::to_string(KS0_PV_sigma) + "/K_S0_decayLength) + atan(" + std::to_string(KS0_SV_sigma) + "/K_S0_decayLength)) >= 0.99 && (K_S0_chi2/K_S0_nDoF) <= 20 && abs(K_S0_mass - 0.5) <= 0.1 && track_1_pT >= 0.2 && track_2_pT >= 0.2";
0117   std::string truthDataCut_KS0_max = "abs(track_1_true_ID) == 211 && Sum$(abs(track_1_true_track_history_PDG_ID) == 310) > 0 && abs(track_2_true_ID) == 211 && Sum$(abs(track_2_true_track_history_PDG_ID) == 310) > 0 && abs(K_S0_rapidity) <= 1.0 && track_1_MVTX_nHits > 0 && track_2_MVTX_nHits > 0 && abs(primary_vertex_z) < 10 && track_1_INTT_nHits > 0 && track_2_INTT_nHits > 0 && track_1_TPC_nHits > 19 && track_2_TPC_nHits > 19 && (track_1_chi2/track_1_nDoF) <= 300 && (track_2_chi2/track_2_nDoF) <= 300 && (abs(track_1_IP_xy) + " + std::to_string(KS0_PV_sigma_xy) + " + " + std::to_string(KS0_track_1_sigma_xy) + ") >= 0.05 && (abs(track_2_IP_xy) + " + std::to_string(KS0_PV_sigma_xy) + " + " + std::to_string(KS0_track_2_sigma_xy) + ") >= 0.05 && (track_1_track_2_DCA - " + std::to_string(KS0_track_1_sigma) + " - " + std::to_string(KS0_track_2_sigma) + ") <= 0.5 && (track_1_track_2_DCA_xy - " + std::to_string(KS0_track_1_sigma_xy) + " - " + std::to_string(KS0_track_2_sigma_xy) + ") <= 1.0 && cos(acos(K_S0_DIRA) - atan(" + std::to_string(KS0_PV_sigma) + "/K_S0_decayLength) - atan(" + std::to_string(KS0_SV_sigma) + "/K_S0_decayLength)) >= 0.99 && (K_S0_chi2/K_S0_nDoF) <= 20 && abs(K_S0_mass - 0.5) <= 0.1 && track_1_pT >= 0.2 && track_2_pT >= 0.2";
0118 
0119   //TH1F* h_pT_truth_KS0 = new TH1F("h_pT_truth_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0120   TH1F* h_pT_base_KS0 = new TH1F("h_pT_base_KS0",";K_{S}^{0} p_{T} [GeV/c];Cut Efficiency",nBins_pT,pTbins);
0121   TH1F* h_pT_base_KS0_max = new TH1F("h_pT_base_KS0_max",";K_{S}^{0} p_{T} [GeV/c];Entries",nBins_pT,pTbins);
0122   TH1F* h_pT_base_KS0_min = new TH1F("h_pT_base_KS0_min",";K_{S}^{0} p_{T} [GeV/c];Entries",nBins_pT,pTbins);
0123   
0124   //TH1F* h_eta_truth_KS0 = new TH1F("h_eta_truth_KS0",";K_{S}^{0} #eta;Cut Efficiency",nBins_eta,etabins);
0125   TH1F* h_eta_base_KS0 = new TH1F("h_eta_base_KS0",";K_{S}^{0} #eta;Entries",nBins_eta,etabins);
0126   TH1F* h_eta_base_KS0_max = new TH1F("h_eta_base_KS0_max",";K_{S}^{0} #eta;Entries",nBins_eta,etabins);
0127   TH1F* h_eta_base_KS0_min = new TH1F("h_eta_base_KS0_min",";K_{S}^{0} #eta;Entries",nBins_eta,etabins);
0128   
0129   //TH1F* h_phi_truth_KS0 = new TH1F("h_phi_truth_KS0",";K_{S}^{0} #phi;Cut Efficiency",nBins_phi,phibins);
0130   TH1F* h_phi_base_KS0 = new TH1F("h_phi_base_KS0",";K_{S}^{0} #phi;Entries",nBins_phi,phibins);
0131   TH1F* h_phi_base_KS0_max = new TH1F("h_phi_base_KS0_max",";K_{S}^{0} #phi;Entries",nBins_phi,phibins);
0132   TH1F* h_phi_base_KS0_min = new TH1F("h_phi_base_KS0_min",";K_{S}^{0} #phi;Entries",nBins_phi,phibins);
0133   
0134   //TH1F* h_y_truth_KS0 = new TH1F("h_y_truth_KS0",";K_{S}^{0} y;Cut Efficiency",nBins_rap,rapbins);
0135   TH1F* h_rap_base_KS0 = new TH1F("h_rap_base_KS0",";K_{S}^{0} y;Entries",nBins_rap,rapbins);
0136   TH1F* h_rap_base_KS0_max = new TH1F("h_rap_base_KS0_max",";K_{S}^{0} y;Entries",nBins_rap,rapbins);
0137   TH1F* h_rap_base_KS0_min = new TH1F("h_rap_base_KS0_min",";K_{S}^{0} y;Entries",nBins_rap,rapbins);
0138    
0139   //h_pT_truth_KS0->Sumw2();
0140   h_pT_base_KS0->Sumw2();
0141   h_pT_base_KS0_max->Sumw2();
0142   h_pT_base_KS0_min->Sumw2();
0143   //h_eta_truth_KS0->Sumw2();
0144   h_eta_base_KS0->Sumw2();
0145   h_eta_base_KS0_max->Sumw2();
0146   h_eta_base_KS0_min->Sumw2();
0147   //h_phi_truth_KS0->Sumw2();
0148   h_phi_base_KS0->Sumw2();
0149   h_phi_base_KS0_max->Sumw2();
0150   h_phi_base_KS0_min->Sumw2();
0151   //h_y_truth_KS0->Sumw2();
0152   h_rap_base_KS0->Sumw2();
0153   h_rap_base_KS0_max->Sumw2();
0154   h_rap_base_KS0_min->Sumw2();
0155 
0156   //sim_tree_KS0->Draw("K_S0_pT>>+h_pT_truth_KS0",truthCut_KS0.c_str());
0157   sim_tree_KS0->Draw("K_S0_pT>>+h_pT_base_KS0",truthDataCut_KS0.c_str());
0158   sim_tree_KS0->Draw("K_S0_pT>>+h_pT_base_KS0_max",truthDataCut_KS0_max.c_str());
0159   sim_tree_KS0->Draw("K_S0_pT>>+h_pT_base_KS0_min",truthDataCut_KS0_min.c_str());
0160   //sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_truth_KS0",truthCut_KS0.c_str());
0161   sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_base_KS0",truthDataCut_KS0.c_str());
0162   sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_base_KS0_max",truthDataCut_KS0_max.c_str());
0163   sim_tree_KS0->Draw("K_S0_pseudorapidity>>+h_eta_base_KS0_min",truthDataCut_KS0_min.c_str());
0164   //sim_tree_KS0->Draw("K_S0_phi>>+h_phi_truth_KS0",truthCut_KS0.c_str());
0165   sim_tree_KS0->Draw("K_S0_phi>>+h_phi_base_KS0",truthDataCut_KS0.c_str());
0166   sim_tree_KS0->Draw("K_S0_phi>>+h_phi_base_KS0_max",truthDataCut_KS0_max.c_str());
0167   sim_tree_KS0->Draw("K_S0_phi>>+h_phi_base_KS0_min",truthDataCut_KS0_min.c_str());
0168   //sim_tree_KS0->Draw("K_S0_rapidity>>+h_y_truth_KS0",truthCut_KS0.c_str());
0169   sim_tree_KS0->Draw("K_S0_rapidity>>+h_rap_base_KS0",truthDataCut_KS0.c_str());
0170   sim_tree_KS0->Draw("K_S0_rapidity>>+h_rap_base_KS0_max",truthDataCut_KS0_max.c_str());
0171   sim_tree_KS0->Draw("K_S0_rapidity>>+h_rap_base_KS0_min",truthDataCut_KS0_min.c_str());
0172 
0173   TFile* fout = new TFile("CutSystematicsHistograms.root","RECREATE");
0174   h_pT_base_Xi->Write();
0175   h_pT_base_KS0->Write();
0176   h_phi_base_Xi->Write();
0177   h_phi_base_KS0->Write();
0178   h_eta_base_Xi->Write();
0179   h_eta_base_KS0->Write();
0180   h_rap_base_Xi->Write();
0181   h_rap_base_KS0->Write();
0182   h_pT_base_Xi_max->Write();
0183   h_pT_base_KS0_max->Write();
0184   h_phi_base_Xi_max->Write();
0185   h_phi_base_KS0_max->Write();
0186   h_eta_base_Xi_max->Write();
0187   h_eta_base_KS0_max->Write();
0188   h_rap_base_Xi_max->Write();
0189   h_rap_base_KS0_max->Write();
0190   h_pT_base_Xi_min->Write();
0191   h_pT_base_KS0_min->Write();
0192   h_phi_base_Xi_min->Write();
0193   h_phi_base_KS0_min->Write();
0194   h_eta_base_Xi_min->Write();
0195   h_eta_base_KS0_min->Write();
0196   h_rap_base_Xi_min->Write();
0197   h_rap_base_KS0_min->Write(); 
0198 }