#define vv_light_cxx // The class definition in vv_light.h has been generated automatically // by the ROOT utility TTree::MakeSelector(). This class is derived // from the ROOT class TSelector. For more information on the TSelector // framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual. // The following methods are defined in this file: // Begin(): called every time a loop on the tree starts, // a convenient place to create your histograms. // SlaveBegin(): called after Begin(), when on PROOF called only on the // slave servers. // Process(): called for each event, in this function you decide what // to read and fill your histograms. // SlaveTerminate: called at the end of the loop on the tree, when on PROOF // called only on the slave servers. // Terminate(): called at the end of the loop on the tree, // a convenient place to draw/fit your histograms. // // To use this file, try the following session on your Tree T: // // root> T->Process("vv_light.C") // root> T->Process("vv_light.C","some options") // root> T->Process("vv_light.C+") // #include "vv_light.h" #include #include void vv_light::Begin(TTree * /*tree*/) { // The Begin() function is called at the start of the query. // When running with PROOF Begin() is only called on the client. // The tree argument is deprecated (on PROOF 0 is passed). TString option = GetOption(); int nbden = 25; int nbavi = 25; int nbm = 200; h_lead_pt = create1D("lead_pt","lead_pt",100,500000,1500000); h_selection = create1D("selection","selection",3,-0.5,2.5); h_lead_ms = create1D("lead_ms","lead_ms",nbm,0.,500000); h_lead_ms_ol = create1D("lead_ms_ol","lead_ms_ol",nbm,0.,500000); h_lead_ms_of = create1D("lead_ms_of","lead_ms_of",nbm,0.,500000); h_lead_ms_of_ntk20 = create1D("lead_ms_of_ntk20","lead_ms_of_ntk20",nbm,0.,500000); h_lead_ms_of_ntk25 = create1D("lead_ms_of_ntk25","lead_ms_of_ntk25",nbm,0.,500000); h_lead_ms_ol_bar = create1D("lead_ms_ol_bar","lead_ms_ol_bar",nbm,0.,500000); h_sub_ms = create1D("sub_ms","sub_ms",nbm,0.,500000); h_sub_ms_ol = create1D("sub_ms_ol","sub_ms_ol",nbm,0.,500000); h_sub_ms_of = create1D("sub_ms_of","sub_ms_of",nbm,0.,500000); h_sub_ms_of_ntk20 = create1D("sub_ms_of_ntk20","sub_ms_of_ntk20",nbm,0.,500000); h_sub_ms_of_ntk25 = create1D("sub_ms_of_ntk25","sub_ms_of_ntk25",nbm,0.,500000); h_both_ms_of_0mu25 = create1D("both_ms_of_0mu25","both_ms_of_0mu25",nbm,0.,500000); h_both_ms_of_25mu40 = create1D("both_ms_of_25mu40","both_ms_of_25mu40",nbm,0.,500000); h_both_ms_of_40mu60 = create1D("both_ms_of_40mu60","both_ms_of_40mu60",nbm,0.,500000); h_both_ms_of_tcc20 = create1D("both_ms_of_tcc20","both_ms_of_tcc20",nbm,0.,500000); h_both_ms_of_tcc25 = create1D("both_ms_of_tcc25","both_ms_of_tcc25",nbm,0.,500000); h_both_ms_of_tcc30 = create1D("both_ms_of_tcc30","both_ms_of_tcc30",nbm,0.,500000); h_both_ms_of_ntkf20 = create1D("both_ms_of_ntkf20","both_ms_of_ntkf20",nbm,0.,500000); h_both_ms_of_ntkf25 = create1D("both_ms_of_ntkf25","both_ms_of_ntkf25",nbm,0.,500000); h_both_ms_of_ntkf30 = create1D("both_ms_of_ntkf30","both_ms_of_ntkf30",nbm,0.,500000); h_both_ms_of_nTCCf20 = create1D("both_ms_of_nTCCf20","both_ms_of_nTCCf20",nbm,0.,500000); h_both_ms_of_nTCCf25 = create1D("both_ms_of_nTCCf25","both_ms_of_nTCCf25",nbm,0.,500000); h_both_ms_of_nTCCf30 = create1D("both_ms_of_nTCCf30","both_ms_of_nTCCf30",nbm,0.,500000); } void vv_light::SlaveBegin(TTree * /*tree*/) { // The SlaveBegin() function is called after the Begin() function. // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). TString option = GetOption(); } Bool_t vv_light::Process(Long64_t entry) { double ptcut = 60e3; const double pi = 3.14159265358979323; // The Process() function is called for each entry in the tree (or possibly // keyed object in the case of PROOF) to be processed. The entry argument // specifies which entry in the currently loaded tree is to be processed. // When processing keyed objects with PROOF, the object is already loaded // and is available via the fObject pointer. // // This function should contain the \"body\" of the analysis. It can contain // simple or elaborate selection criteria, run algorithms on the data // of the event and typically fill histograms. // // The processing can be stopped by calling Abort(). // // Use fStatus to set the return value of TTree::Process(). // // The return value is currently not used. fReader.SetLocalEntry(entry); //if ((entry %1000 == 0 && entry < 10000) || ( entry %100000 == 0 && entry < 1000000) || entry %1000000 == 0 ) std::cout<<"Entry is "< ptcut); bool second_pass_pt = (*second_jet_pt > ptcut); bool lead_pass_pt = (*lead_jet_pt > ptcut); bool sub_pass_pt = (*sub_jet_pt > ptcut); double dphi = (*first_jet_phi - *second_jet_phi - pi); if (dphi < -pi) dphi += 2*pi; if (dphi < -pi) dphi += 2*pi; if (dphi > pi) dphi -= 2*pi; bool first_pass_ol = (*second_jet_m < 60000); bool lead_pass_ol = (*sub_jet_m < 60000); bool sub_pass_ol = (*lead_jet_m < 60000); bool lead_pass_ntk20 = (*lead_jet_ungrtrk500 < 20); bool lead_pass_ntk25 = (*lead_jet_ungrtrk500 < 25); bool sub_pass_ntk20 = (*sub_jet_ungrtrk500 < 20); bool sub_pass_ntk25 = (*sub_jet_ungrtrk500 < 25); bool pass_ntk20 = (*first_jet_ungrtrk500 < 20); bool pass_ntk25 = (*first_jet_ungrtrk500 < 25); bool pass_ntk30 = (*first_jet_ungrtrk500 < 30); bool pass_ntk40 = (*first_jet_ungrtrk500 < 40); bool first_pass_bar = (fabs(*first_jet_eta) < 1); bool lead_pass_bar = (fabs(*lead_jet_eta) < 1); bool firstpassWZ = ( *first_jet_passedWSubstructure > 0.5 || *first_jet_passedZSubstructure > 0.5); bool secondpassWZ = (*second_jet_passedWSubstructure > 0.5 || *second_jet_passedZSubstructure > 0.5); bool leadpassWZ = ( *lead_jet_passedWSubstructure > 0.5 || *lead_jet_passedZSubstructure > 0.5); bool subpassWZ = ( *sub_jet_passedWSubstructure > 0.5 || *sub_jet_passedZSubstructure > 0.5); double x = *pudensity; double y = *first_jet_eta; // double first_jet_ntkfix = *first_jet_ungrtrk500 - (4.5*(*pudensity) - 0.5* (*first_jet_eta)*(*first_jet_eta)*(*pudensity); double first_jet_ntkfix = *first_jet_ungrtrk500 - (5.89*x-3.147*x*x -1.018*x*y*y + 3.892*x*x*y*y); double first_jet_nTCCfix = *first_jet_combTCCs - (4.64*x+4.69*x*x +3.88*x*y*y - 3.276*x*x*y*y); // double second_jet_ntkfix = *second_jet_ungrtrk500 - 4.5*(*pudensity) - 0.5* (*second_jet_eta)*(*second_jet_eta)*(*pudensity); y = *second_jet_eta; double second_jet_ntkfix = *second_jet_ungrtrk500 - (5.89*x-3.147*x*x -1.018*x*y*y + 3.892*x*x*y*y); double second_jet_nTCCfix = *second_jet_combTCCs - (4.64*x+4.69*x*x +3.88*x*y*y - 3.276*x*x*y*y); //V+jet selection for jet mass spectra if (leadpassWZ && lead_pass_pt) { h_lead_ms->Fill(*lead_jet_m,*weight); if (lead_pass_ol) h_lead_ms_ol->Fill(*lead_jet_m,*weight); if (!subpassWZ) { h_lead_ms_of->Fill(*lead_jet_m,*weight); if (*avgMuScaled < 25) h_both_ms_of_0mu25->Fill(*lead_jet_m,*weight); if (25 < * avgMuScaled && *avgMuScaled < 40) h_both_ms_of_25mu40->Fill(*lead_jet_m,*weight); if (40 < * avgMuScaled && *avgMuScaled < 60) h_both_ms_of_40mu60->Fill(*lead_jet_m,*weight); if (*lead_jet_combTCCs < 20) h_both_ms_of_tcc20->Fill(*lead_jet_m,*weight); if (*lead_jet_combTCCs < 25) h_both_ms_of_tcc25->Fill(*lead_jet_m,*weight); if (*lead_jet_combTCCs < 30) h_both_ms_of_tcc30->Fill(*lead_jet_m,*weight); if (lead_pass_ntk20) h_lead_ms_of_ntk20->Fill(*lead_jet_m,*weight); if (lead_pass_ntk25) h_lead_ms_of_ntk25->Fill(*lead_jet_m,*weight); } if (lead_pass_ol && lead_pass_bar) h_lead_ms_ol_bar->Fill(*lead_jet_m,*weight); } if (subpassWZ && sub_pass_pt ) { h_sub_ms->Fill(*sub_jet_m,*weight); if (sub_pass_ol) h_sub_ms_ol->Fill(*sub_jet_m,*weight); if (!leadpassWZ) { h_sub_ms_of->Fill(*sub_jet_m,*weight); if (*avgMuScaled < 25) h_both_ms_of_0mu25->Fill(*sub_jet_m,*weight); if (25 < * avgMuScaled && *avgMuScaled < 40) h_both_ms_of_25mu40->Fill(*sub_jet_m,*weight); if (40 < * avgMuScaled && *avgMuScaled < 60) h_both_ms_of_40mu60->Fill(*sub_jet_m,*weight); if (*sub_jet_combTCCs < 20) h_both_ms_of_tcc20->Fill(*sub_jet_m,*weight); if (*sub_jet_combTCCs < 25) h_both_ms_of_tcc25->Fill(*sub_jet_m,*weight); if (*sub_jet_combTCCs < 30) h_both_ms_of_tcc30->Fill(*sub_jet_m,*weight); if (sub_pass_ntk20) h_sub_ms_of_ntk20->Fill(*sub_jet_m,*weight); if (sub_pass_ntk25) h_sub_ms_of_ntk25->Fill(*sub_jet_m,*weight); } } if (firstpassWZ && first_pass_pt){ if (!secondpassWZ) { if (first_jet_ntkfix < 20) h_both_ms_of_ntkf20->Fill(*first_jet_m,*weight); if (first_jet_ntkfix < 25) h_both_ms_of_ntkf25->Fill(*first_jet_m,*weight); if (first_jet_ntkfix < 30) h_both_ms_of_ntkf30->Fill(*first_jet_m,*weight); if (first_jet_nTCCfix < 20) h_both_ms_of_nTCCf20->Fill(*first_jet_m,*weight); if (first_jet_nTCCfix < 25) h_both_ms_of_nTCCf25->Fill(*first_jet_m,*weight); if (first_jet_nTCCfix < 30) h_both_ms_of_nTCCf30->Fill(*first_jet_m,*weight); } } return kTRUE; } void vv_light::SlaveTerminate() { // The SlaveTerminate() function is called after all entries or objects // have been processed. When running with PROOF SlaveTerminate() is called // on each slave server. } void vv_light::Terminate() { // The Terminate() function is the last function to be called during // a query. It always runs on the client, it can be used to present // the results graphically or save the results to file. for (unsigned int i=0;i(fOutput->FindObject(hlistNames.at(i)));; } TFile *f = new TFile("vv_light.root","RECREATE"); for (unsigned int i=0;icd(); (hlist.at(i))->Write(); } f->Close(); } vv_light::~vv_light() { //for (int i=0;i