CMS 3D CMS Logo

RootNeutronReader.cc
Go to the documentation of this file.
2 #include <sstream>
3 
4 RootNeutronReader::RootNeutronReader(const std::string& fileName) : theFile(new TFile(fileName.c_str())) {}
5 
7  std::map<int, RootChamberReader>::iterator mapItr = theChamberReaders.find(chamberType);
8 
9  if (mapItr != theChamberReaders.end()) {
10  return mapItr->second;
11  } else {
12  // make a new one
13  std::ostringstream treeName;
14  treeName << "ChamberType" << chamberType;
15  theChamberReaders[chamberType] = RootChamberReader(theFile, treeName.str());
16  return theChamberReaders[chamberType];
17  }
18 }
19 
21  chamberReader(chamberType).read(result);
22 }
std::map< int, RootChamberReader > theChamberReaders
void read(edm::PSimHitContainer &hits)
RootNeutronReader(const std::string &fileName)
RootChamberReader & chamberReader(int chamberType)
void readNextEvent(int chamberType, edm::PSimHitContainer &result) override
std::vector< PSimHit > PSimHitContainer