477 |
|
return nice_label.str(); |
478 |
|
} |
479 |
|
|
480 |
+ |
Int_t get_exclusion_region_color(double value, TH2F *histo) { |
481 |
+ |
Double_t wmin = histo->GetMinimum(); |
482 |
+ |
Double_t wmax = histo->GetMaximum(); |
483 |
+ |
Double_t wlmin = wmin; |
484 |
+ |
Double_t wlmax = wmax; |
485 |
+ |
|
486 |
+ |
Int_t ncolors = gStyle->GetNumberOfColors(); |
487 |
+ |
Int_t ndivz = histo->GetContour(); |
488 |
+ |
if (ndivz == 0) return 0; |
489 |
+ |
ndivz = TMath::Abs(ndivz); |
490 |
+ |
Int_t theColor, color; |
491 |
+ |
Double_t scale = ndivz / (wlmax - wlmin); |
492 |
+ |
|
493 |
+ |
if (value < wlmin) value = wlmin; |
494 |
+ |
|
495 |
+ |
color = Int_t(0.01 + (value - wlmin) * scale); |
496 |
+ |
|
497 |
+ |
theColor = Int_t((color + 0.99) * Double_t(ncolors) / Double_t(ndivz)); |
498 |
+ |
return gStyle->GetColorPalette(theColor); |
499 |
+ |
} |
500 |
+ |
|
501 |
+ |
|
502 |
|
TH2F *make_best_limits(vector<TH2F*> explimits,vector<TH2F*> obslimits, bool ismSUGRA, vector<TH2F*> exp1mlimits, vector<TH2F*> exp1plimits, vector<TH2F*> exp2mlimits, vector<TH2F*> exp2plimits, vector<TH2F*> &allbestexplimits) { |
503 |
|
if(obslimits.size()==0) { |
504 |
|
write_warning(__FUNCTION__,"There are no observed limits! Cannot continue!"); |
543 |
|
} |
544 |
|
} |
545 |
|
} |
546 |
< |
gStyle->SetPadRightMargin(0.15); |
546 |
> |
gStyle->SetPadRightMargin(rightmargin); |
547 |
|
TCanvas *canlimsource = new TCanvas("limsource","Source of best limits"); |
548 |
|
set_range(bestlimitsource,ismSUGRA,false); |
549 |
|
bestlimitsource->SetTitle("Source of limit for best limits"); |
550 |
|
bestlimitsource->GetZaxis()->SetRangeUser(0,explimits.size()+1); |
551 |
< |
bestlimitsource->Draw("COLZ"); |
551 |
> |
bestlimitsource->Draw("COL"); |
552 |
|
if(!ismSUGRA) bestlimitsource->Draw("TEXT,same"); |
553 |
|
TLegend *sourceleg = new TLegend(0.15,0.6,0.55,0.85); |
554 |
|
for(int i=0;i<explimits.size();i++) { |
555 |
|
stringstream legendentry; |
556 |
|
legendentry << i+1 << " = " << give_nice_source_label(explimits[i]->GetName()); |
557 |
< |
sourceleg->AddEntry(explimits[i], legendentry.str().c_str(),""); |
557 |
> |
Int_t currcol=get_exclusion_region_color(i+1,bestlimitsource); |
558 |
> |
explimits[i]->SetFillColor(currcol); |
559 |
> |
explimits[i]->SetLineColor(currcol); |
560 |
> |
sourceleg->AddEntry(explimits[i], legendentry.str().c_str(),"f"); |
561 |
|
} |
562 |
|
sourceleg->SetLineColor(kWhite);sourceleg->SetFillColor(kWhite); |
563 |
|
sourceleg->SetTextSize(0.03); |