// This function cloned from one of the balloon analysis files // It will do some very basic histogramming of the pdr ntuple values // // Tracy Usher (June 4 2001) void makeRecPlots(char* histfile) { gROOT->Reset(); gStyle->SetOptStat(1100); gStyle->SetTitleColor(0); // Title box background Color gStyle->SetTitleH(0.11); // Franction of title box hight gStyle->SetTitleW(0.35); // Franction of title box width gStyle->SetTitleX(0.1); // X position of the title box from left gStyle->SetTitleY(1.00); // Y position of the title box from bottom TCanvas *c1 = new TCanvas("c1","Rec Ntuple values",0,0,700,850); c1->SetTitle("Rec Ntuple Plots"); c1->GetFrame()->SetFillColor(46); c1->SetFillColor(19); c1->SetBorderMode(28); TText *c1title = new TText(0.2,0.96,"Rec Ntuple Test Plots"); c1title->SetTextSize(0.04); c1title->Draw(); TFile* histFile = new TFile(histfile); TDirectory* pTKR = (TDirectory *)histFile->Get("PDR"); TTree* pTree = (TTree *)pTKR->Get("t1"); int maxpad = 6; int i; TPad *hpad[26]; //Define the drawing areas //TPad dimensions are xlow,ylow,xhigh,yhigh and are fractions of //the drawing area defined above. hpad[0] = new TPad("pad0" ,"This is pad0" ,0.00,0.65,0.50,0.95,19); hpad[1] = new TPad("pad1" ,"This is pad1" ,0.50,0.65,1.00,0.95,19); hpad[2] = new TPad("pad2" ,"This is pad2" ,0.00,0.35,0.50,0.65,19); hpad[3] = new TPad("pad3" ,"This is pad3" ,0.50,0.35,1.00,0.65,19); hpad[4] = new TPad("pad4" ,"This is pad4" ,0.00,0.05,0.50,0.35,19); hpad[5] = new TPad("pad5" ,"This is pad5" ,0.50,0.05,1.00,0.35,19); TH1F *pHist[26]; //***********************USER************************************ //Last two parameters of pHist[#] can be changed according to //the # multiple hits in each layer //Define the histograms pHist[0] = new TH1F("hists1", "Conv_Twr_Dist",100,-0.5,19.5); pHist[1] = new TH1F("hists2", "fst_Hit_Count",10,-0.5,9.5); pHist[2] = new TH1F("hists3", "Surplus_hit_ratio",125,0.00,10.00); pHist[3] = new TH1F("hists4", "Outside_hit_ratio",100,0.00,4.00); pHist[4] = new TH1F("hists5", "Rec_Sum",50,0.00,50.0); pHist[5] = new TH1F("hists6", "CsI_Corr_Energy",100,0.00,1.0); hpad[0]->Draw(); hpad[0]->cd(); hpad[0]->SetLogy(1); hpad[0]->GetFrame()->SetFillColor(0); TCut hitcut = "TKR_Cnv_Lyr_Hits>1"; TCut trkcut = "TKR_No_Tracks>0"; //Fill the histograms pTree->Draw("REC_Conv_Twr_Dist>>hists1", trkcut); pTree->Draw("REC_fst_Hit_Count>>hists2", trkcut); pTree->Draw("REC_Surplus_Hit_Ratio>>hists3", trkcut); pTree->Draw("REC_Outside_Hit_Ratio>>hists4", trkcut); pTree->Draw("REC_Sum_Hits>>hists5", trkcut); pTree->Draw("REC_CsI_Corr_Energy>>hists6", trkcut); for(i=0;iDraw(); hpad[i]->cd(); hpad[i]->SetLogy(0); hpad[i]->GetFrame()->SetFillColor(10); hpad[i]->SetGrid(); pHist[i]->SetFillColor(46); pHist[i]->SetLabelSize(0.07,"X"); pHist[i]->SetLabelSize(0.07,"Y"); //****************************USER********************************** //range is set on each layer, this is a default //pHist[i]->GetXaxis()->SetRange(0,15); //****************************USER********************************** //SetMaximum sets the Y-axis max range upon # of events selected; // i.e., 50 if Go(10), 500 if Go(1000) //pHist[i]->SetMaximum(500); // pHist[i]->SetXTitle("Nhits"); // pHist[i]->SetYTitle("Nevents"); pHist[i]->SetTitleOffset(1.3,"X"); pHist[i]->SetTitleOffset(1.3,"Y"); pHist[i]->SetTitleSize(0.09,"X"); pHist[i]->SetTitleSize(0.09,"Y"); pHist[i]->Draw(); c1->cd(); } //*****************************USER*********************************** //This is the path to be set for the ps file to be created at // c1->Print("e:/Root_Files/Run/Hits.ps"); }