File indexing completed on 2025-08-05 08:12:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef PROTOTYPE4_PROTOTYPE4DSTREADER_H
0014 #define PROTOTYPE4_PROTOTYPE4DSTREADER_H
0015
0016 #include "RawTower_Prototype4.h"
0017 #include "RawTower_Temperature.h"
0018
0019 #include <fun4all/SubsysReco.h>
0020
0021 #include <memory>
0022 #include <string>
0023 #include <vector>
0024
0025 class PHCompositeNode;
0026 class TClonesArray;
0027 class TTree;
0028
0029
0030
0031
0032
0033 class Prototype4DSTReader : public SubsysReco
0034 {
0035 public:
0036 Prototype4DSTReader(const std::string &filename);
0037 virtual ~Prototype4DSTReader();
0038
0039
0040 int Init(PHCompositeNode *);
0041
0042
0043 int process_event(PHCompositeNode *);
0044
0045
0046 int End(PHCompositeNode *);
0047
0048 void AddTower(const std::string &name) { _tower_postfix.push_back(name); }
0049
0050 void AddTowerTemperature(const std::string &name)
0051 {
0052 _towertemp_postfix.push_back(name);
0053 }
0054
0055 void AddRunInfo(const std::string &name) { _runinfo_list.push_back(name); }
0056 void AddEventInfo(const std::string &name)
0057 {
0058 _eventinfo_list.push_back(name);
0059 }
0060
0061
0062 double get_tower_zero_sup() { return _tower_zero_sup; }
0063
0064
0065 void set_tower_zero_sup(double b) { _tower_zero_sup = b; }
0066
0067 protected:
0068
0069 std::vector<std::string> _tower_postfix;
0070
0071 std::vector<std::string> _towertemp_postfix;
0072
0073
0074 std::vector<std::string> _runinfo_list;
0075 std::vector<std::string> _eventinfo_list;
0076
0077 int nblocks;
0078
0079 typedef std::shared_ptr<TClonesArray> arr_ptr;
0080
0081 struct record
0082 {
0083 unsigned int _cnt;
0084 std::string _name;
0085 arr_ptr _arr;
0086 TClonesArray *_arr_ptr;
0087 double _dvalue;
0088
0089 enum enu_type
0090 {
0091 typ_hit,
0092 typ_part,
0093 typ_vertex,
0094 typ_tower,
0095 typ_jets,
0096 typ_runinfo,
0097 typ_eventinfo,
0098 typ_towertemp
0099 };
0100 enu_type _type;
0101 };
0102 typedef std::vector<record> records_t;
0103 records_t _records;
0104
0105 typedef RawTower_Prototype4 RawTower_type;
0106
0107 typedef RawTower_Temperature RawTowerT_type;
0108
0109 int _event;
0110
0111 std::string _out_file_name;
0112
0113
0114 TTree *_T;
0115
0116
0117 double _tower_zero_sup;
0118
0119 void build_tree();
0120 };
0121
0122 #endif