File indexing completed on 2024-04-06 12:32:16
0001 #include "Validation/Geometry/interface/MaterialBudgetHistos.h"
0002 #include "Validation/Geometry/interface/MaterialBudgetData.h"
0003
0004 MaterialBudgetHistos::MaterialBudgetHistos(std::shared_ptr<MaterialBudgetData> data,
0005 std::shared_ptr<TestHistoMgr> mgr,
0006 const std::string& fileName)
0007 : MaterialBudgetFormat(data), hmgr(mgr) {
0008 theFileName = fileName;
0009 book();
0010 }
0011
0012 void MaterialBudgetHistos::book() {
0013 edm::LogInfo("MaterialBudget") << " MaterialBudgetHistos: Booking Histos";
0014 hmgr->addHistoProf1(new TProfile("10", "MB prof Eta ", 250, -5., 5.));
0015 hmgr->addHisto1(new TH1F("11", "Eta ", 501, -5., 5.));
0016 hmgr->addHistoProf1(new TProfile("20", "MB prof Phi ", 180, -3.1416, 3.1416));
0017 hmgr->addHisto1(new TH1F("21", "Phi ", 360, -3.1416, 3.1416));
0018 hmgr->addHistoProf2(new TProfile2D("30", "MB prof Eta Phi ", 250, -5., 5., 180, -3.1416, 3.1416));
0019 hmgr->addHisto2(new TH2F("31", "Eta vs Phi ", 501, -5., 5., 180, -3.1416, 3.1416));
0020 }
0021
0022 void MaterialBudgetHistos::fillStartTrack() {}
0023
0024 void MaterialBudgetHistos::fillPerStep() {}
0025
0026 void MaterialBudgetHistos::fillEndTrack() {
0027 hmgr->getHisto1(11)->Fill(theData->getEta());
0028 hmgr->getHisto1(21)->Fill(theData->getPhi());
0029 hmgr->getHisto2(31)->Fill(theData->getEta(), theData->getPhi());
0030
0031 hmgr->getHistoProf1(10)->Fill(theData->getEta(), theData->getTotalMB());
0032 hmgr->getHistoProf1(20)->Fill(theData->getPhi(), theData->getTotalMB());
0033 hmgr->getHistoProf2(30)->Fill(theData->getEta(), theData->getPhi(), theData->getTotalMB());
0034 }
0035
0036 void MaterialBudgetHistos::endOfRun() {
0037 edm::LogInfo("MaterialBudget") << "MaterialBudgetHistos: Writing Histos ROOT file to" << theFileName;
0038 hmgr->save(theFileName);
0039 }