37 int plotPedsFromFile(
const Char_t *filenameIn =
"testfile.Ped.txt",
38 const Char_t *filenameOut =
"testfile.Ped.eps",
41 Char_t* quadName =
"FGT #010",
42 Char_t plotVsStrip =
'c',
43 Bool_t doPlotStDev = 1,
44 Short_t timeBin = 4 ){
48 cout <<
"Constructing the ped plotter" << endl;
50 pedPlotter->setReadFromFile( filenameIn );
51 pedPlotter->setTimeBinMask( 1<<timeBin );
52 pedPlotter->setPlotVsStrip( plotVsStrip );
53 pedPlotter->setDisc( disc );
54 pedPlotter->setQuad( quad );
55 pedPlotter->setPlotStDev( doPlotStDev );
57 cout <<
"making the graphs" << endl;
58 ierr = pedPlotter->makePlots();
59 cout <<
"\tdone" << endl;
62 cerr <<
"Error making plots" << endl;
64 gROOT->SetStyle(
"Plain");
65 gStyle->SetOptStat(0);
66 gStyle->SetEndErrorSize(0);
67 gStyle->SetTitleBorderSize(0);
68 gStyle->SetTitleTextColor(kRed);
72 if( plotVsStrip ==
'R' || plotVsStrip ==
'r' || plotVsStrip ==
'P' ){
77 can =
new TCanvas(
"can",
"Pedistal Canvas",width,height);
78 can->SetRightMargin( 0.02 );
84 if( plotVsStrip ==
'R' ){
87 }
else if ( plotVsStrip ==
'P' ){
93 Float_t maxY = pedPlotter->getMaxY()*1.05;
97 TH2F *hist =
new TH2F (
"hist",
"", 1, xlow, xhigh, 1, 0, maxY );
100 const TGraphErrors* gr = pedPlotter->getGraph( timeBin );
102 gr->SetLineColor( kBlue );
103 gr->SetMarkerStyle( 20 );
104 gr->SetMarkerSize( 0.4 );
106 gr->SetMarkerColor( kBlue );
108 hist->SetTitle( gr->GetTitle() );
111 std::string title = hist->GetTitle();
112 title += std::string(
", ") + quadName;
113 hist->SetTitle( title.data() );
116 can->Print( filenameOut );
133 gSystem->Load(
"StUtilities");
134 gSystem->Load(
"StFgtUtil");
135 gSystem->Load(
"StFgtPedPlotter");