File indexing completed on 2025-08-03 08:12:42
0001 #ifndef __CALOEVALUATOR_H__
0002 #define __CALOEVALUATOR_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <phool/PHCompositeNode.h>
0006 #include <g4hough/PHG4HoughTransform.h>
0007
0008 #include <TNtuple.h>
0009 #include <TFile.h>
0010
0011 #include "EMCalTrk.h"
0012
0013 #include <string>
0014 #include <stdint.h>
0015
0016 class PHCompositeNode;
0017 class PHG4HitContainer;
0018 class Fun4AllHistoManager;
0019 class TH1F;
0020 class TTree;
0021 class SvtxEvalStack;
0022 class PHG4Particle;
0023 class RawTowerGeom;
0024 class RawTowerContainer;
0025 class SvtxTrack;
0026
0027
0028 class EMCalAna : public SubsysReco
0029 {
0030
0031 public:
0032
0033 enum enu_flags
0034 {
0035 kProcessSF = 1 << 1,
0036 kProcessTower = 1 << 2,
0037 kProcessTrk = 1 << 3,
0038 kProcessUpslisonTrig = 1 << 4,
0039
0040 kDefaultFlag = kProcessSF | kProcessTower
0041 };
0042
0043 EMCalAna(const std::string &filename = "cemc_ana.root", enu_flags flags =
0044 kDefaultFlag);
0045 virtual
0046 ~EMCalAna();
0047
0048 int
0049 Init(PHCompositeNode *topNode);
0050 int
0051 InitRun(PHCompositeNode *topNode);
0052 int
0053 process_event(PHCompositeNode *topNode);
0054 int
0055 End(PHCompositeNode *topNode);
0056
0057 uint32_t
0058 get_flags() const
0059 {
0060 return _flags;
0061 }
0062
0063 void
0064 set_flags(enu_flags flags)
0065 {
0066 _flags = (uint32_t) flags;
0067 }
0068
0069 void
0070 set_flag(enu_flags flag)
0071 {
0072 _flags |= (uint32_t) flag;
0073 }
0074
0075 bool
0076 flag(enu_flags flag)
0077 {
0078 return _flags & flag;
0079 }
0080
0081 void
0082 reset_flag(enu_flags flag)
0083 {
0084 _flags &= ~(uint32_t) flag;
0085 }
0086
0087 float get_mag_field() const {return _magfield;}
0088 void set_mag_field(float magfield) {_magfield = magfield;}
0089
0090 private:
0091
0092 Fun4AllHistoManager *
0093 get_HistoManager();
0094
0095 int
0096 Init_SF(PHCompositeNode *topNode);
0097 int
0098 process_event_SF(PHCompositeNode *topNode);
0099
0100 int
0101 Init_Tower(PHCompositeNode *topNode);
0102 int
0103 process_event_Tower(PHCompositeNode *topNode);
0104
0105 int
0106 Init_Trk(PHCompositeNode *topNode);
0107 int
0108 process_event_Trk(PHCompositeNode *topNode);
0109
0110 int
0111 Init_UpslisonTrig(PHCompositeNode *topNode);
0112 int
0113 process_event_UpslisonTrig(PHCompositeNode *topNode);
0114
0115 void eval_trk(PHG4Particle * primary_particle, EMCalTrk & trk, PHCompositeNode *topNode);
0116
0117 enum enu_calo
0118 {
0119 kCEMC,
0120 kHCALIN,
0121 kHCALOUT
0122 };
0123
0124 void eval_trk_proj(
0125 SvtxTrack * track,
0126 EMCalTrk & trk,
0127 enu_calo calo_id,
0128 const double gvz,
0129 PHCompositeNode *topNode
0130 );
0131
0132 SvtxEvalStack * _eval_stack;
0133 TTree * _T_EMCalTrk;
0134 EMCalTrk * _trk;
0135
0136 double _magfield;
0137 PHG4HoughTransform _hough;
0138
0139 std::string _filename;
0140
0141 uint32_t _flags;
0142 unsigned long _ievent;
0143
0144 PHG4HitContainer* _hcalout_hit_container;
0145 PHG4HitContainer* _hcalin_hit_container;
0146 PHG4HitContainer* _cemc_hit_container;
0147 PHG4HitContainer* _hcalout_abs_hit_container;
0148 PHG4HitContainer* _hcalin_abs_hit_container;
0149 PHG4HitContainer* _cemc_abs_hit_container;
0150 PHG4HitContainer* _magnet_hit_container;
0151 PHG4HitContainer* _bh_hit_container;
0152 PHG4HitContainer* _bh_plus_hit_container;
0153 PHG4HitContainer* _bh_minus_hit_container;
0154 PHG4HitContainer* _cemc_electronics_hit_container;
0155 PHG4HitContainer* _hcalin_spt_hit_container;
0156 PHG4HitContainer* _svtx_hit_container;
0157 PHG4HitContainer* _svtx_support_hit_container;
0158 };
0159
0160 #endif