Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:22

0001 #ifndef RootNeutronReader_h
0002 #define RootNeutronReader_h
0003 
0004 #include "SimMuon/Neutron/src/NeutronReader.h"
0005 #include "SimMuon/Neutron/src/RootChamberReader.h"
0006 #include <TFile.h>
0007 
0008 /** This reads patterns of neutron hits in muon chambers
0009  * from an ROOT database,
0010  * so they can be superimposed onto signal events.
0011  * It reads the events sequentially, and loops
0012  * back to the beginning when it reaches EOF
0013  */
0014 
0015 class RootNeutronReader : public NeutronReader {
0016 public:
0017   RootNeutronReader(const std::string& fileName);
0018 
0019   void readNextEvent(int chamberType, edm::PSimHitContainer& result) override;
0020 
0021   RootChamberReader& chamberReader(int chamberType);
0022 
0023 private:
0024   TFile* theFile;
0025   std::map<int, RootChamberReader> theChamberReaders;
0026 };
0027 
0028 #endif