CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RootChamberWriter Class Reference

#include <RootChamberWriter.h>

Public Member Functions

 RootChamberWriter ()
 default ctor, for STL More...
 
 RootChamberWriter (const std::string &treeName)
 
TTree * tree ()
 
void write (const edm::PSimHitContainer &hits)
 
 ~RootChamberWriter ()
 writes the tree, and deletes everything More...
 

Private Attributes

TClonesArray * theHits
 
TTree * theTree
 

Detailed Description

Definition at line 8 of file RootChamberWriter.h.

Constructor & Destructor Documentation

RootChamberWriter::RootChamberWriter ( )
inline

default ctor, for STL

Definition at line 12 of file RootChamberWriter.h.

References hfClusterShapes_cfi::hits, AlCaHLTBitMon_QueryRunRegistry::string, write(), and ~RootChamberWriter().

12 : theTree(nullptr), theHits(nullptr) {}
TClonesArray * theHits
RootChamberWriter::RootChamberWriter ( const std::string &  treeName)

Definition at line 8 of file RootChamberWriter.cc.

9 {
10  theHits = new TClonesArray("RootSimHit");
11  theTree = new TTree(treeName.c_str(), "Neutron Background");
12  theTree->Bronch("Hits", "TClonesArray", &theHits);
13 }
TClonesArray * theHits
RootChamberWriter::~RootChamberWriter ( )

writes the tree, and deletes everything

Definition at line 16 of file RootChamberWriter.cc.

Referenced by RootChamberWriter().

17 {
18 //std::cout << "WRITING " << theTree->GetEntries() << std::endl;
19 // theTree->Write();
20  //delete theHits;
21  //delete theTree;
22 }

Member Function Documentation

TTree* RootChamberWriter::tree ( )
inline
void RootChamberWriter::write ( const edm::PSimHitContainer hits)

Definition at line 25 of file RootChamberWriter.cc.

References gather_cfg::cout, and mps_fire::i.

Referenced by RootChamberWriter().

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 }
TClonesArray * theHits

Member Data Documentation

TClonesArray* RootChamberWriter::theHits
private

Definition at line 24 of file RootChamberWriter.h.

TTree* RootChamberWriter::theTree
private

Definition at line 23 of file RootChamberWriter.h.

Referenced by tree().