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

#include <RPCbytestream.h>

Inheritance diagram for RPCbytestream:
Collaboration diagram for RPCbytestream:

Public Types

typedef unsigned long int debu
typedef std::map< int, CMAreadout, std::less< int > > CMA_Readout
typedef std::map< int, PADreadout, std::less< int > > PAD_Readout

Public Member Functions

 RPCbytestream (CMAdata &, const std::string &, MsgStream &, debu, debu, debu, debu, debu, debu, debu, debu, uint, uint)
 RPCbytestream (const RPCbytestream &)
 ~RPCbytestream ()
debu cma_ro_debug (void) const
debu pad_ro_debug (void) const
debu rx_ro_debug (void) const
debu sl_ro_debug (void) const
debu cma_rostruct_debug (void) const
debu pad_rostruct_debug (void) const
debu rx_rostruct_debug (void) const
debu sl_rostruct_debug (void) const
const std::string & filename (void) const
const CMA_Readoutcma_readout (void) const
const PAD_Readoutpad_readout (void) const
void set_number (int)
int number (void) const
void PrintElement (std::ostream &, std::string, bool) const
void Print (std::ostream &, bool) const
ObjectType tag () const
const std::string & name () const

Private Member Functions

void build_pad_readout (MsgStream &log, uint NOBXS)
void dump_rpc_bytestream (void)

Private Attributes

debu m_cma_ro_debug
debu m_pad_ro_debug
debu m_rx_ro_debug
debu m_sl_ro_debug
debu m_cma_rostruct_debug
debu m_pad_rostruct_debug
debu m_rx_rostruct_debug
debu m_sl_rostruct_debug
std::string m_filename
CMA_Readout m_cma_readout
PAD_Readout m_pad_readout
int m_number
ObjectType m_tag
std::string m_name

Detailed Description

Definition at line 19 of file RPCbytestream.h.

Member Typedef Documentation

◆ CMA_Readout

typedef std::map< int, CMAreadout, std::less <int> > RPCbytestream::CMA_Readout

Definition at line 23 of file RPCbytestream.h.

◆ debu

typedef unsigned long int RPCbytestream::debu

Definition at line 22 of file RPCbytestream.h.

◆ PAD_Readout

typedef std::map< int, PADreadout, std::less <int> > RPCbytestream::PAD_Readout

Definition at line 24 of file RPCbytestream.h.

Constructor & Destructor Documentation

◆ RPCbytestream() [1/2]

RPCbytestream::RPCbytestream ( CMAdata & data,
const std::string & filename,
MsgStream & log,
debu cma_debug,
debu pad_debug,
debu rx_debug,
debu sl_debug,
debu cma_struc_debug,
debu pad_struc_debug,
debu rx_struc_debug,
debu sl_struc_debug,
uint NOBXS,
uint BCZERO )

Definition at line 13 of file RPCbytestream.cxx.

17 :
18 RPCtrigDataObject(0,"RPC byte stream"),
19 m_cma_ro_debug(cma_debug),
20 m_pad_ro_debug(pad_debug),
21 m_rx_ro_debug(rx_debug),
22 m_sl_ro_debug(sl_debug),
23 m_cma_rostruct_debug(cma_struc_debug),
24 m_pad_rostruct_debug(pad_struc_debug),
25 m_rx_rostruct_debug(rx_struc_debug),
26 m_sl_rostruct_debug(sl_struc_debug),
28{
29 CMAdata::PatternsList list = data.give_patterns();
30 CMAdata::PatternsList::iterator it = list.begin();
31
32 while(it != list.end())
33 {
34 int key = (*it)->sector() * 10000 +
35 (*it)->cma_parameters().id().PAD_index() * 100 +
36 (*it)->cma_parameters().id().type() * 10 +
37 (*it)->cma_parameters().id().Ixx_index();
38
39 std::pair < CMA_Readout::iterator, bool> ins =
40 m_cma_readout.insert(CMA_Readout::value_type(key,CMAreadout(*it, NOBXS, BCZERO)));
41 if(!ins.second)
42 {
43 log << MSG::ERROR << "Found duplicate CMA readout into CMA data!" << endmsg;
44 }
45
46 ++it;
47 }
48
49 build_pad_readout(log, NOBXS);
51}
#define endmsg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::list< CMApatterns * > PatternsList
Definition CMAdata.h:22
std::string m_filename
debu m_pad_rostruct_debug
const std::string & filename(void) const
debu m_rx_rostruct_debug
debu m_sl_rostruct_debug
debu m_cma_rostruct_debug
void dump_rpc_bytestream(void)
CMA_Readout m_cma_readout
void build_pad_readout(MsgStream &log, uint NOBXS)
RPCtrigDataObject(int, const std::string &)
list(name, path='/')
Definition histSizes.py:38

