34 int32_t
sign = prescale<0 ? -1 : 1;
35 double uprescale = fabs(prescale);
36 return sign * ( 0x1000000 - int32_t(0xFFFFFF/uprescale));
53 double sign = cut<0 ? -1 : 1;
54 uint32_t ucut = abs(cut);
55 return (
sign * 0xFFFFFF ) / ( 0x1000000 - ucut );
90 for(
unsigned int ctpid = 0; ctpid <
cuts.size(); ++ctpid )
102 const int sign = ps_f<0 ? -1 : 1;
103 int ps =
sign *
static_cast<int>(fabs(ps_f)+0.5);
134 for (
unsigned int i = 0; i < size; ++i) {
151 for (
unsigned int i = 0; i < size; i++) {
199 cout <<
indent <<
"PrescaleSet ";
204 cout <<
indent <<
" ctpid=" << i++ <<
": " <<
" prescale=" << ps << endl;
217 <<
" name=\"" <<
name() <<
"\""
218 <<
" type=\"" <<
type() <<
"\""
219 <<
" menuPartition=\"" <<
partition() <<
"\">"
224 for (int32_t cut:
m_Cuts) {
226 <<
"<Prescale ctpid=\"" << ctpid++
227 <<
"\" cut=\"" << (cut<0?
"-":
"") << hex << setfill(
'0') << setw(6) << abs(cut) << setfill(
' ') << dec
236 <<
"<Prescale ctpid=\"" << i++ <<
"\" ps=\"" << psOut.
write() <<
"\"/>" << endl;
240 <<
"</PrescaleSet>" << endl;
std::string write()
Writes nicely the ps value.
float getFloatPrescale() const
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
const std::string & type() const
void setPrescale(unsigned int num, int64_t prescaleValue) __attribute__((deprecated))
Set the prescale NUM from the int64 value prescaleValue.
void setCuts(const std::vector< int32_t > &cuts)
bool newPrescaleStyle() const
const std::vector< int > & prescales() const __attribute__((deprecated))
virtual void print(const std::string &indent="", unsigned int detail=1) const override
void setPrescales(const std::vector< int64_t > &) __attribute__((deprecated))
DEPRECATED.
void setCut(unsigned int num, int32_t cut)
const std::vector< int32_t > & cuts() const
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
static const int32_t maxPrescaleCut
std::vector< int32_t > m_Cuts
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
std::vector< float > m_Prescales_float
std::vector< int > m_Prescales
std::vector< int64_t > m_Prescales_ctp
std::ostream & indent(std::ostream &o, int lvl, int size) const
void printNameIdV(const std::string &indent="") const
static std::vector< std::string > xmlfile
Forward iterator to traverse the main components of the trigger configuration.
DataModel_detail::iterator< DVL > partition(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of partition for DataVector/List.