124 |
|
//******************************************************** |
125 |
|
|
126 |
|
TCut essentialcut("mll>0"); |
127 |
+ |
// This will reweight all the events: use "weight" to correct MC for pileUP |
128 |
+ |
TCut cutWeight("weight"); |
129 |
|
|
130 |
|
void setessentialcut(TCut ess) { |
131 |
|
essentialcut=ess; |
282 |
|
tempdrawhisto->Sumw2(); |
283 |
|
if(use_this_sample) { |
284 |
|
if(Verbosity>0) dout << "[samplecollection::Draw] : Added contribution from sample " << (this->collection)[isample].samplename << endl; |
285 |
< |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*"weight");//this weight is based on PU etc. not XS |
285 |
> |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight);//this weight is based on PU etc. not XS |
286 |
|
if(addoverunderflowbins) { |
287 |
|
//now also adding the overflow & underflow bins: |
288 |
|
tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)); |
347 |
|
tempdrawhisto->Sumw2(); |
348 |
|
if(use_this_sample) { |
349 |
|
if(Verbosity>0) dout << "[samplecollection::Draw] : Added contribution from sample " << (this->collection)[isample].samplename << endl; |
350 |
< |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*"weight");//this weight is based on PU etc. not XS |
350 |
> |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight);//this weight is based on PU etc. not XS |
351 |
|
if(addoverunderflowbins) { |
352 |
|
//now also adding the overflow & underflow bins: |
353 |
|
tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)); |
402 |
|
if(!drawsignal&&(this->collection)[isample].is_signal) continue; |
403 |
|
if((this->collection)[isample].is_active&&(this->collection)[isample].is_data==m_is_data) {//fills mc if we want mc, else fills data. |
404 |
|
TH1F *tempdrawhisto = new TH1F("tempdrawhisto","",binning.size()-1,binningarray); |
405 |
< |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*"weight"); |
405 |
> |
(this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight); |
406 |
|
|
407 |
|
if(addoverunderflowbins) { |
408 |
|
//now also adding the overflow & underflow bins: |
469 |
|
{ |
470 |
|
if(((this->collection)[isam].filename).find(what)!=string::npos) { |
471 |
|
hitcollection.push_back(isam); |
472 |
+ |
} else { |
473 |
|
} |
471 |
– |
else { |
472 |
– |
} |
474 |
|
} |
475 |
< |
if(hitcollection.size()==0) hitcollection.push_back(-1); |
475 |
> |
if(hitcollection.size()==0) { |
476 |
> |
hitcollection.push_back(-1); |
477 |
> |
dout << "*** Warning: couldn't find sample " << what << ": using all" << endl; |
478 |
> |
} |
479 |
|
return hitcollection; |
480 |
|
} |
481 |
|
|
596 |
|
|
597 |
|
void switch_overunderflow(bool newpos=false) { |
598 |
|
addoverunderflowbins=newpos; |
599 |
< |
} |
599 |
> |
} |