Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:25

0001 // ----------------------------------------------------------------------------
0002 /*! \file    TriggerClusterMaker.h'
0003  *  \authors Derek Anderson
0004  *  \date    05.15.2024
0005  *
0006  *  A Fun4All module to construct trigger clusters,
0007  *  jet patches stored in RawCluster objects, for
0008  *  downstream analysis
0009  */
0010 // ----------------------------------------------------------------------------
0011 
0012 #ifndef TRIGGERCLUSTERMAKER_H
0013 #define TRIGGERCLUSTERMAKER_H
0014 
0015 // c++ utilities
0016 #include <array>
0017 #include <string>
0018 #include <utility>
0019 #include <vector>
0020 // calo base
0021 #include <calobase/RawClusterContainer.h>
0022 // f4a libraries
0023 #include <fun4all/SubsysReco.h>
0024 // module utilities
0025 #include "TriggerClusterMakerDefs.h"
0026 
0027 // forward declarations
0028 class LL1Out;
0029 class PHCompositeNode;
0030 class RawClusterv1;
0031 class TowerInfoContainer;
0032 class TriggerPrimitiveContainer;
0033 
0034 
0035 
0036 // ----------------------------------------------------------------------------
0037 //! Options for TriggerClusterMaker module
0038 // ----------------------------------------------------------------------------
0039 struct TriggerClusterMakerConfig {
0040 
0041   // general options
0042   bool debug = true;
0043 
0044   // output options
0045   std::string outNodeName = "TriggerClusters";
0046 
0047   // input trigger nodes
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   // input tower nodes
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 //! Makes Trigger Cluster
0071 // ----------------------------------------------------------------------------
0072 /*! This Fun4all modules ingests calorimeter triggers and
0073  *  trigger primitives to turn them into RawCluster objects,
0074  *  i.e. "Trigger Clusters", for downstream analysis. Output
0075  *  clusters can be placed on the node tree, or saved to
0076  *  a TTree in a specified output file.
0077  */
0078 class TriggerClusterMaker : public SubsysReco {
0079 
0080   public:
0081 
0082     // ctor
0083     TriggerClusterMaker(const std::string& name = "TriggerClusterMaker");
0084     ~TriggerClusterMaker() override;
0085 
0086     // setters
0087     void SetConfig(const TriggerClusterMakerConfig& config) {m_config = config;}
0088 
0089     // getters
0090     TriggerClusterMakerConfig GetConfig() {return m_config;}
0091 
0092     // f4a methods
0093     int Init(PHCompositeNode* topNode)          override;
0094     int process_event(PHCompositeNode* topNode) override;
0095     int End(PHCompositeNode* topNode)           override;
0096 
0097   private:
0098 
0099     // private methods
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     // input nodes
0109     std::array<TowerInfoContainer*, 3>      m_inTowerNodes;
0110     std::vector<LL1Out*>                    m_inLL1Nodes;
0111     std::vector<TriggerPrimitiveContainer*> m_inPrimNodes;
0112 
0113     // output node
0114     RawClusterContainer* m_outClustNode = NULL;
0115 
0116     // module configuration
0117     TriggerClusterMakerConfig m_config;
0118 
0119 };
0120 
0121 #endif
0122 
0123 // end ------------------------------------------------------------------------