This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input.
More...
#include <ByteStreamMultipleOutputStreamCopyTool.h>
This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input.
Definition at line 47 of file ByteStreamMultipleOutputStreamCopyTool.h.
◆ ByteStreamMultipleOutputStreamCopyTool()
ByteStreamMultipleOutputStreamCopyTool::ByteStreamMultipleOutputStreamCopyTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor.
Definition at line 87 of file ByteStreamMultipleOutputStreamCopyTool.cxx.
96 declareInterface<IAthenaOutputStreamTool>(
this);
104 sprintf(buf,
"ByteStreamEventStorageOutputSvc%d",
i);
112 declareProperty(
"ByteStreamOutputSvc0",
m_outputSvc[0],
"Handle to the ByteStreamOutputSvc");
113 declareProperty(
"ByteStreamOutputSvc1",
m_outputSvc[1],
"Handle to the ByteStreamOutputSvc");
114 declareProperty(
"ByteStreamOutputSvc2",
m_outputSvc[2],
"Handle to the ByteStreamOutputSvc");
115 declareProperty(
"ByteStreamOutputSvc3",
m_outputSvc[3],
"Handle to the ByteStreamOutputSvc");
116 declareProperty(
"ByteStreamOutputSvc4",
m_outputSvc[4],
"Handle to the ByteStreamOutputSvc");
117 declareProperty(
"ByteStreamOutputSvc5",
m_outputSvc[5],
"Handle to the ByteStreamOutputSvc");
118 declareProperty(
"ByteStreamOutputSvc6",
m_outputSvc[6],
"Handle to the ByteStreamOutputSvc");
119 declareProperty(
"ByteStreamOutputSvc7",
m_outputSvc[7],
"Handle to the ByteStreamOutputSvc");
120 declareProperty(
"ByteStreamOutputSvc8",
m_outputSvc[8],
"Handle to the ByteStreamOutputSvc");
121 declareProperty(
"ByteStreamOutputSvc9",
m_outputSvc[9],
"Handle to the ByteStreamOutputSvc");
122 declareProperty(
"ByteStreamOutputSvc10",
m_outputSvc[10],
"Handle to the ByteStreamOutputSvc");
123 declareProperty(
"ByteStreamOutputSvc11",
m_outputSvc[11],
"Handle to the ByteStreamOutputSvc");
124 declareProperty(
"ByteStreamOutputSvc12",
m_outputSvc[12],
"Handle to the ByteStreamOutputSvc");
125 declareProperty(
"ByteStreamOutputSvc13",
m_outputSvc[13],
"Handle to the ByteStreamOutputSvc");
126 declareProperty(
"ByteStreamOutputSvc14",
m_outputSvc[14],
"Handle to the ByteStreamOutputSvc");
127 declareProperty(
"ByteStreamOutputSvc15",
m_outputSvc[15],
"Handle to the ByteStreamOutputSvc");
128 declareProperty(
"ByteStreamOutputSvc16",
m_outputSvc[16],
"Handle to the ByteStreamOutputSvc");
129 declareProperty(
"ByteStreamOutputSvc17",
m_outputSvc[17],
"Handle to the ByteStreamOutputSvc");
130 declareProperty(
"ByteStreamOutputSvc18",
m_outputSvc[18],
"Handle to the ByteStreamOutputSvc");
131 declareProperty(
"ByteStreamOutputSvc19",
m_outputSvc[19],
"Handle to the ByteStreamOutputSvc");
132 declareProperty(
"ByteStreamOutputSvc20",
m_outputSvc[20],
"Handle to the ByteStreamOutputSvc");
133 declareProperty(
"ByteStreamOutputSvc21",
m_outputSvc[21],
"Handle to the ByteStreamOutputSvc");
134 declareProperty(
"ByteStreamOutputSvc22",
m_outputSvc[22],
"Handle to the ByteStreamOutputSvc");
135 declareProperty(
"ByteStreamOutputSvc23",
m_outputSvc[23],
"Handle to the ByteStreamOutputSvc");
136 declareProperty(
"ByteStreamOutputSvc24",
m_outputSvc[24],
"Handle to the ByteStreamOutputSvc");
137 declareProperty(
"ByteStreamOutputSvc25",
m_outputSvc[25],
"Handle to the ByteStreamOutputSvc");
138 declareProperty(
"ByteStreamOutputSvc26",
m_outputSvc[26],
"Handle to the ByteStreamOutputSvc");
139 declareProperty(
"ByteStreamOutputSvc27",
m_outputSvc[27],
"Handle to the ByteStreamOutputSvc");
140 declareProperty(
"ByteStreamOutputSvc28",
m_outputSvc[28],
"Handle to the ByteStreamOutputSvc");
141 declareProperty(
"ByteStreamOutputSvc29",
m_outputSvc[29],
"Handle to the ByteStreamOutputSvc");
142 declareProperty(
"ByteStreamOutputSvc30",
m_outputSvc[30],
"Handle to the ByteStreamOutputSvc");
143 declareProperty(
"ByteStreamOutputSvc31",
m_outputSvc[31],
"Handle to the ByteStreamOutputSvc");
144 declareProperty(
"ByteStreamOutputSvc32",
m_outputSvc[32],
"Handle to the ByteStreamOutputSvc");
145 declareProperty(
"ByteStreamOutputSvc33",
m_outputSvc[33],
"Handle to the ByteStreamOutputSvc");
146 declareProperty(
"ByteStreamOutputSvc34",
m_outputSvc[34],
"Handle to the ByteStreamOutputSvc");
147 declareProperty(
"ByteStreamOutputSvc35",
m_outputSvc[35],
"Handle to the ByteStreamOutputSvc");
148 declareProperty(
"ByteStreamOutputSvc36",
m_outputSvc[36],
"Handle to the ByteStreamOutputSvc");
149 declareProperty(
"ByteStreamOutputSvc37",
m_outputSvc[37],
"Handle to the ByteStreamOutputSvc");
150 declareProperty(
"ByteStreamOutputSvc38",
m_outputSvc[38],
"Handle to the ByteStreamOutputSvc");
151 declareProperty(
"ByteStreamOutputSvc39",
m_outputSvc[39],
"Handle to the ByteStreamOutputSvc");
152 declareProperty(
"ByteStreamOutputSvc40",
m_outputSvc[40],
"Handle to the ByteStreamOutputSvc");
153 declareProperty(
"ByteStreamOutputSvc41",
m_outputSvc[41],
"Handle to the ByteStreamOutputSvc");
154 declareProperty(
"ByteStreamOutputSvc42",
m_outputSvc[42],
"Handle to the ByteStreamOutputSvc");
155 declareProperty(
"ByteStreamOutputSvc43",
m_outputSvc[43],
"Handle to the ByteStreamOutputSvc");
156 declareProperty(
"ByteStreamOutputSvc44",
m_outputSvc[44],
"Handle to the ByteStreamOutputSvc");
157 declareProperty(
"ByteStreamOutputSvc45",
m_outputSvc[45],
"Handle to the ByteStreamOutputSvc");
158 declareProperty(
"ByteStreamOutputSvc46",
m_outputSvc[46],
"Handle to the ByteStreamOutputSvc");
159 declareProperty(
"ByteStreamOutputSvc47",
m_outputSvc[47],
"Handle to the ByteStreamOutputSvc");
160 declareProperty(
"ByteStreamOutputSvc48",
m_outputSvc[48],
"Handle to the ByteStreamOutputSvc");
161 declareProperty(
"ByteStreamOutputSvc49",
m_outputSvc[49],
"Handle to the ByteStreamOutputSvc");
163 declareProperty(
"ByteStreamInputSvc",
m_inputSvc,
"Handle to the ByteStreamInputSvc");
◆ ~ByteStreamMultipleOutputStreamCopyTool()
ByteStreamMultipleOutputStreamCopyTool::~ByteStreamMultipleOutputStreamCopyTool |
( |
| ) |
|
|
virtual |
◆ commitOutput()
StatusCode ByteStreamMultipleOutputStreamCopyTool::commitOutput |
( |
bool |
doCommit = false | ) |
|
|
virtual |
Commit the output stream after having streamed out objects Must commitOutput AFTER streaming.
Definition at line 317 of file ByteStreamMultipleOutputStreamCopyTool.cxx.
321 ATH_MSG_ERROR(
" failed to get the current event from ByteStreamInputSvc " );
322 return StatusCode::FAILURE ;
325 int run = re_c->run_no();
328 if (re_c->version() < 0x03010000) {
eventNumber=re_c->lvl1_id(); }
331 int lbn = re_c->lumi_block();
333 int bcid = re_c->bc_id();
335 int nL1word = re_c->nlvl1_trigger_info();
345 return StatusCode::SUCCESS ;
354 return StatusCode::SUCCESS ;
367 if ((
l.currentevent>=
l.nevt || ((
unsigned int)
l.currentevent)>
l.trigmap.size()) &&
l.noalgps>0) {
368 ATH_MSG_WARNING(
"Only expecting "<<
l.nevt<<
" events in "<<
run<<
" "<<
lbn<<
" with trigmap size "<<
l.trigmap.size());
371 std::vector<int>
streams=
l.streammap[
l.currentevent];
373 else{
ATH_MSG_INFO(
lbn<<
" "<<
l.currentevent<<
" goes to "<<
streams.size()<<
" streams and j40 is "<<
l.trigmap[
l.currentevent]);}
376 for (
unsigned int s=0;
s<
streams.size(); ++
s){
381 return StatusCode::FAILURE ;
383 if (
l.noalgps>0){
if (
l.trigmap[
l.currentevent])
l.written_j40++;
else l.written_no_j40++; }
392 static int eventstream=-1,ntotevents=0;
397 return StatusCode::FAILURE ;
401 if (ntotevents%100==0){ ++eventstream; }
404 return StatusCode::SUCCESS ;
409 return StatusCode::FAILURE ;
413 ATH_MSG_ERROR(
" failed to write event to ByteStreamOutputSvc"<<eventstream);
414 return StatusCode::FAILURE ;
416 ATH_MSG_INFO(
" wrote event "<<ntotevents<<
" to ByteStreamOutputSvc"<<eventstream);
419 return StatusCode::SUCCESS ;
◆ connectOutput()
StatusCode ByteStreamMultipleOutputStreamCopyTool::connectOutput |
( |
const std::string & |
outputName = "" | ) |
|
|
virtual |
◆ connectServices()
StatusCode ByteStreamMultipleOutputStreamCopyTool::connectServices |
( |
const std::string & |
dataStore, |
|
|
const std::string & |
cnvSvc, |
|
|
bool |
extendProvenenceRecord = false |
|
) |
| |
|
virtual |
◆ fillObjectRefs()
StatusCode ByteStreamMultipleOutputStreamCopyTool::fillObjectRefs |
( |
const DataObjectVec & |
dataObjects | ) |
|
|
virtual |
◆ finalize()
StatusCode ByteStreamMultipleOutputStreamCopyTool::finalize |
( |
| ) |
|
|
virtual |
Finalize.
Definition at line 274 of file ByteStreamMultipleOutputStreamCopyTool.cxx.
277 for (
auto l =
r->second.begin();
l!=
r->second.end();
l++ ){
279 if (
l->second.magic!=9999){
284 ATH_MSG_INFO(
r->first<<
" "<<
l->first<<
" wrote out "<<
l->second.written_j40<<
" j40 and "<<
l->second.written_no_j40<<
" non-j40 events");
286 if (
l->second.currentevent!=0){
288 if (
l->second.currentevent!=
l->second.nevt){
289 ATH_MSG_WARNING(
r->first<<
" "<<
l->first<<
" saw "<<
l->second.currentevent<<
" and we expected "<<
l->second.nevt<<
" events!");
292 ATH_MSG_INFO(
r->first<<
" "<<
l->first<<
" saw all "<<
l->second.nevt<<
" events expected.");
◆ finalizeOutput()
StatusCode ByteStreamMultipleOutputStreamCopyTool::finalizeOutput |
( |
| ) |
|
|
virtual |
◆ getInputItemList()
StatusCode ByteStreamMultipleOutputStreamCopyTool::getInputItemList |
( |
SG::IFolder * |
m_p2BWrittenFromTool | ) |
|
|
virtual |
◆ initialize()
StatusCode ByteStreamMultipleOutputStreamCopyTool::initialize |
( |
| ) |
|
|
virtual |
◆ initlbnmap()
void ByteStreamMultipleOutputStreamCopyTool::initlbnmap |
( |
| ) |
|
|
private |
Definition at line 189 of file ByteStreamMultipleOutputStreamCopyTool.cxx.
194 FILE *
fp = fopen(
file.c_str(),
"r");
197 throw std::runtime_error(
"File could not be opened in ByteStreamMultipleOutputStreamCopyTool::initlbnmap");
199 char *
line=
new char[500];
202 while (fgets(
line,480,
fp)) {
203 if (
line[0]==
'-')
continue;
204 int s=sscanf(&
line[0],
"stream %d, run %d, lbn %d, has %d events and %f/ub, %f intlumi of run, and %d wanted",&
stream,&
run,&
lbn,&nevt,&
intlumi,&intlumifrac,&nwanted);
223 FILE *
fp = fopen(
file.c_str(),
"r");
226 throw std::runtime_error(
"File could not be opened in ByteStreamMultipleOutputStreamCopyTool::initlbnmap");
228 char *
line=
new char[500];
231 while (fgets(
line,480,
fp)) {
232 if (
line[0]==
'-')
continue;
233 int s=sscanf(&
line[0],
"run_nbr=%d, evt_nbr=%d, time_stamp=%d, lbk_nbr=%d, noalg=%d, j40=%d, noalgps=%d, j40ps=%d",&
run,&
evt,&
time,&
lbn,&noalg,&j40,&psnoalg,&psj40);
235 ATH_MSG_INFO(evtinfile<<
": "<<
run<<
" "<<
lbn<<
" "<<
evt<<
": passed noalg j40 "<<noalg<<
" "<<j40<<
", prescale noalg j40 "<<psnoalg<<
" "<<psj40);
265 for (
auto l =
r->second.begin();
l!=
r->second.end();
l++ ){
266 l->second.makestreammap();
267 ATH_MSG_INFO(
r->first<<
" "<<
l->first<<
" wants: "<<
l->second.streameventstring());
◆ streamObjects() [1/2]
StatusCode ByteStreamMultipleOutputStreamCopyTool::streamObjects |
( |
const DataObjectVec & |
dataObjects, |
|
|
const std::string & |
outputName = "" |
|
) |
| |
|
virtual |
◆ streamObjects() [2/2]
StatusCode ByteStreamMultipleOutputStreamCopyTool::streamObjects |
( |
const TypeKeyPairs & |
typeKeys, |
|
|
const std::string & |
outputName = "" |
|
) |
| |
|
virtual |
◆ m_inputSvc
◆ m_lbn_map_file
std::string ByteStreamMultipleOutputStreamCopyTool::m_lbn_map_file |
|
private |
◆ m_NoutputSvc
int ByteStreamMultipleOutputStreamCopyTool::m_NoutputSvc |
|
private |
◆ m_outputSvc
◆ m_skipevents
int ByteStreamMultipleOutputStreamCopyTool::m_skipevents |
|
private |
◆ m_trigfile
std::string ByteStreamMultipleOutputStreamCopyTool::m_trigfile |
|
private |
◆ m_uselbnmap
bool ByteStreamMultipleOutputStreamCopyTool::m_uselbnmap |
|
private |
The documentation for this class was generated from the following files: