CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HcalTestHistoManager Class Reference

#include <HcalTestHistoManager.h>

Public Member Functions

void fillTree (HcalTestHistoClass *histos)
 
 HcalTestHistoManager (const std::string &)
 
virtual ~HcalTestHistoManager ()
 

Private Attributes

edm::Service< TFileServicefs_
 
std::unique_ptr
< HcalTestHistoClass
h_
 
int kount_
 
TTree * tree_
 

Detailed Description

Definition at line 22 of file HcalTestHistoManager.h.

Constructor & Destructor Documentation

HcalTestHistoManager::HcalTestHistoManager ( const std::string &  file)

Definition at line 17 of file HcalTestHistoManager.cc.

References fs_, h_, edm::Service< T >::isAvailable(), TFileService::make(), and tree_.

17  : tree_(nullptr), kount_(0) {
18  if (fs_.isAvailable()) {
19  h_ = std::make_unique<HcalTestHistoClass>();
20 
21  tree_ = fs_->make<TTree>("HcalTest", "HcalTest");
22  tree_->SetAutoSave(10000);
23  tree_->Branch("HcalTestHisto", "HcalTestHistoClass", &h_);
24  edm::LogVerbatim("HcalSim") << "HcalTestHistoManager:===>>> Book the Tree";
25  } else {
26  edm::LogVerbatim("HcalSim") << "HcalTestHistoManager:===>>> No file provided";
27  }
28 }
Log< level::Info, true > LogVerbatim
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::unique_ptr< HcalTestHistoClass > h_
bool isAvailable() const
Definition: Service.h:40
edm::Service< TFileService > fs_
HcalTestHistoManager::~HcalTestHistoManager ( )
virtual

Definition at line 30 of file HcalTestHistoManager.cc.

References kount_.

30  {
31  edm::LogVerbatim("HcalSim") << "================================================================="
32  << "====================\n=== HcalTestHistoManager: Start writing user "
33  << "histograms after " << kount_ << " events ";
34 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

void HcalTestHistoManager::fillTree ( HcalTestHistoClass histos)

Definition at line 36 of file HcalTestHistoManager.cc.

References h_, mergeVDriftHistosByStation::histos, kount_, and tree_.

36  {
37  ++kount_;
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HcalSim") << "HcalTestHistoManager: tree pointer for " << kount_ << " = " << histos;
40 #endif
41  if (tree_) {
42  h_.reset(histos);
43  tree_->Fill();
44  }
45 }
Log< level::Info, true > LogVerbatim
std::unique_ptr< HcalTestHistoClass > h_

Member Data Documentation

edm::Service<TFileService> HcalTestHistoManager::fs_
private

Definition at line 30 of file HcalTestHistoManager.h.

Referenced by HcalTestHistoManager().

std::unique_ptr<HcalTestHistoClass> HcalTestHistoManager::h_
private

Definition at line 32 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().

int HcalTestHistoManager::kount_
private

Definition at line 33 of file HcalTestHistoManager.h.

Referenced by fillTree(), and ~HcalTestHistoManager().

TTree* HcalTestHistoManager::tree_
private

Definition at line 31 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().