Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimMuon_Neutron_RootChamberWriter_h
0002 #define SimMuon_Neutron_RootChamberWriter_h
0003 
0004 #include <TTree.h>
0005 #include <TClonesArray.h>
0006 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0007 
0008 class RootChamberWriter {
0009 public:
0010   /// default ctor, for STL
0011   RootChamberWriter() : theTree(nullptr), theHits(nullptr) {}
0012   RootChamberWriter(const std::string& treeName);
0013 
0014   /// writes the tree, and deletes everything
0015   ~RootChamberWriter();
0016 
0017   void write(const edm::PSimHitContainer& hits);
0018 
0019   TTree* tree() { return theTree; }
0020 
0021 private:
0022   TTree* theTree;
0023   TClonesArray* theHits;
0024 };
0025 
0026 #endif