Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:07

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_Fun4AllDstPileupMerger_H
0004 #define G4MAIN_Fun4AllDstPileupMerger_H
0005 
0006 /*!
0007  * \file Fun4AllDstPileupMerger.h
0008  * \author Hugo Pereira Da Costa <hugo.pereira-da-costa@cea.fr>
0009  */
0010 
0011 #include <map>
0012 #include <string>
0013 #include <utility>  // for pair
0014 
0015 class PHCompositeNode;
0016 class PHG4HitContainer;
0017 class PHG4TruthInfoContainer;
0018 class PHHepMCGenEventMap;
0019 
0020 /*!
0021  * utility class that can merge the relevant nodes together, once time shifted
0022  * in order to generate full pileup events from raw events
0023  * it is used internally by Fun4AllDstPileupInputManager and Fun4AllSingleDstPileupInputManager
0024  */
0025 class Fun4AllDstPileupMerger final
0026 {
0027  public:
0028   //! constructor
0029   Fun4AllDstPileupMerger() = default;
0030 
0031   //! destructor
0032   ~Fun4AllDstPileupMerger() = default;
0033 
0034   //! load destination nodes from composite
0035   void load_nodes(PHCompositeNode *);
0036 
0037   //! time-shift and copy content of source nodes to destination
0038   void copy_background_event(PHCompositeNode *, double delta_t) const;
0039 
0040   void copyDetectorActiveCrossings(const std::map<std::string, std::pair<double, double>> &dmap) { m_DetectorTiming = dmap; }
0041 
0042  private:
0043   //! hepmc
0044   PHHepMCGenEventMap *m_geneventmap = nullptr;
0045 
0046   //! maps g4hit containers to node names
0047   std::map<std::string, PHG4HitContainer *> m_g4hitscontainers;
0048 
0049   //! truth information
0050   PHG4TruthInfoContainer *m_g4truthinfo = nullptr;
0051 
0052   std::map<std::string, std::pair<double, double>> m_DetectorTiming;
0053 };
0054 
0055 #endif