Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:12

0001 
0002 #ifndef DIJETTREEMAKER_H
0003 #define DIJETTREEMAKER_H
0004 
0005 #include <fun4all/SubsysReco.h>
0006 #include <calotrigger/TriggerAnalyzer.h>
0007 #include <string>
0008 #include <vector>
0009 #include <ffarawobjects/Gl1Packet.h>
0010 #include <ffarawobjects/Gl1Packetv1.h>
0011 #include <ffarawobjects/Gl1Packetv2.h>
0012 #include <calotrigger/LL1Out.h>
0013 #include <calotrigger/LL1Outv1.h>
0014 #include <calotrigger/TriggerPrimitive.h>
0015 #include <calotrigger/TriggerPrimitivev1.h>
0016 #include <calotrigger/TriggerPrimitiveContainer.h>
0017 #include <calotrigger/TriggerPrimitiveContainerv1.h>
0018 #include <calotrigger/TriggerDefs.h>
0019 #include <calobase/TowerInfoContainer.h>
0020 #include <calobase/TowerInfoContainerv1.h>
0021 #include <calobase/TowerInfoContainerv2.h>
0022 #include <calobase/TowerInfoContainerv3.h>
0023 #include <calobase/TowerInfo.h>
0024 #include <calobase/TowerInfov1.h>
0025 #include <calobase/TowerInfov2.h>
0026 #include <calobase/TowerInfov3.h>
0027 // jet includes
0028 #include <jetbase/Jet.h>
0029 #include <jetbase/JetContainer.h>
0030 #include <jetbase/JetContainerv1.h>
0031 #include <jetbase/Jetv2.h>
0032 
0033 #include "TTree.h"
0034 #include "TFile.h"
0035 #include "TVector3.h"
0036 
0037 class TVector3;
0038 class PHCompositeNode;
0039 class TowerInfoContainer;
0040 class JetContainer;
0041 class PHG4TruthInfoContainer;
0042 class DijetTreeMaker : public SubsysReco
0043 {
0044  public:
0045 
0046   DijetTreeMaker(const std::string &name = "DijetTreeMaker", const std::string &outfilename = "trees_caloemulator.root");
0047 
0048   virtual ~DijetTreeMaker();
0049 
0050   int Init(PHCompositeNode *topNode) override;
0051 
0052   int InitRun(PHCompositeNode *topNode) override;
0053 
0054   int process_event(PHCompositeNode *topNode) override;
0055   
0056   void GetNodes (PHCompositeNode *topNode);
0057 
0058   int ResetEvent(PHCompositeNode *topNode) override;
0059 
0060   int EndRun(const int runnumber) override;
0061 
0062   int End(PHCompositeNode *topNode) override;
0063 
0064   int Reset(PHCompositeNode * /*topNode*/) override;
0065   float get_eccentricity(std::vector<TVector3> hcaltowers, float oh_sum);
0066   void SetVerbosity(int verbo) ;
0067   void SetTrigger(const std::string trigger) {_trigger = trigger;}
0068   void SetIsSim(bool use) {isSim = use;}
0069   void SetPtCut(float pt) {pt_cut = pt;}
0070   Double_t getDPHI(Double_t phi1, Double_t phi2);
0071   void saveCalo(bool save){save_calo = save;}
0072  private:
0073   TriggerAnalyzer *triggeranalyzer{nullptr};  
0074   void reset_tree_vars();
0075 
0076   int _verbosity;
0077 
0078   float dijetcut = 10.;
0079   float pt_cut = 4;
0080   float pt_cut_truth = 4;
0081   bool save_calo = true;
0082   TFile *_f;
0083   TTree *_tree;
0084   std::string _trigger;
0085   std::string _foutname;
0086   std::string _nodename;
0087   std::string m_calo_nodename;
0088   int _i_event;
0089   bool isSim{0};
0090   
0091   TowerInfo *_tower;
0092   TowerInfoContainer* _towers;
0093 
0094   float b_vertex_z;
0095 
0096   std::vector<short> b_emcal_good;
0097   std::vector<float> b_emcal_energy;
0098   std::vector<float> b_emcal_time;
0099   std::vector<float> b_emcal_etabin;
0100   std::vector<float> b_emcal_phibin;
0101   std::vector<float> b_emcal_eta;
0102   std::vector<float> b_emcal_phi;
0103 
0104   std::vector<short> b_hcalin_good;
0105   std::vector<float> b_hcalin_energy;
0106   std::vector<float> b_hcalin_time;
0107   std::vector<float> b_hcalin_etabin;
0108   std::vector<float> b_hcalin_phibin;
0109   std::vector<float> b_hcalin_eta;
0110   std::vector<float> b_hcalin_phi;
0111 
0112   std::vector<short> b_hcalout_good;
0113   std::vector<float> b_hcalout_energy;
0114   std::vector<float> b_hcalout_time;
0115   std::vector<float> b_hcalout_etabin;
0116   std::vector<float> b_hcalout_phibin;
0117   std::vector<float> b_hcalout_eta;
0118   std::vector<float> b_hcalout_phi;
0119 
0120   int b_truth_particle_n = 0;
0121   std::vector<int> b_truth_particle_pid = {};
0122   std::vector<float> b_truth_particle_pt = {};
0123   std::vector<float>  b_truth_particle_eta = {};
0124   std::vector<float>  b_truth_particle_phi = {};
0125 
0126 
0127   int b_njet_2 = 0;
0128   std::vector<float> b_jet_pt_2 = {};
0129   std::vector<float> b_jet_et_2 = {};
0130   std::vector<float> b_jet_eta_2 = {};
0131   std::vector<float> b_jet_phi_2 = {};
0132   std::vector<float> b_jet_emcal_2 = {};
0133   std::vector<float> b_jet_hcalin_2 = {};
0134   std::vector<float> b_jet_hcalout_2 = {};
0135   std::vector<float> b_jet_eccen_2 = {};
0136 
0137   int b_njet_4 = 0;
0138   std::vector<float> b_jet_pt_4 = {};
0139   std::vector<float> b_jet_et_4 = {};
0140   std::vector<float> b_jet_eta_4 = {};
0141   std::vector<float> b_jet_phi_4 = {};
0142   std::vector<float> b_jet_emcal_4 = {};
0143   std::vector<float> b_jet_hcalin_4 = {};
0144   std::vector<float> b_jet_hcalout_4 = {};
0145   std::vector<float> b_jet_eccen_4 = {};
0146 
0147   int b_njet_6 = 0;
0148   std::vector<float> b_jet_pt_6 = {};
0149   std::vector<float> b_jet_et_6 = {};
0150   std::vector<float> b_jet_eta_6 = {};
0151   std::vector<float> b_jet_phi_6 = {};
0152   std::vector<float> b_jet_emcal_6 = {};
0153   std::vector<float> b_jet_hcalin_6 = {};
0154   std::vector<float> b_jet_hcalout_6 = {};
0155   std::vector<float> b_jet_eccen_6 = {};
0156 
0157   int b_ntruth_jet_2 = 0;
0158   std::vector<float> b_truth_jet_pt_2 = {};
0159   std::vector<float> b_truth_jet_eta_2 = {};
0160   std::vector<float> b_truth_jet_phi_2 = {};
0161 
0162   int b_ntruth_jet_4 = 0;
0163   std::vector<float> b_truth_jet_pt_4 = {};
0164   std::vector<float> b_truth_jet_eta_4 = {};
0165   std::vector<float> b_truth_jet_phi_4 = {};
0166 
0167   int b_ntruth_jet_6 = 0;
0168   std::vector<float> b_truth_jet_pt_6 = {};
0169   std::vector<float> b_truth_jet_eta_6 = {};
0170   std::vector<float> b_truth_jet_phi_6 = {};
0171 
0172   int b_ncluster = 0;
0173   std::vector<float> b_cluster_e = {};
0174   std::vector<float> b_cluster_ecore = {};
0175   std::vector<float> b_cluster_eta = {};
0176   std::vector<float> b_cluster_phi = {};
0177   std::vector<float> b_cluster_pt = {};
0178   std::vector<float> b_cluster_chi2 = {};
0179   std::vector<float> b_cluster_prob = {};
0180 
0181 };
0182 
0183 #endif