File indexing completed on 2025-08-05 08:11:10
0001 #ifndef CALOWAVEFORMSIM_H__
0002 #define CALOWAVEFORMSIM_H__
0003
0004 #include <fun4all/SubsysReco.h>
0005 #include <TTree.h>
0006 #include <TRandom3.h>
0007 #include <caloreco/CaloWaveformProcessing.h>
0008 #include <g4detectors/PHG4CylinderGeomContainer.h>
0009 #include <g4detectors/PHG4FullProjSpacalCellReco.h>
0010
0011 class Fun4AllHistoManager;
0012 class PHCompositeNode;
0013 class TFile;
0014 class TNtuple;
0015 class TTree;
0016
0017 class CaloWaveFormSim : public SubsysReco
0018 {
0019 public:
0020
0021 CaloWaveFormSim(const std::string &name = "CaloWaveFormSim", const std::string &fname = "MyNtuple.root");
0022
0023
0024 virtual ~CaloWaveFormSim();
0025
0026
0027 int Init(PHCompositeNode *);
0028
0029
0030 int process_event(PHCompositeNode *);
0031
0032
0033 int End(PHCompositeNode *);
0034
0035 int process_g4hits(PHCompositeNode *);
0036 int process_g4cells(PHCompositeNode *);
0037 int process_towers(PHCompositeNode *);
0038 int process_clusters(PHCompositeNode *);
0039 static double template_function(double *x, double *par);
0040 static double template_function_ihcal(double *x, double *par);
0041 static double template_function_ohcal(double *x, double *par);
0042
0043 void Detector(const std::string &name) { detector = name; }
0044
0045 protected:
0046 std::string detector;
0047 std::string outfilename;
0048 Fun4AllHistoManager *hm;
0049 TFile *outfile;
0050
0051 std::vector<float> m_t0;
0052 std::vector<float> m_edep;
0053 std::vector<float> m_nhits;
0054 std::vector<float> m_z0;
0055 std::vector<float> m_x0;
0056 std::vector<float> m_y0;
0057 std::vector<float> m_eta;
0058 std::vector<float> m_phi;
0059 std::vector<float> m_primid;
0060 std::vector<float> m_primpt;
0061 std::vector<float> m_primeta;
0062 std::vector<float> m_primphi;
0063
0064 std::vector<float> m_primtrkid;
0065 std::vector<float> m_g4primtrkid;
0066 std::vector<float> m_g4primpt;
0067 std::vector<float> m_etabin;
0068 std::vector<float> m_phibin;
0069
0070 std::vector<float> m_geoetabin;
0071 std::vector<float> m_geophibin;
0072
0073 int m_waveform[24576][16];
0074 int m_waveform_ihcal[1536][16];
0075 int m_waveform_ohcal[1536][16];
0076 int m_ndep[24576];
0077 float m_tedep[24576];
0078 float m_tedep_ihcal[1536];
0079 float m_tedep_ohcal[1536];
0080
0081 float m_extractedadc[24576];
0082 float m_extractedtime[24576];
0083
0084 float m_extractedadc_ihcal[1536];
0085 float m_extractedtime_ihcal[1536];
0086
0087 float m_extractedadc_ohcal[1536];
0088 float m_extractedtime_ohcal[1536];
0089
0090 float m_toweradc[24576];
0091 float m_toweradc_ihcal[1536];
0092 float m_toweradc_ohcal[1536];
0093
0094 int m_npeaks_ihcal[1536];
0095 int m_npeaks_ohcal[1536];
0096
0097
0098 TTree *g4hitntuple;
0099
0100
0101
0102
0103 CaloWaveformProcessing* WaveformProcessing;
0104 CaloWaveformProcessing* WaveformProcessing_ihcal;
0105 CaloWaveformProcessing* WaveformProcessing_ohcal;
0106
0107 PHG4FullProjSpacalCellReco::LightCollectionModel light_collection_model;
0108 TTree* noise_midrad;
0109 TTree* noise_lowrad;
0110 TTree* noise_norad;
0111 float noise_val_midrad[31];
0112 float noise_val_lowrad[31];
0113 float noise_val_norad[31];
0114 TRandom3* rnd;
0115
0116 };
0117
0118 #endif