CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootChamberWriter.cc
Go to the documentation of this file.
3 using namespace std;
4 
6 {
7  theHits = new TClonesArray("RootSimHit");
8  theTree = new TTree(treeName.c_str(), "Neutron Background");
9  theTree->Bronch("Hits", "TClonesArray", &theHits);
10 }
11 
12 
14 {
15 //std::cout << "WRITING " << theTree->GetEntries() << std::endl;
16 // theTree->Write();
17  //delete theHits;
18  //delete theTree;
19 }
20 
21 
23 {
24 std::cout << "ENTRIES BEFORE " << theTree->GetEntries() << std::endl;
25  theHits->Delete();
26  theHits->Expand(hits.size());
27  for(unsigned int i = 0; i < hits.size(); ++i)
28  {
29  new((*theHits)[i]) RootSimHit(hits[i]);
30  }
31  theTree->Fill();
32 std::cout << "ENTRIES AFTER " << theTree->GetEntries() << std::endl;
33 }
34 
int i
Definition: DBlmapReader.cc:9
RootChamberWriter()
default ctor, for STL
~RootChamberWriter()
writes the tree, and deletes everything
void write(const edm::PSimHitContainer &hits)
tuple cout
Definition: gather_cfg.py:121
std::vector< PSimHit > PSimHitContainer