#include <SimG4CMS/Calo/interface/HcalTestHistoManager.h>
Public Member Functions | |
void | fillTree (HcalTestHistoClass *histos) |
HcalTestHistoManager (const std::string &) | |
virtual | ~HcalTestHistoManager () |
Private Attributes | |
pool::Ref< HcalTestHistoClass > | h |
pool::IFileCatalog | lcat |
pool::Placement | placeH |
pool::Placement | placeVx |
std::auto_ptr< pool::IDataSvc > | svc |
Definition at line 18 of file HcalTestHistoManager.h.
HcalTestHistoManager::HcalTestHistoManager | ( | const std::string & | file | ) |
Definition at line 27 of file HcalTestHistoManager.cc.
00027 : 00028 svc(pool::DataSvcFactory::instance(&lcat)), 00029 placeH(file, pool::DatabaseSpecification::PFN, "HcalTestAnalysis", 00030 ROOT::Reflex::Type(), pool::ROOTTREE_StorageType.type()), h(*svc) { 00031 00032 pool::URIParser p("file:HcalTestHistoCatalog.cat"); 00033 p.parse(); 00034 00035 lcat.setWriteCatalog(p.contactstring()); 00036 00037 lcat.connect(); 00038 lcat.start(); 00039 00040 // Define the policy for the implicit file handling 00041 pool::DatabaseConnectionPolicy policy; 00042 policy.setWriteModeForNonExisting(pool::DatabaseConnectionPolicy::CREATE); 00043 policy.setWriteModeForExisting(pool::DatabaseConnectionPolicy::OVERWRITE); 00044 // policy.setWriteModeForExisting(pool::DatabaseConnectionPolicy::UPDATE); 00045 svc->session().setDefaultConnectionPolicy(policy); 00046 00047 edm::LogInfo("HcalSim") << "HcalTestHistoManager:===>>> Book user" 00048 << " Histograms and Root tree"; 00049 }
HcalTestHistoManager::~HcalTestHistoManager | ( | ) | [virtual] |
Definition at line 51 of file HcalTestHistoManager.cc.
00051 { 00052 00053 edm::LogInfo("HcalSim") << "=============================================" 00054 << "==============\n" 00055 << "=== HcalTestHistoManager: Start writing user " 00056 << "histograms ==="; 00057 00058 svc->transaction().commit(); 00059 svc->session().disconnectAll(); 00060 edm::LogInfo("HcalSim") << "=== HcalTestHistoManager: cache size at end " 00061 << svc->cacheSvc().cacheSize(); 00062 lcat.commit(); 00063 00064 edm::LogInfo("HcalSim") << "=== HcalTestHistoManager: End writing user " 00065 << "histograms ===\n" 00066 << "=============================================" 00067 << "=============="; 00068 }
void HcalTestHistoManager::fillTree | ( | HcalTestHistoClass * | histos | ) |
Definition at line 70 of file HcalTestHistoManager.cc.
References h, LogDebug, placeH, svc, and UPDATE.
00070 { 00071 00072 svc->transaction().start(pool::ITransaction::UPDATE); 00073 LogDebug("HcalSim") << "HcalTestHistoManager: tree pointer = " << histos; 00074 LogDebug("HcalSim") << "HcalTestHistoManager: cache size before assign " 00075 << svc->cacheSvc().cacheSize(); 00076 00077 h = histos; 00078 h.markWrite(placeH); 00079 svc->transaction().commitAndHold(); 00080 }
pool::Ref<HcalTestHistoClass> HcalTestHistoManager::h [private] |
pool::IFileCatalog HcalTestHistoManager::lcat [private] |
Definition at line 28 of file HcalTestHistoManager.h.
Referenced by HcalTestHistoManager(), and ~HcalTestHistoManager().
pool::Placement HcalTestHistoManager::placeH [private] |
pool::Placement HcalTestHistoManager::placeVx [private] |
Definition at line 32 of file HcalTestHistoManager.h.
std::auto_ptr<pool::IDataSvc> HcalTestHistoManager::svc [private] |
Definition at line 29 of file HcalTestHistoManager.h.
Referenced by fillTree(), HcalTestHistoManager(), and ~HcalTestHistoManager().