Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 "MCPhoton.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 /// \class EMCalCalib
0028 class EMCalCalib : public SubsysReco
0029 {
0030 
0031 public:
0032 
0033   enum enu_flags
0034   {
0035     kProcessSF = 1 << 1,
0036     kProcessTower = 1 << 2,
0037     kProcessMCPhoton = 1 << 3,
0038     kProcessUpslisonTrig = 1 << 4,
0039 
0040     kDefaultFlag = kProcessSF | kProcessTower
0041   };
0042 
0043   EMCalCalib(const std::string &filename = "cemc_ana.root", enu_flags flags =
0044       kDefaultFlag);
0045   virtual
0046   ~EMCalCalib();
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
0088   get_mag_field() const
0089   {
0090     return _magfield;
0091   }
0092   void
0093   set_mag_field(float magfield)
0094   {
0095     _magfield = magfield;
0096   }
0097 
0098 private:
0099 
0100   Fun4AllHistoManager *
0101   get_HistoManager();
0102 
0103   int
0104   Init_SF(PHCompositeNode *topNode);
0105   int
0106   process_event_SF(PHCompositeNode *topNode);
0107 
0108   int
0109   Init_Tower(PHCompositeNode *topNode);
0110   int
0111   process_event_Tower(PHCompositeNode *topNode);
0112 
0113   int
0114   Init_MCPhoton(PHCompositeNode *topNode);
0115   int
0116   process_event_MCPhoton(PHCompositeNode *topNode);
0117 
0118   int
0119   Init_UpslisonTrig(PHCompositeNode *topNode);
0120   int
0121   process_event_UpslisonTrig(PHCompositeNode *topNode);
0122 
0123   //! project a photon to calorimeters and collect towers around it
0124   void
0125   eval_photon(PHG4Particle * primary_particle, MCPhoton & trk,
0126       PHCompositeNode *topNode);
0127 
0128   enum enu_calo
0129   {
0130     kCEMC, kHCALIN, kHCALOUT
0131   };
0132 
0133   void eval_photon_proj(//
0134       PHG4Particle * g4particle, //
0135       MCPhoton & trk,
0136       enu_calo calo_id,//
0137       const double gvz,
0138       PHCompositeNode *topNode//
0139       );
0140 
0141   SvtxEvalStack * _eval_stack;
0142   TTree * _T_EMCalTrk;
0143   MCPhoton * _mc_photon;
0144 
0145   double _magfield;
0146   PHG4HoughTransform _hough;
0147 
0148   std::string _filename;
0149 
0150   uint32_t _flags;
0151   unsigned long _ievent;
0152 
0153   PHG4HitContainer* _hcalout_hit_container;
0154   PHG4HitContainer* _hcalin_hit_container;
0155   PHG4HitContainer* _cemc_hit_container;
0156   PHG4HitContainer* _hcalout_abs_hit_container;
0157   PHG4HitContainer* _hcalin_abs_hit_container;
0158   PHG4HitContainer* _cemc_abs_hit_container;
0159   PHG4HitContainer* _magnet_hit_container;
0160   PHG4HitContainer* _bh_hit_container;
0161   PHG4HitContainer* _bh_plus_hit_container;
0162   PHG4HitContainer* _bh_minus_hit_container;
0163   PHG4HitContainer* _cemc_electronics_hit_container;
0164   PHG4HitContainer* _hcalin_spt_hit_container;
0165   PHG4HitContainer* _svtx_hit_container;
0166   PHG4HitContainer* _svtx_support_hit_container;
0167 };
0168 
0169 #endif // __CALOEVALUATOR_H__