ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::PrescaleSet Class Reference

#include <PrescaleSet.h>

Inheritance diagram for TrigConf::PrescaleSet:
Collaboration diagram for TrigConf::PrescaleSet:

Public Member Functions

 PrescaleSet ()=default
virtual ~PrescaleSet () override=default
bool isNull () const
const std::string & type () const
unsigned int partition () const
const std::vector< int64_t > & prescales_ctp () const
const std::vector< float > & prescales_float () const
const std::vector< int32_t > & cuts () const
void setType (const std::string &type)
void setPartition (unsigned int partition)
void resize (size_t size)
void setPrescale (unsigned int num, float prescaleValue)
void setCuts (const std::vector< int32_t > &cuts)
void setCut (unsigned int num, int32_t cut)
void reset ()
virtual void print (const std::string &indent="", unsigned int detail=1) const override
void writeXML (std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
 Writes the Prescale item to the XML file.
unsigned int lvl1MasterTableId () const
void setLvl1MasterTableId (unsigned int id)
int superMasterTableId () const
unsigned int smk () const
unsigned int id () const
const std::string & name () const
const std::string & comment () const
unsigned int version () const
void setSuperMasterTableId (int id)
void setSMK (int id)
void setId (unsigned int id)
void setName (const std::string &name)
void setVersion (unsigned int version)
void setComment (const std::string &c)
void printNameIdV (const std::string &indent="") const
virtual std::string __str__ () const

Static Public Member Functions

static int32_t getCutFromPrescale (double prescale)
 calculate cut value for hardware configuration cut = 2*24/prescale - 1
static double getPrescaleFromCut (int32_t cut)
 prescale = 2*24/(cut+1.)

Static Public Attributes

static const int32_t maxPrescaleCut = 0xFFFFFF

Protected Member Functions

std::ostream & indent (std::ostream &o, int lvl, int size) const

Private Attributes

bool m_null {true}
std::string m_Type {"Physics"}
unsigned int m_Partition {0}
std::vector< int64_t > m_Prescales_ctp
std::vector< float > m_Prescales_float
std::vector< int32_t > m_Cuts
unsigned int m_Lvl1MasterId
unsigned int m_smk
unsigned int m_id
std::string m_name
unsigned int m_version
std::string m_comment

Detailed Description

Definition at line 23 of file PrescaleSet.h.

Constructor & Destructor Documentation

◆ PrescaleSet()

TrigConf::PrescaleSet::PrescaleSet ( )
default

◆ ~PrescaleSet()

virtual TrigConf::PrescaleSet::~PrescaleSet ( )
overridevirtualdefault

Member Function Documentation

◆ __str__()

string TrigConfData::__str__ ( ) const
virtualinherited

Reimplemented in TrigConf::HLTChain, TrigConf::HLTPrescaleSet, TrigConf::HLTSequence, and TrigConf::TriggerItem.

Definition at line 50 of file TrigConfData.cxx.

50 {
51 stringstream s;
52 s << *this;
53 return s.str();
54}

◆ comment()

const std::string & TrigConf::TrigConfData::comment ( ) const
inlineinherited

Definition at line 23 of file TrigConfData.h.

23{return m_comment;}

◆ cuts()

const std::vector< int32_t > & TrigConf::PrescaleSet::cuts ( ) const
inline

Definition at line 41 of file PrescaleSet.h.

41{ return m_Cuts; }
std::vector< int32_t > m_Cuts
Definition PrescaleSet.h:67

◆ getCutFromPrescale()

int32_t PrescaleSet::getCutFromPrescale ( double prescale)
static

calculate cut value for hardware configuration cut = 2*24/prescale - 1

prescale = 1 --> C = 2*24-1 prescale = 2 --> C = 2*23-1 prescale = 10 --> C = 1677720 prescale = 1024 --> C = 2*14-1 prescale = 50 --> C = 335543 prescale = 500 --> C = 33553 prescale = 5000 --> C = 3354 prescale = 50000 --> C = 334

Definition at line 30 of file PrescaleSet.cxx.

30 {
31 int32_t sign = prescale<0 ? -1 : 1;
32 double uprescale = fabs(prescale);
33 return sign * ( 0x1000000 - int32_t(0xFFFFFF/uprescale));
34}
int sign(int a)

◆ getPrescaleFromCut()

double PrescaleSet::getPrescaleFromCut ( int32_t cut)
static

prescale = 2*24/(cut+1.)

cut = 2*24-1 --> prescale = 1 cut = 2*23-1 --> prescale = 2 cut = 1677720 --> prescale = 10.000002980233305 cut = 2*14-1 --> prescale = 1024 cut = 335543 --> prescale = 50.0000447035 cut = 33553 --> prescale = 500.006407582 cut = 3354 --> prescale = 5000.66020864
cut = 334 --> prescale = 50081.238806

Definition at line 49 of file PrescaleSet.cxx.

49 {
50 double sign = cut<0 ? -1 : 1;
51 uint32_t ucut = abs(cut);
52 return (sign * 0xFFFFFF ) / ( 0x1000000 - ucut );
53}
setEventNumber uint32_t

◆ id()

unsigned int TrigConf::TrigConfData::id ( ) const
inlineinherited

Definition at line 21 of file TrigConfData.h.

21{return m_id;}

◆ indent()

std::ostream & TrigConfData::indent ( std::ostream & o,
int lvl,
int size ) const
protectedinherited

Definition at line 23 of file TrigConfData.cxx.

23 {
24 int width = lvl*size;
25 if(width==0) return o;
26 o << setw(lvl*size) << " ";
27 return o;
28}
size_t size() const
Number of registered mappings.
const double width

◆ isNull()

bool TrigConf::PrescaleSet::isNull ( ) const
inline

Definition at line 36 of file PrescaleSet.h.

36{ return m_null; }

◆ lvl1MasterTableId()

unsigned int TrigConf::L1DataBaseclass::lvl1MasterTableId ( ) const
inlineinherited

Definition at line 30 of file L1DataBaseclass.h.

30{ return m_Lvl1MasterId; }

◆ name()

const std::string & TrigConf::TrigConfData::name ( ) const
inlineinherited

Definition at line 22 of file TrigConfData.h.

22{return m_name;}

◆ partition()

unsigned int TrigConf::PrescaleSet::partition ( ) const
inline

Definition at line 38 of file PrescaleSet.h.

38{ return m_Partition; }
unsigned int m_Partition
Definition PrescaleSet.h:64

◆ prescales_ctp()

const std::vector< int64_t > & TrigConf::PrescaleSet::prescales_ctp ( ) const
inline

Definition at line 39 of file PrescaleSet.h.

39{ return m_Prescales_ctp; }
std::vector< int64_t > m_Prescales_ctp
Definition PrescaleSet.h:65

◆ prescales_float()

const std::vector< float > & TrigConf::PrescaleSet::prescales_float ( ) const
inline

Definition at line 40 of file PrescaleSet.h.

40{ return m_Prescales_float; }
std::vector< float > m_Prescales_float
Definition PrescaleSet.h:66

◆ print()

void TrigConf::PrescaleSet::print ( const std::string & indent = "",
unsigned int detail = 1 ) const
overridevirtual

Implements TrigConf::TrigConfData.

Definition at line 94 of file PrescaleSet.cxx.

94 {
95 if(detail>=1) {
96 std::cout << indent << "PrescaleSet ";
97 printNameIdV("");
98 if(detail>=3) {
99 int i(0);
100 for( auto ps: m_Prescales_float)
101 std::cout << indent << " ctpid=" << i++ << ": " << " prescale=" << ps << std::endl;
102 }
103 }
104}
std::ostream & indent(std::ostream &o, int lvl, int size) const
void printNameIdV(const std::string &indent="") const

◆ printNameIdV()

void TrigConfData::printNameIdV ( const std::string & indent = "") const
inherited

Definition at line 31 of file TrigConfData.cxx.

31 {
32 cout << indent << name();
33 if(id()>0 || version()>0)
34 cout << " (id=" << id() << "/v=" << version() << ")";
35 cout << endl;
36 if(comment()!="")
37 cout << indent << "Comment: " << comment() << endl;
38}
unsigned int id() const
const std::string & name() const
const std::string & comment() const
unsigned int version() const

◆ reset()

void TrigConf::PrescaleSet::reset ( )

Definition at line 55 of file PrescaleSet.cxx.

55 {
56 for(auto& x: m_Prescales_ctp) x=-1;
57 for(auto& x: m_Prescales_float) x=-1;
58 for(auto& x: m_Cuts) x=-maxPrescaleCut;
59 m_null = true;
60}
#define x
static const int32_t maxPrescaleCut
Definition PrescaleSet.h:26

◆ resize()

void TrigConf::PrescaleSet::resize ( size_t size)

Definition at line 63 of file PrescaleSet.cxx.

63 {
64 m_Prescales_ctp.resize(size,-1);
65 m_Prescales_float.resize(size,-1);
66 m_Cuts.resize(size,2<<10);
67}

◆ setComment()

void TrigConf::TrigConfData::setComment ( const std::string & c)
inlineinherited

Definition at line 32 of file TrigConfData.h.

◆ setCut()

void TrigConf::PrescaleSet::setCut ( unsigned int num,
int32_t cut )

Definition at line 77 of file PrescaleSet.cxx.

77 {
78 m_Cuts[ctpid] = cut;
80 m_null = false;
81}
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)

