test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual void readNextEvent (int chamberType, edm::PSimHitContainer &result)
 
 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 ( const std::string &  fileName)

Definition at line 4 of file RootNeutronReader.cc.

5 : theFile(new TFile(fileName.c_str()))
6 {
7 }

Member Function Documentation

RootChamberReader & RootNeutronReader::chamberReader ( int  chamberType)

Definition at line 10 of file RootNeutronReader.cc.

References theChamberReaders, and theFile.

Referenced by readNextEvent().

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 }
std::map< int, RootChamberReader > theChamberReaders
void RootNeutronReader::readNextEvent ( int  chamberType,
edm::PSimHitContainer result 
)
virtual

Implements NeutronReader.

Definition at line 30 of file RootNeutronReader.cc.

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

31 {
32  chamberReader(chamberType).read(result);
33 }
tuple result
Definition: mps_fire.py:83
void read(edm::PSimHitContainer &hits)
RootChamberReader & chamberReader(int chamberType)

Member Data Documentation

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

Definition at line 26 of file RootNeutronReader.h.

Referenced by chamberReader().

TFile* RootNeutronReader::theFile
private

Definition at line 25 of file RootNeutronReader.h.

Referenced by chamberReader().