CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
FitSlicesYTool Class Reference

Public Types

typedef dqm::harvesting::MonitorElement MonitorElement
 

Public Member Functions

 FitSlicesYTool (MonitorElement *me)
 
void getFittedMean (MonitorElement *me)
 Fill the ME with the mean value of the gaussian fit in each slice. More...
 
void getFittedMeanWithError (MonitorElement *me)
 Fill the ME with the mean value (with error) of the gaussian fit in each slice. More...
 
void getFittedSigma (MonitorElement *me)
 Fill the ME with the sigma value of the gaussian fit in each slice. More...
 
void getFittedSigmaWithError (MonitorElement *me)
 Fill the ME with the sigma value (with error) of the gaussian fit in each slice. More...
 
 ~FitSlicesYTool ()
 Destructor. More...
 

Private Attributes

TH1 * h0
 
TH1 * h1
 
TH1 * h2
 
TH1 * h3
 

Detailed Description

Definition at line 152 of file DQMGenericClient.cc.

Member Typedef Documentation

◆ MonitorElement

Definition at line 154 of file DQMGenericClient.cc.

Constructor & Destructor Documentation

◆ FitSlicesYTool()

FitSlicesYTool::FitSlicesYTool ( MonitorElement me)
inline

Definition at line 155 of file DQMGenericClient.cc.

155  {
156  const bool oldAddDir = TH1::AddDirectoryStatus();
157  TH1::AddDirectory(true);
158  // ... create your hists
159  TH2F* h = me->getTH2F();
160  TF1 fgaus("fgaus", "gaus", h->GetYaxis()->GetXmin(), h->GetYaxis()->GetXmax(), TF1::EAddToList::kNo);
161  h->FitSlicesY(&fgaus, 0, -1, 0, "QNR SERIAL");
162  string name(h->GetName());
163  h0 = (TH1*)gDirectory->Get((name + "_0").c_str());
164  h1 = (TH1*)gDirectory->Get((name + "_1").c_str());
165  h2 = (TH1*)gDirectory->Get((name + "_2").c_str());
166  h3 = (TH1*)gDirectory->Get((name + "_chi2").c_str());
167  TH1::AddDirectory(oldAddDir);
168  }

References hlt_dqm_clientPB-live_cfg::me, and Skims_PA_cff::name.

◆ ~FitSlicesYTool()

FitSlicesYTool::~FitSlicesYTool ( )
inline

Destructor.

Definition at line 171 of file DQMGenericClient.cc.

171  {
172  delete h0;
173  delete h1;
174  delete h2;
175  delete h3;
176  }

Member Function Documentation

◆ getFittedMean()

void FitSlicesYTool::getFittedMean ( MonitorElement me)
inline

Fill the ME with the mean value of the gaussian fit in each slice.

Definition at line 178 of file DQMGenericClient.cc.

178  {
179  if (!(h1 && me))
180  throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me;
181  if (h1->GetNbinsX() == me->getNbinsX()) {
182  for (int bin = 0; bin != h1->GetNbinsX(); bin++) {
183  me->setBinContent(bin + 1, h1->GetBinContent(bin + 1));
184  // me->setBinEntries(bin+1, 1.);
185  }
186  } else {
187  throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
188  }
189  }

References newFWLiteAna::bin, Exception, and hlt_dqm_clientPB-live_cfg::me.

◆ getFittedMeanWithError()

void FitSlicesYTool::getFittedMeanWithError ( MonitorElement me)
inline

Fill the ME with the mean value (with error) of the gaussian fit in each slice.

Definition at line 204 of file DQMGenericClient.cc.

204  {
205  if (!(h1 && me))
206  throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me;
207  if (h1->GetNbinsX() == me->getNbinsX()) {
208  for (int bin = 0; bin != h1->GetNbinsX(); bin++) {
209  me->setBinContent(bin + 1, h1->GetBinContent(bin + 1));
210  // me->setBinEntries(bin+1, 1.);
211  me->setBinError(bin + 1, h1->GetBinError(bin + 1));
212  }
213  } else {
214  throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
215  }
216  }

References newFWLiteAna::bin, Exception, and hlt_dqm_clientPB-live_cfg::me.

Referenced by DQMGenericClient::computeResolution().

◆ getFittedSigma()

void FitSlicesYTool::getFittedSigma ( MonitorElement me)
inline

Fill the ME with the sigma value of the gaussian fit in each slice.

Definition at line 191 of file DQMGenericClient.cc.

191  {
192  if (!(h2 && me))
193  throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me;
194  if (h2->GetNbinsX() == me->getNbinsX()) {
195  for (int bin = 0; bin != h2->GetNbinsX(); bin++) {
196  me->setBinContent(bin + 1, h2->GetBinContent(bin + 1));
197  // me->setBinEntries(bin+1, 1.);
198  }
199  } else {
200  throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
201  }
202  }

References newFWLiteAna::bin, Exception, and hlt_dqm_clientPB-live_cfg::me.

◆ getFittedSigmaWithError()

void FitSlicesYTool::getFittedSigmaWithError ( MonitorElement me)
inline

Fill the ME with the sigma value (with error) of the gaussian fit in each slice.

Definition at line 218 of file DQMGenericClient.cc.

218  {
219  if (!(h2 && me))
220  throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h1=" << h1 << " me=" << me;
221  if (h2->GetNbinsX() == me->getNbinsX()) {
222  for (int bin = 0; bin != h2->GetNbinsX(); bin++) {
223  me->setBinContent(bin + 1, h2->GetBinContent(bin + 1));
224  // me->setBinEntries(bin+1, 1.);
225  me->setBinError(bin + 1, h2->GetBinError(bin + 1));
226  }
227  } else {
228  throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
229  }
230  }

References newFWLiteAna::bin, Exception, and hlt_dqm_clientPB-live_cfg::me.

Referenced by DQMGenericClient::computeResolution().

Member Data Documentation

◆ h0

TH1* FitSlicesYTool::h0
private

Definition at line 233 of file DQMGenericClient.cc.

◆ h1

TH1* FitSlicesYTool::h1
private

◆ h2

TH1* FitSlicesYTool::h2
private

◆ h3

TH1* FitSlicesYTool::h3
private

Definition at line 236 of file DQMGenericClient.cc.

h
FitSlicesYTool::h1
TH1 * h1
Definition: DQMGenericClient.cc:234
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
FitSlicesYTool::h2
TH1 * h2
Definition: DQMGenericClient.cc:235
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
FitSlicesYTool::h3
TH1 * h3
Definition: DQMGenericClient.cc:236
FitSlicesYTool::h0
TH1 * h0
Definition: DQMGenericClient.cc:233