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

#include <Random.h>

Inheritance diagram for TrigConf::Random:
Collaboration diagram for TrigConf::Random:

Public Member Functions

 Random ()
virtual ~Random () override=default
uint32_t cuts (unsigned int idx) const
const std::string & rndmName (unsigned int idx) const
int rate1 () const
int rate2 () const
float getRateFromCut (unsigned int idx) const
void setRndmName (uint32_t idx, const std::string &name)
void setCut (uint32_t idx, uint32_t cut)
void setRate1 (int rate)
void setRate2 (int rate)
virtual void print (const std::string &indent="", unsigned int detail=1) const override
virtual void writeXML (std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
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

Protected Member Functions

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

Private Attributes

int m_rate1
int m_rate2
std::string m_names [4]
uint32_t m_cuts [4]
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

Constructor & Destructor Documentation

◆ Random()

Random::Random ( )

Definition at line 12 of file Random.cxx.

◆ ~Random()

virtual TrigConf::Random::~Random ( )
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()

uint32_t TrigConf::Random::cuts ( unsigned int idx) const
inline

◆ getRateFromCut()

float Random::getRateFromCut ( unsigned int idx) const

Definition at line 21 of file Random.cxx.

21 {
22 int32_t cut = m_cuts[idx];
23 float ucut = abs(cut);
24 return ( 0x1000000 / ( ucut + 1 ) );
25}
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.

◆ 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}
const double width

◆ 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;}

◆ print()

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

Implements TrigConf::TrigConfData.

Definition at line 28 of file Random.cxx.

28 {
29 if(detail>=1) {
30 cout << indent << "Random "; printNameIdV();
31 if(detail>=2) {
32 if( m_cuts[0]!=0xffffffff ||
33 m_cuts[1]!=0xffffffff ||
34 m_cuts[2]!=0xffffffff ||
35 m_cuts[3]!=0xffffffff )
36 {
37 for(int i=0; i<4; i++) {
38 cout << indent << " " << m_names[i] << ": cut=" << m_cuts[i] << " (prescale=" << PrescaleSet::getPrescaleFromCut(m_cuts[i]) << ")" << endl;
39 }
40 } else {
41 cout << indent << " Rate 1: " << m_rate1 << endl;
42 cout << indent << " Rate 2: " << m_rate2 << endl;
43 }
44 }
45 }
46}
static double getPrescaleFromCut(int32_t cut)
prescale = 2*24/(cut+1.)
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

◆ rate1()

int TrigConf::Random::rate1 ( ) const
inline

Definition at line 24 of file TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h.

24{ return m_rate1; }

◆ rate2()

int TrigConf::Random::rate2 ( ) const
inline

Definition at line 25 of file TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h.

25{ return m_rate2; }

◆ rndmName()

const std::string & TrigConf::Random::rndmName ( unsigned int idx) const
inline

Definition at line 23 of file TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h.

23{ return m_names[idx]; }

◆ setComment()

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

Definition at line 32 of file TrigConfData.h.

◆ setCut()

void TrigConf::Random::setCut ( uint32_t idx,
uint32_t cut )
inline

◆ 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;}

◆ setRate1()

void TrigConf::Random::setRate1 ( int rate)
inline

Definition at line 31 of file TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h.

31{ m_rate1 = rate; }

◆ setRate2()

void TrigConf::Random::setRate2 ( int rate)
inline

Definition at line 32 of file TrigConfiguration/TrigConfL1Data/TrigConfL1Data/Random.h.

32{ m_rate2 = rate; }

◆ setRndmName()

void TrigConf::Random::setRndmName ( uint32_t idx,
const std::string & name )
inline

◆ 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;}

◆ 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;}

◆ version()

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

Definition at line 24 of file TrigConfData.h.

24{return m_version;}

◆ writeXML()

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

Definition at line 49 of file Random.cxx.

49 {
50 if( m_cuts[0]!=0xffffffff ||
51 m_cuts[1]!=0xffffffff ||
52 m_cuts[2]!=0xffffffff ||
53 m_cuts[3]!=0xffffffff )
54 {
55 indent(xmlfile,indentLevel, indentWidth)
56 << "<Random "
57 << "name0=\""<< m_names[0] << "\" cut0=\"" << m_cuts[0] << "\" "
58 << "name1=\""<< m_names[1] << "\" cut1=\"" << m_cuts[1] << "\" "
59 << "name2=\""<< m_names[2] << "\" cut2=\"" << m_cuts[2] << "\" "
60 << "name3=\""<< m_names[3] << "\" cut3=\"" << m_cuts[3] << "\"/>" << endl;
61 } else {
62 indent(xmlfile,indentLevel, indentWidth)
63 << "<Random name=\"" << name() << "\" rate1=\"" << m_rate1
64 << "\" rate2=\"" << m_rate2
65 << "\" seed1=\"1\" seed2=\"1\"/>" << endl;
66 }
67}
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

uint32_t TrigConf::Random::m_cuts[4]
private

◆ 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_names

std::string TrigConf::Random::m_names[4]
private

◆ m_rate1

int TrigConf::Random::m_rate1
private

◆ m_rate2

int TrigConf::Random::m_rate2
private

◆ m_smk

unsigned int TrigConf::TrigConfData::m_smk
privateinherited

Definition at line 44 of file TrigConfData.h.

◆ m_version

unsigned int TrigConf::TrigConfData::m_version
privateinherited

Definition at line 47 of file TrigConfData.h.


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