◆ setCuts()

void TrigConf::PrescaleSet::setCuts ( const std::vector< int32_t > & cuts)

Definition at line 70 of file PrescaleSet.cxx.

70 {
71 for(unsigned int ctpid = 0; ctpid < cuts.size(); ++ctpid )
72 setCut(ctpid, cuts[ctpid]);
73}
void setCut(unsigned int num, int32_t cut)
const std::vector< int32_t > & cuts() const
Definition PrescaleSet.h:41

◆ setId()

void TrigConf::TrigConfData::setId ( unsigned int id)
inlineinherited

Definition at line 29 of file TrigConfData.h.

29{ m_id=id; }

◆ setLvl1MasterTableId()

void TrigConf::L1DataBaseclass::setLvl1MasterTableId ( unsigned int id)
inlineinherited

Definition at line 31 of file L1DataBaseclass.h.

31{ m_Lvl1MasterId = id; }

◆ setName()

void TrigConf::TrigConfData::setName ( const std::string & name)
inlineinherited

Definition at line 30 of file TrigConfData.h.

30{ m_name = name;}

◆ setPartition()

void TrigConf::PrescaleSet::setPartition ( unsigned int partition)
inline

Definition at line 45 of file PrescaleSet.h.

unsigned int partition() const
Definition PrescaleSet.h:38

