#include <SimMuon/Neutron/src/RootNeutronReader.h>
Public Member Functions | |
RootChamberReader & | chamberReader (int chamberType) |
virtual void | readNextEvent (int chamberType, edm::PSimHitContainer &result) |
RootNeutronReader (const std::string &fileName) | |
Private Attributes | |
std::map< int, RootChamberReader > | theChamberReaders |
TFile * | theFile |
It reads the events sequentially, and loops back to the beginning when it reaches EOF
Definition at line 15 of file RootNeutronReader.h.
RootNeutronReader::RootNeutronReader | ( | const std::string & | fileName | ) |
RootChamberReader & RootNeutronReader::chamberReader | ( | int | chamberType | ) |
Definition at line 10 of file RootNeutronReader.cc.
References theChamberReaders, and theFile.
Referenced by readNextEvent().
00011 { 00012 std::map<int, RootChamberReader>::iterator mapItr 00013 = theChamberReaders.find(chamberType); 00014 00015 if(mapItr != theChamberReaders.end()) 00016 { 00017 return mapItr->second; 00018 } 00019 else 00020 { 00021 // make a new one 00022 std::ostringstream treeName; 00023 treeName << "ChamberType" << chamberType; 00024 theChamberReaders[chamberType] = RootChamberReader(theFile, treeName.str()); 00025 return theChamberReaders[chamberType]; 00026 } 00027 }
void RootNeutronReader::readNextEvent | ( | int | chamberType, | |
edm::PSimHitContainer & | result | |||
) | [virtual] |
Implements NeutronReader.
Definition at line 30 of file RootNeutronReader.cc.
References chamberReader(), and RootChamberReader::read().
00031 { 00032 chamberReader(chamberType).read(result); 00033 }
std::map<int, RootChamberReader> RootNeutronReader::theChamberReaders [private] |
TFile* RootNeutronReader::theFile [private] |