Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:59

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef SYNRADANA_H
0004 #define SYNRADANA_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 class PHCompositeNode;
0012 class Fun4AllHistoManager;
0013 
0014 class SynRadAna : public SubsysReco
0015 {
0016  public:
0017   SynRadAna(const std::string &filename = "SynRadAna.root");
0018 
0019   virtual ~SynRadAna();
0020 
0021   /** Called during initialization.
0022       Typically this is where you can book histograms, and e.g.
0023       register them to Fun4AllServer (so they can be output to file
0024       using Fun4AllServer::dumpHistos() method).
0025    */
0026   int Init(PHCompositeNode *topNode) override;
0027 
0028   /** Called for first event when run number is known.
0029       Typically this is where you may want to fetch data from
0030       database, because you know the run number. A place
0031       to book histograms which have to know the run number.
0032    */
0033   int InitRun(PHCompositeNode *topNode) override;
0034 
0035   /** Called for each event.
0036       This is where you do the real work.
0037    */
0038   int process_event(PHCompositeNode *topNode) override;
0039 
0040   /// Clean up internals after each event.
0041   int ResetEvent(PHCompositeNode *topNode) override;
0042 
0043   /// Called at the end of each run.
0044   int EndRun(const int runnumber) override;
0045 
0046   /// Called at the end of all processing.
0047   int End(PHCompositeNode *topNode) override;
0048 
0049   /// Reset
0050   int Reset(PHCompositeNode * /*topNode*/) override;
0051 
0052   void Print(const std::string &what = "ALL") const override;
0053 
0054   //! embedding ID for the event
0055   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0056   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0057   //! Usually, ID = 0 means the primary Au+Au collision background
0058   int get_embedding_id() const { return _embedding_id; }
0059   //
0060   //! embedding ID for the event
0061   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0062   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0063   //! Usually, ID = 0 means the primary Au+Au collision background
0064   void set_embedding_id(int id) { _embedding_id = id; }
0065 
0066   void
0067   AddNode(const std::string &name)
0068   {
0069     _node_postfix.push_back(name);
0070   }
0071 
0072   void
0073   AddHit(const std::string &name)
0074   {
0075     _node_postfix.push_back(name);
0076   }
0077 
0078   void
0079   AddTower(const std::string &name)
0080   {
0081     _tower_postfix.push_back(name);
0082   }
0083 
0084   bool isDoMvtxHits() const
0085   {
0086     return do_MVTXHits;
0087   }
0088 
0089   void setDoMvtxHits(bool doMvtxHits)
0090   {
0091     do_MVTXHits = doMvtxHits;
0092   }
0093 
0094   bool isDoTPCHits() const
0095   {
0096     return do_TPCHits;
0097   }
0098 
0099   void setDoTPCHits(bool doTPCHits)
0100   {
0101     do_TPCHits = doTPCHits;
0102   }
0103 
0104   bool isDoPhoton() const
0105   {
0106     return do_photon;
0107   }
0108 
0109   void setDoPhoton(bool doPhoton)
0110   {
0111     do_photon = doPhoton;
0112   }
0113 
0114  private:
0115   //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0116   //! negative IDs are backgrounds, .e.g out of time pile up collisions
0117   //! Usually, ID = 0 means the primary Au+Au collision background
0118   int _embedding_id;
0119 
0120   double m_eventWeight;
0121 
0122   bool do_photon;
0123   bool do_MVTXHits;
0124   bool do_TPCHits;
0125 
0126   std::string m_outputFIle;
0127 
0128   std::vector<std::string> _node_postfix;
0129   std::vector<std::string> _tower_postfix;
0130   //! Get a pointer to the default hist manager for QA modules
0131   Fun4AllHistoManager *
0132   getHistoManager();
0133 
0134   // common prefix for QA histograms
0135   std::string get_histo_prefix();
0136 };
0137 
0138 #endif  // SYNRADANA_H