141 |
|
//TString title = htemp1->GetName(); |
142 |
|
TString title = htemp1->GetTitle(); |
143 |
|
|
144 |
+ |
// Make sure histograms exist |
145 |
+ |
if ( !htemp2 ) { |
146 |
+ |
cout << "Histogram missing from 2nd file: " << htemp1->GetName() << endl; |
147 |
+ |
return; |
148 |
+ |
} |
149 |
+ |
|
150 |
|
// Scale by given factor. |
151 |
|
// If given factor is negative, area normalize |
152 |
|
if (scale1 > 0.0) { |
175 |
|
|
176 |
|
// Create TStack but we will draw without stacking |
177 |
|
THStack *tempStack = new THStack(); |
178 |
< |
tempStack->Add(htemp1,"same"); |
179 |
< |
tempStack->Add(htemp2,"same"); |
178 |
> |
tempStack->Add(htemp1,"sames"); |
179 |
> |
tempStack->Add(htemp2,"sames"); |
180 |
|
|
181 |
|
// Draw the histogram and titles |
182 |
|
tempStack->Draw("hist nostack"); |
183 |
|
tempStack->SetTitle(title); |
184 |
< |
//tempStack->GetXaxis()->SetTitle(titleX); |
184 |
> |
tempStack->GetXaxis()->SetTitle(htemp1->GetXaxis()->GetTitle()); |
185 |
|
|
186 |
|
// Draw the legend |
187 |
|
TLegend *infoBox = new TLegend(0.75, 0.83, 0.99, 0.99, ""); |
188 |
|
infoBox->AddEntry(htemp1,label1,"L"); |
189 |
|
infoBox->AddEntry(htemp2,label2,"L"); |
190 |
+ |
infoBox->SetShadowColor(0); // 0 = transparent |
191 |
+ |
infoBox->SetFillColor(kWhite); |
192 |
|
infoBox->Draw(); |
193 |
|
|
194 |
|
// Place the stats boxes to be non-overlapping |