#define bcal_calib_selector_cxx // The class definition in bcal_calib_selector.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("bcal_calib_selector.C") // Root > T->Process("bcal_calib_selector.C","some options") // Root > T->Process("bcal_calib_selector.C+") // #include "bcal_calib_selector.h" #include #include void bcal_calib_selector::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(); Nevents = 0; Eraw_ratio_vs_Eraw_vs_z = new TH3D("Erec_ratio_vs_Eraw_vs_z", "E_{raw}/E_{thrown}", 130, 17.0, 407.0, 100, 0.0, 2.0, 100, 0.0, 2.0); Eraw_ratio_vs_Eraw_vs_z->SetXTitle("z_{rec} (cm)"); Eraw_ratio_vs_Eraw_vs_z->SetYTitle("E_{raw} (GeV)"); Eraw_ratio_vs_Eraw_vs_z->SetZTitle("E_{raw}/E_{gen} (cm)"); Eresi_ratio_vs_Egen_vs_z = new TH3D("Eresi_ratio_vs_Egen_vs_z", "(E_{corr}-E_{gen}/E_{gen}", 130, 17.0, 407.0, 100, 0.0, 2.0, 200, -1.0, 1.0); Eresi_ratio_vs_Egen_vs_z->SetXTitle("z_{rec} (cm)"); Eresi_ratio_vs_Egen_vs_z->SetYTitle("E_{gen} (GeV)"); Eresi_ratio_vs_Egen_vs_z->SetZTitle("E_{resi}/E_{gen} (cm)"); Eraw_vs_Egen_vs_z = new TH3D("Eraw_vs_Egen_vs_z", "E_{raw} vs. E_{gen} vs. z_{rec}", 130, 17.0, 407.0, 100, 0.0, 2.0, 100, 0.0, 2.0); Eraw_vs_Egen_vs_z->SetXTitle("z_{rec} (cm)"); Eraw_vs_Egen_vs_z->SetYTitle("E_{gen} (GeV)"); Eraw_vs_Egen_vs_z->SetZTitle("E_{raw} (GeV)"); Ecorr_vs_Egen_vs_z = new TH3D("Ecorr_vs_Egen_vs_z", "E_{corr} vs. E_{gen} vs. z_{rec}", 130, 17.0, 407.0, 100, 0.0, 2.0, 100, 0.0, 2.0); Ecorr_vs_Egen_vs_z->SetXTitle("z_{rec} (cm)"); Ecorr_vs_Egen_vs_z->SetYTitle("E_{gen} (GeV)"); Ecorr_vs_Egen_vs_z->SetZTitle("E_{corr} (GeV)"); Eresi_vs_Egen_vs_z = new TH3D("Eresi_vs_Egen_vs_z", "E_{resi} vs. E_{gen} vs. z_{rec}", 130, 17.0, 407.0, 100, 0.0, 2.0, 100, -0.5, 0.5); Eresi_vs_Egen_vs_z->SetXTitle("z_{rec} (cm)"); Eresi_vs_Egen_vs_z->SetYTitle("E_{gen} (GeV)"); Eresi_vs_Egen_vs_z->SetZTitle("E_{resi} (GeV)"); } void bcal_calib_selector::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 bcal_calib_selector::Process(Long64_t entry) { // 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. // It can be passed to either bcal_calib_selector::GetEntry() or TBranch::GetEntry() // to read either all or the required parts of the data. 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. GetEntry(entry); //TVector3 pos(pos_fX, pos_fY, pos_fZ); //TVector3 p_thrown(p_thrown_fX, p_thrown_fY, p_thrown_fZ); if(Nrecon==1){ Eraw_ratio_vs_Eraw_vs_z->Fill(pos_fZ, E_raw, E_raw/E_thrown); Eraw_vs_Egen_vs_z->Fill(pos_fZ, E_thrown, E_raw); Ecorr_vs_Egen_vs_z->Fill(pos_fZ, E_thrown, E); Eresi_vs_Egen_vs_z->Fill(pos_fZ, E_thrown, E-E_thrown); Eresi_ratio_vs_Egen_vs_z->Fill(pos_fZ, E_thrown, (E-E_thrown)/E_thrown); } if(++Nevents%10000 == 0)cout<<" "<