111 const std::string& direction,
int color,
const std::string& title){
113 std::vector <TH1F*> *histo =
new std::vector <TH1F*>();
114 std::vector<float> anglebins;
115 std::vector<float> csbins;
117 std::string xory, colorrow;
119 if(direction ==
"phi"){
120 anglebins = parameters.getAngleBins();
121 csbins = parameters.getClusterSizeXBins();
122 nConstants = parameters.getNumberOfXbins();
133 anglebins = parameters.getEtaBins();
134 csbins = parameters.getClusterSizeYBins();
135 nConstants = parameters.getNumberOfYbins();
146 int nangleBins = anglebins.size() - 1;
147 int nCsBins = csbins.size() - 1;
148 int nLayerBins = nConstants / (nangleBins * nCsBins);
150 int nhisto = nCsBins;
151 int nbinhisto = nLayerBins * nangleBins;
165 static std::atomic<int> pass = 0;
167 for(
int i = 0; i < nhisto; i++){
168 std::ostringstream NameString, TitleString;
169 NameString << csbins[i] <<
"_" << direction << p
170 <<
"clustersize_ " << csbins[i+1];
171 if(title !=
"") TitleString << title;
172 else TitleString <<
"Local " + xory +
" - "
173 << (csbins[i] + csbins[i+1]) /2 <<
"-" << colorrow <<
" clusters";
174 TH1F *currentPlot =
new TH1F(NameString.str().c_str(),
175 TitleString.str().c_str(),nbinhisto,0,nbinhisto);
176 currentPlot->UseCurrentStyle();
177 currentPlot->GetYaxis()->SetTitle(
"Charge sharing correction [#mum]");
179 currentPlot->SetLineColor(
color);
180 currentPlot->SetMarkerColor(
color);
181 for(
int j = 0; j < nangleBins; j++ ){
182 for(
int k = 0; k < nLayerBins; k++){
185 if(direction ==
"phi"){
186 constant = parameters.getDeltaX(j,i,k);
187 error = parameters.getErrDeltaX(j,i,k);
189 constant = parameters.getDeltaY(j,i,k);
190 error = parameters.getErrDeltaY(j,i,k);
192 int iBin = (nLayerBins*j)+k+1;
193 currentPlot->SetBinContent(iBin,constant*1000);
195 currentPlot->SetBinError(iBin,
error*1000);
203 histo->push_back(currentPlot);
212 const std::string& direction){
214 std::vector < std::vector < TH1F* > > *RefHistos = 0;
215 std::vector < TH1F* > *histograms = 0;
217 if(direction ==
"phi"){
225 unsigned int nhistos_all = histograms->size();
226 unsigned int nhistos = 0;
229 for(
unsigned int i = 0; i < nhistos_all; i++){
230 if((*histograms)[i]->
GetMean() == 0 &&
231 (*histograms)[i]->GetRMS() == 0)
continue;
235 std::vector<TCanvas*> canvases;
236 for(
unsigned int i = 0; i < nhistos; i++){
237 TCanvas* c1 =
new TCanvas();
238 canvases.push_back(c1);
239 float maximum = (*histograms)[i]->GetMaximum();
240 for(
unsigned int j = 0; j < RefHistos->size(); j++){
241 float newmax = ((*RefHistos)[j])[i]->GetMaximum();
242 if(maximum < newmax) maximum = newmax;
244 if(
int((*histograms)[i]->GetNbinsX()/(2*
m_nlayers)) > 20)
245 c1->SetBottomMargin(0.18);
248 std::string title = filename;
249 size_t found = title.find(
"PixelChargeInterpolationData");
250 if(found != std::string::npos) title =
"PixelOfflineReco" + title.substr(title.find(
'-'));
252 (*histograms)[i]->GetMarkerColor(),0.05);
254 (*histograms)[i]->GetMarkerColor());
257 unsigned int nreferences = RefHistos->size();
260 for(
unsigned int j = 0; j < nreferences; j++){
262 std::string title = ((*RefHistos)[j])[i]->GetTitle();
263 size_t found = title.find(
"PixelChargeInterpolationData");
264 if(found != std::string::npos) title =
"PixelOfflineReco" + title.substr(title.find(
'-'));
267 0.20, 0.83 - (j+1)*0.06,
268 ((*RefHistos)[j])[i]->GetMarkerColor(),0.05);
270 0.15, 0.83 - (j+1)*0.05,
271 ((*RefHistos)[j])[i]->GetMarkerColor());
278 for(
unsigned int i = 0; i < nhistos; i++){
279 std::ostringstream name;
280 name << filename << direction << i+2 <<
".pdf";
281 canvases[i]->Print(name.str().c_str());
299 float ymaximum = 1.5 * maximum;
300 float yminimum = - 0.1 * histo->GetMaximum();
301 histo->SetMaximum(ymaximum);
302 histo->SetMinimum(yminimum);
303 histo->GetXaxis()->SetLabelOffset(10);
304 histo->GetXaxis()->SetNdivisions(0);
307 int xmaximum = histo->GetNbinsX();
328 histo->GetXaxis()->SetRange(xminimum,xmaximum);
329 histo->DrawCopy(
"AXIS");
331 DrawAxis(yminimum, ymaximum, xminimum, xmaximum, direction);
342 int startmarker = 21;
343 TH1F *
markers = (TH1F *)histo->Clone();
344 markers->SetMarkerStyle(startmarker+5*goodj);
347 for (
int j = 1; j <
markers->GetNbinsX(); j++){
350 markers->DrawCopy(options.c_str());
352 for (
int j = 0; j <
markers->GetNbinsX(); j++){
354 markers->SetMarkerStyle(startmarker+period);
355 markers->GetXaxis()->SetRange(j+1,j+1);
357 markers->DrawCopy(options.c_str());
397 float stdtextsize = 0.05;
401 int naxbins = lastbin - firstbin;
403 std::string axtitle =
"";
406 if(direction ==
"phi"){
408 axtitle =
"Track incident angle (#phi_{i}) [#circ]";
409 }
else if(direction ==
"eta"){
411 axtitle =
"Track incident pseudorapidity (#eta_{i})";
413 if (!axbins) {
return; }
417 TGaxis *axis =
new TGaxis(x1-1, y1, x2, y1, axbins[firstbin], axbins[lastbin], naxbins);
418 axis->UseCurrentStyle();
419 axis->SetName(direction.c_str());
420 axis->SetTitle(axtitle.c_str());
421 axis->SetTitleFont(stdfont);
422 axis->SetTitleSize(stdtextsize);
424 if(naxbins > 20) offset = 1.8;
425 axis->SetTitleOffset(offset);
426 std::string opt =
"UNW+-";
428 axis->DrawAxis(x1-1, y1, x2, y1,
429 axbins[firstbin], axbins[lastbin], naxbins,opt.c_str());
430 axis->DrawAxis(x1-1, y2, x2, y2,
431 axbins[firstbin], axbins[lastbin], naxbins,
"UN-");
434 label.SetTextSize(stdtextsize);
435 label.SetTextFont(stdfont);
436 label.SetTextAlign(23);
437 double pass = ( axis->GetX2()-axis->GetX1() ) / double( naxbins);
438 double ylabel = y1 - 0.05 * (y2 - y1);
439 double distance = - 0.05 * (y2 - y1);
440 for(
int i = 0 ; i <= naxbins; i++){
441 std::ostringstream LabelString;
442 LabelString << axbins[firstbin+i];
443 float ylabel2 = ylabel;
444 if(naxbins > 20) ylabel2 = ylabel + i%2 * distance;
445 label.DrawLatex( axis->GetX1() + i * pass, ylabel2,
446 LabelString.str().c_str());