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  h->FitSlicesY(nullptr, 0, -1, 0, "QNR SERIAL");
161  string name(h->GetName());
162  h0 = (TH1*)gDirectory->Get((name + "_0").c_str());
163  h1 = (TH1*)gDirectory->Get((name + "_1").c_str());
164  h2 = (TH1*)gDirectory->Get((name + "_2").c_str());
165  h3 = (TH1*)gDirectory->Get((name + "_chi2").c_str());
166  TH1::AddDirectory(oldAddDir);
167  }

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

◆ ~FitSlicesYTool()

FitSlicesYTool::~FitSlicesYTool ( )
inline

Destructor.

Definition at line 170 of file DQMGenericClient.cc.

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

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 177 of file DQMGenericClient.cc.

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

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 203 of file DQMGenericClient.cc.

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

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 190 of file DQMGenericClient.cc.

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

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 217 of file DQMGenericClient.cc.

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

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 232 of file DQMGenericClient.cc.

◆ h1

TH1* FitSlicesYTool::h1
private

◆ h2

TH1* FitSlicesYTool::h2
private

◆ h3

TH1* FitSlicesYTool::h3
private

Definition at line 235 of file DQMGenericClient.cc.

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