Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-19 09:18:43

0001 /*!
0002  * \file MvtxHitMapWriter.h
0003  * \brief Module to write the Mvtx hit map to a ROOT file
0004  * \author Tanner Mengel <tmengel@bnl.gov>
0005  * \version $Version: 1.0.1 $
0006  * \date $Date: 05/23/2025.
0007  */
0008 
0009 #ifndef MVTXCALIB_MVTXHITMAPWRITER_H
0010 #define MVTXCALIB_MVTXHITMAPWRITER_H
0011 
0012 #include <fun4all/SubsysReco.h>
0013 
0014 #include <cstdint>
0015 #include <string>
0016 #include <vector>
0017 
0018 class PHCompositeNode;
0019 class MvtxHitMap;
0020 class MvtxRawEvtHeader;
0021 class MvtxRawHitContainer;
0022 class TTree;
0023 
0024 class MvtxHitMapWriter : public SubsysReco
0025 {
0026  public:
0027   MvtxHitMapWriter(const std::string& name = "MvtxHitMapWriter")
0028     : SubsysReco(name)
0029   {}
0030 
0031   ~MvtxHitMapWriter() override = default;
0032 
0033   // standard Fun4All functions
0034   int InitRun(PHCompositeNode*) override;
0035   int process_event(PHCompositeNode*) override;
0036   int End(PHCompositeNode*) override;
0037 
0038   void SetOutputfile(const std::string& name) { m_outputfile = name; }
0039 
0040  private:
0041   // optional output
0042   std::string m_outputfile{"mvtx_hit_map.root"};
0043 
0044   uint64_t m_last_strobe{0};
0045 
0046   // hit map
0047   MvtxHitMap* m_hit_map{nullptr};
0048 
0049   MvtxRawEvtHeader* m_mvtx_raw_event_header{nullptr};
0050   MvtxRawHitContainer* m_mvtx_raw_hit_container{nullptr};
0051 
0052   TTree* m_tree_info{nullptr};
0053   unsigned int m_num_strobes{0};
0054   unsigned int m_nhits_total{0};
0055   unsigned int m_num_fired_pixels{0};
0056 
0057   TTree* m_tree{nullptr};
0058   std::vector<uint64_t> m_pixels{};
0059   std::vector<unsigned int> m_nhits{};
0060 
0061   int get_nodes(PHCompositeNode* topNode);
0062   int FillTree();
0063 };
0064 
0065 #endif