Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "GL1TriggerSelect.h"
0002 
0003 // Calo 
0004 #include <phool/getClass.h>
0005 #include <phool/phool.h>  // for PHWHERE
0006 #include <fun4all/Fun4AllReturnCodes.h>
0007 #include <ffarawobjects/Gl1Packet.h>
0008 
0009 #include <cassert>
0010 #include <cmath>  // for log10, pow, sqrt, abs, M_PI
0011 #include <cstdint>
0012 #include <iostream>  // for operator<<, endl, basic_...
0013 #include <limits>
0014 #include <map>  // for operator!=, _Rb_tree_con...
0015 #include <string>
0016 #include <utility>  // for pair
0017 
0018 GL1TriggerSelect::GL1TriggerSelect(const std::string& name)
0019 : SubsysReco(name)
0020 {                       
0021 
0022 }
0023 
0024 GL1TriggerSelect::~GL1TriggerSelect()
0025 {
0026   
0027 }
0028 
0029 int GL1TriggerSelect::Init(PHCompositeNode* /*unused*/)
0030 {
0031 
0032   return Fun4AllReturnCodes::EVENT_OK;
0033 }
0034 
0035 int GL1TriggerSelect::process_event(PHCompositeNode* topNode)
0036 {
0037   _eventcounter++;  
0038   //  std::cout << "In process_event" << std::endl;
0039 
0040   Gl1Packet *gl1PacketInfo = findNode::getClass<Gl1Packet>(topNode, "GL1Packet");
0041   if (!gl1PacketInfo)
0042   {
0043     std::cout << PHWHERE << "GL1TriggerSelect::process_event: GL1Packet node is missing" << std::endl;
0044     return Fun4AllReturnCodes::ABORTRUN;
0045   }
0046   
0047 
0048   uint64_t triggervec = gl1PacketInfo->getScaledVector();
0049 
0050   for (auto &bit: m_triggerbits)
0051     {
0052       if (((triggervec >> bit) & 0x1U) == 0x1U)
0053     {
0054       return Fun4AllReturnCodes::EVENT_OK;
0055     }
0056     }
0057 
0058   return Fun4AllReturnCodes::ABORTEVENT;
0059   
0060   
0061   
0062 }
0063 
0064 int GL1TriggerSelect::End(PHCompositeNode* /*unused*/) 
0065 {
0066   return Fun4AllReturnCodes::EVENT_OK;
0067 }