CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 
HcalTestHistoClassh
 
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 13 of file HcalTestHistoManager.cc.

References fs, h, edm::Service< T >::isAvailable(), TFileService::make(), and tree.

13  :
14  tree(0), h(0), kount(0) {
15  if (fs.isAvailable()) {
16  h = new HcalTestHistoClass();
17 
18  tree = fs->make<TTree>("HcalTest", "HcalTest");
19  tree->SetAutoSave(10000);
20  tree->Branch("HcalTestHisto", "HcalTestHistoClass", &h);
21  edm::LogInfo("HcalSim") << "HcalTestHistoManager:===>>> Book the Tree";
22  } else {
23  edm::LogInfo("HcalSim") << "HcalTestHistoManager:===>>> No file provided";
24  }
25 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
HcalTestHistoClass * h
edm::Service< TFileService > fs
bool isAvailable() const
Definition: Service.h:46
HcalTestHistoManager::~HcalTestHistoManager ( )
virtual

Definition at line 27 of file HcalTestHistoManager.cc.

References h, and kount.

27  {
28 
29  edm::LogInfo("HcalSim") << "============================================="
30  << "========================================\n"
31  << "=== HcalTestHistoManager: Start writing user "
32  << "histograms after " << kount << " events ";
33  if (h) delete h;
34 }
HcalTestHistoClass * h

Member Function Documentation

void HcalTestHistoManager::fillTree ( HcalTestHistoClass histos)

Definition at line 36 of file HcalTestHistoManager.cc.

References h, mergeVDriftHistosByStation::histos, kount, LogDebug, and tree.

36  {
37 
38  kount++;
39  LogDebug("HcalSim") << "HcalTestHistoManager: tree pointer for " << kount
40  << " = " << histos;
41  if (tree) {
42  h = histos;
43  tree->Fill();
44  }
45 }
#define LogDebug(id)
HcalTestHistoClass * h

Member Data Documentation

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

Definition at line 33 of file HcalTestHistoManager.h.

Referenced by HcalTestHistoManager().

HcalTestHistoClass* HcalTestHistoManager::h
private

Definition at line 35 of file HcalTestHistoManager.h.

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

int HcalTestHistoManager::kount
private

Definition at line 36 of file HcalTestHistoManager.h.

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

TTree* HcalTestHistoManager::tree
private