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

edm::Service< TFileServicefs_
 
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 16 of file HcalTestHistoManager.cc.

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

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

◆ ~HcalTestHistoManager()

HcalTestHistoManager::~HcalTestHistoManager ( )
virtual

Definition at line 29 of file HcalTestHistoManager.cc.

29  {
30  edm::LogVerbatim("HcalSim") << "================================================================="
31  << "====================\n=== HcalTestHistoManager: Start writing user "
32  << "histograms after " << kount_ << " events ";
33 }

References kount_.

Member Function Documentation

◆ fillTree()

void HcalTestHistoManager::fillTree ( HcalTestHistoClass histos)

Definition at line 35 of file HcalTestHistoManager.cc.

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

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

Member Data Documentation

◆ fs_

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

Definition at line 30 of file HcalTestHistoManager.h.

Referenced by HcalTestHistoManager().

◆ h_

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

Definition at line 32 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().

◆ kount_

int HcalTestHistoManager::kount_
private

Definition at line 33 of file HcalTestHistoManager.h.

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

◆ tree_

TTree* HcalTestHistoManager::tree_
private

Definition at line 31 of file HcalTestHistoManager.h.

Referenced by fillTree(), and HcalTestHistoManager().

HcalTestHistoManager::fs_
edm::Service< TFileService > fs_
Definition: HcalTestHistoManager.h:30
HcalTestHistoManager::kount_
int kount_
Definition: HcalTestHistoManager.h:33
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
HcalTestHistoManager::tree_
TTree * tree_
Definition: HcalTestHistoManager.h:31
combine.histos
histos
Definition: combine.py:4
HcalTestHistoManager::h_
std::unique_ptr< HcalTestHistoClass > h_
Definition: HcalTestHistoManager.h:32
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64