Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:28

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef MBDANALYSIS_H
0004 #define MBDANALYSIS_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 
0010 class PHCompositeNode;
0011 class TTree;
0012 
0013 class mbdAnalysis : public SubsysReco
0014 {
0015  public:
0016 
0017   mbdAnalysis(const std::string &name = "mbdAnalysis");
0018 
0019   ~mbdAnalysis() override;
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  private:
0055 
0056   TFile *out;
0057   TTree *T = nullptr;
0058   //std::vector<float> adc;
0059   //std::vector<float> tdc0;
0060   //std::vector<float> tdc1;
0061   std::vector<float> pmtcharge;
0062   std::vector<float> pmttime;
0063   std::vector<float> pmtx;
0064   std::vector<float> pmty;
0065   std::vector<float> pmtz;
0066   std::vector<float> pmtr;
0067   std::vector<float> pmtphi;
0068 
0069 };
0070 
0071 #endif // MBDANALYSIS_H