CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EcalZmassClient Class Reference
Inheritance diagram for EcalZmassClient:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalZmassClient (const edm::ParameterSet &)
 
 ~EcalZmassClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob () override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

MonitorElementh_fitres1
 
MonitorElementh_fitres1bis
 
MonitorElementh_fitres1Chi2
 
MonitorElementh_fitres2
 
MonitorElementh_fitres2bis
 
MonitorElementh_fitres2Chi2
 
MonitorElementh_fitres3
 
MonitorElementh_fitres3bis
 
MonitorElementh_fitres3Chi2
 
std::string prefixME_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 50 of file EcalZmassClient.cc.

Constructor & Destructor Documentation

EcalZmassClient::EcalZmassClient ( const edm::ParameterSet iConfig)
explicit

Definition at line 107 of file EcalZmassClient.cc.

References edm::ParameterSet::getUntrackedParameter(), prefixME_, and AlCaHLTBitMon_QueryRunRegistry::string.

108 {
109  prefixME_ = iConfig.getUntrackedParameter < std::string > ("prefixME", "");
110 
111 }
T getUntrackedParameter(std::string const &, T const &) const
std::string prefixME_
EcalZmassClient::~EcalZmassClient ( )

Definition at line 114 of file EcalZmassClient.cc.

115 {
116 
117  // do anything here that needs to be done at desctruction time
118  // (e.g. close files, deallocate resources etc.)
119 
120 }

Member Function Documentation

void EcalZmassClient::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 129 of file EcalZmassClient.cc.

131 {
132 
133 }
void EcalZmassClient::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file EcalZmassClient.cc.

139 {
140 }
void EcalZmassClient::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 777 of file EcalZmassClient.cc.

779 {
780 }
void EcalZmassClient::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file EcalZmassClient.cc.

References DQMStore::book1D(), h_fitres1, h_fitres1bis, h_fitres1Chi2, h_fitres2, h_fitres2bis, h_fitres2Chi2, h_fitres3, h_fitres3bis, h_fitres3Chi2, cppFunctionSkipper::operator, prefixME_, and DQMStore::setCurrentFolder().

151 {
152  DQMStore *theDbe = edm::Service < DQMStore > ().operator-> ();
153 
154  theDbe->setCurrentFolder (prefixME_ + "/Zmass");
155  h_fitres1 =
156  theDbe->book1D ("Gaussian mean WP80 EB-EB",
157  "Gaussian mean WP80 EB-EB", 1, 0, 1);
158  h_fitres1bis =
159  theDbe->book1D ("Gaussian sigma WP80 EB-EB",
160  "Gaussian sigma WP80 EB-EB", 1, 0, 1);
161  h_fitres1Chi2 =
162  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EB",
163  "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
164 
165  h_fitres3 =
166  theDbe->book1D ("Gaussian mean WP80 EB-EE",
167  "Gaussian mean result WP80 EB-EE", 1, 0, 1);
168  h_fitres3bis =
169  theDbe->book1D ("Gaussian sigma WP80 EB-EE",
170  "Gaussian sigma WP80 EB-EE", 1, 0, 1);
171  h_fitres3Chi2 =
172  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EE",
173  "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
174 
175  h_fitres2 =
176  theDbe->book1D ("Gaussian mean WP80 EE-EE",
177  "Gaussian mean WP80 EE-EE", 1, 0, 1);
178  h_fitres2bis =
179  theDbe->book1D ("Gaussian sigma WP80 EE-EE",
180  "Gaussian sigma WP80 EE-EE", 1, 0, 1);
181  h_fitres2Chi2 =
182  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EE-EE",
183  "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
184 }
MonitorElement * h_fitres1Chi2
MonitorElement * h_fitres2
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:928
MonitorElement * h_fitres1
MonitorElement * h_fitres2Chi2
MonitorElement * h_fitres3Chi2
MonitorElement * h_fitres2bis
MonitorElement * h_fitres3
MonitorElement * h_fitres3bis
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:639
MonitorElement * h_fitres1bis
std::string prefixME_
void EcalZmassClient::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file EcalZmassClient.cc.

145 {
146 }
void EcalZmassClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 784 of file EcalZmassClient.cc.

786 {
787 }
void EcalZmassClient::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 217 of file EcalZmassClient.cc.

