Main Page
Namespaces
Classes
Package Documentation
SimMuon
Neutron
src
RootChamberWriter.cc
Go to the documentation of this file.
1
#include "
SimMuon/Neutron/src/RootChamberWriter.h
"
2
#include "
SimMuon/Neutron/src/RootSimHit.h
"
3
4
#include <iostream>
5
using namespace
std
;
6
7
8
RootChamberWriter::RootChamberWriter
(
const
std::string
& treeName)
9
{
10
theHits =
new
TClonesArray(
"RootSimHit"
);
11
theTree =
new
TTree(treeName.c_str(),
"Neutron Background"
);
12
theTree->Bronch(
"Hits"
,
"TClonesArray"
, &theHits);
13
}
14
15
16
RootChamberWriter::~RootChamberWriter
()
17
{
18
//std::cout << "WRITING " << theTree->GetEntries() << std::endl;
19
// theTree->Write();
20
//delete theHits;
21
//delete theTree;
22
}
23
24
25
void
RootChamberWriter::write
(
const
edm::PSimHitContainer
&
hits
)
26
{
27
std::cout
<<
"ENTRIES BEFORE "
<< theTree->GetEntries() << std::endl;
28
theHits->Delete();
29
theHits->Expand(hits.size());
30
for
(
unsigned
int
i
= 0;
i
< hits.size(); ++
i
)
31
{
32
new
((*theHits)[
i
])
RootSimHit
(hits[
i
]);
33
}
34
theTree->Fill();
35
std::cout
<<
"ENTRIES AFTER "
<< theTree->GetEntries() << std::endl;
36
}
37
RootSimHit.h
mps_fire.i
i
Definition:
mps_fire.py:277
RootSimHit
Definition:
RootSimHit.h:7
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
hfClusterShapes_cfi.hits
hits
Definition:
hfClusterShapes_cfi.py:5
std
Definition:
JetResolutionObject.h:80
RootChamberWriter::RootChamberWriter
RootChamberWriter()
default ctor, for STL
Definition:
RootChamberWriter.h:12
RootChamberWriter::~RootChamberWriter
~RootChamberWriter()
writes the tree, and deletes everything
Definition:
RootChamberWriter.cc:16
RootChamberWriter::write
void write(const edm::PSimHitContainer &hits)
Definition:
RootChamberWriter.cc:25
RootChamberWriter.h
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition:
PSimHitContainer.h:11
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
Generated for CMSSW Reference Manual by
1.8.11