File indexing completed on 2025-08-06 08:14:12
0001 #define RhoFluct_cxx
0002 #include "RhoFluct.h"
0003 #include <TH2.h>
0004 #include <TStyle.h>
0005 #include <TCanvas.h>
0006
0007 void RhoFluct::Loop(string out_name)
0008 {
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 if (fChain == 0) return;
0033
0034 TFile* fout = new TFile(voi_stem(out_name,".root").c_str(),"recreate");
0035
0036 array<TH1D*,10> harr_sub1, harr_rhoA;
0037 for (int i=0; i<10; ++i) {
0038 int i0 = i*10;
0039 int i1 = i*10+10;
0040 harr_sub1[i] = new TH1D(Form("fluct_sub1_%i",i),
0041 Form("impact param [%4.2f-%4.2f];p_{T,jet}^{SUB1+probe}-p_{T}^{probe};N_{events}", IP_DEC[i], IP_DEC[i+1]), 400, -50, 50);
0042 harr_rhoA[i] = new TH1D(Form("fluct_rhoA_%i",i),
0043 Form("impact param [%4.2f-%4.2f];(p_{T,jet}^{calo+probe}-#rho#timesA)-p_{T}^{probe};N_{events}", IP_DEC[i], IP_DEC[i+1]), 400, -50, 50);
0044 }
0045
0046 Long64_t nentries = fChain->GetEntriesFast();
0047
0048 Long64_t nbytes = 0, nb = 0;
0049 for (Long64_t jentry=0; jentry<nentries;jentry++) {
0050 Long64_t ientry = LoadTree(jentry);
0051 if (ientry < 0) break;
0052 nb = fChain->GetEntry(jentry); nbytes += nb;
0053
0054
0055 int k = get_ip_decile(impactparam);
0056 if (k<0 || k>9) {
0057 cout << "bad impact parameter; should NEVER happen" << endl;
0058 }
0059
0060
0061
0062 if (sub1_ismatched) {
0063 harr_sub1[k]->Fill(sub1Jet_delPt);
0064 }
0065 if (rhoA_ismatched) {
0066 harr_rhoA[k]->Fill(rhoAJet_delPt);
0067 }
0068
0069
0070 }
0071
0072 for (int k=0;k<10;++k) {
0073 harr_sub1[k]->Write();
0074 harr_rhoA[k]->Write();
0075 }
0076 fout->Close();
0077 }