Main Page
Namespaces
Classes
Package Documentation
SimG4CMS
Calo
src
HcalTestHistoManager.cc
Go to the documentation of this file.
1
// File: HcalTestHistoManager.cc
3
// Description: Histogram managing class in HcalTestAnalysis (HcalTest)
5
6
#include "
SimG4CMS/Calo/interface/HcalTestHistoManager.h
"
7
8
#include "
FWCore/PluginManager/interface/PluginManager.h
"
9
10
#include <iostream>
11
#include <cmath>
12
13
HcalTestHistoManager::HcalTestHistoManager
(
const
std::string
&
file
) :
14
tree
(
nullptr
),
h
(
nullptr
), 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
}
26
27
HcalTestHistoManager::~HcalTestHistoManager
() {
28
29
edm::LogInfo
(
"HcalSim"
) <<
"============================================="
30
<<
"========================================\n"
31
<<
"=== HcalTestHistoManager: Start writing user "
32
<<
"histograms after "
<<
kount
<<
" events "
;
33
if
(
h
)
delete
h
;
34
}
35
36
void
HcalTestHistoManager::fillTree
(
HcalTestHistoClass
*
histos
) {
37
38
kount
++;
39
LogDebug
(
"HcalSim"
) <<
"HcalTestHistoManager: tree pointer for "
<<
kount
40
<<
" = "
<<
histos
;
41
if
(
tree
) {
42
h
=
histos
;
43
tree
->Fill();
44
}
45
}
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:601
plotFactory.histos
histos
Definition:
plotFactory.py:109
HcalTestHistoManager::kount
int kount
Definition:
HcalTestHistoManager.h:36
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalTestHistoManager::HcalTestHistoManager
HcalTestHistoManager(const std::string &)
Definition:
HcalTestHistoManager.cc:13
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition:
TFileService.h:64
HcalTestHistoManager::h
HcalTestHistoClass * h
Definition:
HcalTestHistoManager.h:35
nullptr
#define nullptr
HcalTestHistoManager::fs
edm::Service< TFileService > fs
Definition:
HcalTestHistoManager.h:33
FrontierConditions_GlobalTag_cff.file
file
Definition:
FrontierConditions_GlobalTag_cff.py:13
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:46
HcalTestHistoManager.h
edm::LogInfo
Definition:
MessageLogger.h:238
PluginManager.h
HcalTestHistoClass
Definition:
HcalTestHistoClass.h:16
HcalTestHistoManager::~HcalTestHistoManager
virtual ~HcalTestHistoManager()
Definition:
HcalTestHistoManager.cc:27
tree
Definition:
tree.py:1
HcalTestHistoManager::fillTree
void fillTree(HcalTestHistoClass *histos)
Definition:
HcalTestHistoManager.cc:36
Generated for CMSSW Reference Manual by
1.8.11