◆ RPCbytestream() [2/2]

RPCbytestream::RPCbytestream ( const RPCbytestream & readout)

Definition at line 53 of file RPCbytestream.cxx.

53 :
54 RPCtrigDataObject(readout.number(),readout.name()),
57 m_rx_ro_debug(readout.rx_ro_debug()),
58 m_sl_ro_debug(readout.sl_ro_debug()),
63 m_filename(readout.filename()),
64 m_cma_readout(readout.cma_readout()),
65 m_pad_readout(readout.pad_readout())
66{
67}
const std::string & name() const
Definition BaseObject.h:23
PAD_Readout m_pad_readout
debu rx_ro_debug(void) const
debu pad_ro_debug(void) const
debu rx_rostruct_debug(void) const
debu pad_rostruct_debug(void) const
debu sl_ro_debug(void) const
const PAD_Readout & pad_readout(void) const
debu cma_rostruct_debug(void) const
debu sl_rostruct_debug(void) const
debu cma_ro_debug(void) const
const CMA_Readout & cma_readout(void) const
int number(void) const

◆ ~RPCbytestream()

RPCbytestream::~RPCbytestream ( )

Definition at line 70 of file RPCbytestream.cxx.

71{
72 m_cma_readout.clear();
73}

Member Function Documentation

◆ build_pad_readout()

void RPCbytestream::build_pad_readout ( MsgStream & log,
uint NOBXS )
private

Definition at line 77 of file RPCbytestream.cxx.

78{
79 for (int i=0;i<64;++i)
80 {
81 for(int j=0;j<=10;++j) // 99 is the maximum number allowed
82 {
83 int kPAD_lw = i * 10000 + j * 100;
84 int kPAD_hg = i * 10000 + j * 100 + 99;
85
86 CMA_Readout::iterator PAD_l = m_cma_readout.lower_bound(kPAD_lw);
87 CMA_Readout::iterator PAD_h = m_cma_readout.upper_bound(kPAD_hg);
88
89 if(distance(PAD_l,PAD_h) )
90 {
91 int SLid = (*PAD_l).second.sector();
92 int PADid = (*PAD_l).second.id().PAD_index();
93 PADreadout pad_readout(SLid,PADid);
94
95 int key = SLid * 100 + PADid;
96
97 if(SLid != i)
98 {
99 log << MSG::ERROR << "Key doesn't correspond to CMA Sector Id!" << endmsg;
100 }
101
102 for (CMA_Readout::iterator it = PAD_l; it != PAD_h; ++it)
103 {
104 auto cma_readout = (*it).second.give_matrix_readout(log, NOBXS);
105 pad_readout.load_readout(cma_readout);
106 if (log.level() <= MSG::DEBUG) {
107 log << MSG::DEBUG << "Dump of the matrices readout into PAD " << PADid
108 << endl
109 << cma_readout[0]
110 << cma_readout[1] << endmsg;
111 }
112 }
113
114 std::pair < PAD_Readout::iterator, bool> ins =
115 m_pad_readout.insert(PAD_Readout::value_type(key,pad_readout));
116 if(!ins.second)
117 {
118 log << MSG::ERROR << "Found duplicate PAD readout into CMA data!" << endmsg;
119 }
120 }
121 }
122 }
123}
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space

◆ cma_readout()

const CMA_Readout & RPCbytestream::cma_readout ( void ) const
inline

Definition at line 63 of file RPCbytestream.h.

63{return m_cma_readout;}

◆ cma_ro_debug()

debu RPCbytestream::cma_ro_debug ( void ) const
inline

Definition at line 51 of file RPCbytestream.h.

51{return m_cma_ro_debug;}

◆ cma_rostruct_debug()

debu RPCbytestream::cma_rostruct_debug ( void ) const
inline

Definition at line 56 of file RPCbytestream.h.

◆ dump_rpc_bytestream()

void RPCbytestream::dump_rpc_bytestream ( void )
private

Definition at line 126 of file RPCbytestream.cxx.

127{
128 ofstream out;
129 out.open(m_filename.c_str(),ios::app);
130
131 // dump the PAD chunk of data into the byte stream file
132 PAD_Readout::iterator it = m_pad_readout.begin();
133 while(it != m_pad_readout.end())
134 {
135 PadReadOut* readout = (*it).second.give_pad_readout();
136
137 readout->bytestream(out);
138
139 out << endl;
140
141 ++it;
142 }
143}
void bytestream(std::ostream &stream)

