CMS 3D CMS Logo

RootNeutronReader Class Reference

This reads patterns of neutron hits in muon chambers from an ROOT database, so they can be superimposed onto signal events. More...

#include <SimMuon/Neutron/src/RootNeutronReader.h>

Inheritance diagram for RootNeutronReader:

NeutronReader

List of all members.

Public Member Functions

RootChamberReaderchamberReader (int chamberType)
virtual void readNextEvent (int chamberType, edm::PSimHitContainer &result)
 RootNeutronReader (const std::string &fileName)

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.

00005 : theFile(new TFile(fileName.c_str()))
00006 {
00007 }


Member Function Documentation

RootChamberReader & RootNeutronReader::chamberReader ( int  chamberType  ) 

Definition at line 10 of file RootNeutronReader.cc.

References theChamberReaders, and theFile.

Referenced by readNextEvent().

00011 {
00012   std::map<int, RootChamberReader>::iterator mapItr
00013     = theChamberReaders.find(chamberType);
00014 
00015   if(mapItr != theChamberReaders.end())
00016   {
00017     return mapItr->second;
00018   }
00019   else
00020   {
00021     // make a new one
00022     std::ostringstream treeName;
00023     treeName << "ChamberType" << chamberType;
00024     theChamberReaders[chamberType] = RootChamberReader(theFile, treeName.str());
00025     return theChamberReaders[chamberType];
00026   }
00027 }

void RootNeutronReader::readNextEvent ( int  chamberType,
edm::PSimHitContainer result 
) [virtual]

Implements NeutronReader.

Definition at line 30 of file RootNeutronReader.cc.

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

00031 {
00032    chamberReader(chamberType).read(result);
00033 }


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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:53 2009 for CMSSW by  doxygen 1.5.4