File indexing completed on 2025-08-05 08:13:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef TRIGGERCLUSTERTUPLEMAKER_H
0012 #define TRIGGERCLUSTERTUPLEMAKER_H
0013
0014
0015 #include <string>
0016 #include <vector>
0017 #include <cassert>
0018
0019 #include <TFile.h>
0020 #include <TNtuple.h>
0021
0022 #include <calobase/RawCluster.h>
0023 #include <calobase/RawClusterv1.h>
0024 #include <calobase/RawClusterContainer.h>
0025
0026
0027
0028
0029
0030
0031 struct TriggerClusterTupleMakerConfig {
0032
0033
0034 bool debug = true;
0035
0036
0037 std::string outFile = "test.tuple.root";
0038 std::string outTuple = "TrgClustTuple";
0039
0040
0041 std::string inNode = "TriggerClusters";
0042
0043 };
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 class TriggerClusterTupleMaker : public SubsysReco {
0055
0056 public:
0057
0058
0059 TriggerClusterTupleMaker(const std::string& name = "TriggerClusterTupleMaker");
0060 ~TriggerClusterMaker() override;
0061
0062
0063 void SetConfig(const TriggerClusterTupleMakerConfig& config) {m_config = config;}
0064
0065
0066 TriggerClusterTupleMakerConfig GetConfig() {return m_config;}
0067
0068
0069 int Init(PHCompositeNode* topNode) override;
0070 int process_event(PHCompositeNode* topNode) override;
0071 int End(PHCompositeNode* topNode) override;
0072
0073 private:
0074
0075
0076 void InitOutput();
0077 void GrabInputNode(PHCompositeNode* topNode);
0078 void SetVariables(RawClusterv1* cluster);
0079 void SaveOutput();
0080 void ResetVariables();
0081
0082
0083 std::vector<float> m_vecOutVars;
0084
0085
0086 TFile* m_outFile = NULL;
0087 TNtuple* m_outTuple = NULL;
0088
0089
0090 RawClusterContainer* m_inTrgClusts = NULL;
0091
0092
0093 TriggerClusterMakerConfig m_config;
0094
0095 };
0096
0097 #endif
0098
0099