Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:14:32

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PI0MASSANALYSIS_H
0004 #define PI0MASSANALYSIS_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include "TFile.h"
0010 #include "TH1F.h"
0011 #include "TTree.h"
0012 
0013 class PHCompositeNode;
0014 
0015 class Pi0MassAnalysis : public SubsysReco
0016 {
0017  public:
0018   Pi0MassAnalysis(const std::string &name = "Pi0MassAnalysis");
0019 
0020   ~Pi0MassAnalysis() override;
0021 
0022   /** Called during initialization.
0023       Typically this is where you can book histograms, and e.g.
0024       register them to Fun4AllServer (so they can be output to file
0025       using Fun4AllServer::dumpHistos() method).
0026    */
0027   int Init(PHCompositeNode *topNode) override;
0028 
0029   /** Called for first event when run number is known.
0030       Typically this is where you may want to fetch data from
0031       database, because you know the run number. A place
0032       to book histograms which have to know the run number.
0033    */
0034   int InitRun(PHCompositeNode *topNode) override;
0035 
0036   /** Called for each event.
0037       This is where you do the real work.
0038    */
0039   int process_event(PHCompositeNode *topNode) override;
0040 
0041   /// Clean up internals after each event.
0042   int ResetEvent(PHCompositeNode *topNode) override;
0043 
0044   /// Called at the end of each run.
0045   int EndRun(const int runnumber) override;
0046 
0047   /// Called at the end of all processing.
0048   int End(PHCompositeNode *topNode) override;
0049 
0050   /// Reset
0051   int Reset(PHCompositeNode * /*topNode*/) override;
0052 
0053   void Print(const std::string &what = "ALL") const override;
0054 
0055   void SetMinClusterEnergy(float e = 0.15) { minClusterEnergy = e; }
0056   void SetPhotonClusterProbability(float p = 0.1) { photonClusterProbability = p; }
0057 
0058  private:
0059   std::string _foutname;
0060 
0061   TFile *_f;
0062   TTree *_tree;
0063 
0064   TH1F *pi0MassHist;
0065   TH1F *pi0MassHistEtaDep[24];
0066 
0067   int counter;
0068 
0069   float minClusterEnergy;
0070   float photonClusterProbability;
0071 
0072   int nclus;
0073 
0074   float cluster_energy[10000];
0075   float cluster_eta[10000];
0076   float cluster_phi[10000];
0077   float cluster_prob[10000];
0078   float cluster_chi2[10000];
0079 
0080   int npi0;
0081 
0082   float pi0cand_pt[100000];
0083   float pi0cand_eta[100000];
0084   float pi0cand_phi[100000];
0085   float pi0cand_mass[100000];
0086 };
0087 
0088 #endif  // PI0MASSANALYSIS_H