Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:55

0001 #include "DumpJetContainer.h"
0002 
0003 #include <jetbase/Jet.h>
0004 #include <jetbase/JetContainer.h>
0005 
0006 #include <phool/PHIODataNode.h>
0007 
0008 #include <climits>
0009 #include <map>
0010 #include <ostream>
0011 #include <string>
0012 #include <utility>
0013 
0014 using MyNode_t = PHIODataNode<JetContainer>;
0015 
0016 DumpJetContainer::DumpJetContainer(const std::string &NodeName)
0017   : DumpObject(NodeName)
0018 {
0019   return;
0020 }
0021 
0022 int DumpJetContainer::process_Node(PHNode *myNode)
0023 {
0024   JetContainer *jets = nullptr;
0025   MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);  // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
0026   if (thisNode)
0027   {
0028     jets = thisNode->getData();
0029   }
0030   if (jets)
0031   {
0032     *fout << "size: " << jets->size() << std::endl;
0033     *fout << "par: " << jets->get_par() << std::endl;
0034     *fout << "algo: " << jets->get_algo() << std::endl;
0035     /* auto jet_properties = jets->get_property_vec(); */
0036     for (auto *jet : *jets)
0037     {
0038       *fout << "id: " << jet->get_id() << std::endl;
0039       *fout << "px: " << jet->get_px() << std::endl;
0040       *fout << "py: " << jet->get_py() << std::endl;
0041       *fout << "pz: " << jet->get_pz() << std::endl;
0042       *fout << "e: " << jet->get_e() << std::endl;
0043       *fout << "p: " << jet->get_p() << std::endl;
0044       *fout << "pt: " << jet->get_pt() << std::endl;
0045       *fout << "et: " << jet->get_et() << std::endl;
0046       *fout << "eta: " << jet->get_eta() << std::endl;
0047       *fout << "phi: " << jet->get_phi() << std::endl;
0048       *fout << "mass: " << jet->get_mass() << std::endl;
0049       // print out the jet properties
0050 
0051       for (auto prop : jets->property_indices())
0052       {
0053         *fout << "prop id: " << static_cast<unsigned int>(prop.first)
0054               << " value: " << jet->get_property(prop.second)
0055               << std::endl;
0056       }
0057       /* Jet::ConstIter jetbegin = jiter->second->begin_comp(); */
0058       /* Jet::ConstIter jetend = jiter->second->end_comp(); */
0059       /* for (Jet::ConstIter jetiter = jetbegin; jetiter != jetend; ++jetiter) */
0060       /* { */
0061       for (const auto &comp : jet->get_comp_vec())
0062       {
0063         *fout << "src: " << comp.first << " value: " << comp.second << std::endl;
0064       }
0065     }
0066   }
0067   return 0;
0068 }