CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
tuple result
Definition: mps_fire.py:311
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