Go to the source code of this file.
int drawhistosA4 |
( |
TString |
filename = "Data/HistoVertexing.root" | ) |
|
Definition at line 2 of file PmtTask/drawhistosA4.C.
References filename, LoadPandaStyle(), and plotandfithistosfromfile().
4 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/Tools.C");
7 gStyle->SetOptTitle(1);
12 gStyle->SetTextSize(0.10);
13 gStyle->SetLabelSize(0.07,
"x");
14 gStyle->SetTitleSize(0.07,
"x");
15 gStyle->SetLabelSize(0.07,
"y");
16 gStyle->SetTitleSize(0.07,
"y");
17 gStyle->SetLabelSize(0.07,
"z");
18 gStyle->SetTitleSize(0.07,
"z");
19 gStyle->SetPadBottomMargin(0.17);
plotandfithistosfromfile(TString filename="histos.root", TString ext=".pdf", Int_t divx=2, Int_t divy=2, Int_t pix=1200)
void GaussFitPlot |
( |
TH1 * |
his | ) |
|
Definition at line 127 of file PmtTask/drawhistosA4.C.
References ccc, Double_t, DrawText(), mean, par, sigma, and TString.
Referenced by plotandfithistosfromfile().
130 TF1* fitted =
new TF1(fitname.Data(),
"gaus",-5,5);
132 cout<<
" --- Fitting Gaussian to histogram "<<his->GetName()<<
" \""<<his->GetTitle()<<
"\" ---"<<endl;
133 fitted->SetLineColor(kAzure+2);
134 fitted->SetLineWidth(2);
135 fitted->SetLineStyle(2);
137 fitted->GetParameters(par);
142 DrawText( 0.2, 0.75, str.Data(),0.07,1);
143 str=Form(
"#mu = %.3g",mean);
144 DrawText( 0.2, 0.65, str.Data(),0.07,1);
145 str=Form(
"#sigma = %.3g",sigma);
146 DrawText( 0.2, 0.55, str.Data(),0.07,1);
void LineFitPlot |
( |
TH1 * |
his | ) |
|
Definition at line 152 of file PmtTask/drawhistosA4.C.
References ccc, Double_t, DrawText(), par, range, and TString.
Referenced by plotandfithistosfromfile().
153 range=1.2*his->GetMaximum();
154 his->SetAxisRange(0.,
range,
"Y");
157 TF1* fitted =
new TF1(fitname.Data(),
"pol1");
158 cout<<
" --- Fitting Line to histogram "<<his->GetName()<<
" \""<<his->GetTitle()<<
"\" ---"<<endl;
159 fitted->SetLineColor(kAzure+2);
160 fitted->SetLineWidth(2);
161 fitted->SetLineStyle(2);
163 fitted->GetParameters(par);
166 DrawText( 0.2, 0.425, str.Data(),0.07,1);
167 str=Form(
"const = %.3g",par[0]);
168 DrawText( 0.2, 0.325, str.Data(),0.07,1);
169 str=Form(
"slope = %.2g",par[1]);
170 DrawText( 0.2, 0.225, str.Data(),0.07,1);
plotandfithistosfromfile |
( |
TString |
filename = "histos.root" , |
|
|
TString |
ext = ".pdf" , |
|
|
Int_t |
divx = 2 , |
|
|
Int_t |
divy = 2 , |
|
|
Int_t |
pix = 1200 |
|
) |
| |
Definition at line 29 of file PmtTask/drawhistosA4.C.
References ext, file, filename, GaussFitPlot(), i, LineFitPlot(), and TString.
Referenced by drawhistos(), drawhistosA4(), and gethistos().
33 if (!file) {cout<<
"File \""<<
filename.Data()<<
"\" is not there..."<<endl;
return;}
34 TCanvas* can =
new TCanvas();
36 Int_t pixy = ceil(1.2*pix);
37 can->SetCanvasSize(pixx,pixy);
38 can->Divide(divx, divy);
41 ext.ReplaceAll(
"..",
".");
42 picname.ReplaceAll(
".root",
ext);
44 cout <<
"opening: " << pic.Data()<<endl;
48 TList* list = file->GetListOfKeys();
49 if (!list) {cout<<
"List not there..."<<endl;
return;}
52 for(
int i=0;
i<list->GetEntries();
i++)
54 if(padcount > divx*divy)
56 can->Print(pic.Data());
58 can->SetCanvasSize(pixx,pixy);
59 can->Divide(divx, divy);
63 TKey*
key = (TKey*)list->At(
i);
64 keyclass = key->GetClassName();
66 if(keyclass.Contains(
"TH1"))
69 TH1* his = (TH1*)key->ReadObj();
71 TString vorname = his->GetName();
72 if(titel.Contains(
"value"))
continue;
73 if(titel.Contains(
"#Theta"))
continue;
74 if(titel.Contains(
"#Phi"))
continue;
78 if(vorname.EndsWith(
"the")||vorname.EndsWith(
"phi"))
continue;
80 if(titel.Contains(
"Momentum reco")) his->SetTitle(
"Momentum Smearing");
81 his->GetXaxis()->SetNoExponent();
82 his->GetYaxis()->SetNoExponent();
83 if( (titel.Contains(
"#chi")||titel.Contains(
"#Chi")) ){
84 if( titel.Contains(
"P") )
92 }
else if( titel.Contains(
"error") )
95 }
else if( titel.Contains(
"CPU") )
98 his->SetFillColor(kAzure+2);
99 his->SetBarWidth(0.75);
100 his->SetBarOffset(0.125);
101 gStyle->SetPaintTextFormat(
"4.3f ms");
102 his->SetMarkerSize(2.);
104 his->Draw(
"TEXT0 SAME");
113 can->Print(pic.Data());
115 can->Print(pic.Data());
116 cout <<
"closed: " << pic.Data()<<endl;
117 TString convertcmd =
"test -r ps2pdf && ps2pdf ";
118 convertcmd += pic.Data();
119 gSystem->Exec(convertcmd.Data());
void LineFitPlot(TH1 *his)
void GaussFitPlot(TH1 *his)
Definition at line 125 of file PmtTask/drawhistosA4.C.
Referenced by PndSttTrackFinderReal::AssociateSkewHitsToXYTrack(), GaussFitPlot(), LineFitPlot(), PndTrkTracking2::OrderingUsingConformal(), PndSttTrackFinderReal::WriteMacroParallelAssociatedHits(), PndSttTrackFinderReal::WriteMacroParallelAssociatedHitswithMC(), PndSttTrackFinderReal::WriteMacroParallelHitsConformalwithMCspecial(), PndSttTrackFinderReal::WriteMacroParallelHitsGeneral(), PndSttTrackFinderReal::WriteMacroParallelHitsGeneralConformalwithMC(), PndSttTrackFinderReal::WriteMacroParallelHitswithRfromMC(), PndSttTrackFinderReal::WriteMacroSkewAssociatedHits(), PndSttTrackFinderReal::WriteMacroSkewAssociatedHitswithMC(), and PndSttTrackFinderReal::WriteMacroSkewAssociatedHitswithRfromMC().