164 |
|
if ( obj->IsA()->InheritsFrom( TH1::Class() ) ) { |
165 |
|
|
166 |
|
// histogram found |
167 |
< |
SHist* shist = new SHist((TH1*) obj); |
167 |
> |
TH1* thist = (TH1*) obj; |
168 |
> |
TH1* rebinned = Rebin(thist, dirname); |
169 |
> |
SHist* shist = NULL; |
170 |
> |
if (rebinned){ |
171 |
> |
shist = new SHist(rebinned); |
172 |
> |
} else { |
173 |
> |
shist = new SHist(thist); |
174 |
> |
} |
175 |
|
shist->SetProcessName(m_process); |
176 |
|
shist->SetDir(dirname); |
177 |
|
if (debug) cout << "Adding hist " << shist->GetHist()->GetName() |
189 |
|
|
190 |
|
} |
191 |
|
|
192 |
+ |
TH1* FileParser::Rebin(TH1* hist, TString dirname) |
193 |
+ |
{ |
194 |
+ |
TString name(hist->GetName()); |
195 |
+ |
TString title(hist->GetTitle()); |
196 |
+ |
if (name.CompareTo("pT")==0 && dirname.Contains("Electron") && title.Contains("electron")){ |
197 |
+ |
//Double_t binsx[] = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 160, 170, 180, 190, 200, 220, 240, 260, 280, 300, 350, 400, 500}; |
198 |
+ |
Double_t binsx[] = {30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 160, 170, 180, 190, 200, 220, 240, 260, 280, 300, 350, 400, 500}; |
199 |
+ |
name.Append("_rebin_lx"); |
200 |
+ |
TH1* rebinned = hist->Rebin(37, name, binsx); |
201 |
+ |
rebinned->SetTitle("electron P_{T} [GeV]"); |
202 |
+ |
return rebinned; |
203 |
+ |
} else { |
204 |
+ |
return NULL; |
205 |
+ |
} |
206 |
+ |
|
207 |
+ |
} |
208 |
+ |
|
209 |
|
void FileParser::SetInfo(TString legname, double weight, int colour, int marker) |
210 |
|
{ |
211 |
|
|