34 int32_t
sign = prescale<0 ? -1 : 1;
35 double uprescale = fabs(prescale);
36 return sign * ( 0x1000000 - int32_t(0xFFFFFF/uprescale));
55 return (
sign * 0xFFFFFF ) / ( 0x1000000 - ucut );
72 for(
auto&
x: m_Prescales)
x=-1;
73 for(
auto&
x: m_Prescales_ctp)
x=-1;
74 for(
auto&
x: m_Prescales_float)
x=-1;
81 m_Prescales.resize(
size,-1);
82 m_Prescales_ctp.resize(
size,-1);
83 m_Prescales_float.resize(
size,-1);
84 m_Cuts.resize(
size,2<<10);
90 for(
unsigned int ctpid = 0; ctpid <
cuts.size(); ++ctpid )
91 setCut(ctpid,
cuts[ctpid]);
100 m_Prescales_float[ctpid] = ps_f;
102 const int sign = ps_f<0 ? -1 : 1;
103 int ps =
sign *
static_cast<int>(fabs(ps_f)+0.5);
105 m_Prescales[ctpid] = ps;
119 for (
auto ps: m_Prescales_ctp) {
134 for (
unsigned int i = 0;
i <
size; ++
i) {
135 m_Prescales_ctp[
i] =
p[
i];
151 for (
unsigned int i = 0;
i <
size;
i++) {
152 m_Prescales_ctp[
i] = (int64_t)
p[
i];
169 m_Prescales_ctp[
num] = prescaleValue;
179 m_Prescales_ctp[
num] = (int64_t) prescaleValue;
190 m_Prescales_ctp[
num] =
cut;
191 m_Prescales_float[
num] = prescaleValue;
199 cout <<
indent <<
"PrescaleSet ";
203 for(
auto ps: m_Prescales_float)
204 cout <<
indent <<
" ctpid=" <<
i++ <<
": " <<
" prescale=" << ps << endl;
215 indent(xmlfile, indentLevel, indentWidth)
217 <<
" name=\"" <<
name() <<
"\""
218 <<
" type=\"" <<
type() <<
"\""
219 <<
" menuPartition=\"" <<
partition() <<
"\">"
222 if(newPrescaleStyle()) {
224 for (int32_t
cut: m_Cuts) {
225 indent(xmlfile, indentLevel + 1, indentWidth)
226 <<
"<Prescale ctpid=\"" << ctpid++
227 <<
"\" cut=\"" << (
cut<0?
"-":
"") << hex << setfill(
'0') << setw(6) << abs(
cut) << setfill(
' ') << dec
233 for (
auto& ps: m_Prescales_ctp) {
235 indent(xmlfile, indentLevel + 1, indentWidth)
236 <<
"<Prescale ctpid=\"" <<
i++ <<
"\" ps=\"" << psOut.
write() <<
"\"/>" << endl;
239 indent(xmlfile, indentLevel, indentWidth)
240 <<
"</PrescaleSet>" << endl;