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

This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input. More...

#include <ByteStreamMultipleOutputStreamCopyTool.h>

Inheritance diagram for ByteStreamMultipleOutputStreamCopyTool:
Collaboration diagram for ByteStreamMultipleOutputStreamCopyTool:

Public Member Functions

 ByteStreamMultipleOutputStreamCopyTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual ~ByteStreamMultipleOutputStreamCopyTool ()
 Destructor. More...
 
virtual StatusCode initialize ()
 Initialize. More...
 
virtual StatusCode finalize ()
 Finalize. More...
 
virtual StatusCode connectOutput (const std::string &outputName="")
 Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions. More...
 
virtual StatusCode commitOutput (bool doCommit=false)
 Commit the output stream after having streamed out objects Must commitOutput AFTER streaming. More...
 
virtual StatusCode finalizeOutput ()
 Finalize the output stream after the last commit, e.g. More...
 
virtual StatusCode connectServices (const std::string &dataStore, const std::string &cnvSvc, bool extendProvenenceRecord=false)
 No need to connect Services. More...
 
virtual StatusCode streamObjects (const TypeKeyPairs &typeKeys, const std::string &outputName="")
 No object written for this tool. More...
 
virtual StatusCode streamObjects (const DataObjectVec &dataObjects, const std::string &outputName="")
 no stream of vector of objects either. More...
 
virtual StatusCode fillObjectRefs (const DataObjectVec &dataObjects)
 no refs for this tool. More...
 
virtual StatusCode getInputItemList (SG::IFolder *m_p2BWrittenFromTool)
 Get ItemList from the OutputStreamTool (e.g. all input objects) More...
 

Private Member Functions

void initlbnmap ()
 

Private Attributes

ServiceHandle< IByteStreamInputSvcm_inputSvc
 
bool m_uselbnmap
 
std::string m_lbn_map_file
 
std::string m_trigfile
 
std::vector< ServiceHandle< IByteStreamOutputSvc > > m_outputSvc
 
int m_NoutputSvc
 
int m_skipevents
 

Detailed Description

This is a tool that implements the IAthenaOutputStreamTool for copying ByteStream from input.

Definition at line 47 of file ByteStreamMultipleOutputStreamCopyTool.h.

Constructor & Destructor Documentation

◆ ByteStreamMultipleOutputStreamCopyTool()

ByteStreamMultipleOutputStreamCopyTool::ByteStreamMultipleOutputStreamCopyTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Definition at line 87 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

91  : base_class(type, name, parent),
92  m_inputSvc("ByteStreamEventStorageInputSvc", name),
93  m_uselbnmap(false)
94 {
95  // Declare IAthenaOutputStreamTool interface
96  declareInterface<IAthenaOutputStreamTool>(this);
97 
98  declareProperty("lbn_map_file",m_lbn_map_file="lbn_anal_map.txt");
99  declareProperty("skipevents",m_skipevents=0);
100  declareProperty("trigfile",m_trigfile="");
101  declareProperty("NoutputSvc",m_NoutputSvc=50);
102  for (int i=0; i<m_NoutputSvc; ++i){
103  char buf[100];
104  sprintf(buf,"ByteStreamEventStorageOutputSvc%d",i);
105  //std::cout<<"Making "<<buf<<std::endl;
107 
108  //sprintf(buf,"ByteStreamOutputSvc%d",i);
109  //declareProperty(buf, m_outputSvc[i], "Handle to the ByteStreamOutputSvc");
110  }
111 
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");
162 
163  declareProperty("ByteStreamInputSvc", m_inputSvc, "Handle to the ByteStreamInputSvc");
164 }

◆ ~ByteStreamMultipleOutputStreamCopyTool()

ByteStreamMultipleOutputStreamCopyTool::~ByteStreamMultipleOutputStreamCopyTool ( )
virtual

Destructor.

Definition at line 166 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

166  {
167 }

Member Function Documentation

◆ 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.

