Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:13:57

0001 #include "StreamingLumiCheck.h"
0002 
0003 //#include "BcoInfo.h"
0004 #include "StreamingBcoInfo.h"
0005 #include "StreamingLumiInfo.h"
0006 //#include "BcoStreamingLumiInfov1.h"
0007 
0008 
0009 #include <ffaobjects/SyncDefs.h>
0010 #include <ffaobjects/SyncObject.h>
0011 
0012 #include <ffarawobjects/Gl1Packet.h>
0013 
0014 #include <fun4all/Fun4AllReturnCodes.h>
0015 #include <fun4all/SubsysReco.h>  // for SubsysReco
0016 #include <fun4all/Fun4AllHistoManager.h>
0017 #include <fun4all/Fun4AllServer.h>
0018 
0019 
0020 #include <phool/PHCompositeNode.h>
0021 #include <phool/PHNode.h>          // for PHNode
0022 #include <phool/PHNodeIterator.h>  // for PHNodeIterator
0023 #include <phool/getClass.h>
0024 #include <phool/phool.h>  // for PHWHERE
0025 
0026 
0027 #include <iostream>
0028 
0029 StreamingLumiCheck::StreamingLumiCheck(const std::string &name)
0030   : SubsysReco(name)
0031 {
0032   return;
0033 }
0034 
0035 int StreamingLumiCheck::Init(PHCompositeNode *topNode)
0036 {
0037   int iret = CreateNodeTree(topNode);
0038 
0039   return iret;
0040 }
0041 
0042 int StreamingLumiCheck::InitRun(PHCompositeNode *topNode)
0043 {
0044   StreamingLumiInfo *streaming_lumi_info = findNode::getClass<StreamingLumiInfo>(topNode, "STREAMINGLUMIINFO");
0045   if (streaming_lumi_info)
0046   {
0047     std::cout << " raw lumi : " << streaming_lumi_info->get_lumi_raw() << std::endl;
0048     std::cout << " live lumi : " << streaming_lumi_info->get_lumi_live() << std::endl;
0049     std::cout << " scaled lumi : " << streaming_lumi_info->get_lumi_scaled() << std::endl;
0050   }
0051   return Fun4AllReturnCodes::EVENT_OK;
0052 }
0053 
0054 int StreamingLumiCheck::CreateNodeTree(PHCompositeNode *topNode)
0055 {
0056   PHNodeIterator iter(topNode);
0057   PHCompositeNode *dstNode;
0058   dstNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "DST"));
0059   if (!dstNode)
0060   {
0061     std::cout << PHWHERE << " DST Node is missing doing nothing" << std::endl;
0062     return Fun4AllReturnCodes::ABORTRUN;
0063   }
0064   return Fun4AllReturnCodes::EVENT_OK;
0065 }
0066 /*
0067 int StreamingLumiCheck::process_event(PHCompositeNode *topNode)
0068 {
0069   StreamingBcoInfo *streaming_bco_info = findNode::getClass<StreamingBcoInfo>(topNode, "STREAMINGBCOINFO");
0070   if (streaming_bco_info)
0071   {
0072     if (Verbosity() > 1)
0073     {
0074       std::cout << "bco : " << streaming_bco_info->get_bco() << std::endl;
0075       std::cout << "usable bco tag : " << streaming_bco_info->get_usable_bco_tag() << std::endl;
0076       std::cout << "bco streaming window : (" <<  streaming_bco_info->get_bco_streaming_window().first << ", " << streaming_bco_info->get_bco_streaming_window().second << ")" << std::endl;
0077     }
0078   }
0079   
0080   return Fun4AllReturnCodes::EVENT_OK;
0081 }
0082 */