◆ setPrescale()

void TrigConf::PrescaleSet::setPrescale ( unsigned int num,
float prescaleValue )

Definition at line 85 of file PrescaleSet.cxx.

85 {
86 int32_t cut = getCutFromPrescale(prescaleValue);
88 m_Prescales_float[num] = prescaleValue;
89 m_null = false;
90}
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1

◆ setSMK()

void TrigConf::TrigConfData::setSMK ( int id)
inlineinherited

Definition at line 28 of file TrigConfData.h.

28{m_smk=id;}

◆ setSuperMasterTableId()

void TrigConf::TrigConfData::setSuperMasterTableId ( int id)
inlineinherited

Definition at line 27 of file TrigConfData.h.

27{m_smk=id;}

◆ setType()

void TrigConf::PrescaleSet::setType ( const std::string & type)
inline

Definition at line 44 of file PrescaleSet.h.

44{ m_Type = type; }
const std::string & type() const
Definition PrescaleSet.h:37

◆ setVersion()

void TrigConf::TrigConfData::setVersion ( unsigned int version)
inlineinherited

Definition at line 31 of file TrigConfData.h.

◆ smk()

unsigned int TrigConf::TrigConfData::smk ( ) const
inlineinherited

Definition at line 20 of file TrigConfData.h.

