CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RootNeutronReader Class Reference

#include <RootNeutronReader.h>

Inheritance diagram for RootNeutronReader:
NeutronReader

Public Member Functions

RootChamberReaderchamberReader (int chamberType)
 
void readNextEvent (int chamberType, edm::PSimHitContainer &result) override
 
 RootNeutronReader (const std::string &fileName)
 
- Public Member Functions inherited from NeutronReader
 NeutronReader ()
 
virtual ~NeutronReader ()
 

Private Attributes

std::map< int, RootChamberReadertheChamberReaders
 
TFile * theFile
 

Detailed Description

This reads patterns of neutron hits in muon chambers from an ROOT database, so they can be superimposed onto signal events. It reads the events sequentially, and loops back to the beginning when it reaches EOF

Definition at line 15 of file RootNeutronReader.h.

Constructor & Destructor Documentation

◆ RootNeutronReader()

RootNeutronReader::RootNeutronReader ( const std::string &  fileName)

Definition at line 4 of file RootNeutronReader.cc.

Member Function Documentation

◆ chamberReader()

RootChamberReader & RootNeutronReader::chamberReader ( int  chamberType)

Definition at line 6 of file RootNeutronReader.cc.

References theChamberReaders, and theFile.

Referenced by readNextEvent().

6  {
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 }
std::map< int, RootChamberReader > theChamberReaders

◆ readNextEvent()

void RootNeutronReader::readNextEvent ( int  chamberType,
edm::PSimHitContainer result 
)
overridevirtual

Implements NeutronReader.

Definition at line 20 of file RootNeutronReader.cc.

References chamberReader(), RootChamberReader::read(), and mps_fire::result.

20  {
21  chamberReader(chamberType).read(result);
22 }
void read(edm::PSimHitContainer &hits)
RootChamberReader & chamberReader(int chamberType)

Member Data Documentation

◆ theChamberReaders

std::map<int, RootChamberReader> RootNeutronReader::theChamberReaders
private

Definition at line 25 of file RootNeutronReader.h.

Referenced by chamberReader().

◆ theFile

TFile* RootNeutronReader::theFile
private

Definition at line 24 of file RootNeutronReader.h.

Referenced by chamberReader().