CMS 3D CMS Logo

RootNeutronReader.cc
Go to the documentation of this file.
2 #include <sstream>
3 
5 : theFile(new TFile(fileName.c_str()))
6 {
7 }
8 
9 
11 {
12  std::map<int, RootChamberReader>::iterator mapItr
13  = theChamberReaders.find(chamberType);
14 
15  if(mapItr != theChamberReaders.end())
16  {
17  return mapItr->second;
18  }
19  else
20  {
21  // make a new one
22  std::ostringstream treeName;
23  treeName << "ChamberType" << chamberType;
24  theChamberReaders[chamberType] = RootChamberReader(theFile, treeName.str());
25  return theChamberReaders[chamberType];
26  }
27 }
28 
29 
31 {
32  chamberReader(chamberType).read(result);
33 }
34 
35 
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