Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __TRUTHPHOTONJET_H__
0002 #define __TRUTHPHOTONJET_H__
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <vector>
0006 
0007 #include <TFile.h>
0008 #include <TH1.h>
0009 #include <TH2.h>
0010 #include <TMath.h>
0011 #include <TTree.h>
0012 
0013 class PHCompositeNode;
0014 class RawClusterContainer;
0015 class RawCluster;
0016 class SvtxTrackMap;
0017 class JetMap;
0018 class JetEvalStack;
0019 class JetRecoEval;
0020 class SvtxTrackEval;
0021 class PHG4TruthInfoContainer;
0022 class PHHepMCGenEventMap;
0023 class PHHepMCGenEvent;
0024 class CaloTriggerInfo;
0025 class PHGenIntegral;
0026 class TruthPhotonJet : public SubsysReco
0027 {
0028  public:
0029   TruthPhotonJet(const std::string &name = "truthphotonjet.root");
0030   double isoconeradius, mincluspt;
0031   double minjetpt;
0032   int jet_cone_size;
0033   int use_isocone;
0034   int eval_tracked_jets;
0035   int etalow;
0036   int etahigh;
0037   int _is_dijet_process;
0038   int Init(PHCompositeNode *);
0039   int process_event(PHCompositeNode *);
0040   int End(PHCompositeNode *);
0041   void set_jetpt_mincut(double pt) { minjetpt = pt; };
0042   void set_cluspt_mincut(double pt) { mincluspt = pt; };
0043   void set_jetcone_size(int size) { jet_cone_size = size; }    //float for jet cone size, i.e. 0.2,0.3,0.4, etc.
0044   void SetFirstEventNum(int eventnum) { nevents = eventnum; }  //setting the first event based on job number so that each event has an individual eventnum
0045   void use_tracked_jets(int useit) { eval_tracked_jets = useit; };
0046   void set_eta_lowhigh(float low, float high)
0047   {
0048     etalow = low;
0049     etahigh = high;
0050   };
0051   void set_dijet_process(int yesorno) { _is_dijet_process = yesorno; };
0052  private:
0053   TH1 *ntruthconstituents_h;
0054 
0055   TFile *file;
0056   TTree *tree;
0057 
0058   TTree *truth_g4particles;
0059   TTree *truthtree;
0060 
0061   TTree *truthjettree;
0062 
0063   TTree *event_tree;
0064   TTree *runinfo;
0065 
0066   std::string outfilename;
0067 
0068   int nevents;
0069   TH1F *histo;
0070 
0071   float beam_energy;
0072   float x1;
0073   float x2;
0074   int partid1;
0075   int partid2;
0076   int ntruthconstituents;
0077   float hardest_jetpt;
0078   float hardest_jetphi;
0079   float hardest_jeteta;
0080   float hardest_jetenergy;
0081 
0082   //cluster info
0083   float clus_energy;
0084   float clus_eta;
0085   float clus_phi;
0086   float clus_pt;
0087   float clus_px;
0088   float clus_py;
0089   float clus_pz;
0090   float clus_theta;
0091   float clus_x, clus_y, clus_z, clus_t;
0092 
0093   //track info
0094   float tr_px, tr_py, tr_pz;
0095   float tr_p;
0096   float tr_pt;
0097   float tr_phi;
0098   float tr_eta;
0099   int charge;
0100   float chisq;
0101   unsigned int ndf;
0102   float dca;
0103   float tr_x, tr_y, tr_z;
0104   float truthtrackpx, truthtrackpy, truthtrackpz;
0105   float truthtrackp;
0106   float truthtracke;
0107   float truthtrackpt;
0108   float truthtrackphi;
0109   float truthtracketa;
0110   int truthtrackpid;
0111   bool truth_is_primary;
0112 
0113   //all truth jets
0114   float truthjetpt;
0115   float truthjetpx, truthjetpy, truthjetpz;
0116   float truthjetphi;
0117   float truthjeteta;
0118   float truthjetmass;
0119   float truthjetp;
0120   float truthjetenergy;
0121   float truthjetxf;
0122 
0123   //all reco jets
0124   float recojetpt;
0125   float recojetpx, recojetpy, recojetpz;
0126   float recojetphi;
0127   float recojeteta;
0128   float recojetmass;
0129   float recojetp;
0130   float recojetenergy;
0131   float recojetid;
0132   float truthjetid;
0133 
0134   //isophot+reco jet
0135   float _recojetid;
0136   float _recojetpt;
0137   float _recojetpx, _recojetpy, _recojetpz;
0138   float _recojetphi;
0139   float _recojeteta;
0140   float _recojetmass;
0141   float _recojetp;
0142   float _recojetenergy;
0143   float jetdphi;
0144   float jetpout;
0145   float jetdeta;
0146   float _truthjetid;
0147   float _truthjetpt;
0148   float _truthjetpx, _truthjetpy, _truthjetpz;
0149   float _truthjetphi;
0150   float _truthjeteta;
0151   float _truthjetmass;
0152   float _truthjetp;
0153   float _truthjetenergy;
0154 
0155   //isophot+reco track jet
0156   float _trecojetid;
0157   float _trecojetpt;
0158   float _trecojetpx, _trecojetpy, _trecojetpz;
0159   float _trecojetphi;
0160   float _trecojeteta;
0161   float _trecojetmass;
0162   float _trecojetp;
0163   float _trecojetenergy;
0164   float tjetdphi;
0165   float tjetpout;
0166   float tjetdeta;
0167   float _ttruthjetid;
0168   float _ttruthjetpt;
0169   float _ttruthjetpx, _ttruthjetpy, _ttruthjetpz;
0170   float _ttruthjetphi;
0171   float _ttruthjeteta;
0172   float _ttruthjetmass;
0173   float _ttruthjetp;
0174   float _ttruthjetenergy;
0175 
0176   //isophot+reco hadron
0177   float _tr_px, _tr_py, _tr_pz;
0178   float _tr_p;
0179   float _tr_pt;
0180   float _tr_phi;
0181   float _tr_eta;
0182   int _charge;
0183   float _chisq;
0184   unsigned int _ndf;
0185   float _dca;
0186   float _tr_x, _tr_y, _tr_z;
0187   float haddphi;
0188   float hadpout;
0189   float haddeta;
0190   bool _truth_is_primary;
0191   float _truthtrackpx;
0192   float _truthtrackpy;
0193   float _truthtrackpz;
0194   float _truthtrackp;
0195   float _truthtracke;
0196   float _truthtrackpt;
0197   float _truthtrackphi;
0198   float _truthtracketa;
0199   int _truthtrackpid;
0200 
0201   //all truth particles
0202   float truthpx, truthpy, truthpz;
0203   float truthp;
0204   float truthphi;
0205   float trutheta;
0206   float truthpt;
0207   float truthenergy;
0208   int truthpid;
0209   int numparticlesinevent;
0210   int process_id;
0211 
0212   //clust truth variables
0213   float clustruthpx;
0214   float clustruthpy;
0215   float clustruthpz;
0216   float clustruthenergy;
0217   float clustruthpt;
0218   float clustruthphi;
0219   float clustrutheta;
0220   int clustruthpid;
0221 
0222   float cluseventenergy;
0223   float cluseventphi;
0224   float cluseventeta;
0225   float cluseventpt;
0226 
0227   float eventdphi;
0228 
0229   float intlumi;
0230   float nprocessedevents;
0231   float nacceptedevents;
0232   float xsecprocessedevents;
0233   float xsecacceptedevents;
0234 
0235   //trigger emulator info (emcal trigger)
0236   float E_4x4;
0237   float phi_4x4;
0238   float eta_4x4;
0239   float E_2x2;
0240   float phi_2x2;
0241   float eta_2x2;
0242 
0243   void Set_Tree_Branches();
0244   void initialize_values();
0245 
0246   const float pi2 = -1.5707963;
0247   const float threepi2 = 4.71238898;
0248   const float pi = 3.1415926;
0249 };
0250 
0251 #endif  // __PHOTONJET_H__