File indexing completed on 2025-08-03 08:11:18
0001 #ifndef __PHANA_H__
0002 #define __PHANA_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <string>
0006
0007
0008 class PHCompositeNode;
0009 class PHG4HitContainer;
0010 class PHG4TruthInfoContainer;
0011 class TFile;
0012 class TNtuple;
0013
0014
0015
0016 class PHAna: public SubsysReco
0017 {
0018 public:
0019
0020 PHAna(const std::string &name="PHAna");
0021
0022
0023 int Init(PHCompositeNode *);
0024
0025
0026 int process_event(PHCompositeNode *);
0027
0028
0029 int End(PHCompositeNode *);
0030
0031
0032 void set_filename(const char* file)
0033 { if(file) _outfile = file; }
0034
0035 float Square(float x){ return x*x; }
0036
0037
0038 enum Flag
0039 {
0040
0041 NONE = 0,
0042
0043
0044 TRUTH = (1<<0),
0045
0046
0047 HIST = (1<<1),
0048
0049
0050 SF = (1<<2),
0051
0052
0053 HCALIN_TOWER = (1<<3),
0054
0055
0056 ALL = (1<<4)-1
0057 };
0058
0059
0060
0061 void set_flag(const Flag& flag, const bool& value)
0062 {
0063 if(value) _flags |= flag;
0064 else _flags &= (~flag);
0065 }
0066
0067
0068 void fill_truth_ntuple(PHCompositeNode*);
0069 void fill_sf_ntuple(PHCompositeNode*);
0070 void create_histos();
0071 void fill_histos(PHCompositeNode*);
0072
0073 private:
0074
0075 std::string _outfile;
0076
0077
0078 int _event;
0079
0080
0081 void GetNodes(PHCompositeNode *);
0082
0083
0084 unsigned int _flags;
0085
0086
0087 TNtuple* _truth;
0088 TNtuple* _sf;
0089 TNtuple* _hcalin_towers;
0090
0091
0092 PHG4TruthInfoContainer* _truth_container;
0093 PHG4HitContainer* _hcalout_hit_container;
0094 PHG4HitContainer* _hcalin_hit_container;
0095 PHG4HitContainer* _cemc_hit_container;
0096 PHG4HitContainer* _hcalout_abs_hit_container;
0097 PHG4HitContainer* _hcalin_abs_hit_container;
0098 PHG4HitContainer* _cemc_abs_hit_container;
0099 PHG4HitContainer* _cemc_electronics_hit_container;
0100 PHG4HitContainer* _hcalin_spt_hit_container;
0101
0102
0103 };
0104
0105 #endif