File indexing completed on 2025-08-05 08:13:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef TRIGGERCLUSTERMAKER_H
0013 #define TRIGGERCLUSTERMAKER_H
0014
0015
0016 #include <array>
0017 #include <string>
0018 #include <utility>
0019 #include <vector>
0020
0021 #include <calobase/RawClusterContainer.h>
0022
0023 #include <fun4all/SubsysReco.h>
0024
0025 #include "TriggerClusterMakerDefs.h"
0026
0027
0028 class LL1Out;
0029 class PHCompositeNode;
0030 class RawClusterv1;
0031 class TowerInfoContainer;
0032 class TriggerPrimitiveContainer;
0033
0034
0035
0036
0037
0038
0039 struct TriggerClusterMakerConfig {
0040
0041
0042 bool debug = true;
0043
0044
0045 std::string outNodeName = "TriggerClusters";
0046
0047
0048 std::vector<std::string> inLL1Nodes = {
0049 "LL1OUT_JET"
0050 };
0051 std::vector<std::string> inPrimNodes = {
0052 "TRIGGERPRIMITIVES_JET",
0053 "TRIGGERPRIMITIVES_EMCAL",
0054 "TRIGGERPRIMITIVES_EMCAL_LL1",
0055 "TRIGGERPRIMITIVES_HCAL_LL1",
0056 "TRIGGERPRIMITIVES_HCALIN",
0057 "TRIGGERPRIMITIVES_HCALOUT"
0058 };
0059
0060
0061 std::string inEMCalTowerNode = "TOWERINFO_CALIB_CEMC";
0062 std::string inIHCalTowerNode = "TOWERINFO_CALIB_HCALIN";
0063 std::string inOHCalTowerNode = "TOWERINFO_CALIB_HCALOUT";
0064
0065 };
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078 class TriggerClusterMaker : public SubsysReco {
0079
0080 public:
0081
0082
0083 TriggerClusterMaker(const std::string& name = "TriggerClusterMaker");
0084 ~TriggerClusterMaker() override;
0085
0086
0087 void SetConfig(const TriggerClusterMakerConfig& config) {m_config = config;}
0088
0089
0090 TriggerClusterMakerConfig GetConfig() {return m_config;}
0091
0092
0093 int Init(PHCompositeNode* topNode) override;
0094 int process_event(PHCompositeNode* topNode) override;
0095 int End(PHCompositeNode* topNode) override;
0096
0097 private:
0098
0099
0100 void InitOutNode(PHCompositeNode* topNode);
0101 void GrabTowerNodes(PHCompositeNode* topNode);
0102 void GrabTriggerNodes(PHCompositeNode* topNode);
0103 void ProcessLL1s(LL1Out* lloNode);
0104 void ProcessPrimitives(TriggerPrimitiveContainer* primNode);
0105 void AddPrimitiveToCluster(TriggerPrimitive* primitive, RawClusterv1* cluster);
0106 TowerInfo* GetTowerFromKey(const uint32_t key, const uint32_t det);
0107
0108
0109 std::array<TowerInfoContainer*, 3> m_inTowerNodes;
0110 std::vector<LL1Out*> m_inLL1Nodes;
0111 std::vector<TriggerPrimitiveContainer*> m_inPrimNodes;
0112
0113
0114 RawClusterContainer* m_outClustNode = NULL;
0115
0116
0117 TriggerClusterMakerConfig m_config;
0118
0119 };
0120
0121 #endif
0122
0123