53 |
|
TTree *events; |
54 |
|
|
55 |
|
sample(string m_filename,string m_samplename,long m_Nentries, float m_xs,bool is_data, bool m_is_signal, int m_groupindex, Color_t color); |
56 |
+ |
string ExtractVersion(string FullVersionString); |
57 |
|
void closeFile(); |
58 |
|
}; |
59 |
|
|
63 |
|
return "MC"; |
64 |
|
} |
65 |
|
|
66 |
+ |
string sample::ExtractVersion(string FullVersionString) { |
67 |
+ |
string Result=FullVersionString.substr(FullVersionString.find(" ")+1,FullVersionString.length()); |
68 |
+ |
Result=Result.substr(0,Result.find(" ")); |
69 |
+ |
return Result; |
70 |
+ |
} |
71 |
+ |
|
72 |
|
sample::sample(string m_filename, string m_samplename, long m_Nentries, float m_xs,bool m_is_data, bool m_is_signal, int m_groupindex, Color_t mycolor) |
73 |
|
{ |
74 |
|
this->filename=m_filename; |
100 |
|
TH1F *weight_histo = (TH1F*)(this->tfile)->Get("weight_histo"); |
101 |
|
float average_weight = 1.0; |
102 |
|
if(weight_histo) { |
103 |
< |
average_weight = weight_histo->Integral()/weight_histo->GetEntries(); |
103 |
> |
//average_weight = weight_histo->Integral()/weight_histo->GetEntries(); |
104 |
|
measured_nevents = (long)weight_histo->GetEntries(); |
105 |
|
} else { |
106 |
|
measured_nevents=(this->events)->GetEntries(); |
130 |
|
this->weightrenormalization=1; |
131 |
|
} |
132 |
|
} |
133 |
+ |
|
134 |
|
} |
135 |
|
else { |
136 |
|
this->is_active=false; |
240 |
|
dout << "MC sample(s): " << endl; |
241 |
|
for (int isamp=0;isamp<(int)this->collection.size();isamp++) |
242 |
|
{ |
243 |
< |
if(!(this->collection)[isamp].is_data) dout << " - " << (this->collection)[isamp].samplename << " (" << (this->collection)[isamp].filename << ") xs=" << (this->collection)[isamp].xs << " pb, N(events)=" << (this->collection)[isamp].Nentries << " , RN = " << (this->collection)[isamp].weightrenormalization << endl; |
243 |
> |
if(!(this->collection)[isamp].is_data) dout << " - " << (this->collection)[isamp].samplename << " (" << (this->collection)[isamp].filename << ") xs=" << (this->collection)[isamp].xs << " pb, N(events)=" << (this->collection)[isamp].Nentries << endl; |
244 |
|
} |
245 |
|
} |
246 |
|
dout << "---------------------------------------------------------------------------------------------------" << endl; |
594 |
|
fakehistos[(this->collection)[isample].groupindex]->SetFillColor(this->GetColor(isample)); |
595 |
|
leg->AddEntry(fakehistos[(this->collection)[isample].groupindex],((this->collection)[isample].samplename).c_str(),"f"); |
596 |
|
donealready[(this->collection)[isample].groupindex]=true; |
597 |
+ |
PlottingSetup::FakeHistoHeap.push_back(fakehistos[(this->collection)[isample].groupindex]); |
598 |
|
} |
599 |
|
} |
600 |
|
DrawPrelim(); |
607 |
|
// gErrorIgnoreLevel=5000; |
608 |
|
TH1F *blub = new TH1F("nothing","nothing",1,0,1); |
609 |
|
// gErrorIgnoreLevel=currlevel;//we know this possibly replaces a previous histo, but we don't care since it's fake anyway. |
610 |
< |
return this->allbglegend(title,blub,posx,posy); |
610 |
> |
TLegend *leg = this->allbglegend(title,blub,posx,posy); |
611 |
> |
delete blub; |
612 |
> |
return leg; |
613 |
|
} |
614 |
|
|
615 |
|
|