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

#include <BunchDescription.h>

Collaboration diagram for BunchDescription:

Public Member Functions

 BunchDescription ()
unsigned int nBunchD1 () const
const std::vector< unsigned int > & bunchD () const
void clear ()
bool setValue (const coral::AttributeList &attrList)
bool setValue (const cool::Record &rec)

Public Attributes

std::string error

Private Attributes

std::vector< unsigned int > m_bunchD

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 21 of file BunchDescription.h.

Constructor & Destructor Documentation

◆ BunchDescription()

BunchDescription::BunchDescription ( )

Definition at line 14 of file BunchDescription.cxx.

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

Member Function Documentation

◆ bunchD()

const std::vector< unsigned int > & BunchDescription::bunchD ( ) const

Definition at line 33 of file BunchDescription.cxx.

33 {
34 return m_bunchD;
35}
std::vector< unsigned int > m_bunchD

◆ clear()

void BunchDescription::clear ( )

Definition at line 21 of file BunchDescription.cxx.

21 {
22 m_bunchD.clear();
23}

◆ nBunchD1()

unsigned int BunchDescription::nBunchD1 ( ) const

Definition at line 28 of file BunchDescription.cxx.

28 {
29 return m_bunchD.size();
30}

◆ setValue() [1/2]

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

Definition at line 39 of file BunchDescription.cxx.

39 {
40 return setValue(rec.attributeList());
41}
bool setValue(const coral::AttributeList &attrList)

◆ setValue() [2/2]

bool BunchDescription::setValue ( const coral::AttributeList & attrList)

Definition at line 46 of file BunchDescription.cxx.

46 {
47
48 // First, clear old values
49 this->clear();
50 error.clear();
51
52 // Check if there is any data
53 if (attrList["ItemToBunchGroupMap"].isNull()) {
54 error = "BunchCode is NULL!";
55 return false;
56 }
57
58 const coral::Blob &blobBC = attrList["ItemToBunchGroupMap"].data<coral::Blob>();
59 // std::cout << "size of blob: " << blobBC.size() << std::endl;
60
61 // Verify length
62 /* if ( static_cast<cool::UInt32>( blobBC.size() ) != 2 * (nb1 + nb2 + ncol)) {
63 std::stringstream ss;
64 ss << "BCIDmasks length " << blobBC.size() << " != 2 * " << (nb1+nb2+ncol) << "!";
65 error = ss.str();
66 return false;
67 }
68 */
69 // for (int i =0; i < ( blobBC.size() ); i++) {
70 // std::cout << blobBC.startingAddress();
71 // }
72
73
74
75 // Pointer to blob to allow unpacking from binary
76 const uint8_t *p=static_cast<const uint8_t*>(blobBC.startingAddress());
77
78 // Decode beam1 list
79 for (unsigned int i = 0; i < blobBC.size(); i++, p++) {
80 //unsigned int tmp = *p;
81 // std::cout << "The Data of BunchGroupContent is " << tmp << std::endl ;
82 // std::cout << "BGC " << tmp << std::endl;
83 m_bunchD.push_back(*p);
84 }
85
86 /*
87 std::cout << "COME ON 1368 " << c131+c33 << std::endl;
88 std::cout << "C131 " << c131 << std::endl;
89 std::cout << "C65 " << c65 << std::endl;
90 std::cout << "C33 " << c33 << std::endl;
91 std::cout << "C17 " << c17 << std::endl;
92 std::cout << "C9 " << c9 << std::endl;
93 std::cout << "C5 " << c5 << std::endl;
94 std::cout << "C3 " << c3 << std::endl;
95 std::cout << "C1 " << c1 << std::endl;
96 std::cout << "Other " << other << std::endl;
97 // Success! */
98 return true;
99}

Member Data Documentation

◆ error

std::string BunchDescription::error

Definition at line 53 of file BunchDescription.h.

◆ m_bunchD

std::vector<unsigned int> BunchDescription::m_bunchD
private

Definition at line 63 of file BunchDescription.h.


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