#include "TH1.h" #include "TTree.h" #include "TMath.h" #include using namespace std; void test(int s1 = 1, int s2 = 10, int s3 = 10) { cout << " s1 = " << s1 << " s2 = " << s2 << " s3 = " << s3 << endl; cout << __LINE__ << endl << flush; TH1D * hQp[7][4][24]; TH1D * hQeta[7][4][24]; TH1D * hWp[7][4][24]; TH1D * hWeta[7][4][24]; TH1D * hWc[7][4][24]; // book histo for ( int n = 1; n < 7; n++ ) { for ( int np = 0; np < 4; np++ ) { for ( int i = 0; i < 24; i++ ) { hQp[n][np][i] = new TH1D(Form("hQp%i%i_%i", n, 2+2*np, i), "", 500, -0.5, 499.5); hQeta[n][np][i] = new TH1D(Form("hQeta%i%i_%i", n, 2+2*np, i), "", 500, -0.5, 499.5); } for ( int i = 0; i < 24; i++ ) { hWp[n][np][i] = new TH1D(Form("hWp%i%i_%i", n, 2+2*np, i), "", 500, -0.5, 499.5); hWeta[n][np][i] = new TH1D(Form("hWeta%i%i_%i", n, 2+2*np, i), "", 500, -0.5, 499.5); } for ( int i = 0; i < 2; i++ ) { hWc[n][np][i] = new TH1D(Form("hWc%i%i_%i", n, 2+2*np, i), "", 500, -0.5, 499.5); } } } double dQp[7][4][24][500]; double dQeta[7][4][24][500]; double yQp[7][4][24][500]; double yQeta[7][4][24][500]; double yQc[7][4][24][500]; for ( int n = 1; n < 7; n++ ) { for ( int np = 0; np < 4; np++ ) { for ( int c = 0; c < 500; c++ ) { for ( int i = 0; i < 24; i++ ) { hQp[n][np][i]->SetBinContent(c+1, dQp[n][np][i][c]); // [1] hWp[n][np][i]->SetBinContent(c+1, yQp[n][np][i][c]); // [2] hQeta[n][np][i]->SetBinContent(c+1, dQeta[n][np][i][c]); // [3] hWeta[n][np][i]->SetBinContent(c+1, yQeta[n][np][i][c]); // [4] } for ( int i = 0; i < 2; i++ ) { hWc[n][np][i]->SetBinContent(c+1, yQc[n][np][i][c]); // [5] } } } } return; }