References alignCSCRings::e, DQMStore::get(), MonitorElement::getTH1F(), h_fitres1, h_fitres1bis, h_fitres1Chi2, h_fitres2, h_fitres2bis, h_fitres2Chi2, h_fitres3, h_fitres3bis, h_fitres3Chi2, LogTrace, timingPdfMaker::mean, mygauss(), N, cppFunctionSkipper::operator, prefixME_, plotscripts::rms(), and cms::Exception::what().

218 {
219  DQMStore *theDbe = edm::Service < DQMStore > ().operator-> ();
220 
221  LogTrace ("EwkAnalyzer") << "Parameters initialization";
222 
223  MonitorElement *me1 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EB-EB");
224  MonitorElement *me2 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EE-EE");
225  MonitorElement *me3 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EB-EE");
226 
227 
228  if (me1 != 0)
229  {
230  TH1F *B = me1->getTH1F ();
231  TH1F *R1 = h_fitres1->getTH1F ();
232  int division = B->GetNbinsX ();
233  float massMIN = B->GetBinLowEdge (1);
234  float massMAX = B->GetBinLowEdge (division + 1);
235  //float BIN_SIZE = B->GetBinWidth(1);
236 
237  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
238  func->SetParameter (0, 1.0);
239  func->SetParName (0, "const");
240  func->SetParameter (1, 95.0);
241  func->SetParName (1, "mean");
242  func->SetParameter (2, 5.0);
243  func->SetParName (2, "sigma");
244 
245  double stats[4];
246  R1->GetStats (stats);
247  float N = 0;
248  float mean = 0;
249  float sigma = 0;
250  N = B->GetEntries ();
251 
252  try
253  {
254  if (N != 0)
255  {
256 
257  B->Fit ("mygauss", "QR");
258  mean = fabs (func->GetParameter (1));
259  sigma = fabs (func->GetParError (1));
260  }
261 
262  if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
263  {
264  N = 1;
265  mean = 0;
266  sigma = 0;
267  }
268 
269  }
270  catch (cms::Exception& e)
271  {
272  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
273  N = 1;
274  mean = 40;
275  sigma = 0;
276  }
277 
278  stats[0] = N;
279  stats[1] = N;
280  stats[2] = mean * N;
281  stats[3] = sigma * sigma * N + mean * mean * N;
282 
283  R1->SetEntries (N);
284  R1->PutStats (stats);
285  }
286 /*******************************************************/
287  if (me1 != 0)
288  {
289  TH1F *Bbis = me1->getTH1F ();
290  TH1F *R1bis = h_fitres1bis->getTH1F ();
291  int division = Bbis->GetNbinsX ();
292  float massMIN = Bbis->GetBinLowEdge (1);
293  float massMAX = Bbis->GetBinLowEdge (division + 1);
294  //float BIN_SIZE = B->GetBinWidth(1);
295 
296  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
297  func->SetParameter (0, 1.0);
298  func->SetParName (0, "const");
299  func->SetParameter (1, 95.0);
300  func->SetParName (1, "mean");
301  func->SetParameter (2, 5.0);
302  func->SetParName (2, "sigma");
303 
304  double stats[4];
305  R1bis->GetStats (stats);
306  float N = 0;
307  float rms = 0;
308  float rmsErr = 0;
309  N = Bbis->GetEntries ();
310 
311  try
312  {
313  if (N != 0)
314  {
315 
316  Bbis->Fit ("mygauss", "QR");
317  rms = fabs (func->GetParameter (2));
318  rmsErr = fabs (func->GetParError (2));
319  }
320 
321  if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
322  {
323  N = 1;
324  rms = 0;
325  rmsErr = 0;
326  }
327 
328  }
329  catch (cms::Exception& e)
330  {
331  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
332  N = 1;
333  rms = 40;
334  rmsErr = 0;
335  }
336 
337  stats[0] = N;
338  stats[1] = N;
339  stats[2] = rms * N;
340  stats[3] = rmsErr * rmsErr * N + rms * rms * N;
341 
342  R1bis->SetEntries (N);
343  R1bis->PutStats (stats);
344  }
345 /****************************************/
346 
347  if (me2 != 0)
348  {
349  TH1F *E = me2->getTH1F ();
350  TH1F *R2 = h_fitres2->getTH1F ();
351  int division = E->GetNbinsX ();
352  float massMIN = E->GetBinLowEdge (1);
353  float massMAX = E->GetBinLowEdge (division + 1);
354  //float BIN_SIZE = E->GetBinWidth(1);
355 
356  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
357  func->SetParameter (0, 1.0);
358  func->SetParName (0, "const");
359  func->SetParameter (1, 95.0);
360  func->SetParName (1, "mean");
361  func->SetParameter (2, 5.0);
362  func->SetParName (2, "sigma");
363 
364  double stats[4];
365  R2->GetStats (stats);
366  float N = 0;
367  float mean = 0;
368  float sigma = 0;
369  N = E->GetEntries ();
370 
371  try
372  {
373  if (N != 0)
374  {
375  E->Fit ("mygauss", "QR");
376  mean = fabs (func->GetParameter (1));
377  sigma = fabs (func->GetParError (1));
378  }
379 
380  if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
381  {
382  N = 1;
383  mean = 0;
384  sigma = 0;
385 
386  }
387 
388  }
389  catch (cms::Exception& e)
390  {
391  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
392  N = 1;
393  mean = 40;
394  sigma = 0;
395  }
396 
397  stats[0] = N;
398  stats[1] = N;
399  stats[2] = mean * N;
400  stats[3] = sigma * sigma * N + mean * mean * N;
401 
402  R2->SetEntries (N);
403  R2->PutStats (stats);
404  }
405 /**************************************************************************/
406 
407  if (me2 != 0)
408  {
409  TH1F *Ebis = me2->getTH1F ();
410  TH1F *R2bis = h_fitres2bis->getTH1F ();
411  int division = Ebis->GetNbinsX ();
412  float massMIN = Ebis->GetBinLowEdge (1);
413  float massMAX = Ebis->GetBinLowEdge (division + 1);
414  //float BIN_SIZE = B->GetBinWidth(1);
415 
416  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
417  func->SetParameter (0, 1.0);
418  func->SetParName (0, "const");
419  func->SetParameter (1, 95.0);
420  func->SetParName (1, "mean");
421  func->SetParameter (2, 5.0);
422  func->SetParName (2, "sigma");
423 
424  double stats[4];
425  R2bis->GetStats (stats);
426  float N = 0;
427  float rms = 0;
428  float rmsErr = 0;
429  N = Ebis->GetEntries ();
430 
431  try
432  {
433  if (N != 0)
434  {
435 
436  Ebis->Fit ("mygauss", "QR");
437  rms = fabs (func->GetParameter (2));
438  rmsErr = fabs (func->GetParError (2));
439  }
440 
441  if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
442  {
443  N = 1;
444  rms = 0;
445  rmsErr = 0;
446  }
447 
448  }
449  catch (cms::Exception& e)
450  {
451  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
452  N = 1;
453  rms = 40;
454  rmsErr = 0;
455  }
456 
457  stats[0] = N;
458  stats[1] = N;
459  stats[2] = rms * N;
460  stats[3] = rmsErr * rmsErr * N + rms * rms * N;
461 
462  R2bis->SetEntries (N);
463  R2bis->PutStats (stats);
464  }
465 /*********************************************************************************************/
466 
467  if (me3 != 0)
468  {
469  TH1F *R3 = h_fitres3->getTH1F ();
470  TH1F *M = me3->getTH1F ();
471  int division = M->GetNbinsX ();
472  float massMIN = M->GetBinLowEdge (1);
473  float massMAX = M->GetBinLowEdge (division + 1);
474  //float BIN_SIZE = M->GetBinWidth(1);
475 
476  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
477  func->SetParameter (0, 1.0);
478  func->SetParName (0, "const");
479  func->SetParameter (1, 95.0);
480  func->SetParName (1, "mean");
481  func->SetParameter (2, 5.0);
482  func->SetParName (2, "sigma");
483 
484  double stats[4];
485  R3->GetStats (stats);
486  float N = 0;
487  float mean = 0;
488  float sigma = 0;
489  N = M->GetEntries ();
490 
491 
492  try
493  {
494  if (N != 0)
495  {
496 
497  M->Fit ("mygauss", "QR");
498  mean = fabs (func->GetParameter (1));
499  sigma = fabs (func->GetParError (1));
500  }
501  if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20)
502  {
503  N = 1;
504  mean = 0;
505  sigma = 0;
506  }
507 
508  }
509  catch (cms::Exception& e)
510  {
511  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
512  N = 1;
513  mean = 40;
514  sigma = 0;
515  }
516 
517  stats[0] = N;
518  stats[1] = N;
519  stats[2] = mean * N;
520  stats[3] = sigma * sigma * N + mean * mean * N;
521 
522  R3->SetEntries (N);
523  R3->PutStats (stats);
524  }
525  /********************************************************************************/
526 
527  if (me3 != 0)
528  {
529  TH1F *Mbis = me3->getTH1F ();
530  TH1F *R3bis = h_fitres3bis->getTH1F ();
531  int division = Mbis->GetNbinsX ();
532  float massMIN = Mbis->GetBinLowEdge (1);
533  float massMAX = Mbis->GetBinLowEdge (division + 1);
534  //float BIN_SIZE = B->GetBinWidth(1);
535 
536  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
537  func->SetParameter (0, 1.0);
538  func->SetParName (0, "const");
539  func->SetParameter (1, 95.0);
540  func->SetParName (1, "mean");
541  func->SetParameter (2, 5.0);
542  func->SetParName (2, "sigma");
543 
544  double stats[4];
545  R3bis->GetStats (stats);
546  float N = 0;
547  float rms = 0;
548  float rmsErr = 0;
549  N = Mbis->GetEntries ();
550 
551  try
552  {
553  if (N != 0)
554  {
555 
556  Mbis->Fit ("mygauss", "QR");
557  rms = fabs (func->GetParameter (2));
558  rmsErr = fabs (func->GetParError (2));
559  }
560 
561  if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50)
562  {
563  N = 1;
564  rms = 0;
565  rmsErr = 0;
566  }
567 
568  }
569  catch (cms::Exception& e)
570  {
571  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
572  N = 1;
573  rms = 40;
574  rmsErr = 0;
575  }
576 
577  stats[0] = N;
578  stats[1] = N;
579  stats[2] = rms * N;
580  stats[3] = rmsErr * rmsErr * N + rms * rms * N;
581 
582  R3bis->SetEntries (N);
583  R3bis->PutStats (stats);
584  }
585 
586  /*Chi2 */
587 
588  if (me1 != 0)
589  {
590  TH1F *C1 = me1->getTH1F ();
591  TH1F *S1 = h_fitres1Chi2->getTH1F ();
592  int division = C1->GetNbinsX ();
593  float massMIN = C1->GetBinLowEdge (1);
594  float massMAX = C1->GetBinLowEdge (division + 1);
595  //float BIN_SIZE = B->GetBinWidth(1);
596 
597  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
598  func->SetParameter (0, 1.0);
599  func->SetParName (0, "const");
600  func->SetParameter (1, 95.0);
601  func->SetParName (1, "mean");
602  func->SetParameter (2, 5.0);
603  func->SetParName (2, "sigma");
604 
605  double stats[4];
606  S1->GetStats (stats);
607  float N = 0;
608  float Chi2 = 0;
609  float NDF = 0;
610  N = C1->GetEntries ();
611 
612  try
613  {
614  if (N != 0)
615  {
616 
617  C1->Fit ("mygauss", "QR");
618  if ((func->GetNDF () != 0))
619  {
620  Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
621  NDF = 0.1;
622  }
623  }
624 
625  if (N == 0 || Chi2 < 0 || NDF < 0)
626  {
627  N = 1;
628  Chi2 = 0;
629  NDF = 0;
630  }
631 
632  }
633  catch (cms::Exception& e)
634  {
635  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
636  N = 1;
637  Chi2 = 40;
638  NDF = 0;
639  }
640 
641  stats[0] = N;
642  stats[1] = N;
643  stats[2] = Chi2 * N;
644  stats[3] = NDF * NDF * N + Chi2 * Chi2 * N;
645 
646  S1->SetEntries (N);
647  S1->PutStats (stats);
648  }
649  /**********************************************/
650 
651  if (me2 != 0)
652  {
653  TH1F *C2 = me2->getTH1F ();
654  TH1F *S2 = h_fitres2Chi2->getTH1F ();
655  int division = C2->GetNbinsX ();
656  float massMIN = C2->GetBinLowEdge (1);
657  float massMAX = C2->GetBinLowEdge (division + 1);
658  //float BIN_SIZE = B->GetBinWidth(1);
659 
660  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
661  func->SetParameter (0, 1.0);
662  func->SetParName (0, "const");
663  func->SetParameter (1, 95.0);
664  func->SetParName (1, "mean");
665  func->SetParameter (2, 5.0);
666  func->SetParName (2, "sigma");
667 
668  double stats[4];
669  S2->GetStats (stats);
670  float N = 0;
671  float Chi2 = 0;
672  float NDF = 0;
673  N = C2->GetEntries ();
674 
675  try
676  {
677  if (N != 0)
678  {
679  C2->Fit ("mygauss", "QR");
680  if (func->GetNDF () != 0)
681  {
682  Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
683  NDF = 0.1;
684  }
685  }
686 
687  if (N == 0 || Chi2 < 0 || NDF < 0)
688  {
689  N = 1;
690  Chi2 = 0;
691  NDF = 0;
692  }
693 
694  }
695  catch (cms::Exception& e)
696  {
697  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
698  N = 1;
699  Chi2 = 40;
700  NDF = 0;
701  }
702 
703  stats[0] = N;
704  stats[1] = N;
705  stats[2] = Chi2 * N;
706  stats[3] = NDF * NDF * N + Chi2 * Chi2 * N;
707 
708  S2->SetEntries (N);
709  S2->PutStats (stats);
710  }
711  /**************************************************************************/
712  if (me3 != 0)
713  {
714  TH1F *C3 = me3->getTH1F ();
715  TH1F *S3 = h_fitres3Chi2->getTH1F ();
716  int division = C3->GetNbinsX ();
717  float massMIN = C3->GetBinLowEdge (1);
718  float massMAX = C3->GetBinLowEdge (division + 1);
719  //float BIN_SIZE = B->GetBinWidth(1);
720 
721  TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3);
722  func->SetParameter (0, 1.0);
723  func->SetParName (0, "const");
724  func->SetParameter (1, 95.0);
725  func->SetParName (1, "mean");
726  func->SetParameter (2, 5.0);
727  func->SetParName (2, "sigma");
728 
729  double stats[4];
730  S3->GetStats (stats);
731  float N = 0;
732  float Chi2 = 0;
733  float NDF = 0;
734  N = C3->GetEntries ();
735 
736  try
737  {
738  if (N != 0)
739  {
740  C3->Fit ("mygauss", "QR");
741  if ((func->GetNDF () != 0))
742  {
743  Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ());
744  NDF = 0.1;
745  }
746  }
747 
748 
749  if (N == 0 || Chi2 < 0 || NDF < 0)
750  {
751  N = 1;
752  Chi2 = 0;
753  NDF = 0;
754  }
755 
756  }
757  catch (cms::Exception& e)
758  {
759  edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..." << e.what();
760  N = 1;
761  Chi2 = 40;
762  NDF = 0;
763  }
764 
765  stats[0] = N;
766  stats[1] = N;
767  stats[2] = Chi2 * N;
768  stats[3] = NDF * NDF * N + Chi2 * Chi2 * N;
769 
770  S3->SetEntries (N);
771  S3->PutStats (stats);
772  }
773 }
virtual char const * what() const
Definition: Exception.cc:141
MonitorElement * h_fitres1Chi2
MonitorElement * h_fitres2
MonitorElement * h_fitres1
Double_t mygauss(Double_t *x, Double_t *par)
MonitorElement * h_fitres2Chi2
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1679
#define LogTrace(id)
MonitorElement * h_fitres3Chi2
MonitorElement * h_fitres2bis
#define N
Definition: blowfish.cc:9
MonitorElement * h_fitres3
MonitorElement * h_fitres3bis
TH1F * getTH1F(void) const
Definition: Chi2.h:17
MonitorElement * h_fitres1bis
std::string prefixME_
void EcalZmassClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 791 of file EcalZmassClient.cc.

References edm::ParameterSetDescription::setUnknown().

793 {
794  //The following says we do not know what parameters are allowed so do no validation
795  // Please change this to state exactly what you do use, even if it is no parameters
797  desc.setUnknown ();
798  descriptions.addDefault (desc);
799 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

MonitorElement* EcalZmassClient::h_fitres1
private

Definition at line 86 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres1bis
private

Definition at line 88 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres1Chi2
private

Definition at line 90 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2
private

Definition at line 92 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2bis
private

Definition at line 94 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2Chi2
private

Definition at line 96 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3
private

Definition at line 98 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3bis
private

Definition at line 100 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3Chi2
private

Definition at line 102 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

std::string EcalZmassClient::prefixME_
private

Definition at line 83 of file EcalZmassClient.cc.

Referenced by beginRun(), EcalZmassClient(), and endRun().