CMS 3D CMS Logo

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