BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Signature.cxx
Go to the documentation of this file.
1//#ifdef HAVE_NEW_IOSTREAMS
2// #include <sstream>
3// typedef std::stringstream my_sstream;
4//#else
5// #include <strstream>
6// typedef strstream my_sstream;
7//#endif
8
9#include "HltSteerData/Signature.h"
10#include "GaudiKernel/StatusCode.h"
11
13
14/// Constructors //
16m_SignaturePrescale(1),m_SignatureForcedRate(1.),m_Id(0) {
17 m_msgSvcProvider = MessageSvcProvider::instance();
18}
19
20Signature::Signature(std::vector<HltCriteria*> vec) :
21 m_criteriaVec(vec),
22 m_SignaturePrescale(1),
23 m_SignatureForcedRate(1.),
24 m_Id(0),
25 m_Predecessor_Id(0),
26 m_Successor_Id(0)
27{
28 m_msgSvcProvider = MessageSvcProvider::instance();
29}
30
31/// Destructor //
33 int size = m_criteriaVec.size();
34 for (int i = 0; i < size; i++) delete m_criteriaVec[i];
35}
36
37/// Print method. //
39{
40 MsgStream log(m_msgSvcProvider->msgSvc(), "Signature");
41 log << MSG::INFO << "< ";
42 log << MSG::INFO << "> \t prescale " << m_SignaturePrescale
43 << " \t forcedAccept " << m_SignatureForcedRate
44 << " \t id " << m_Id << endreq;
45}
46
48 m_criteriaVec.push_back(criteria);
49}
50
51/// Returns the id //
52int Signature::id() const { return m_Id; }
53
54/// set the id //
55void Signature::setId(int id){ m_Id=id; }
56
57/// Get the forced accept rate. //
59{
60 return m_SignatureForcedRate;
61}
62
63/// Set the forced accept rate. //
65{
66 m_SignatureForcedRate = value;
67}
68
69/// Get prescale. //
71{
72 return m_SignaturePrescale;
73}
74
75/// Set prescale. //
77{
78 m_SignaturePrescale = value;
79}
80
81/// Get veto or not. //
83{
84 return m_SignatureVeto;
85}
86
87/// set veto. //
88void Signature::setVeto(bool value)
89{
90 m_SignatureVeto = value;
91}
92
94 return m_Predecessor_Id;
95}
96
98 return m_Successor_Id;
99}
100
102 m_Predecessor_Id=id;
103}
104
106 m_Successor_Id=id;
107}
108
109void Signature::setSigLabel(std::string label) {
110 m_Sig_label = label;
111}
112
113std::string Signature::label() const {
114 return m_Sig_label;
115}
116
118 int size = m_criteriaVec.size();
119 m_midMark="";
120 for (int i = 0; i < size; i++) {
121 if (m_criteriaVec[i]->satisfyCriteria()) {
122 m_result = m_criteriaVec[i]->getBehaviour();
123 std::string::size_type separator=m_result.find('_');
124 std::string perform = m_result.substr(0, separator);
125 if(perform=="continue"){
126 m_midMark = m_result.substr(separator+1);
127 }
128 else {
129 return m_criteriaVec[i]->idCriteria();
130 }
131 }
132 }
133 m_result = "";
134 return -1;
135}
136
void setForcedAccept(float)
Set the forced accept rate. //.
Definition: Signature.cxx:64
bool isVeto() const
Get veto or not. //.
Definition: Signature.cxx:82
void setSigLabel(std::string label)
Definition: Signature.cxx:109
float forcedAccept() const
Get the forced accept rate. //.
Definition: Signature.cxx:58
int isCriteriaMatched()
For trigger.
Definition: Signature.cxx:117
void makeVectors(HltCriteria *criteria)
Definition: Signature.cxx:47
int prescale() const
Get prescale. //.
Definition: Signature.cxx:70
int id() const
Returns the id //.
Definition: Signature.cxx:52
Signature()
Constructors //.
Definition: Signature.cxx:15
std::string label() const
Definition: Signature.cxx:113
virtual ~Signature()
Destructor //.
Definition: Signature.cxx:32
void setVeto(bool)
set veto. //
Definition: Signature.cxx:88
void print()
Print method. //.
Definition: Signature.cxx:38
void setPrescale(int)
Set prescale. //.
Definition: Signature.cxx:76
void setId(int)
set the id //
Definition: Signature.cxx:55
static MessageSvcProvider * instance()
dble_vec_t vec[12]
Definition: ranlxd.c:372