#include <RootChamberReader.h>
Public Member Functions | |
void | read (edm::PSimHitContainer &hits) |
RootChamberReader (TFile *file, const std::string &treeName) | |
RootChamberReader () | |
default ctor, for STL | |
~RootChamberReader () | |
writes the tree, and deletes everything | |
Private Attributes | |
TClonesArray * | theHits |
int | thePosition |
int | theSize |
TTree * | theTree |
Definition at line 8 of file RootChamberReader.h.
RootChamberReader::RootChamberReader | ( | ) |
default ctor, for STL
Definition at line 7 of file RootChamberReader.cc.
: theTree(0), theHits(0), thePosition(0), theSize(0) { }
RootChamberReader::RootChamberReader | ( | TFile * | file, |
const std::string & | treeName | ||
) |
Definition at line 16 of file RootChamberReader.cc.
RootChamberReader::~RootChamberReader | ( | ) |
writes the tree, and deletes everything
Definition at line 30 of file RootChamberReader.cc.
{ // delete theHits; // delete theTree; }
void RootChamberReader::read | ( | edm::PSimHitContainer & | hits | ) |
Definition at line 37 of file RootChamberReader.cc.
References RootSimHit::get(), LogTrace, GetRecoTauVFromDQM_MC_cff::next, theHits, thePosition, theSize, and theTree.
Referenced by RootNeutronReader::readNextEvent().
{ // if there's no tree, make no events if(theTree != 0 && theSize != 0) { ++thePosition; // start again from the beginning, if needed if(thePosition >= theSize) thePosition = 0; theTree->GetEntry(thePosition); TIter next(theHits); RootSimHit * rootHit; while( (rootHit = (RootSimHit *) next()) ) { hits.push_back(rootHit->get()); } LogTrace("Neutrons") << "Event " << thePosition << " OF " << theSize << " has " << hits.size() << " hits "; } }
TClonesArray* RootChamberReader::theHits [private] |
Definition at line 21 of file RootChamberReader.h.
Referenced by read(), and RootChamberReader().
int RootChamberReader::thePosition [private] |
Definition at line 22 of file RootChamberReader.h.
Referenced by read().
int RootChamberReader::theSize [private] |
Definition at line 23 of file RootChamberReader.h.
Referenced by read(), and RootChamberReader().
TTree* RootChamberReader::theTree [private] |
Definition at line 20 of file RootChamberReader.h.
Referenced by read(), and RootChamberReader().