317  {
318  ATH_MSG_DEBUG( "In commitOutput" );
319  const RawEvent* re_c = m_inputSvc->currentEvent() ;
320  if(!re_c){
321  ATH_MSG_ERROR( " failed to get the current event from ByteStreamInputSvc " );
322  return StatusCode::FAILURE ;
323  }
324 
325  int run = re_c->run_no();
326  ATH_MSG_DEBUG("run is "<<run);
328  if (re_c->version() < 0x03010000) { eventNumber=re_c->lvl1_id(); }
329  else { eventNumber=re_c->global_id(); }
330  ATH_MSG_DEBUG("event is "<<eventNumber);
331  int lbn = re_c->lumi_block();
332  ATH_MSG_DEBUG("lbn is "<<lbn);
333  int bcid = re_c->bc_id();
334  ATH_MSG_DEBUG("bcid is "<<bcid);
335  int nL1word = re_c->nlvl1_trigger_info();
336  ATH_MSG_DEBUG("nL1word is "<<nL1word);
337  const OFFLINE_FRAGMENTS_NAMESPACE::DataType* L1word; re_c->lvl1_trigger_info(L1word);
338  int bit=240;//2*8 gets us to the Trigger AfterVeto (TAV) bank
339  ATH_MSG_DEBUG("bit "<<bit<<" fired? "<< IsBitSet(L1word[2*8+bit/32],bit%32) );
340 
341  //Skip the first N events, if asked to do so...
342  if (m_skipevents>0){
343  ATH_MSG_INFO("Skipping this event because skipevents="<<m_skipevents<<".");
344  --m_skipevents;
345  return StatusCode::SUCCESS ;
346  }
347 
348  if (m_uselbnmap==true){
349 
350  //See if we want this event in any stream...
351  lbninfo &l = runlbnmap[run][lbn];
352  if (l.magic!=9999){
353  ATH_MSG_WARNING( "Event in lbn "<<lbn<<" not in map... skipping." );
354  return StatusCode::SUCCESS ;
355  }
356 
357  if (l.noalgps>0){
358  //using trigmap info... check the event numbers line up
359  if (l.trigevt[l.currentevent] != (int)eventNumber){
360  ATH_MSG_ERROR("Trigmap was for event "<<l.trigevt[l.currentevent]<<" but we are on event "<<eventNumber);
361  }
362  else{
363  ATH_MSG_INFO("Trigmap matches for event "<<l.trigevt[l.currentevent]<<" and we are on event "<<eventNumber);
364  }
365  }
366 
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());
369  }
370 
371  std::vector<int> streams= l.streammap[l.currentevent];//so at this point the first event is at index 0, last at nevt-1
372  if (l.noalgps<0){ATH_MSG_INFO(lbn<<" "<<l.currentevent<<" goes to "<<streams.size()<<" streams");}
373  else{ATH_MSG_INFO(lbn<<" "<<l.currentevent<<" goes to "<<streams.size()<<" streams and j40 is "<<l.trigmap[l.currentevent]);}
374 
375  RawEvent* re = const_cast<RawEvent*>(re_c);
376  for (unsigned int s=0; s<streams.size(); ++s){
377  if (streams[s]>=m_NoutputSvc) ATH_MSG_ERROR("Stream "<<streams[s]<< "is more than we have ("<<m_NoutputSvc<<")");
378  else{
379  if( !m_outputSvc[streams[s]]->putEvent(re) ) {
380  ATH_MSG_ERROR( " failed to write event to ByteStreamOutputSvc"<<streams[s]);
381  return StatusCode::FAILURE ;
382  }
383  if (l.noalgps>0){ if (l.trigmap[l.currentevent]) l.written_j40++; else l.written_no_j40++; }
384  ATH_MSG_INFO( " wrote event to ByteStreamOutputSvc"<<streams[s] );
385  }
386  }
387  l.currentevent++;
388 
389  }//m_usebnlmap
390  else{
391  RawEvent* re = const_cast<RawEvent*>(re_c);
392  static int eventstream=-1,ntotevents=0;
393  if (m_lbn_map_file==std::string("random")){
394  eventstream = rand()%m_NoutputSvc;
395  if (eventstream<0 || eventstream>=m_NoutputSvc){
396  ATH_MSG_ERROR("Only have "<<m_NoutputSvc<<" streams but eventstream is "<<eventstream<<"!");
397  return StatusCode::FAILURE ;
398  }
399  }
400  else if (m_lbn_map_file==std::string("serial")){
401  if (ntotevents%100==0){ ++eventstream; }
402  if (eventstream<0 || eventstream>=m_NoutputSvc){
403  ATH_MSG_WARNING("Skipping event because only have "<<m_NoutputSvc<<" streams (of 100 events)");
404  return StatusCode::SUCCESS ;
405  }
406  }
407  else {
408  ATH_MSG_ERROR( " I don't know what lbn_map_file="<<m_lbn_map_file<<" means!");
409  return StatusCode::FAILURE ;
410  }
411 
412  if( !m_outputSvc[eventstream]->putEvent(re) ) {
413  ATH_MSG_ERROR( " failed to write event to ByteStreamOutputSvc"<<eventstream);
414  return StatusCode::FAILURE ;
415  }
416  ATH_MSG_INFO( " wrote event "<<ntotevents<<" to ByteStreamOutputSvc"<<eventstream);
417  ++ntotevents;
418  }
419  return StatusCode::SUCCESS ;
420 }

◆ connectOutput()

StatusCode ByteStreamMultipleOutputStreamCopyTool::connectOutput ( const std::string &  outputName = "")
virtual

Connect to the output stream Must connectOutput BEFORE streaming Only specify "outputName" if one wants to override jobOptions.

Do nothing for connectOutput

Definition at line 312 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

312  {
314  return StatusCode::SUCCESS;
315 }

◆ connectServices()

StatusCode ByteStreamMultipleOutputStreamCopyTool::connectServices ( const std::string &  dataStore,
const std::string &  cnvSvc,
bool  extendProvenenceRecord = false 
)
virtual

No need to connect Services.

Do nothing for connectServices

Definition at line 305 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

307  {
309  return StatusCode::SUCCESS;
310 }

◆ fillObjectRefs()

StatusCode ByteStreamMultipleOutputStreamCopyTool::fillObjectRefs ( const DataObjectVec &  dataObjects)
virtual

no refs for this tool.

Definition at line 446 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

446  {
447  if ( dataObjects.size()!=0){
448  ATH_MSG_WARNING( " fillObjectRefs is not supported. The whole input event is written out" );
449  }
450 
451  return(StatusCode::SUCCESS);
452 }

◆ finalize()

StatusCode ByteStreamMultipleOutputStreamCopyTool::finalize ( )
virtual

Finalize.

Definition at line 274 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

274  {
275 
276  for (auto r = runlbnmap.begin(); r!=runlbnmap.end(); r++ ){
277  for (auto l = r->second.begin(); l!=r->second.end(); l++ ){
278 
279  if (l->second.magic!=9999){
280  ATH_MSG_WARNING("Run "<<r->first<<" saw events but wasn't in the map");
281  continue;
282  }
283 
284  ATH_MSG_INFO(r->first<<" "<<l->first<<" wrote out "<<l->second.written_j40<<" j40 and "<<l->second.written_no_j40<<" non-j40 events");
285 
286  if (l->second.currentevent!=0){
287  //check that we got all the events we were promised
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!");
290  }
291  else {
292  ATH_MSG_INFO(r->first<<" "<<l->first<<" saw all "<<l->second.nevt<<" events expected.");
293  }
294  }
295  }
296  }
297 
298 
299  for (int i=0; i<m_NoutputSvc; ++i){
300  CHECK( m_outputSvc[i].release() );
301  }
302  return(::AlgTool::finalize());
303 }

◆ finalizeOutput()

StatusCode ByteStreamMultipleOutputStreamCopyTool::finalizeOutput ( )
virtual

Finalize the output stream after the last commit, e.g.

in finalize

Definition at line 423 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

424 {
425  return StatusCode::SUCCESS ;
426 }

◆ getInputItemList()

StatusCode ByteStreamMultipleOutputStreamCopyTool::getInputItemList ( SG::IFolder m_p2BWrittenFromTool)
virtual

Get ItemList from the OutputStreamTool (e.g. all input objects)

Definition at line 454 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

454  {
455  return(StatusCode::SUCCESS);
456 }

◆ initialize()

StatusCode ByteStreamMultipleOutputStreamCopyTool::initialize ( )
virtual

Initialize.

Definition at line 169 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

169  {
170  ATH_MSG_INFO( "Initializing" );
171 
172  CHECK( ::AlgTool::initialize() );
173 
174  // retrieve services
175  CHECK( m_inputSvc.retrieve() );
176 
177  for (int i=0; i<m_NoutputSvc; ++i){
178  CHECK( m_outputSvc[i].retrieve() );
179  }
180 
181  if (m_lbn_map_file!=std::string("") && m_lbn_map_file!=std::string("random") && m_lbn_map_file!=std::string("serial") ) m_uselbnmap=true;
182  ATH_MSG_INFO( "lbn_map_file is "<<m_lbn_map_file<<" and uselbnmap is "<<m_uselbnmap );
183 
184  if (m_uselbnmap==true) initlbnmap();
185 
186  return(StatusCode::SUCCESS);
187 }

