CMS 3D CMS Logo

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

std::unique_ptr< HcalTestHistoClassh_
 
int kount_
 
TTree * tree_
 

Detailed Description

Definition at line 22 of file HcalTestHistoManager.h.

Constructor & Destructor Documentation

◆ HcalTestHistoManager()

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

Definition at line 17 of file HcalTestHistoManager.cc.

References compareTotals::fs, h_, and tree_.

17  : tree_(nullptr), kount_(0) {
19  if (fs.isAvailable()) {
20  h_ = std::make_unique<HcalTestHistoClass>();
21 
22  tree_ = fs->make<TTree>("HcalTest", "HcalTest");
23  tree_->SetAutoSave(10000);
24  tree_->Branch("HcalTestHisto", "HcalTestHistoClass", &h_);
25  edm::LogVerbatim("HcalSim") << "HcalTestHistoManager:===>>> Book the Tree";
26  } else {
27  edm::LogVerbatim("HcalSim") << "HcalTestHistoManager:===>>> No file provided";
28  }
29 }
Log< level::Info, true > LogVerbatim
std::unique_ptr< HcalTestHistoClass > h_

◆ ~HcalTestHistoManager()

HcalTestHistoManager::~HcalTestHistoManager ( )
virtual

Definition at line 31 of file HcalTestHistoManager.cc.

References kount_.

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

Member Function Documentation

◆ fillTree()

void HcalTestHistoManager::fillTree ( HcalTestHistoClass histos)

Definition at line 37 of file HcalTestHistoManager.cc.

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

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

Member Data Documentation

◆ h_

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

Definition at line 31 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().

◆ kount_

int HcalTestHistoManager::kount_
private

Definition at line 32 of file HcalTestHistoManager.h.

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

◆ tree_

TTree* HcalTestHistoManager::tree_
private

Definition at line 30 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().