Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64415
b: "refs/heads/CMSSW_7_1_X"
c: e9986d0
h: "refs/heads/CMSSW_7_1_X"
i:
  64413: 2a9d506
  64411: 47d3ba0
  64407: 6942da3
  64399: d927219
  64383: b4b0337
v: v3
  • Loading branch information
Marco De Mattia committed Apr 7, 2009
1 parent d4c48c2 commit c11e529
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 82f76fd1a3f5d9423d7c163d852a0c36647fc4ea
"refs/heads/CMSSW_7_1_X": e929ed58ddc1844afbd4610abae63a8d8cb5f927
"refs/heads/CMSSW_7_1_X": e9986d07fc7a4b9dbd6c56eb3bef3e46d9465221
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ void drawMasses(const double ResMass, const double ResHalfWidth, histos & h)
// Set a consistent binning
int massXbins = h.mass->GetNbinsX();
int massProbXbins = h.massProb->GetNbinsX();
if( massXbins > massProbXbins && h.mass->GetNbinsX() % h.massProb->GetNbinsX() != 0 ) {
if( massXbins > massProbXbins && massXbins % massProbXbins != 0 ) {
cout << "Warning: number of bins are not multiples: massXbins = " << massXbins << ", massProbXbins = " << massProbXbins << endl;
}
else if( h.mass->GetNbinsX() % h.massProb->GetNbinsX() != 0 ) {
else if( massProbXbins % massXbins != 0 ) {
cout << "Warning: number of bins are not multiples: massXbins = " << massXbins << ", massProbXbins = " << massProbXbins << endl;
}
if( massProbXbins > massXbins ) {
Expand All @@ -51,17 +51,26 @@ void drawMasses(const double ResMass, const double ResHalfWidth, histos & h)
cout << "massXbins("<<massXbins<<") > " << "massProbXbins("<<massProbXbins<<")" << endl;
h.mass->Rebin(massXbins/massProbXbins);
}
h.mass->SetAxisRange(ResMass - ResHalfWidth, ResMass + ResHalfWidth);
double normFactor = (h.mass->Integral())/(h.massProb->Integral());
h.massProb->SetNormFactor(normFactor);
h.massProb->SetAxisRange(ResMass - ResHalfWidth, ResMass + ResHalfWidth);
h.massProb->SetLineColor(kBlue);
h.massProb->SetNormFactor(normFactor);
h.mass->SetMarkerColor(kRed);
cout << (h.massProb->GetMaximum())*normFactor << endl;
cout << h.mass->GetMaximum() << endl;
// ATTENTION: put so that the maximum is correct
// if( (h.massProb->GetMaximum())*normFactor > h.mass->GetMaximum() ) h.massProb->DrawCopy();
h.mass->DrawCopy("PE");
h.massProb->DrawCopy("SAMEHISTO");
cout << "(h.massProb->GetMaximum())*normFactor = " << (h.massProb->GetMaximum())*normFactor << endl;
cout << "h.mass->GetMaximum() = " << h.mass->GetMaximum() << endl;
if( (h.massProb->GetMaximum())*normFactor > h.mass->GetMaximum() ) {
h.massProb->DrawCopy("PE");
h.mass->DrawCopy("SAMEHISTO");
}
else {
h.mass->DrawCopy("PE");
h.massProb->DrawCopy("SAMEHISTO");
}
}

/// Helper function to draw likelihood histograms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TList *FileList;
TFile *Target;
void draw( TDirectory *target, TList *sourcelist, const bool doHalfEta );

void Draw(const bool doHalfEta = false) {
void ResolDraw(const bool doHalfEta = false) {
// in an interactive ROOT session, edit the file names
// Target and FileList, then
// root > .L hadd.C
Expand Down

0 comments on commit c11e529

Please sign in to comment.