Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:15:01

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef SINGLEPHOTONCLUSTERANA_H
0004 #define SINGLEPHOTONCLUSTERANA_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 class PHCompositeNode;
0012 class TTree;
0013 class PHG4Particle;
0014 class CaloEvalStack;
0015 class TFile;
0016 class Fun4AllHistoManager;
0017 
0018 class singlePhotonClusterAna : public SubsysReco
0019 {
0020  public:
0021 
0022   singlePhotonClusterAna(const std::string &name, const std::string &outName);
0023 
0024   ~singlePhotonClusterAna() override;
0025 
0026   /** Called during initialization.
0027       Typically this is where you can book histograms, and e.g.
0028       register them to Fun4AllServer (so they can be output to file
0029       using Fun4AllServer::dumpHistos() method).
0030    */
0031   int Init(PHCompositeNode *topNode) override;
0032 
0033   /** Called for first event when run number is known.
0034       Typically this is where you may want to fetch data from
0035       database, because you know the run number. A place
0036       to book histograms which have to know the run number.
0037    */
0038   int InitRun(PHCompositeNode *topNode) override;
0039 
0040   /** Called for each event.
0041       This is where you do the real work.
0042    */
0043   int process_event(PHCompositeNode *topNode) override;
0044 
0045   /// Clean up internals after each event.
0046   int ResetEvent(PHCompositeNode *topNode) override;
0047 
0048   /// Called at the end of each run.
0049   int EndRun(const int runnumber) override;
0050 
0051   /// Called at the end of all processing.
0052   int End(PHCompositeNode *topNode) override;
0053 
0054   /// Reset
0055   int Reset(PHCompositeNode * /*topNode*/) override;
0056 
0057   void Print(const std::string &what = "ALL") const override;
0058 
0059  private:
0060 
0061   float getEta(PHG4Particle *particle);
0062     
0063   TTree *clusters_Towers;
0064   TTree *truth_photon;
0065   TTree *conversion;
0066   
0067   //CaloEvalStack *caloevalstack;
0068   
0069   //stuff for towers and clusters
0070   std::vector<float> m_eta_center;
0071   std::vector<float> m_phi_center;
0072   std::vector<float> m_tower_energy;
0073   std::vector<float> m_cluster_eta;
0074   std::vector<float> m_cluster_phi;
0075   std::vector<float> m_cluster_e;
0076   std::vector<float> m_cluster_ecore;
0077   std::vector<float> m_cluster_chi2;
0078   std::vector<float> m_cluster_prob;
0079   std::vector<float> m_cluster_nTowers;
0080   
0081   //stuff for truth photons
0082   std::vector<float> m_photon_E;
0083   std::vector<float> m_photon_eta;
0084   std::vector<float> m_photon_phi;
0085 
0086   //stuff for conversions
0087   std::vector<float> m_electron_E;
0088   std::vector<float> m_electron_eta;
0089   std::vector<float> m_electron_phi;
0090   std::vector<float> m_positron_E;
0091   std::vector<float> m_positron_eta;
0092   std::vector<float> m_positron_phi;
0093   std::vector<float> m_vtx_x;
0094   std::vector<float> m_vtx_y;
0095   std::vector<float> m_vtx_z;
0096   std::vector<float> m_vtx_t;
0097   std::vector<float> m_vtx_r;
0098   std::vector<bool> m_isConversionEvent;
0099   
0100   TFile *out;
0101   Fun4AllHistoManager *hm = nullptr;
0102   std::string Outfile;
0103 
0104   
0105 };
0106 
0107 #endif // SINGLEPHOTONCLUSTERANA_H