30 m_Active(thr.m_Active),
31 m_Mapping(thr.m_Mapping),
32 m_CableName(thr.m_CableName),
33 m_CableCtpin(thr.m_CableCtpin),
34 m_CableConnector(thr.m_CableConnector),
35 m_CableStart(thr.m_CableStart),
36 m_CableEnd(thr.m_CableEnd),
38 m_ThresholdNumber(thr.m_ThresholdNumber),
39 m_ZBSeedingThresholdName(thr.m_ZBSeedingThresholdName),
40 m_ZBSeedingThresholdMulti(thr.m_ZBSeedingThresholdMulti),
41 m_BCDelay(thr.m_BCDelay),
42 m_Bitnum(thr.m_Bitnum),
51 clearThresholdValues();
71 throw runtime_error(
"Threshold input must be either 'ctpin' or 'ctpcore' but value was '"+
input+
"'" );
86 float eta =
float(eta_i)+0.5;
87 float phi =
float(phi_i)+0.5;
91 if( thrV->contains(eta, phi) ) {
93 if( ttv != 0 && ttv->
priority()==thrV->priority() ) {
94 cerr <<
"TriggerThreshold '" <<
name() <<
"' has overlapping values of same priority at eta = "
95 << eta <<
", phi = " << phi << endl;
96 throw runtime_error(
"Overlapping thresholdValues of the same priority" );
98 if( ttv==0 || ttv->
priority()<thrV->priority() ) {
104 cerr <<
"TriggerThreshold::triggerThresholdValue: did not find threshold value at eta = "
105 << eta <<
", phi = " << phi <<
" for threshold " <<
name() << endl;
106 throw runtime_error(
"Did not find threshold value" );
113 std::vector<TrigConf::TriggerThresholdValue*>&
115 return m_TriggerThresholdValueVector;
120 m_TriggerThresholdValueVector.push_back(
value);
127 addThresholdValue(thrV);
135 if (
type == L1DataDef::muonType()) {
137 }
else if (
type == L1DataDef::emType() ||
138 type == L1DataDef::tauType()) {
141 type == L1DataDef::jbType() ||
142 type == L1DataDef::jfType()) {
144 }
else if (
type == L1DataDef::xeType() ||
145 type == L1DataDef::jeType() ||
146 type == L1DataDef::teType()) {
148 }
else if (
type== L1DataDef::xsType() ) {
153 type == L1DataDef::bptxType() ) {
156 cout <<
"TriggerThreshold::createThresholdValue: ERROR Unknown trigger value type: " <<
type << endl;
157 throw std::runtime_error(
"TriggerThreshold::createThresholdValue: Unknown trigger value type.");
166 m_TriggerThresholdValueVector.clear();
171 cout <<
indent <<
"TriggerThreshold " <<
name() << endl;
175 cout <<
indent <<
"==================================" << endl;
176 cout <<
indent <<
"TriggerThreshold "; printNameIdV(
indent);
178 cout <<
indent <<
" Type: " <<
type() << endl;
180 cout <<
indent <<
" seed: " << m_ZBSeedingThresholdName << endl;
181 cout <<
indent <<
" seed multi: " << m_ZBSeedingThresholdMulti << endl;
182 cout <<
indent <<
" BC delay: " << m_BCDelay << endl;
184 cout <<
indent <<
" active: " << m_Active << endl;
185 cout <<
indent <<
" mapping " << m_Mapping << endl;
186 cout <<
indent <<
" number of values: " << numberofValues() << endl;
187 cout <<
indent <<
" cable name: " << m_CableName << endl;
188 cout <<
indent <<
" cable ctpin: " << m_CableCtpin << endl;
189 cout <<
indent <<
" cable connector: " << m_CableConnector << endl;
190 cout <<
indent <<
" cable start: " << m_CableStart << endl;
191 cout <<
indent <<
" cable end: " << m_CableEnd << endl;
192 cout <<
indent <<
" threshold number: " << m_ThresholdNumber << endl;
193 for(
unsigned int i=0;
i < m_TriggerThresholdValueVector.size();
i++)
203 if(
x->priority() !=
y->priority())
204 return x->priority() <
y->priority();
205 if(
x->etamin() !=
y->etamin())
206 return x->etamin() <
y->etamin();
207 return x->name() <
y->name();
215 indent(xmlfile, indentLevel, indentWidth)
216 <<
"<TriggerThreshold active=\"" << m_Active
217 <<
"\" bitnum=\"" << bitnum()
218 <<
"\" id=\"" <<
id()
219 <<
"\" mapping=\"" << m_Mapping
220 <<
"\" name=\"" <<
name()
221 <<
"\" type=\"" <<
type()
222 <<
"\" input=\"" <<
input();
225 xmlfile <<
"\" seed=\"" << m_ZBSeedingThresholdName
226 <<
"\" seed_multi=\"" << m_ZBSeedingThresholdMulti
227 <<
"\" bcdelay=\"" << m_BCDelay;
229 xmlfile <<
"\" version=\"" <<
version() <<
"\">" << endl;
231 auto sortedThresholdValues = m_TriggerThresholdValueVector;
232 sort(sortedThresholdValues.begin(),sortedThresholdValues.end(),compThrValues);
235 thrV->writeXML(xmlfile, indentLevel+1, indentWidth);
237 if(m_CableName!=
"") {
238 if(
input()==
"ctpin") {
239 indent(xmlfile, indentLevel+1, indentWidth)
240 <<
"<Cable connector=\"" << m_CableConnector <<
"\" input=\"" << m_CableCtpin <<
"\" name=\"" << m_CableName <<
"\">" << endl;
241 indent(xmlfile, indentLevel+2, indentWidth)
242 <<
"<Signal range_begin=\"" << m_CableStart <<
"\" range_end=\"" << m_CableEnd <<
"\"/>" << endl;
244 indent(xmlfile, indentLevel+1, indentWidth)
245 <<
"<Cable connector=\"" << m_CableConnector <<
"\" input=\"" << m_CableCtpin <<
"\" name=\"" << m_CableName <<
"\">" << endl;
246 indent(xmlfile, indentLevel+2, indentWidth)
247 <<
"<Signal range_begin=\"" << m_CableStart <<
"\" range_end=\"" << m_CableEnd <<
"\" clock=\"" << m_Clock <<
"\"/>" << endl;
249 indent(xmlfile, indentLevel+1, indentWidth) <<
"</Cable>" << endl;
252 indent(xmlfile, indentLevel, indentWidth)
253 <<
"</TriggerThreshold>" << endl;