Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:15

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef HCALJETPHISHIFT_H
0004 #define HCALJETPHISHIFT_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <vector>
0010 
0011 class PHCompositeNode;
0012 class TTree;
0013 class TFile;
0014 
0015 class HCalJetPhiShift : public SubsysReco
0016 {
0017 public:
0018   
0019   HCalJetPhiShift(const std::string &name = "HCalJetPhiShift", const std::string &outputFile = "HCalJetPhiShift_test.root");
0020   
0021   ~HCalJetPhiShift() override;
0022   
0023   /** Called during initialization.
0024    Typically this is where you can book histograms, and e.g.
0025    register them to Fun4AllServer (so they can be output to file
0026    using Fun4AllServer::dumpHistos() method).
0027    */
0028   int Init(PHCompositeNode *topNode) override;
0029   
0030   /** Called for first event when run number is known.
0031    Typically this is where you may want to fetch data from
0032    database, because you know the run number. A place
0033    to book histograms which have to know the run number.
0034    */
0035   int InitRun(PHCompositeNode *topNode) override;
0036   
0037   /** Called for each event.
0038    This is where you do the real work.
0039    */
0040   int process_event(PHCompositeNode *topNode) override;
0041   
0042   /// Clean up internals after each event.
0043   int ResetEvent(PHCompositeNode *topNode) override;
0044   
0045   /// Called at the end of each run.
0046   int EndRun(const int runnumber) override;
0047   
0048   /// Called at the end of all processing.
0049   int End(PHCompositeNode *topNode) override;
0050   
0051   /// Reset
0052   int Reset(PHCompositeNode * /*topNode*/) override;
0053   
0054   void Print(const std::string &what = "ALL") const override;
0055   
0056   void SetEventNumber(int event_number)
0057   {
0058     m_event = event_number;
0059   };
0060     
0061 private:
0062   std::string m_outputFileName;
0063   
0064   //! Output Tree variables
0065   TTree *m_T;
0066   
0067   //! eventwise quantities
0068   int m_event;
0069   int m_nTow_in;
0070   int m_nTow_out;
0071   int m_nTow_emc;
0072   float m_eta;
0073   float m_phi;
0074   float m_e;
0075   float m_pt;
0076   float m_vx;
0077   float m_vy;
0078   float m_vz;
0079 
0080   //! towers
0081   std::vector<int> m_id;
0082   std::vector<float> m_eta_in;
0083   std::vector<float> m_phi_in;
0084   std::vector<float> m_e_in;
0085   std::vector<int> m_ieta_in;
0086   std::vector<int> m_iphi_in;
0087   
0088   std::vector<float> m_eta_out;
0089   std::vector<float> m_phi_out;
0090   std::vector<float> m_e_out;
0091   std::vector<int> m_ieta_out;
0092   std::vector<int> m_iphi_out;
0093 
0094   std::vector<float> m_eta_emc;
0095   std::vector<float> m_phi_emc;
0096   std::vector<float> m_e_emc;
0097   std::vector<int> m_ieta_emc;
0098   std::vector<int> m_iphi_emc;
0099 
0100   int FillTTree(PHCompositeNode *topNode);
0101 };
0102 
0103 #endif // HCALJETPHISHIFT_H