CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Builder Class Referenceabstract

#include <Builder.h>

+ Inheritance diagram for Builder:

Classes

class  DataErrException
 

Public Types

typedef std::map< uint32_t, uint32_t > TE2REMAP
 
typedef std::map< uint32_t, uint32_t > TE2REMAP
 

Public Member Functions

virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)=0
 
virtual uint32_t getREID (uint32_t reid)=0
 
virtual StatusCode initialize (string &initFile)
 
virtual uint32_t getTEID (uint32_t teid)=0
 
virtual uint32_t getREID (uint32_t reid)=0
 

Static Public Member Functions

static bool expect (ifstream &f, string msg, string fname)
 
static bool expectInt (ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
 
static bool expectLong (ifstream &f, string msg, string fname, uint64_t &val)
 
static bool find (ifstream &f, string msg, string fname)
 
static bool expect (ifstream &f, string msg, string fname)
 
static bool expectInt (ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
 
static bool expectLong (ifstream &f, string msg, string fname, uint64_t &val)
 
static bool find (ifstream &f, string msg, string fname)
 

Protected Member Functions

 Builder ()
 
virtual ~Builder ()
 
void append2event (WriteRawEvent *&re, uint32_t source_id, uint32_t size)
 
 Builder ()
 
virtual ~Builder ()
 
void append2event (WriteRawEvent *&re, uint32_t source_id, uint32_t size)
 

Protected Attributes

PropertyMgr m_propMgr
 
uint32_t * m_buf
 
uint32_t m_status
 

Static Protected Attributes

static string m_confFile
 

Detailed Description

Member Typedef Documentation

◆ TE2REMAP [1/2]

typedef std::map<uint32_t, uint32_t> Builder::TE2REMAP

◆ TE2REMAP [2/2]

typedef std::map<uint32_t, uint32_t> Builder::TE2REMAP

Constructor & Destructor Documentation

◆ Builder() [1/2]

Builder::Builder ( )
protected

Definition at line 8 of file Builder.cxx.

9{
10 // default 128k bytes buffer size, it's dangerous!!!
11 // a smarter method is expected !!!
12 m_buf = new uint32_t[32768];
13
14 if (!m_confFile.empty()) return;
15 m_propMgr.declareProperty("RawDataCnvConfFile", m_confFile);
16 m_propMgr.declareProperty("Status", m_status=0xFFFFFFFF); //fucd
17
18 // Get a pointer to the Job Options Service
19 IJobOptionsSvc* jobSvc;
20 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
21 jobSvc->setMyProperties("Builder", &m_propMgr);
22}

◆ ~Builder() [1/2]

Builder::~Builder ( )
protectedvirtual

Definition at line 24 of file Builder.cxx.

24 {
25 delete m_buf;
26}

◆ Builder() [2/2]

Builder::Builder ( )
protected

◆ ~Builder() [2/2]

virtual Builder::~Builder ( )
protectedvirtual

Member Function Documentation

◆ append2event() [1/2]

void Builder::append2event ( WriteRawEvent *&  re,
uint32_t  source_id,
uint32_t  size 
)
protected

Definition at line 76 of file Builder.cxx.

77{
78 uint32_t run_no = re->run_no();
79 uint32_t lvl1_id = re->lvl1_id();
80 uint32_t bc_id = 0; // ?
81 // ROB
83 source_id, // source_id
84 run_no, // run_no
85 lvl1_id, // lvl1_id
86 bc_id, // bc_id
87 0, // lvl1_type
88 0, // detev_type
89 size, // ndata
90 m_buf, // data
91 0 // status_position
92 );
93 if(m_status==0xFFFFFFFF){
94 nrob->status(0, NULL);
95 nrob->rod_status(0, NULL);
96 }
97 else{ //fucd
98 nrob->status(1, &m_status);
99 nrob->rod_status(1, &m_status);
100 }
101 // ROS
103 source_id, // source_id
104 run_no, // run_no
105 lvl1_id, // lvl1_id
106 bc_id // bc_id
107 );
108 if(m_status==0xFFFFFFFF) nros->status(0, NULL);
109 else nros->status(1, &m_status); //fucd
110 // SubDetector
112 if(m_status==0xFFFFFFFF) nsd->status(0, NULL);
113 else nsd->status(1, &m_status); //fucd
114 // append to FullEventFragment
115 nros->append(nrob);
116 nsd->append(nros);
117 re->append(nsd);
118}
void append(eformat::write::SubDetectorFragment *sd)
void status(uint32_t n, const uint32_t *status)
void rod_status(uint32_t n, const uint32_t *status)
void status(uint32_t n, const uint32_t *status)
void append(eformat::write::ROBFragment *rob)
void status(uint32_t n, const uint32_t *status)
void append(eformat::write::ROSFragment *ros)

Referenced by EmcBuilder::pack(), HltBuilder::pack(), McParticleBuilder::pack(), MdcBuilder::pack(), MucBuilder::pack(), and TofBuilder::pack().

◆ append2event() [2/2]

void Builder::append2event ( WriteRawEvent *&  re,
uint32_t  source_id,
uint32_t  size 
)
protected

◆ expect() [1/2]

◆ expect() [2/2]

bool Builder::expect ( ifstream &  f,
string  msg,
string  fname 
)
static

Definition at line 28 of file Builder.cxx.

29{
30 string str;
31 if( f.bad() )
32 {
33 cerr << "Error: file " << fname << " is bad" << endl;
34 return false;
35 }
36 f >> str;
37 if( str == msg )
38 return true;
39
40 cerr << "Error: expected `" << msg << "|" << str <<"` in " << fname << endl;
41 return false;
42}

◆ expectInt() [1/2]

static bool Builder::expectInt ( ifstream &  f,
string  msg,
string  fname,
uint32_t &  val1,
uint32_t &  val2 
)
static

◆ expectInt() [2/2]

bool Builder::expectInt ( ifstream &  f,
string  msg,
string  fname,
uint32_t &  val1,
uint32_t &  val2 
)
static

Definition at line 44 of file Builder.cxx.

45{
46 if( !expect( f, msg, fname ) || f.bad() )
47 return false;
48 f >> val1 >> val2;
49 return true;
50}
static bool expect(ifstream &f, string msg, string fname)

◆ expectLong() [1/2]

static bool Builder::expectLong ( ifstream &  f,
string  msg,
string  fname,
uint64_t &  val 
)
static

◆ expectLong() [2/2]

bool Builder::expectLong ( ifstream &  f,
string  msg,
string  fname,
uint64_t &  val 
)
static

Definition at line 52 of file Builder.cxx.

53{
54 if ( !expect(f, msg, fname) || f.bad() )
55 return false;
56 f >> val;
57 return true;
58}

◆ find() [1/2]

◆ find() [2/2]

bool Builder::find ( ifstream &  f,
string  msg,
string  fname 
)
static

Definition at line 60 of file Builder.cxx.

61{
62 if ( f.bad() ) {
63 cerr << "Error: file " << fname << " bad checked" << endl;
64 return false;
65 }
66
67 string str;
68 while ( !f.eof() ) {
69 f >> str;
70 if ( str == msg ) return true;
71 }
72
73 return false;
74}

◆ getREID() [1/2]

◆ getREID() [2/2]

◆ getTEID() [1/2]

◆ getTEID() [2/2]

◆ initialize() [1/2]

◆ initialize() [2/2]

Member Data Documentation

◆ m_buf

◆ m_confFile

◆ m_propMgr

PropertyMgr Builder::m_propMgr
protected

◆ m_status

uint32_t Builder::m_status
protected

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