◆ initlbnmap()

void ByteStreamMultipleOutputStreamCopyTool::initlbnmap ( )
private

Definition at line 189 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

189  {
190 
191  //read the runlbn map
192  std::string file = m_lbn_map_file;
193  ATH_MSG_INFO( "Going to open "<<file );
194  FILE *fp = fopen(file.c_str(),"r");
195  if (!fp) {
196  ATH_MSG_ERROR( "Could not open "<<file<<"!" );
197  throw std::runtime_error("File could not be opened in ByteStreamMultipleOutputStreamCopyTool::initlbnmap");
198  }
199  char *line=new char[500];
200  int stream,run,lbn,nevt,nwanted;
201  float intlumi,intlumifrac;
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);
205  if (s>0) {
206  ATH_MSG_DEBUG(run<<" "<<lbn<<" has "<<nevt<<" events and we want "<<nwanted<<" of them for stream "<<stream);
207  runlbnmap[run][lbn].magic=9999;
208  runlbnmap[run][lbn].nevt=nevt;
209  for (int w=0; w<m_NoutputSvc; ++w){runlbnmap[run][lbn].wantedmap[w]=nwanted;}
210  }
211  else{
212  ATH_MSG_ERROR("Line in "<<file<<" not understood!");
214  }
215  }
216  fclose(fp);
217  delete [] line;
218 
219  if (m_trigfile!=""){
220  //read the trigger info file
221  std::string file = m_trigfile;
222  ATH_MSG_INFO( "Going to open "<<file );
223  FILE *fp = fopen(file.c_str(),"r");
224  if (!fp) {
225  ATH_MSG_ERROR( "Could not open "<<file<<"!" );
226  throw std::runtime_error("File could not be opened in ByteStreamMultipleOutputStreamCopyTool::initlbnmap");
227  }
228  char *line=new char[500];
229  int run,evt,time,lbn,noalg,j40,psnoalg,psj40;
230  int evtinfile=0;
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);
234  if (s>0) {
235  ATH_MSG_INFO(evtinfile<<": "<<run<<" "<<lbn<<" "<<evt<<": passed noalg j40 "<<noalg<<" "<<j40<<", prescale noalg j40 "<<psnoalg<<" "<<psj40);
236 
237  if (runlbnmap[run][lbn].noalgps!=-1){
238  assert(runlbnmap[run][lbn].noalgps == psnoalg);//it should be the same for every event in the lbn
239  }
240  else runlbnmap[run][lbn].noalgps=psnoalg;
241 
242  if (runlbnmap[run][lbn].j40ps!=-1){
243  assert(runlbnmap[run][lbn].j40ps == psj40);//it should be the same for every event in the lbn
244  }
245  else runlbnmap[run][lbn].j40ps=psj40;
246 
247  runlbnmap[run][lbn].trigmap.push_back(j40);//whether j40 fired for this event index in the file
248  runlbnmap[run][lbn].trigevt.push_back(evt);//event number for this event index in the file, for cross-checking
249  ++evtinfile;
250  }
251  else{
252  ATH_MSG_ERROR("Line in "<<file<<" not understood!");
254  }
255  }
256  fclose(fp);
257  delete [] line;
258  }
259 
260  myrand.SetSeed();
261  ATH_MSG_INFO("Seed is "<<myrand.GetSeed());
262 
263  //go through the runlbn map and figure out which events to put to which stream(s)
264  for (auto r = runlbnmap.begin(); r!=runlbnmap.end(); r++ ){
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());
268  }
269  }
270 
271 }

◆ streamObjects() [1/2]

StatusCode ByteStreamMultipleOutputStreamCopyTool::streamObjects ( const DataObjectVec &  dataObjects,
const std::string &  outputName = "" 
)
virtual

no stream of vector of objects either.

Definition at line 438 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

438  {
439  if ( dataObjects.size()!=0){
440  ATH_MSG_WARNING( " Streaming objects is not supported. The whole input event is written out" );
441  }
442 
443  return(StatusCode::SUCCESS);
444 }

◆ streamObjects() [2/2]

StatusCode ByteStreamMultipleOutputStreamCopyTool::streamObjects ( const TypeKeyPairs &  typeKeys,
const std::string &  outputName = "" 
)
virtual

No object written for this tool.

Definition at line 429 of file ByteStreamMultipleOutputStreamCopyTool.cxx.

