Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:49

0001 #ifndef SimMuon_Neutron_RootNeutronWriter_h
0002 #define SimMuon_Neutron_RootNeutronWriter_h
0003 
0004 #include "SimMuon/Neutron/src/NeutronWriter.h"
0005 #include "SimMuon/Neutron/src/RootChamberWriter.h"
0006 #include <TFile.h>
0007 #include <vector>
0008 /**  This writes the fields of a SimHit into an ASCII
0009  *   file, which can be read out later to add neutron
0010  *   hits to a muon chamber
0011  */
0012 
0013 class RootNeutronWriter : public NeutronWriter {
0014 public:
0015   RootNeutronWriter(const std::string& fileName);
0016   ~RootNeutronWriter() override;
0017 
0018   /// users should use this to create chamberwriters
0019   /// for each chamber type just after creation
0020   void initialize(int detType) override;
0021 
0022   RootChamberWriter& chamberWriter(int chamberType);
0023 
0024   void writeCluster(int chamberType, const edm::PSimHitContainer& hits) override;
0025 
0026 private:
0027   std::map<int, RootChamberWriter> theChamberWriters;
0028   TFile* theFile;
0029 };
0030 
0031 #endif