20{return m_smk;}

◆ superMasterTableId()

int TrigConf::TrigConfData::superMasterTableId ( ) const
inlineinherited

Definition at line 19 of file TrigConfData.h.

19{return (int)m_smk;}

◆ type()

const std::string & TrigConf::PrescaleSet::type ( ) const
inline

Definition at line 37 of file PrescaleSet.h.

37{ return m_Type; }

◆ version()

unsigned int TrigConf::TrigConfData::version ( ) const
inlineinherited

Definition at line 24 of file TrigConfData.h.

24{return m_version;}

◆ writeXML()

void TrigConf::PrescaleSet::writeXML ( std::ostream & xmlfile,
int indentLevel = 0,
int indentWidth = 2 ) const

Writes the Prescale item to the XML file.

Definition at line 110 of file PrescaleSet.cxx.

110 {
111 L1PSNumber psOut;
112 indent(xmlfile, indentLevel, indentWidth)
113 << "<PrescaleSet"
114 << " name=\"" << name() << "\""
115 << " type=\"" << type() << "\""
116 << " menuPartition=\"" << partition() << "\">"
117 << std::endl;
118
119 int ctpid(0);
120 for (int32_t cut: m_Cuts) {
121 indent(xmlfile, indentLevel + 1, indentWidth)
122 << "<Prescale ctpid=\"" << ctpid++
123 << "\" cut=\"" << (cut<0?"-":"") << std::hex << std::setfill('0') << std::setw(6) << abs(cut)
124 << std::setfill(' ') << std::dec << "\" value=\"" << getPrescaleFromCut(cut)
125 << "\"/>" << std::endl;
126 }
127 indent(xmlfile, indentLevel, indentWidth)
128 << "</PrescaleSet>" << std::endl;
129}
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29

Member Data Documentation

◆ m_comment

std::string TrigConf::TrigConfData::m_comment
privateinherited

Definition at line 48 of file TrigConfData.h.

◆ m_Cuts

std::vector<int32_t> TrigConf::PrescaleSet::m_Cuts
private

Definition at line 67 of file PrescaleSet.h.

◆ m_id

unsigned int TrigConf::TrigConfData::m_id
privateinherited

Definition at line 45 of file TrigConfData.h.

◆ m_Lvl1MasterId

unsigned int TrigConf::L1DataBaseclass::m_Lvl1MasterId
privateinherited

Definition at line 35 of file L1DataBaseclass.h.

◆ m_name

std::string TrigConf::TrigConfData::m_name
privateinherited

Definition at line 46 of file TrigConfData.h.

◆ m_null

bool TrigConf::PrescaleSet::m_null {true}
private

Definition at line 61 of file PrescaleSet.h.

61{true}; // false: indicates if the prescale set has been filled

◆ m_Partition

unsigned int TrigConf::PrescaleSet::m_Partition {0}
private

Definition at line 64 of file PrescaleSet.h.

64{0};

◆ m_Prescales_ctp

std::vector<int64_t> TrigConf::PrescaleSet::m_Prescales_ctp
private

Definition at line 65 of file PrescaleSet.h.

◆ m_Prescales_float

std::vector<float> TrigConf::PrescaleSet::m_Prescales_float
private

Definition at line 66 of file PrescaleSet.h.

◆ m_smk

unsigned int TrigConf::TrigConfData::m_smk
privateinherited

Definition at line 44 of file TrigConfData.h.

◆ m_Type

std::string TrigConf::PrescaleSet::m_Type {"Physics"}
private

Definition at line 63 of file PrescaleSet.h.

63{"Physics"}; // the type of the prescale set, e.g. Physics, Standby, Cosmics, HighRate, VdM (case insensitive)

◆ m_version

unsigned int TrigConf::TrigConfData::m_version
privateinherited

Definition at line 47 of file TrigConfData.h.

◆ maxPrescaleCut

const int32_t PrescaleSet::maxPrescaleCut = 0xFFFFFF
static

Definition at line 26 of file PrescaleSet.h.


The documentation for this class was generated from the following files: