Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:23

0001 /// ---------------------------------------------------------------------------
0002 /*! \file   SLambdaJetHunter.cc
0003  *  \author Derek Anderson
0004  *  \date   01.25.2024
0005  *
0006  *  A minimal analysis module to find lambda-tagged
0007  *  jets in pythia events.
0008  */
0009 /// ---------------------------------------------------------------------------
0010 
0011 #define SLAMBDAJETHUNTER_CC
0012 
0013 // analysis utilities
0014 #include "SLambdaJetHunter.h"
0015 #include "SLambdaJetHunter.sys.h"
0016 #include "SLambdaJetHunter.ana.h"
0017 #include "SLambdaJetHunterConfig.h"
0018 
0019 // make common namespaces implicit
0020 using namespace std;
0021 using namespace fastjet;
0022 
0023 
0024 
0025 namespace SColdQcdCorrelatorAnalysis {
0026 
0027   // ctor/dtor ================================================================
0028 
0029   // --------------------------------------------------------------------------
0030   //! Module ctor accepting name and debug on/off flag
0031   // --------------------------------------------------------------------------
0032   SLambdaJetHunter::SLambdaJetHunter(const string &name, const bool debug) : SubsysReco(name) {
0033 
0034     if (debug) {
0035       cout << "SLambdaJetHunter::SLambdaJetHunter(string&, bool) Calling ctor" << endl;
0036     }
0037 
0038   }  // end ctor(string&, bool)
0039 
0040 
0041 
0042   // --------------------------------------------------------------------------
0043   //! Module ctor accepting config struct
0044   // --------------------------------------------------------------------------
0045   SLambdaJetHunter::SLambdaJetHunter(SLambdaJetHunterConfig& config) : SubsysReco(config.moduleName) {
0046 
0047     m_config = config;
0048     if (m_config.isDebugOn) {
0049       cout << "SLambdaJetHunter::SLambdaJetHunter(SLambdaJetHunterConfig&) Calling ctor" << endl;
0050     }
0051 
0052   }  // end ctor(SLambdaJetHunter&)
0053 
0054 
0055 
0056   // --------------------------------------------------------------------------
0057   //! Module dtor
0058   // --------------------------------------------------------------------------
0059   SLambdaJetHunter::~SLambdaJetHunter() {
0060 
0061     if (m_config.isDebugOn) {
0062       cout << "SLambdaJetHunter::~SLambdaJetHunter() Calling dtor" << endl;
0063     }
0064 
0065   }  // end dtor
0066 
0067 
0068 
0069   // f4a methods ==============================================================
0070 
0071   // --------------------------------------------------------------------------
0072   //! F4A module initialization
0073   // --------------------------------------------------------------------------
0074   int SLambdaJetHunter::Init(PHCompositeNode *topNode) {
0075 
0076     // print debug statement
0077     if (m_config.isDebugOn) {
0078       cout << "SLambdaJetHunter::Init(PHCompositeNode *topNode) Initializing" << endl;
0079     }
0080 
0081     /* TODO check user fastjet input */
0082 
0083     InitOutput();
0084     InitTree();
0085     return Fun4AllReturnCodes::EVENT_OK;
0086 
0087   }  // end 'Init(PHCompositeNode*)'
0088 
0089 
0090 
0091   // --------------------------------------------------------------------------
0092   //! Process an event inside F4A
0093   // --------------------------------------------------------------------------
0094   int SLambdaJetHunter::process_event(PHCompositeNode *topNode) {
0095 
0096     // print debug statement
0097     if (m_config.isDebugOn) {
0098       cout << "SLambdaJetHunter::process_event(PHCompositeNode *topNode) Processing Event" << endl;
0099     }
0100 
0101     // make sure output containers are emtpy
0102     ResetOutput();
0103 
0104     // run analysis routines
0105     GrabEventInfo(topNode);
0106     FindLambdas(topNode);
0107     MakeJets(topNode);
0108     CollectJetOutput(topNode);
0109     AssociateLambdasToJets(topNode);
0110 
0111     // fill tree and return
0112     FillOutputTree();
0113     return Fun4AllReturnCodes::EVENT_OK;
0114 
0115   }  // end 'process_event(PHCompositeNode*)'
0116 
0117 
0118 
0119   // --------------------------------------------------------------------------
0120   //! F4A module wind-down
0121   // --------------------------------------------------------------------------
0122   int SLambdaJetHunter::End(PHCompositeNode *topNode) {
0123 
0124     if (m_config.isDebugOn) {
0125       cout << "SLambdaJetHunter::End(PHCompositeNode *topNode) This is the End..." << endl;
0126     }
0127 
0128     SaveAndCloseOutput();
0129     return Fun4AllReturnCodes::EVENT_OK;
0130 
0131   }
0132 
0133 }  // end SColdQcdCorrelatorAnalysis namespace
0134 
0135 // end ------------------------------------------------------------------------