◆ filename()

const std::string & RPCbytestream::filename ( void ) const
inline

Definition at line 61 of file RPCbytestream.h.

61{return m_filename;}

◆ name()

const std::string & BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23{ return m_name; }
std::string m_name
Definition BaseObject.h:16

◆ number()

int RPCtrigDataObject::number ( void ) const
inlineinherited

Definition at line 29 of file RPCtrigDataObject.h.

29{return m_number;}

◆ pad_readout()

const PAD_Readout & RPCbytestream::pad_readout ( void ) const
inline

Definition at line 64 of file RPCbytestream.h.

64{return m_pad_readout;}

◆ pad_ro_debug()

debu RPCbytestream::pad_ro_debug ( void ) const
inline

Definition at line 52 of file RPCbytestream.h.

52{return m_pad_ro_debug;}

◆ pad_rostruct_debug()

debu RPCbytestream::pad_rostruct_debug ( void ) const
inline

Definition at line 57 of file RPCbytestream.h.

◆ Print()

void RPCtrigDataObject::Print ( std::ostream & stream,
bool detail ) const
virtualinherited

Reimplemented from BaseObject.

Reimplemented in SLpatterns.

Definition at line 31 of file RPCtrigDataObject.cxx.

32{
33 detail = true;
34 if(detail)
35 {
36 stream << name() << " number " << setw(3) << number();
37 }
38 stream << endl;
39}

◆ PrintElement()

void RPCtrigDataObject::PrintElement ( std::ostream & ,
std::string ,
bool  ) const
inlineinherited

Definition at line 31 of file RPCtrigDataObject.h.

31{}

◆ rx_ro_debug()

debu RPCbytestream::rx_ro_debug ( void ) const
inline

Definition at line 53 of file RPCbytestream.h.

53{return m_rx_ro_debug;}

◆ rx_rostruct_debug()

debu RPCbytestream::rx_rostruct_debug ( void ) const
inline

Definition at line 58 of file RPCbytestream.h.

58{return m_rx_rostruct_debug;}

◆ set_number()

void RPCtrigDataObject::set_number ( int number)
inherited

Definition at line 42 of file RPCtrigDataObject.cxx.

43{
45}

◆ sl_ro_debug()

debu RPCbytestream::sl_ro_debug ( void ) const
inline

Definition at line 54 of file RPCbytestream.h.

54{return m_sl_ro_debug;}

◆ sl_rostruct_debug()

debu RPCbytestream::sl_rostruct_debug ( void ) const
inline

Definition at line 59 of file RPCbytestream.h.

59{return m_sl_rostruct_debug;}

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22{ return m_tag; }
ObjectType m_tag
Definition BaseObject.h:15

Member Data Documentation

◆ m_cma_readout

CMA_Readout RPCbytestream::m_cma_readout
private

Definition at line 39 of file RPCbytestream.h.

◆ m_cma_ro_debug

debu RPCbytestream::m_cma_ro_debug
private

Definition at line 27 of file RPCbytestream.h.

◆ m_cma_rostruct_debug

debu RPCbytestream::m_cma_rostruct_debug
private

Definition at line 32 of file RPCbytestream.h.

◆ m_filename

std::string RPCbytestream::m_filename
private

Definition at line 37 of file RPCbytestream.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_number

int RPCtrigDataObject::m_number
privateinherited

Definition at line 17 of file RPCtrigDataObject.h.

◆ m_pad_readout

PAD_Readout RPCbytestream::m_pad_readout
private

Definition at line 40 of file RPCbytestream.h.

◆ m_pad_ro_debug

debu RPCbytestream::m_pad_ro_debug
private

Definition at line 28 of file RPCbytestream.h.

◆ m_pad_rostruct_debug

debu RPCbytestream::m_pad_rostruct_debug
private

Definition at line 33 of file RPCbytestream.h.

◆ m_rx_ro_debug

debu RPCbytestream::m_rx_ro_debug
private

Definition at line 29 of file RPCbytestream.h.

◆ m_rx_rostruct_debug

debu RPCbytestream::m_rx_rostruct_debug
private

Definition at line 34 of file RPCbytestream.h.

◆ m_sl_ro_debug

debu RPCbytestream::m_sl_ro_debug
private

Definition at line 30 of file RPCbytestream.h.

◆ m_sl_rostruct_debug

debu RPCbytestream::m_sl_rostruct_debug
private

Definition at line 35 of file RPCbytestream.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.


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