Definition at line 55 of file EcalZmassClient.cc.
EcalZmassClient::EcalZmassClient | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 153 of file EcalZmassClient.cc.
References edm::ParameterSet::getUntrackedParameter(), and prefixME_.
{ prefixME_ = iConfig.getUntrackedParameter < string > ("prefixME", ""); }
EcalZmassClient::~EcalZmassClient | ( | ) |
Definition at line 160 of file EcalZmassClient.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
void EcalZmassClient::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 175 of file EcalZmassClient.cc.
References edm::EventSetup::get(), and edm::Event::getByLabel().
{ using namespace edm; #ifdef THIS_IS_AN_EVENT_EXAMPLE Handle < ExampleData > pIn; iEvent.getByLabel ("example", pIn); #endif #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE ESHandle < SetupData > pSetup; iSetup.get < SetupRecord > ().get (pSetup); #endif }
void EcalZmassClient::beginJob | ( | void | ) | [private, virtual] |
void EcalZmassClient::beginLuminosityBlock | ( | edm::LuminosityBlock const & | , |
edm::EventSetup const & | |||
) | [private, virtual] |
void EcalZmassClient::beginRun | ( | edm::Run const & | , |
edm::EventSetup const & | |||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 208 of file EcalZmassClient.cc.
References DQMStore::book1D(), cmsCodeRules::cppFunctionSkipper::operator, prefixME_, and DQMStore::setCurrentFolder().
{ DQMStore *theDbe = Service < DQMStore > ().operator-> (); theDbe->setCurrentFolder (prefixME_ + "/Zmass"); h_fitres1 = theDbe->book1D ("Gaussian mean WP80 EB-EB", "Gaussian mean WP80 EB-EB", 1, 0, 1); h_fitres1bis = theDbe->book1D ("Gaussian sigma WP80 EB-EB", "Gaussian sigma WP80 EB-EB", 1, 0, 1); h_fitres1Chi2 = theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EB", "Gaussian Chi2 result over NDF WP80 EB-EB", 1, 0, 1); h_fitres3 = theDbe->book1D ("Gaussian mean WP80 EB-EE", "Gaussian mean result WP80 EB-EE", 1, 0, 1); h_fitres3bis = theDbe->book1D ("Gaussian sigma WP80 EB-EE", "Gaussian sigma WP80 EB-EE", 1, 0, 1); h_fitres3Chi2 = theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EB-EE", "Gaussian Chi2 result over NDF WP80 EB-EE", 1, 0, 1); h_fitres2 = theDbe->book1D ("Gaussian mean WP80 EE-EE", "Gaussian mean WP80 EE-EE", 1, 0, 1); h_fitres2bis = theDbe->book1D ("Gaussian sigma WP80 EE-EE", "Gaussian sigma WP80 EE-EE", 1, 0, 1); h_fitres2Chi2 = theDbe->book1D ("Gaussian Chi2 result over NDF WP80 EE-EE", "Gaussian Chi2 result over NDF WP80 EE-EE", 1, 0, 1); /* h_95_fitres1 = theDbe->book1D ("Breit-Wigner mean WP95 EB-EB", "Breit-Wigner mean WP95 EB-EB", 1, 0, 1); h_95_fitres1bis = theDbe->book1D ("Breit-Wigner sigma WP95 EB-EB", "Breit-Wigner sigma WP95 EB-EB", 1, 0, 1); h_95_fitres3 = theDbe->book1D ("Breit-Wigner mean WP95 EB-EE", "Breit-Wigner mean WP95 EB-EE", 1, 0, 1); h_95_fitres3bis = theDbe->book1D ("Breit-Wigner sigma WP95 EB-EE", "Breit-Wigner sigma WP95 EB-EE", 1, 0, 1); h_95_fitres2 = theDbe->book1D ("Gaussian mean WP95 EE-EE", "Gaussian mean WP95 EE-EE", 1, 0, 1); h_95_fitres2bis = theDbe->book1D ("Gaussian sigma WP95 EE-EE", "Gaussian sigma WP95 EE-EE", 1, 0, 1); */ }
void EcalZmassClient::endJob | ( | void | ) | [private, virtual] |
void EcalZmassClient::endLuminosityBlock | ( | edm::LuminosityBlock const & | , |
edm::EventSetup const & | |||
) | [private, virtual] |
void EcalZmassClient::endRun | ( | edm::Run const & | , |
edm::EventSetup const & | |||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 299 of file EcalZmassClient.cc.
References DQMStore::get(), MonitorElement::getTH1F(), LogTrace, timingPdfMaker::mean, mygauss(), MultiGaussianStateTransform::N, cmsCodeRules::cppFunctionSkipper::operator, prefixME_, and plotscripts::rms().
{ DQMStore *theDbe = Service < DQMStore > ().operator-> (); std::string logTraceName; logTraceName = "EwkAnalyzer"; LogTrace (logTraceName) << "Parameters initialization"; MonitorElement *me1 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EB-EB"); MonitorElement *me2 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EE-EE"); MonitorElement *me3 = theDbe->get (prefixME_ + "/Zmass/Z peak - WP80 EB-EE"); if (me1 != 0) { TH1F *B = me1->getTH1F (); TH1F *R1 = h_fitres1->getTH1F (); int division = B->GetNbinsX (); float massMIN = B->GetBinLowEdge (1); float massMAX = B->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R1->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = B->GetEntries (); try { if (N != 0) { B->Fit ("mygauss", "QR"); mean = fabs (func->GetParameter (1)); sigma = fabs (func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 0; sigma = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R1->SetEntries (N); R1->PutStats (stats); } /*******************************************************/ if (me1 != 0) { TH1F *Bbis = me1->getTH1F (); TH1F *R1bis = h_fitres1bis->getTH1F (); int division = Bbis->GetNbinsX (); float massMIN = Bbis->GetBinLowEdge (1); float massMAX = Bbis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R1bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = Bbis->GetEntries (); try { if (N != 0) { Bbis->Fit ("mygauss", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) { N = 1; rms = 0; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R1bis->SetEntries (N); R1bis->PutStats (stats); } /****************************************/ if (me2 != 0) { TH1F *E = me2->getTH1F (); TH1F *R2 = h_fitres2->getTH1F (); int division = E->GetNbinsX (); float massMIN = E->GetBinLowEdge (1); float massMAX = E->GetBinLowEdge (division + 1); //float BIN_SIZE = E->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R2->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = E->GetEntries (); try { if (N != 0) { E->Fit ("mygauss", "QR"); mean = fabs (func->GetParameter (1)); sigma = fabs (func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 0; sigma = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R2->SetEntries (N); R2->PutStats (stats); } /**************************************************************************/ if (me2 != 0) { TH1F *Ebis = me2->getTH1F (); TH1F *R2bis = h_fitres2bis->getTH1F (); int division = Ebis->GetNbinsX (); float massMIN = Ebis->GetBinLowEdge (1); float massMAX = Ebis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R2bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = Ebis->GetEntries (); try { if (N != 0) { Ebis->Fit ("mygauss", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) { N = 1; rms = 0; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R2bis->SetEntries (N); R2bis->PutStats (stats); } /*********************************************************************************************/ if (me3 != 0) { TH1F *R3 = h_fitres3->getTH1F (); TH1F *M = me3->getTH1F (); int division = M->GetNbinsX (); float massMIN = M->GetBinLowEdge (1); float massMAX = M->GetBinLowEdge (division + 1); //float BIN_SIZE = M->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R3->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = M->GetEntries (); try { if (N != 0) { M->Fit ("mygauss", "QR"); mean = fabs (func->GetParameter (1)); sigma = fabs (func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 0; sigma = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R3->SetEntries (N); R3->PutStats (stats); } /********************************************************************************/ if (me3 != 0) { TH1F *Mbis = me3->getTH1F (); TH1F *R3bis = h_fitres3bis->getTH1F (); int division = Mbis->GetNbinsX (); float massMIN = Mbis->GetBinLowEdge (1); float massMAX = Mbis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R3bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = Mbis->GetEntries (); try { if (N != 0) { Mbis->Fit ("mygauss", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) { N = 1; rms = 0; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R3bis->SetEntries (N); R3bis->PutStats (stats); } /* WP95 DO NOT USE IT ****************************************************************************************************************************** MonitorElement *me4 = theDbe->get ("Physics/EwkDQM/Z peak - WP95 EB-EB"); MonitorElement *me5 = theDbe->get ("Physics/EwkDQM/Z peak - WP95 EE-EE"); MonitorElement *me6 = theDbe->get ("Physics/EwkDQM/Z peak - WP95 EB-EE"); if (me4 != 0) { TH1F *B_95 = me4->getTH1F (); TH1F *R1_95 = h_95_fitres1->getTH1F (); int division = B_95->GetNbinsX (); float massMIN = B_95->GetBinLowEdge (1); float massMAX = B_95->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mybw", mybw, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R1_95->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = B_95->GetEntries (); try { if (N != 0) { B_95->Fit ("mybw", "QR"); mean = fabs (func->GetParameter (1)); sigma = fabs (func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 50; sigma = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R1_95->SetEntries (N); R1_95->PutStats (stats); } *************************************************************************** if (me4 != 0) { TH1F *B_95bis = me4->getTH1F (); TH1F *R1_95bis = h_95_fitres1bis->getTH1F (); int division = B_95bis->GetNbinsX (); float massMIN = B_95bis->GetBinLowEdge (1); float massMAX = B_95bis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mybw", mybw, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R1_95bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = B_95bis->GetEntries (); try { if (N != 0) { B_95bis->Fit ("mybw", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) { N = 1; rms = 50; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R1_95bis->SetEntries (N); R1_95bis->PutStats (stats); } *************************************************************** if (me5 != 0) { TH1F *E_95 = me5->getTH1F (); TH1F *R2_95 = h_95_fitres2->getTH1F (); int division = E_95->GetNbinsX (); float massMIN = E_95->GetBinLowEdge (1); float massMAX = E_95->GetBinLowEdge (division + 1); //float BIN_SIZE = E->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R2_95->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = E_95->GetEntries (); try { if (N != 0) { E_95->Fit ("mygauss", "QR"); mean = fabs(func->GetParameter (1)); sigma = fabs(func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 50; sigma = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R2_95->SetEntries (N); R2_95->PutStats (stats); } ******************************************************************* if (me5 != 0) { TH1F *E_95bis = me5->getTH1F (); TH1F *R2_95bis = h_95_fitres2bis->getTH1F (); int division = E_95bis->GetNbinsX (); float massMIN = E_95bis->GetBinLowEdge (1); float massMAX = E_95bis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R2_95bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = E_95bis->GetEntries (); try { if (N != 0) { E_95bis->Fit ("mygauss", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms < 0 || rms > 50 || rmsErr <= 0 || rmsErr > 50) { N = 1; rms = 50; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R2_95bis->SetEntries (N); R2_95bis->PutStats (stats); } **************************************************************************************** if (me6 != 0) { TH1F *R3_95 = h_95_fitres3->getTH1F (); TH1F *M_95 = me6->getTH1F (); int division = M_95->GetNbinsX (); float massMIN = M_95->GetBinLowEdge (1); float massMAX = M_95->GetBinLowEdge (division + 1); //float BIN_SIZE = M->GetBinWidth(1); TF1 *func = new TF1 ("mybw", mybw, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R3_95->GetStats (stats); float N = 0; float mean = 0; float sigma = 0; N = M_95->GetEntries (); try { if (N != 0) { M_95->Fit ("mybw", "QR"); mean = fabs (func->GetParameter (1)); sigma = fabs (func->GetParError (1)); } if (N == 0 || mean < 50 || mean > 100 || sigma <= 0 || sigma > 20) { N = 1; mean = 50; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R3_95->SetEntries (N); R3_95->PutStats (stats); } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; mean = 40; sigma = 0; } stats[0] = N; stats[1] = N; stats[2] = mean * N; stats[3] = sigma * sigma * N + mean * mean * N; R3_95->SetEntries (N); R3_95->PutStats (stats); } *********************************************************** if (me6 != 0) { TH1F *M_95bis = me6->getTH1F (); TH1F *R3_95bis = h_95_fitres3bis->getTH1F (); int division = M_95bis->GetNbinsX (); float massMIN = M_95bis->GetBinLowEdge (1); float massMAX = M_95bis->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mybw", mybw, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; R3_95bis->GetStats (stats); float N = 0; float rms = 0; float rmsErr = 0; N = M_95bis->GetEntries (); try { if (N != 0) { M_95bis->Fit ("mybw", "QR"); rms = fabs (func->GetParameter (2)); rmsErr = fabs (func->GetParError (2)); } if (N == 0 || rms <= 0 || rms > 50 || rmsErr <= 0 || rmsErr > 100) { N = 1; rms = 50; rmsErr = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; rms = 40; rmsErr = 0; } stats[0] = N; stats[1] = N; stats[2] = rms * N; stats[3] = rmsErr * rmsErr * N + rms * rms * N; R3_95bis->SetEntries (N); R3_95bis->PutStats (stats); }******************************************************************************* */ /*Chi2 */ if (me1 != 0) { TH1F *C1 = me1->getTH1F (); TH1F *S1 = h_fitres1Chi2->getTH1F (); int division = C1->GetNbinsX (); float massMIN = C1->GetBinLowEdge (1); float massMAX = C1->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; S1->GetStats (stats); float N = 0; float Chi2 = 0; float NDF = 0; N = C1->GetEntries (); try { if (N != 0) { C1->Fit ("mygauss", "QR"); if ((func->GetNDF () != 0)) { Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ()); NDF = 0.1; } } if (N == 0 || Chi2 < 0 || NDF < 0) { N = 1; Chi2 = 0; NDF = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; Chi2 = 40; NDF = 0; } stats[0] = N; stats[1] = N; stats[2] = Chi2 * N; stats[3] = NDF * NDF * N + Chi2 * Chi2 * N; S1->SetEntries (N); S1->PutStats (stats); } /**********************************************/ if (me2 != 0) { TH1F *C2 = me2->getTH1F (); TH1F *S2 = h_fitres2Chi2->getTH1F (); int division = C2->GetNbinsX (); float massMIN = C2->GetBinLowEdge (1); float massMAX = C2->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; S2->GetStats (stats); float N = 0; float Chi2 = 0; float NDF = 0; N = C2->GetEntries (); try { if (N != 0) { C2->Fit ("mygauss", "QR"); if (func->GetNDF () != 0) { Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ()); NDF = 0.1; } } if (N == 0 || Chi2 < 0 || NDF < 0) { N = 1; Chi2 = 0; NDF = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; Chi2 = 40; NDF = 0; } stats[0] = N; stats[1] = N; stats[2] = Chi2 * N; stats[3] = NDF * NDF * N + Chi2 * Chi2 * N; S2->SetEntries (N); S2->PutStats (stats); } /**************************************************************************/ if (me3 != 0) { TH1F *C3 = me3->getTH1F (); TH1F *S3 = h_fitres3Chi2->getTH1F (); int division = C3->GetNbinsX (); float massMIN = C3->GetBinLowEdge (1); float massMAX = C3->GetBinLowEdge (division + 1); //float BIN_SIZE = B->GetBinWidth(1); TF1 *func = new TF1 ("mygauss", mygauss, massMIN, massMAX, 3); func->SetParameter (0, 1.0); func->SetParName (0, "const"); func->SetParameter (1, 95.0); func->SetParName (1, "mean"); func->SetParameter (2, 5.0); func->SetParName (2, "sigma"); double stats[4]; S3->GetStats (stats); float N = 0; float Chi2 = 0; float NDF = 0; N = C3->GetEntries (); try { if (N != 0) { C3->Fit ("mygauss", "QR"); if ((func->GetNDF () != 0)) { Chi2 = fabs (func->GetChisquare ()) / fabs (func->GetNDF ()); NDF = 0.1; } } if (N == 0 || Chi2 < 0 || NDF < 0) { N = 1; Chi2 = 0; NDF = 0; } } catch (...) { edm::LogError ("ZFitter") << "[Zfitter]: Exception when fitting..."; N = 1; Chi2 = 40; NDF = 0; } stats[0] = N; stats[1] = N; stats[2] = Chi2 * N; stats[3] = NDF * NDF * N + Chi2 * Chi2 * N; S3->SetEntries (N); S3->PutStats (stats); } }
void EcalZmassClient::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Reimplemented from edm::EDAnalyzer.
Definition at line 1220 of file EcalZmassClient.cc.
References edm::ParameterSetDescription::setUnknown().
{ //The following says we do not know what parameters are allowed so do no validation // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; desc.setUnknown (); descriptions.addDefault (desc); }
Definition at line 102 of file EcalZmassClient.cc.
Definition at line 98 of file EcalZmassClient.cc.
Definition at line 100 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e1_et [private] |
Definition at line 106 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e1_eta [private] |
Definition at line 110 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e1_phi [private] |
Definition at line 114 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e2_et [private] |
Definition at line 108 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e2_eta [private] |
Definition at line 112 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_e2_phi [private] |
Definition at line 116 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_ee_invMass [private] |
Definition at line 104 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_ee_invMass_BB [private] |
Definition at line 96 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_ee_invMass_EB [private] |
Definition at line 92 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_ee_invMass_EE [private] |
Definition at line 94 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres1 [private] |
Definition at line 118 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres1bis [private] |
Definition at line 120 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres1Chi2 [private] |
Definition at line 122 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres2 [private] |
Definition at line 124 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres2bis [private] |
Definition at line 126 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres2Chi2 [private] |
Definition at line 128 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres3 [private] |
Definition at line 130 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres3bis [private] |
Definition at line 132 of file EcalZmassClient.cc.
MonitorElement* EcalZmassClient::h_fitres3Chi2 [private] |
Definition at line 134 of file EcalZmassClient.cc.
std::string EcalZmassClient::prefixME_ [private] |
Definition at line 89 of file EcalZmassClient.cc.