00001 #include "Validation/Geometry/interface/MaterialBudgetHistos.h" 00002 #include "Validation/Geometry/interface/MaterialBudgetData.h" 00003 00004 00005 MaterialBudgetHistos::MaterialBudgetHistos(MaterialBudgetData* data, 00006 TestHistoMgr* mgr, 00007 const std::string& fileName ): MaterialBudgetFormat( data ), hmgr(mgr) 00008 { 00009 theFileName = fileName; 00010 book(); 00011 00012 } 00013 00014 00015 void MaterialBudgetHistos::book() 00016 { 00017 std::cout << "=== booking user histos ===" << std::endl; 00018 hmgr->addHistoProf1( new TProfile("10", "MB prof Eta ", 250, -5., 5. ) ); 00019 hmgr->addHisto1( new TH1F("11", "Eta " , 501, -5., 5. ) ); 00020 hmgr->addHistoProf1( new TProfile("20", "MB prof Phi ", 180, -3.1416, 3.1416 ) ); 00021 hmgr->addHisto1( new TH1F("21", "Phi " , 360, -3.1416, 3.1416 ) ); 00022 hmgr->addHistoProf2( new TProfile2D("30", "MB prof Eta Phi ", 250, -5., 5., 180, -3.1416, 3.1416 ) ); 00023 hmgr->addHisto2( new TH2F("31", "Eta vs Phi " , 501, -5., 5., 180, -3.1416, 3.1416 ) ); 00024 00025 std::cout << "=== booking user histos done ===" << std::endl; 00026 00027 } 00028 00029 00030 void MaterialBudgetHistos::fillStartTrack() 00031 { 00032 00033 } 00034 00035 00036 void MaterialBudgetHistos::fillPerStep() 00037 { 00038 00039 } 00040 00041 00042 void MaterialBudgetHistos::fillEndTrack() 00043 { 00044 hmgr->getHisto1(11)->Fill(theData->getEta()); 00045 hmgr->getHisto1(21)->Fill(theData->getPhi()); 00046 hmgr->getHisto2(31)->Fill(theData->getEta(),theData->getPhi()); 00047 00048 hmgr->getHistoProf1(10)->Fill(theData->getEta(),theData->getTotalMB()); 00049 hmgr->getHistoProf1(20)->Fill(theData->getPhi(),theData->getTotalMB()); 00050 hmgr->getHistoProf2(30)->Fill(theData->getEta(),theData->getPhi(),theData->getTotalMB()); 00051 00052 } 00053 00054 00055 void MaterialBudgetHistos::hend() 00056 { 00057 std::cout << "=== save user histos ===" << std::endl; 00058 hmgr->save( theFileName ); 00059 00060 } 00061