ATLAS Offline Software
VP1TriggerDecisionChannel.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Implementation of class VP1TriggerDecisionChannel //
8 // Weiyi Zhang <wyizhang@cern.ch> //
9 // June 18 2007 //
10 //
11 // Major Updates:
12 // - 2022/03, Riccardo Maria BIANCHI <riccardo.maria.bianchi@cern.ch>
13 //
15 
17 #include "ui_trigdecchannelwidgetform.h"
19 #include <QLabel>
20 
21 //_________________________________________________________
24  "This channel simply shows the trigger decision, provided by the VP1TrigDecSystem.",
25  "wyizhang@cern.ch, Riccardo.Maria.Bianchi@cern.ch"),
26  m_tableWidget(0)
27 {
28 }
29 
31 {
32 }
33 
34 //_________________________________________________________
36 {
39 
40  connect(m_trigdecsystem.get(),SIGNAL(entriesChanged(const QStringList&,const QStringList&)),
41  this, SLOT( entriesChanged(const QStringList&,const QStringList&)) );
42 }
43 
44 //_________________________________________________________
46 {
47 
48  //Setup this widget
49  Ui::TrigDecChannelWidgetForm ui;
50  ui.setupUi(this);
51  m_tableWidget=ui.tableWidget;
52  m_tableWidget->setColumnCount(2);
53  m_tableWidget->setHorizontalHeaderLabels((QStringList()<<"Signature"<<"Passed?"));
54  m_tableWidget->setAlternatingRowColors ( true );
55  m_tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
56 
57  connect(m_tableWidget,SIGNAL(cellActivated(int,int)),this,SLOT(cellActivated(int,int)));
58 }
59 
60 //_________________________________________________________
61 void VP1TriggerDecisionChannel::entriesChanged( const QStringList& entry_key,const QStringList& entry_type )
62 {
63  clearAll();
64 
65  if (entry_key.count()!=entry_type.count())
66  {
67  message("Error: Received data has wrong format!");
68  return;
69  }
70 
71  m_tableWidget->setUpdatesEnabled(false);
72 
73  //Turn sorting off while inserting (otherwise the correct row index to use will likely change in the middle of insertions):
74  m_tableWidget->setSortingEnabled(false);
75 
76  for (int irow = 0; irow<entry_key.count();++irow)
77  {
78  m_tableWidget->insertRow ( irow );
79  m_tableWidget->setItem(irow, 0, new QTableWidgetItem(entry_key.at(irow)));
80  m_tableWidget->setItem(irow, 1, new QTableWidgetItem(entry_type.at(irow)));
81  }
82 
83  m_tableWidget->setSortingEnabled(true);
84  m_tableWidget->resizeColumnsToContents();
85  m_tableWidget->resizeRowsToContents();
86  m_tableWidget->setUpdatesEnabled(true);
87 }
88 
89 //_________________________________________________________
91 {
92  clearAll();
93 }
94 
95 //_________________________________________________________
97 {
98 
99 }
100 
101 //_________________________________________________________
103 {
104  m_tableWidget->setUpdatesEnabled(false);
105  m_tableWidget->setSortingEnabled(false);
106  m_tableWidget->clearContents();
107 
108  while (m_tableWidget->rowCount()>0)
109  m_tableWidget->removeRow(m_tableWidget->rowCount()-1);
110  m_tableWidget->setUpdatesEnabled(true);
111 
112 }
113 
114 //_________________________________________________________
116 {
117  QString key = m_tableWidget->item(row,0)->text();
118  QString type = m_tableWidget->item(row,1)->text();
119 
120  QStringList info = m_trigdecsystem->getInfoForEntry(key,type);
121 
122  message("===== "+key+" ("+(type.isEmpty()? 0 :type)+"):");
123 
124  for (QString line : info)
125  message(line);
126 
127 }
grepfile.info
info
Definition: grepfile.py:38
IVP1ChannelWidget::registerSystem
void registerSystem(IVP1System *)
Definition: IVP1ChannelWidget.cxx:221
VP1TriggerDecisionChannel::create
void create()
Definition: VP1TriggerDecisionChannel.cxx:45
query_example.row
row
Definition: query_example.py:24
VP1TriggerDecisionChannel::systemErased
void systemErased(IVP1System *)
Definition: VP1TriggerDecisionChannel.cxx:90
checkFileSG.line
line
Definition: checkFileSG.py:75
VP1TriggerDecisionChannel::~VP1TriggerDecisionChannel
virtual ~VP1TriggerDecisionChannel()
Definition: VP1TriggerDecisionChannel.cxx:30
VP1TriggerDecisionChannel.h
VP1TriggerDecisionChannel
Definition: VP1TriggerDecisionChannel.h:26
VP1TriggerDecisionChannel::VP1TriggerDecisionChannel
VP1TriggerDecisionChannel()
Definition: VP1TriggerDecisionChannel.cxx:22
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1TriggerDecisionChannel::clearAll
void clearAll()
Definition: VP1TriggerDecisionChannel.cxx:102
VP1CHANNELNAMEINPLUGIN
#define VP1CHANNELNAMEINPLUGIN(cls, nme)
Definition: IVP1ChannelWidget.h:139
VP1TriggerDecisionChannel::entriesChanged
void entriesChanged(const QStringList &entry_key, const QStringList &entry_type)
Definition: VP1TriggerDecisionChannel.cxx:61
IVP1System
Definition: IVP1System.h:36
VP1TriggerDecisionChannel::systemRefreshed
void systemRefreshed(IVP1System *)
Definition: VP1TriggerDecisionChannel.cxx:96
VP1TriggerDecisionChannel::type
Type type() const
Definition: VP1TriggerDecisionChannel.h:34
IVP1ChannelWidget::message
void message(QString)
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
VP1TriggerDecisionChannel::m_trigdecsystem
std::unique_ptr< VP1TriggerDecisionSystem > m_trigdecsystem
Definition: VP1TriggerDecisionChannel.h:46
VP1TriggerDecisionChannel::cellActivated
void cellActivated(int row, int column)
Definition: VP1TriggerDecisionChannel.cxx:115
VP1TriggerDecisionSystem
Definition: VP1TriggerDecisionSystem.h:22
VP1TriggerDecisionSystem.h
VP1TriggerDecisionChannel::init
void init()
Definition: VP1TriggerDecisionChannel.cxx:35
VP1TriggerDecisionChannel::m_tableWidget
QTableWidget * m_tableWidget
Definition: VP1TriggerDecisionChannel.h:44
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37