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
 
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_95_ee_invMass_BB
 
MonitorElementh_95_ee_invMass_EB
 
MonitorElementh_95_ee_invMass_EE
 
MonitorElementh_e1_et
 
MonitorElementh_e1_eta
 
MonitorElementh_e1_phi
 
MonitorElementh_e2_et
 
MonitorElementh_e2_eta
 
MonitorElementh_e2_phi
 
MonitorElementh_ee_invMass
 
MonitorElementh_ee_invMass_BB
 
MonitorElementh_ee_invMass_EB
 
MonitorElementh_ee_invMass_EE
 
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 133 of file EcalZmassClient.cc.

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

134 {
135  prefixME_ = iConfig.getUntrackedParameter < std::string > ("prefixME", "");
136 
137 }
T getUntrackedParameter(std::string const &, T const &) const
std::string prefixME_
EcalZmassClient::~EcalZmassClient ( )

Definition at line 140 of file EcalZmassClient.cc.

141 {
142 
143  // do anything here that needs to be done at desctruction time
144  // (e.g. close files, deallocate resources etc.)
145 
146 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 155 of file EcalZmassClient.cc.

157 {
158 
159 }
void EcalZmassClient::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file EcalZmassClient.cc.

165 {
166 }
void EcalZmassClient::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 803 of file EcalZmassClient.cc.

805 {
806 }
void EcalZmassClient::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 176 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().

177 {
178  DQMStore *theDbe = edm::Service < DQMStore > ().operator-> ();
179 
180  theDbe->setCurrentFolder (prefixME_ + "/Zmass");
181  h_fitres1 =
182  theDbe->book1D ("Gaussian mean WP80 EB-EB",
183  "Gaussian mean WP80 EB-EB", 1, 0, 1);
184  h_fitres1bis =
185  theDbe->book1D ("Gaussian sigma WP80 EB-EB",
186  "Gaussian sigma WP80 EB-EB", 1, 0, 1);
187  h_fitres1Chi2 =
188  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EB",
189  "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1);
190 
191  h_fitres3 =
192  theDbe->book1D ("Gaussian mean WP80 EB-EE",
193  "Gaussian mean result WP80 EB-EE", 1, 0, 1);
194  h_fitres3bis =
195  theDbe->book1D ("Gaussian sigma WP80 EB-EE",
196  "Gaussian sigma WP80 EB-EE", 1, 0, 1);
197  h_fitres3Chi2 =
198  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EE",
199  "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1);
200 
201  h_fitres2 =
202  theDbe->book1D ("Gaussian mean WP80 EE-EE",
203  "Gaussian mean WP80 EE-EE", 1, 0, 1);
204  h_fitres2bis =
205  theDbe->book1D ("Gaussian sigma WP80 EE-EE",
206  "Gaussian sigma WP80 EE-EE", 1, 0, 1);
207  h_fitres2Chi2 =
208  theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EE-EE",
209  "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1);
210 }
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:872
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:584
MonitorElement * h_fitres1bis
std::string prefixME_
void EcalZmassClient::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file EcalZmassClient.cc.

171 {
172 }
void EcalZmassClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 810 of file EcalZmassClient.cc.

812 {
813 }
void EcalZmassClient::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 243 of file EcalZmassClient.cc.

References alignCSCRings::e, statics::func, 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().

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

Definition at line 817 of file EcalZmassClient.cc.

References edm::ParameterSetDescription::setUnknown().

819 {
820  //The following says we do not know what parameters are allowed so do no validation
821  // Please change this to state exactly what you do use, even if it is no parameters
823  desc.setUnknown ();
824  descriptions.addDefault (desc);
825 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

MonitorElement* EcalZmassClient::h_95_ee_invMass_BB
private

Definition at line 96 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_95_ee_invMass_EB
private

Definition at line 92 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_95_ee_invMass_EE
private

Definition at line 94 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e1_et
private

Definition at line 100 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e1_eta
private

Definition at line 104 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e1_phi
private

Definition at line 108 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e2_et
private

Definition at line 102 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e2_eta
private

Definition at line 106 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_e2_phi
private

Definition at line 110 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_ee_invMass
private

Definition at line 98 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_ee_invMass_BB
private

Definition at line 90 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_ee_invMass_EB
private

Definition at line 86 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_ee_invMass_EE
private

Definition at line 88 of file EcalZmassClient.cc.

MonitorElement* EcalZmassClient::h_fitres1
private

Definition at line 112 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres1bis
private

Definition at line 114 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres1Chi2
private

Definition at line 116 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2
private

Definition at line 118 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2bis
private

Definition at line 120 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres2Chi2
private

Definition at line 122 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3
private

Definition at line 124 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3bis
private

Definition at line 126 of file EcalZmassClient.cc.

Referenced by beginRun(), and endRun().

MonitorElement* EcalZmassClient::h_fitres3Chi2
private

Definition at line 128 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().