ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
FillParamsUtil Class Reference

Utility class to to decode data from FILLPARAMS COOL folder. More...

#include <FillParamsUtil.h>

Collaboration diagram for FillParamsUtil:

Public Member Functions

 FillParamsUtil ()
 
unsigned int nBeam1Bunches () const
 
unsigned int nBeam2Bunches () const
 
unsigned int nLuminousBunches () const
 
const std::vector< unsigned int > & beam1Bunches () const
 
const std::vector< unsigned int > & beam2Bunches () const
 
const std::vector< unsigned int > & luminousBunches () 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_beam1Bunches
 
std::vector< unsigned int > m_beam2Bunches
 
std::vector< unsigned int > m_luminousBunches
 

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 FillParamsUtil.h.

Constructor & Destructor Documentation

◆ FillParamsUtil()

FillParamsUtil::FillParamsUtil ( )

Definition at line 13 of file FillParamsUtil.cxx.

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

Member Function Documentation

◆ beam1Bunches()

const std::vector< unsigned int > & FillParamsUtil::beam1Bunches ( ) const

Definition at line 46 of file FillParamsUtil.cxx.

46  {
47  return m_beam1Bunches;
48 }

◆ beam2Bunches()

const std::vector< unsigned int > & FillParamsUtil::beam2Bunches ( ) const

Definition at line 51 of file FillParamsUtil.cxx.

51  {
52  return m_beam2Bunches;
53 }

◆ clear()

void FillParamsUtil::clear ( )

Definition at line 20 of file FillParamsUtil.cxx.

20  {
21  m_beam1Bunches.clear();
22  m_beam2Bunches.clear();
23  m_luminousBunches.clear();
24 }

◆ luminousBunches()

const std::vector< unsigned int > & FillParamsUtil::luminousBunches ( ) const

Definition at line 56 of file FillParamsUtil.cxx.

56  {
57  return m_luminousBunches;
58 }

◆ nBeam1Bunches()

unsigned int FillParamsUtil::nBeam1Bunches ( ) const

Definition at line 29 of file FillParamsUtil.cxx.

29  {
30  return m_beam1Bunches.size();
31 }

◆ nBeam2Bunches()

unsigned int FillParamsUtil::nBeam2Bunches ( ) const

Definition at line 34 of file FillParamsUtil.cxx.

34  {
35  return m_beam2Bunches.size();
36 }

◆ nLuminousBunches()

unsigned int FillParamsUtil::nLuminousBunches ( ) const

Definition at line 39 of file FillParamsUtil.cxx.

39  {
40  return m_luminousBunches.size();
41 }

◆ setValue() [1/2]

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

Definition at line 69 of file FillParamsUtil.cxx.

69  {
70  return setValue(rec.attributeList());
71 }

◆ setValue() [2/2]

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

Definition at line 76 of file FillParamsUtil.cxx.

76  {
77 
78  // First, clear old values
79  this->clear();
80  error.clear();
81 
82  // Check if there is any data
83  if (attrList["BCIDmasks"].isNull()) {
84  error = "BCIDmasks is NULL!";
85  return false;
86  }
87 
88  // Extract raw data from COOL object
89  cool::UInt32 nb1 = attrList["Beam1Bunches"].data<cool::UInt32>();
90  cool::UInt32 nb2 = attrList["Beam2Bunches"].data<cool::UInt32>();
91  cool::UInt32 ncol = attrList["LuminousBunches"].data<cool::UInt32>();
92 
93  const coral::Blob& blob = attrList["BCIDmasks"].data<coral::Blob>();
94 
95  // Verify length
96  if ( static_cast<cool::UInt32>( blob.size() ) != 2 * (nb1 + nb2 + ncol)) {
97  std::stringstream ss;
98  ss << "BCIDmasks length " << blob.size() << " != 2 * " << (nb1+nb2+ncol) << "!";
99  error = ss.str();
100  return false;
101  }
102  // std::cout << " Size of BCIDmask: " << blob.size() << std::endl;
103 
104  // Pointer to blob to allow unpacking from binary
105  const uint16_t* p=static_cast<const uint16_t*>(blob.startingAddress());
106 
107  // Decode beam1 list
108  for (unsigned int i = 0; i < nb1; i++, p++) {
109  m_beam1Bunches.push_back(*p);
110  // std::cout << "nBeam1 is " << *p << std::endl;
111  }
112 
113  // Decode beam2 list
114  for (unsigned int i = 0; i < nb2; i++, p++) {
115  // unsigned int tmp = *p;
116  // std::cout << "#2 is " << tmp << std::endl;
117  m_beam2Bunches.push_back(*p);
118  }
119 
120 
121  // Decode luminous list
122  for (unsigned int i = 0; i < ncol; i++, p++) {
123  //unsigned int tmp = *p;
124  // std::cout << "Luminous bunch is " << tmp << std::endl;
125  m_luminousBunches.push_back(*p);
126  }
127 
128 
129  for (unsigned int i = (nb1+nb2+ncol); i < blob.size(); i++, p++) {
130  //unsigned int tmp = *p;
131  // std::cout << "BCIDmask is " << tmp << std::endl;
132  }
133  // Success!
134  return true;
135 }

Member Data Documentation

◆ error

std::string FillParamsUtil::error

Definition at line 45 of file FillParamsUtil.h.

◆ m_beam1Bunches

std::vector<unsigned int> FillParamsUtil::m_beam1Bunches
private

Definition at line 49 of file FillParamsUtil.h.

◆ m_beam2Bunches

std::vector<unsigned int> FillParamsUtil::m_beam2Bunches
private

Definition at line 50 of file FillParamsUtil.h.

◆ m_luminousBunches

std::vector<unsigned int> FillParamsUtil::m_luminousBunches
private

Definition at line 51 of file FillParamsUtil.h.


The documentation for this class was generated from the following files:
FillParamsUtil::clear
void clear()
Definition: FillParamsUtil.cxx:20
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
FillParamsUtil::m_luminousBunches
std::vector< unsigned int > m_luminousBunches
Definition: FillParamsUtil.h:51
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
FillParamsUtil::m_beam1Bunches
std::vector< unsigned int > m_beam1Bunches
Definition: FillParamsUtil.h:49
FillParamsUtil::setValue
bool setValue(const coral::AttributeList &attrList)
Definition: FillParamsUtil.cxx:76
error
Definition: IImpactPoint3dEstimator.h:70
FillParamsUtil::m_beam2Bunches
std::vector< unsigned int > m_beam2Bunches
Definition: FillParamsUtil.h:50
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96