429  {
430  if ( typeKeys.size()!=0){
431  MsgStream log(msgSvc(), name());
432  ATH_MSG_WARNING( " Streaming objects is not supported. The whole input event is written out" );
433  }
434 
435  return(StatusCode::SUCCESS);
436 }

Member Data Documentation

◆ m_inputSvc

ServiceHandle<IByteStreamInputSvc> ByteStreamMultipleOutputStreamCopyTool::m_inputSvc
private

Definition at line 100 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_lbn_map_file

std::string ByteStreamMultipleOutputStreamCopyTool::m_lbn_map_file
private

Definition at line 104 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_NoutputSvc

int ByteStreamMultipleOutputStreamCopyTool::m_NoutputSvc
private

Definition at line 110 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_outputSvc

std::vector< ServiceHandle<IByteStreamOutputSvc> > ByteStreamMultipleOutputStreamCopyTool::m_outputSvc
private

Definition at line 109 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_skipevents

int ByteStreamMultipleOutputStreamCopyTool::m_skipevents
private

Definition at line 112 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_trigfile

std::string ByteStreamMultipleOutputStreamCopyTool::m_trigfile
private

Definition at line 105 of file ByteStreamMultipleOutputStreamCopyTool.h.

◆ m_uselbnmap

bool ByteStreamMultipleOutputStreamCopyTool::m_uselbnmap
private

Definition at line 103 of file ByteStreamMultipleOutputStreamCopyTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
beamspotman.r
def r
Definition: beamspotman.py:676
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
checkFileSG.line
line
Definition: checkFileSG.py:75
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ByteStreamMultipleOutputStreamCopyTool::m_NoutputSvc
int m_NoutputSvc
Definition: ByteStreamMultipleOutputStreamCopyTool.h:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
OFFLINE_FRAGMENTS_NAMESPACE::DataType
uint32_t DataType
Definition: RawEvent.h:24
python.outputTest_v2.streams
streams
Definition: outputTest_v2.py:55
ByteStreamMultipleOutputStreamCopyTool::m_lbn_map_file
std::string m_lbn_map_file
Definition: ByteStreamMultipleOutputStreamCopyTool.h:104
initialize
void initialize()
Definition: run_EoverP.cxx:894
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition: RawEvent.h:37
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
myrand
TRandom3 myrand
Definition: ByteStreamMultipleOutputStreamCopyTool.cxx:27
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
ByteStreamMultipleOutputStreamCopyTool::initlbnmap
void initlbnmap()
Definition: ByteStreamMultipleOutputStreamCopyTool.cxx:189
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
ByteStreamMultipleOutputStreamCopyTool::m_uselbnmap
bool m_uselbnmap
Definition: ByteStreamMultipleOutputStreamCopyTool.h:103
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
ByteStreamMultipleOutputStreamCopyTool::m_outputSvc
std::vector< ServiceHandle< IByteStreamOutputSvc > > m_outputSvc
Definition: ByteStreamMultipleOutputStreamCopyTool.h:109
lumiFormat.i
int i
Definition: lumiFormat.py:85
trigmenu_modify_prescale_json.fp
fp
Definition: trigmenu_modify_prescale_json.py:53
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
file
TFile * file
Definition: tile_monitor.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
run
Definition: run.py:1
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
ByteStreamMultipleOutputStreamCopyTool::m_inputSvc
ServiceHandle< IByteStreamInputSvc > m_inputSvc
Definition: ByteStreamMultipleOutputStreamCopyTool.h:100
IsBitSet
#define IsBitSet(val, bit)
Definition: ByteStreamMultipleOutputStreamCopyTool.cxx:17
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
lbninfo
Definition: ByteStreamMultipleOutputStreamCopyTool.cxx:29
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
lumiFormat.intlumi
intlumi
Definition: lumiFormat.py:107
re
const boost::regex re(r_e)
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
runlbnmap
std::map< int, std::map< int, lbninfo > > runlbnmap
Definition: ByteStreamMultipleOutputStreamCopyTool.cxx:84
ByteStreamMultipleOutputStreamCopyTool::m_trigfile
std::string m_trigfile
Definition: ByteStreamMultipleOutputStreamCopyTool.h:105
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
LB_AnalMapSplitter.lbn
lbn
Definition: LB_AnalMapSplitter.py:28
ByteStreamMultipleOutputStreamCopyTool::m_skipevents
int m_skipevents
Definition: ByteStreamMultipleOutputStreamCopyTool.h:112
ServiceHandle< IByteStreamOutputSvc >