ATLAS Offline Software
VP1TriggerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***********************************************************************************
6  * @Package : VP1TriggerSystems
7  * @Class : VP1TriggerTool
8  *
9  * @brief : VP1 Trigger Tool - public access tool to retrieve trigger data
10  *
11  * @author : Manuel Proissl <mproissl@cern.ch> - University of Edinburgh
12  ***********************************************************************************/
13 
14 //Local includes
17 
18 //Other includes
19 #include <iostream>
20 #include <string>
21 #include <vector>
22 #include <map>
23 #include <stdio.h>
24 
25 
26 //Trigger System Constructor
27 //_____________________________________________________________________________________________
29  : Logger("VP1TriggerTool"),
30  m_status(false)
31 {
32  //Initialize VP1TriggerProcessor
33  log_info("Initializing VP1Trig::VP1TriggerProcessor");
36 }
37 
38 
39 //Trigger System Destructor
40 //_____________________________________________________________________________________________
42 {
43  log_verbose("destructor");
44  delete m_triggerprocessor;
45 }
46 
47 
48 //Load Trigger Data from StoreGate (after new event loaded)
49 //_____________________________________________________________________________________________
51 {
52  if(m_status)
53  clear();
54 
55  log_info("Load trigger data from StoreGate");
56  if(m_triggerprocessor->getInitStatus()) {
57  m_triggerprocessor->loadData(storeGate);
58  m_status=true;
59  log_info("Successfully retrieved the VP1TriggerTool!");
60  }
61  else {
62  m_status=false;
63  log_error("VP1Trig::VP1TriggerProcessor not initialized!");
64  }
65 }
66 
67 
68 //Clear Trigger System (before new event loaded)
69 //_____________________________________________________________________________________________
71 {
72  log_verbose("Clear system-wide allocated memory");
73  m_status=false;
74  m_triggerprocessor->clearSystem();
75 }
76 
77 
78 //#############################################################################################
79 // USER INTERFACE TO TRIGGER DATA
80 //#############################################################################################
81 
82 
83 //Return System Status
84 //_____________________________________________________________________________________________
86 {
87  log_verbose("Requesting DAQ status from VP1Trig::VP1TriggerProcessor");
88  if(m_status && m_triggerprocessor->getDaqStatus())
89  return true;
90  return false;
91 }
92 
93 
94 //Set trigger level flag to process its data
95 //--- Note: has to be called before new event loaded, which means before system ---
96 //--- refresh(), e.g. at the particular channel init() or create(). ---
97 //--- Default: [ALL] trigger levels; set by constructor. ---
98 //_____________________________________________________________________________________________
100 {
101  log_verbose("Presetting trigger level flag in VP1Trig::VP1TriggerProcessor");
102  m_triggerprocessor->setTrigLvl(triglvl);
103 }
104 
105 
106 //Get trigger level flag to process its data
107 //_____________________________________________________________________________________________
109 {
110  log_verbose("Requesting preset trigger level flag from VP1Trig::VP1TriggerProcessor");
111  return m_triggerprocessor->getTrigLvl();
112 }
113 
114 
115 //Set data container format to store trigger data
116 //--- Note: has to be called before new event loaded, which means before system ---
117 //--- refresh(), e.g. at the particular channel init() or create(). ---
118 //--- Default: [v]ector format; set by constructor. ---
119 //_____________________________________________________________________________________________
121 {
122  //Container IDs: [v]ector, [q]tree, [a]ll available
123  log_verbose("Presetting data format in VP1Trig::VP1TriggerProcessor");
124  m_triggerprocessor->setDataFormat(ctnid);
125 }
126 
127 
128 //Get data container format to store trigger data
129 //_____________________________________________________________________________________________
131 {
132  log_verbose("Requesting preset data format from VP1Trig::VP1TriggerProcessor");
133  return m_triggerprocessor->getDataFormat();
134 }
135 
136 
137 //Get number of muons in event
138 //_____________________________________________________________________________________________
140 {
141  log_verbose("Requesting number of muons from VP1Trig::VP1TriggerProcessor");
142  return m_triggerprocessor->getMuonsInEvt();
143 }
144 
145 
146 //Get trigger data in QTree container format
147 //_____________________________________________________________________________________________
148 QList<QTreeWidgetItem *> VP1Trig::VP1TriggerTool::getTriggerData_QTree(QString triglvl)
149 {
150  log_verbose("Requesting data in QTree format from VP1Trig::VP1TriggerProcessor");
151  return m_triggerprocessor->getQTrigData(triglvl);
152 }
VP1Trig::Logger
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h:32
VP1Trig::VP1TriggerTool::VP1TriggerTool
VP1TriggerTool()
Definition: VP1TriggerTool.cxx:28
VP1Trig::VP1TriggerTool::isReady
bool isReady()
Definition: VP1TriggerTool.cxx:85
VP1Trig::VP1TriggerProcessor::initialize
void initialize()
Definition: VP1TriggerProcessor.cxx:58
VP1Trig::VP1TriggerTool::getDataContainerFormat
char getDataContainerFormat()
Definition: VP1TriggerTool.cxx:130
VP1Trig::VP1TriggerTool::getTriggerData_QTree
QList< QTreeWidgetItem * > getTriggerData_QTree(QString)
Definition: VP1TriggerTool.cxx:148
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
VP1Trig::VP1TriggerTool::getTrigLvlToProcess
QString getTrigLvlToProcess()
Definition: VP1TriggerTool.cxx:108
VP1Trig::VP1TriggerTool::~VP1TriggerTool
virtual ~VP1TriggerTool()
Definition: VP1TriggerTool.cxx:41
VP1Trig::VP1TriggerTool::getMuonCount
int getMuonCount()
Definition: VP1TriggerTool.cxx:139
VP1Trig::VP1TriggerTool::m_triggerprocessor
VP1TriggerProcessor * m_triggerprocessor
Definition: VP1TriggerTool.h:72
VP1Trig::VP1TriggerProcessor
Definition: VP1TriggerProcessor.h:40
VP1Trig::Logger::log_info
void log_info(const QString &msg)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:32
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
VP1Trig::VP1TriggerTool::setDataContainerFormat
void setDataContainerFormat(char ctnid)
Definition: VP1TriggerTool.cxx:120
VP1Trig::VP1TriggerTool::process
void process(StoreGateSvc *storeGate)
Definition: VP1TriggerTool.cxx:50
VP1Trig::VP1TriggerTool::setTrigLvlToProcess
void setTrigLvlToProcess(QString triglvl)
Definition: VP1TriggerTool.cxx:99
VP1TriggerProcessor.h
VP1TriggerTool.h
python.PyKernel.storeGate
storeGate
Definition: PyKernel.py:40
VP1Trig::VP1TriggerTool::clear
void clear()
Definition: VP1TriggerTool.cxx:70