ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/SampleClass.C
(Generate patch)

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/SampleClass.C (file contents):
Revision 1.15 by fronga, Thu Aug 25 08:44:43 2011 UTC vs.
Revision 1.17 by buchmann, Thu Sep 8 15:20:56 2011 UTC

# Line 125 | Line 125 | bool doesROOTFileExist(string filename)
125  
126   TCut essentialcut("mll>0");
127   // This will reweight all the events: use "weight" to correct MC for pileUP, "1.0" otherwise
128 < TCut cutWeight("weight");
128 > TCut cutWeight("1.0");
129  
130   void setessentialcut(TCut ess) {
131    essentialcut=ess;
# Line 286 | Line 286 | TH1F* samplecollection::Draw(string m_hi
286        (this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight);//this weight is based on PU etc. not XS
287        if(addoverunderflowbins) {
288          //now also adding the overflow & underflow bins:
289 <        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1));
289 >        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)+tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()));
290          tempdrawhisto->SetBinError(tempdrawhisto->GetNbinsX(),TMath::Sqrt(tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX())));
291 <        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0));
291 >        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0)+tempdrawhisto->GetBinContent(1));
292          tempdrawhisto->SetBinError(1,TMath::Sqrt(tempdrawhisto->GetBinContent(1)));
293        }
294  
# Line 359 | Line 359 | TH2F* samplecollection::Draw(string m_hi
359        (this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight);//this weight is based on PU etc. not XS
360        if(addoverunderflowbins) {
361          //now also adding the overflow & underflow bins:
362 <        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1));
362 >        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)+tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()));
363          tempdrawhisto->SetBinError(tempdrawhisto->GetNbinsX(),TMath::Sqrt(tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX())));
364 <        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0));
364 >        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0)+tempdrawhisto->GetBinContent(1));
365          tempdrawhisto->SetBinError(1,TMath::Sqrt(tempdrawhisto->GetBinContent(1)));
366        }
367  
# Line 415 | Line 415 | THStack samplecollection::DrawStack(stri
415        
416        if(addoverunderflowbins) {
417          //now also adding the overflow & underflow bins:
418 <        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1));
419 <        tempdrawhisto->SetBinError(tempdrawhisto->GetNbinsX(),TMath::Sqrt(tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX())));
420 <        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0));
421 <        tempdrawhisto->SetBinError(1,TMath::Sqrt(tempdrawhisto->GetBinContent(1)));
418 >        tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)+tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()));
419 > //      tempdrawhisto->SetBinError(tempdrawhisto->GetNbinsX(),TMath::Sqrt(tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX())));  // errors not necessary for stack!
420 >        tempdrawhisto->SetBinContent(1,tempdrawhisto->GetBinContent(0)+tempdrawhisto->GetBinContent(1));
421 > //      tempdrawhisto->SetBinError(1,TMath::Sqrt(tempdrawhisto->GetBinContent(1)));  // errors not necessary for stack!
422        }
423  
424        if(!(this->collection)[isample].is_data) tempdrawhisto->Scale(luminosity*((this->collection)[isample].weight));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines