ATLAS Offline Software
Loading...
Searching...
No Matches
BunchDataUtil Class Reference

#include <BunchDataUtil.h>

Collaboration diagram for BunchDataUtil:

Public Member Functions

 BunchDataUtil ()
int nx1Storage (const cool::Record &rec)
int ny1Storage (const cool::Record &rec)
int nx1Storage (const coral::AttributeList &attrList1) const
int ny1Storage (const coral::AttributeList &attrList1) const
int nx2Storage (const cool::Record &rec)
int ny2Storage (const cool::Record &rec)
int nx2Storage (const coral::AttributeList &attrList1) const
int ny2Storage (const coral::AttributeList &attrList1) const
unsigned int nBunch1Data () const
unsigned int nBunch2Data () const
const std::vector< unsigned int > & bunch1Data () const
const std::vector< unsigned int > & bunch2Data () const
void clear ()
bool setValue (const coral::AttributeList &attrList1)
bool setValue (const cool::Record &rec)
bool setCollidingBCID1s (std::vector< unsigned int > &)
bool setCollidingBCID2s (std::vector< unsigned int > &)

Public Attributes

std::string error

Private Attributes

std::vector< unsigned int > m_collidingBCID1s
std::vector< unsigned int > m_collidingBCID2s
std::vector< unsigned int > m_bunch1Data
std::vector< unsigned int > m_bunch2Data
class LumiBlobUtil m_blobUtil

Detailed Description

Utility class to to decode data from FILLPARAMS COOL folder

Can be used with FillParamsTool or python FillParamsData

Author
E.Torrence

Definition at line 22 of file BunchDataUtil.h.

Constructor & Destructor Documentation

◆ BunchDataUtil()

BunchDataUtil::BunchDataUtil ( )

Definition at line 14 of file BunchDataUtil.cxx.

14 {
15 // Clear vectors
16 this->clear();
17 error.clear();
18}
std::string error

Member Function Documentation

◆ bunch1Data()

const std::vector< unsigned int > & BunchDataUtil::bunch1Data ( ) const

Definition at line 35 of file BunchDataUtil.cxx.

35 {
36 return m_bunch1Data;
37}
std::vector< unsigned int > m_bunch1Data

◆ bunch2Data()

const std::vector< unsigned int > & BunchDataUtil::bunch2Data ( ) const

Definition at line 39 of file BunchDataUtil.cxx.

39 {
40 return m_bunch2Data;
41}
std::vector< unsigned int > m_bunch2Data

◆ clear()

void BunchDataUtil::clear ( )

Definition at line 21 of file BunchDataUtil.cxx.

21 {
22 m_bunch1Data.clear();
23 m_bunch2Data.clear();
24}

◆ nBunch1Data()

unsigned int BunchDataUtil::nBunch1Data ( ) const

Definition at line 27 of file BunchDataUtil.cxx.

27 {
28 return m_bunch1Data.size();
29}

◆ nBunch2Data()

unsigned int BunchDataUtil::nBunch2Data ( ) const

Definition at line 31 of file BunchDataUtil.cxx.

31 {
32 return m_bunch2Data.size();
33}

◆ nx1Storage() [1/2]

int BunchDataUtil::nx1Storage ( const cool::Record & rec)

Definition at line 44 of file BunchDataUtil.cxx.

44 {
45 return nx1Storage(rec.attributeList());
46}
int nx1Storage(const cool::Record &rec)

◆ nx1Storage() [2/2]

int BunchDataUtil::nx1Storage ( const coral::AttributeList & attrList1) const

Definition at line 64 of file BunchDataUtil.cxx.

64 {
65
66 const coral::Blob &blobBC = attrList1["B1BunchIntensities"].data<coral::Blob>();
67 const uint8_t *k=static_cast<const uint8_t*>(blobBC.startingAddress());
68 int x = 1;
69 if (blobBC.size() == 0) {
70 return -1;
71 }
72 unsigned int tmk = *k;
73 x=tmk/10;
74 return x;
75
76}
#define x

◆ nx2Storage() [1/2]

int BunchDataUtil::nx2Storage ( const cool::Record & rec)

Definition at line 54 of file BunchDataUtil.cxx.

54 {
55 return nx2Storage(rec.attributeList());
56}
int nx2Storage(const cool::Record &rec)

◆ nx2Storage() [2/2]

int BunchDataUtil::nx2Storage ( const coral::AttributeList & attrList1) const

Definition at line 94 of file BunchDataUtil.cxx.

94 {
95 const coral::Blob &blobBC = attrList1["B2BunchIntensities"].data<coral::Blob>();
96 const uint8_t *k=static_cast<const uint8_t*>(blobBC.startingAddress());
97 int x = 1;
98 if (blobBC.size() == 0) {
99 return -1;
100 }
101 unsigned int tmk = *k;
102 x=tmk/10;
103 return x;
104}

◆ ny1Storage() [1/2]

int BunchDataUtil::ny1Storage ( const cool::Record & rec)

Definition at line 49 of file BunchDataUtil.cxx.

49 {
50 return ny1Storage(rec.attributeList());
51}
int ny1Storage(const cool::Record &rec)

◆ ny1Storage() [2/2]

int BunchDataUtil::ny1Storage ( const coral::AttributeList & attrList1) const

Definition at line 79 of file BunchDataUtil.cxx.

79 {
80 const coral::Blob &blobBC = attrList1["B1BunchIntensities"].data<coral::Blob>();
81 const uint8_t *k=static_cast<const uint8_t*>(blobBC.startingAddress());
82 int x = 1;
83 int y = 1;
84 if (blobBC.size() == 0) {
85 return -1;
86 }
87 unsigned int tmk = *k;
88 x=tmk/10;
89 y=tmk-10*x;
90 return y;
91}
#define y

◆ ny2Storage() [1/2]

int BunchDataUtil::ny2Storage ( const cool::Record & rec)

Definition at line 59 of file BunchDataUtil.cxx.

59 {
60 return ny2Storage(rec.attributeList());
61}
int ny2Storage(const cool::Record &rec)

◆ ny2Storage() [2/2]

int BunchDataUtil::ny2Storage ( const coral::AttributeList & attrList1) const

Definition at line 107 of file BunchDataUtil.cxx.

107 {
108 const coral::Blob &blobBC = attrList1["B2BunchIntensities"].data<coral::Blob>();
109 const uint8_t *k=static_cast<const uint8_t*>(blobBC.startingAddress());
110 int x = 1;
111 int y = 1;
112 if (blobBC.size() == 0) {
113 return -1;
114 }
115 unsigned int tmk = *k;
116 x=tmk/10;
117 y=tmk-10*x;
118 return y;
119}

◆ setCollidingBCID1s()

bool BunchDataUtil::setCollidingBCID1s ( std::vector< unsigned int > & p)

Definition at line 128 of file BunchDataUtil.cxx.

128 {
130 return true;
131}
std::vector< unsigned int > m_collidingBCID1s

◆ setCollidingBCID2s()

bool BunchDataUtil::setCollidingBCID2s ( std::vector< unsigned int > & pp)

Definition at line 134 of file BunchDataUtil.cxx.

134 {
136 return true;
137}
std::vector< unsigned int > m_collidingBCID2s

◆ setValue() [1/2]

bool BunchDataUtil::setValue ( const cool::Record & rec)

Definition at line 123 of file BunchDataUtil.cxx.

123 {
124 return setValue(rec.attributeList());
125}
bool setValue(const coral::AttributeList &attrList1)

◆ setValue() [2/2]

bool BunchDataUtil::setValue ( const coral::AttributeList & attrList1)

Definition at line 142 of file BunchDataUtil.cxx.

142 {
143 // First, clear old values
144 this->clear();
145 error.clear();
146
147 // Check if there is any data
148 if (attrList1["B1BunchIntensities"].isNull()) {
149 error = "BunchCode is NULL!";
150 return false;
151 }
152
153 cool::Float AI1 = attrList1["B1BunchAverage"].data<cool::Float>();
154 cool::Float AI2 = attrList1["B2BunchAverage"].data<cool::Float>();
155
156 const coral::Blob &blobBC1 = attrList1["B1BunchIntensities"].data<coral::Blob>();
157 const coral::Blob &blobBC2 = attrList1["B2BunchIntensities"].data<coral::Blob>();
158
159
160 std::cout << "Dette skulle vaere beam1 " << std::endl;
161 m_blobUtil.unpack(AI1,blobBC1,m_collidingBCID1s);
162
163 std::cout << "This should be beam 2 " << std::endl;
164 m_blobUtil.unpack(AI2,blobBC2,m_collidingBCID2s);
165
166 return true;
167}
class LumiBlobUtil m_blobUtil

Member Data Documentation

◆ error

std::string BunchDataUtil::error

Definition at line 57 of file BunchDataUtil.h.

◆ m_blobUtil

class LumiBlobUtil BunchDataUtil::m_blobUtil
private

Definition at line 67 of file BunchDataUtil.h.

◆ m_bunch1Data

std::vector<unsigned int> BunchDataUtil::m_bunch1Data
private

Definition at line 65 of file BunchDataUtil.h.

◆ m_bunch2Data

std::vector<unsigned int> BunchDataUtil::m_bunch2Data
private

Definition at line 66 of file BunchDataUtil.h.

◆ m_collidingBCID1s

std::vector<unsigned int> BunchDataUtil::m_collidingBCID1s
private

Definition at line 62 of file BunchDataUtil.h.

◆ m_collidingBCID2s

std::vector<unsigned int> BunchDataUtil::m_collidingBCID2s
private

Definition at line 63 of file BunchDataUtil.h.


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