Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:59

0001 #ifndef INTTANA_H__
0002 #define INTTANA_H__
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <string>
0006 
0007 /// Class declarations for use in the analysis module
0008 class PHCompositeNode;
0009 class TFile;
0010 class TH1;
0011 class TH2;
0012 class TNtuple;
0013 class TTree;
0014 class InttRawData;
0015 
0016 /// Definition of this analysis module class
0017 class InttAna : public SubsysReco
0018 {
0019  public:
0020   struct evtbco_info{
0021     int      evt_gl1 {-1};
0022     uint     evt_intt{ 0};
0023     int      evt_mbd {-1};
0024     uint64_t bco_gl1 {0};
0025     uint64_t bco_intt{0};
0026     uint64_t bco_mbd {0};
0027 
0028     void clear() {
0029       evt_gl1  = -1;
0030       evt_intt =  0;
0031       evt_mbd  = -1;
0032       bco_gl1  =  0;
0033       bco_intt =  0;
0034       bco_mbd  =  0;
0035     };
0036 
0037     void copy(const evtbco_info& info) {
0038       evt_gl1  = info.evt_gl1 ;
0039       evt_intt = info.evt_intt;
0040       evt_mbd  = info.evt_mbd ;
0041       bco_gl1  = info.bco_gl1 ;
0042       bco_intt = info.bco_intt;
0043       bco_mbd  = info.bco_mbd ;
0044     };
0045   };
0046  public:
0047   /// Constructor
0048   InttAna(const std::string &name = "InttAna",
0049           const std::string &fname = "AnaTutorial.root");
0050 
0051   // Destructor
0052   virtual ~InttAna();
0053 
0054   /// SubsysReco initialize processing method
0055   int Init(PHCompositeNode *);
0056  
0057   /// SubsysReco initialize processing method
0058   int InitRun(PHCompositeNode *);
0059 
0060   /// SubsysReco event processing method
0061   int process_event(PHCompositeNode *);
0062 
0063   /// SubsysReco end processing method
0064   int End(PHCompositeNode *);
0065 
0066 
0067   //truth information
0068   // void getHEPMCTruth(PHCompositeNode *);
0069   // void getPHG4Particle(PHCompositeNode *);
0070   void getHEPMCTruth(PHCompositeNode *topNode);
0071   void getPHG4Particle(PHCompositeNode *topNode);
0072 
0073 
0074   void setInttRawData(InttRawData *rawModule) { _rawModule = rawModule; }
0075 
0076   void readRawHit(PHCompositeNode *);
0077 
0078   void setBeamCenter(float x=0, float y=0) {xbeam_=x; ybeam_=y;}
0079 
0080  private:
0081   InttRawData* _rawModule;
0082 
0083   std::string fname_;
0084   TFile* anafile_;
0085   TH1*   h_dca2d_zero; 
0086   TH2*   h2_dca2d_zero; 
0087   TH2*   h2_dca2d_len; 
0088   TH1*   h_zvtx;
0089   TNtuple*  h_ntp_clus; 
0090   TNtuple*  h_ntp_emcclus; 
0091   //TTree*  h_t_clus; 
0092   TNtuple*  h_ntp_cluspair; 
0093   TNtuple*  h_ntp_emccluspair{nullptr}; 
0094   TNtuple*  h_ntp_evt; 
0095   TTree*  h_t_evt_bco; 
0096 
0097   float xbeam_;
0098   float ybeam_;
0099     double xvtx_sim;
0100   double yvtx_sim;
0101   double zvtx_sim;
0102 
0103   evtbco_info m_evtbcoinfo;
0104   evtbco_info m_evtbcoinfo_prev;
0105 
0106   TH1* h_zvtxseed_;
0107   TTree *m_hepmctree;
0108 
0109     /// HEPMC Tree variables
0110   int m_evt=0;
0111   double m_xvtx;
0112   double m_yvtx;
0113   double m_zvtx;
0114   int m_partid1;
0115   int m_partid2;
0116   double m_x1;
0117   double m_x2;
0118   int m_mpi;
0119   int m_process_id;
0120   double m_truthenergy;
0121   double m_trutheta;
0122   double m_truththeta;
0123   double m_truthphi;
0124   int m_status;
0125   double m_truthpx;
0126   double m_truthpy;
0127   double m_truthpz;
0128   double m_truthpt;
0129   double m_truthp;
0130   int m_numparticlesinevent;
0131   int m_truthpid;
0132   double m_vertex;
0133 };
0134 
0135 #endif