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.

4 : theFile(new TFile(fileName.c_str())) {}

Member Function Documentation

◆ chamberReader()

RootChamberReader & RootNeutronReader::chamberReader ( int  chamberType)

Definition at line 6 of file RootNeutronReader.cc.

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 }

References theChamberReaders, and theFile.

Referenced by readNextEvent().

◆ readNextEvent()

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

Implements NeutronReader.

Definition at line 20 of file RootNeutronReader.cc.

20  {
21  chamberReader(chamberType).read(result);
22 }

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

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().

RootNeutronReader::theChamberReaders
std::map< int, RootChamberReader > theChamberReaders
Definition: RootNeutronReader.h:25
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
RootChamberReader::read
void read(edm::PSimHitContainer &hits)
Definition: RootChamberReader.cc:25
RootChamberReader
Definition: RootChamberReader.h:8
RootNeutronReader::chamberReader
RootChamberReader & chamberReader(int chamberType)
Definition: RootNeutronReader.cc:6
mps_fire.result
result
Definition: mps_fire.py:303
RootNeutronReader::theFile
TFile * theFile
Definition: RootNeutronReader.h:24