CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Definition at line 154 of file DQMGenericClient.cc.

Constructor & Destructor Documentation

FitSlicesYTool::FitSlicesYTool ( MonitorElement me)
inline

Definition at line 155 of file DQMGenericClient.cc.

References dqm::legacy::MonitorElement::getTH2F(), h, and mergeVDriftHistosByStation::name.

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  }
virtual TH2F * getTH2F() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
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

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.

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

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  }
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.

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

Referenced by DQMGenericClient::computeResolution().

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  }
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.

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

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  }
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.

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

Referenced by DQMGenericClient::computeResolution().

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  }

Member Data Documentation

TH1* FitSlicesYTool::h0
private

Definition at line 233 of file DQMGenericClient.cc.

TH1* FitSlicesYTool::h1
private
TH1* FitSlicesYTool::h2
private
TH1* FitSlicesYTool::h3
private

Definition at line 236 of file DQMGenericClient.cc.