#include <FitSlicesYTool.h>
Public Member Functions | |
FitSlicesYTool (MonitorElement *) | |
void | getFittedMean (MonitorElement *) |
Fill the ME with the mean value of the gaussian fit in each slice. | |
void | getFittedMeanWithError (MonitorElement *) |
Fill the ME with the mean value (with error) of the gaussian fit in each slice. | |
void | getFittedSigma (MonitorElement *) |
Fill the ME with the sigma value of the gaussian fit in each slice. | |
void | getFittedSigmaWithError (MonitorElement *) |
Fill the ME with the sigma value (with error) of the gaussian fit in each slice. | |
~FitSlicesYTool () | |
Constructor: needs a TH2F. | |
Private Attributes | |
TH1 * | h0 |
TH1 * | h1 |
TH1 * | h2 |
TH1 * | h3 |
Class to fill Monitor Elements using the ROOT FitSlicesY tool
Definition at line 17 of file FitSlicesYTool.h.
FitSlicesYTool::FitSlicesYTool | ( | MonitorElement * | me | ) |
Definition at line 8 of file FitSlicesYTool.cc.
References MonitorElement::getTH2F(), h, and mergeVDriftHistosByStation::name.
{ const bool oldAddDir = TH1::AddDirectoryStatus(); TH1::AddDirectory(true); // ... create your hists TH2F * h = me->getTH2F(); h->FitSlicesY(); string name(h->GetName()); h0 = (TH1*)gDirectory->Get((name+"_0").c_str()); h1 = (TH1*)gDirectory->Get((name+"_1").c_str()); h2 = (TH1*)gDirectory->Get((name+"_2").c_str()); h3 = (TH1*)gDirectory->Get((name+"_chi2").c_str()); TH1::AddDirectory(oldAddDir); }
FitSlicesYTool::~FitSlicesYTool | ( | ) |
void FitSlicesYTool::getFittedMean | ( | MonitorElement * | me | ) |
Fill the ME with the mean value of the gaussian fit in each slice.
Definition at line 37 of file FitSlicesYTool.cc.
References newFWLiteAna::bin, Exception, and MonitorElement::setBinContent().
{ if (!(h1&&me)) throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me; if (h1->GetNbinsX()==me->getNbinsX()){ for (int bin=0;bin!=h1->GetNbinsX();bin++){ me->setBinContent(bin+1,h1->GetBinContent(bin+1)); } } else { throw cms::Exception("FitSlicesYTool") << "Different number of bins!"; } }
void FitSlicesYTool::getFittedMeanWithError | ( | MonitorElement * | me | ) |
Fill the ME with the mean value (with error) of the gaussian fit in each slice.
Definition at line 57 of file FitSlicesYTool.cc.
References newFWLiteAna::bin, Exception, and MonitorElement::setBinContent().
Referenced by MuonTrackResidualAnalyzer::computeResolution(), and MTVHistoProducerAlgoForTracker::finalHistoFits().
{ if (!(h1&&me)) throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me; if (h1->GetNbinsX()==me->getNbinsX()){ for (int bin=0;bin!=h1->GetNbinsX();bin++){ me->setBinContent(bin+1,h1->GetBinContent(bin+1)); me->setBinError(bin+1,h1->GetBinError(bin+1)); } } else { throw cms::Exception("FitSlicesYTool") << "Different number of bins!"; } }
void FitSlicesYTool::getFittedSigma | ( | MonitorElement * | me | ) |
Fill the ME with the sigma value of the gaussian fit in each slice.
Definition at line 47 of file FitSlicesYTool.cc.
References newFWLiteAna::bin, Exception, and MonitorElement::setBinContent().
{ if (!(h2&&me)) throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me; if (h2->GetNbinsX()==me->getNbinsX()){ for (int bin=0;bin!=h2->GetNbinsX();bin++){ me->setBinContent(bin+1,h2->GetBinContent(bin+1)); } } else { throw cms::Exception("FitSlicesYTool") << "Different number of bins!"; } }
void FitSlicesYTool::getFittedSigmaWithError | ( | MonitorElement * | me | ) |
Fill the ME with the sigma value (with error) of the gaussian fit in each slice.
Definition at line 68 of file FitSlicesYTool.cc.
References newFWLiteAna::bin, Exception, and MonitorElement::setBinContent().
Referenced by MuonTrackResidualAnalyzer::computeResolution(), and MTVHistoProducerAlgoForTracker::finalHistoFits().
{ if (!(h2&&me)) throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me; if (h2->GetNbinsX()==me->getNbinsX()){ for (int bin=0;bin!=h2->GetNbinsX();bin++){ me->setBinContent(bin+1,h2->GetBinContent(bin+1)); me->setBinError(bin+1,h2->GetBinError(bin+1)); } } else { throw cms::Exception("FitSlicesYTool") << "Different number of bins!"; } }
TH1* FitSlicesYTool::h0 [private] |
Definition at line 33 of file FitSlicesYTool.h.
TH1* FitSlicesYTool::h1 [private] |
Definition at line 34 of file FitSlicesYTool.h.
TH1* FitSlicesYTool::h2 [private] |
Definition at line 35 of file FitSlicesYTool.h.
TH1* FitSlicesYTool::h3 [private] |
Definition at line 36 of file FitSlicesYTool.h.