ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Root::TGoodRunsListWriter Class Reference

#include <TGoodRunsListWriter.h>

Inheritance diagram for Root::TGoodRunsListWriter:
Collaboration diagram for Root::TGoodRunsListWriter:

Public Member Functions

 TGoodRunsListWriter ()
 
 TGoodRunsListWriter (const TGoodRunsList &goodrunslist, const TString &dataCardName)
 
 ~TGoodRunsListWriter ()
 
Bool_t WriteXMLFile ()
 
Bool_t WriteXMLFiles ()
 
const TString & GetXMLString ()
 
const std::vector< TString > & GetXMLStrings ()
 
const TString & GetFilename () const
 
const TGoodRunsList GetMergedGoodRunsList (const Root::BoolOperation &operation=OR) const
 
const TGRLCollectionGetGRLCollection () const
 
void SetMergeGoodRunsLists (bool merge=true)
 
void SetCheckGRLInfo (bool check=true)
 
void SetIndividuals (bool indf=true)
 
void SetGRLCollection (const TGRLCollection &grlvec)
 
void SetGoodRunsList (const TGoodRunsList &goodrunslist)
 
void SetFilename (const TString &dataCardName)
 
void SetPrefix (const TString &prefix)
 
void AddGoodRunsList (const TGoodRunsList &goodrunslist)
 

Private Member Functions

void reset ()
 
Bool_t WriteLumiRangeCollection (xmlTextWriterPtr writer)
 
Bool_t WriteNamedLumiRange (xmlTextWriterPtr writer)
 
Bool_t WriteMetadata (xmlTextWriterPtr writer)
 
Bool_t WriteLumiBlockCollection (xmlTextWriterPtr writer, const TGoodRun &goodrun)
 
Bool_t WriteElement (xmlTextWriterPtr writer, const char *name, const char *value=0, const char *atr1=0, const char *val1=0, const char *atr2=0, const char *val2=0)
 
xmlCharConvertInput (const char *in, const char *encoding)
 ConvertInput: @in: string in a given encoding @encoding: the encoding used. More...
 

Private Attributes

TGRLCollection m_grlvec
 
TGoodRunsList m_grl
 
std::vector< TString > m_xmlstringVec
 
TString m_xmlstring
 
TString m_dataCardName
 
TString m_prefix
 
TMsgLogger m_logger
 
Bool_t m_mergegrls
 
Bool_t m_individuals
 

Detailed Description

Definition at line 38 of file TGoodRunsListWriter.h.

Constructor & Destructor Documentation

◆ TGoodRunsListWriter() [1/2]

Root::TGoodRunsListWriter::TGoodRunsListWriter ( )

Definition at line 41 of file TGoodRunsListWriter.cxx.

42  : TObject()
43  , m_logger ( "TGoodRunsListWriter" )
44  , m_mergegrls(false)
45  , m_individuals(false)
46 {
47 }

◆ TGoodRunsListWriter() [2/2]

Root::TGoodRunsListWriter::TGoodRunsListWriter ( const TGoodRunsList goodrunslist,
const TString &  dataCardName 
)

Definition at line 50 of file TGoodRunsListWriter.cxx.

51  : TObject()
52  , m_dataCardName( dataCardName )
53  , m_logger ( "TGoodRunsListWriter" )
54  , m_mergegrls(false)
55  , m_individuals(false)
56 {
57  m_grlvec.push_back(goodrunslist);
58 }

◆ ~TGoodRunsListWriter()

Root::TGoodRunsListWriter::~TGoodRunsListWriter ( )

Definition at line 61 of file TGoodRunsListWriter.cxx.

62 {
63  this->reset();
64 }

Member Function Documentation

◆ AddGoodRunsList()

void Root::TGoodRunsListWriter::AddGoodRunsList ( const TGoodRunsList goodrunslist)
inline

Definition at line 65 of file TGoodRunsListWriter.h.

65 { m_grlvec.push_back(goodrunslist); }

◆ ConvertInput()

xmlChar * Root::TGoodRunsListWriter::ConvertInput ( const char *  in,
const char *  encoding 
)
private

ConvertInput: @in: string in a given encoding @encoding: the encoding used.

Converts @in into UTF-8 for processing with libxml2 APIs

Returns the converted UTF-8 string, or NULL in case of error.

Definition at line 499 of file TGoodRunsListWriter.cxx.

500 {
501  xmlChar* out(0);
502 
503 #ifndef __NOLIBXML__
504 
505  int ret;
506  int size;
507  int out_size;
508  int temp;
509  xmlCharEncodingHandlerPtr handler;
510 
511  if (in == 0)
512  return 0;
513 
514  handler = xmlFindCharEncodingHandler(encoding);
515 
516  if (!handler) {
517  m_logger << kWARNING << "ConvertInput: no encoding handler found for " << (encoding ? encoding : "") << GEndl;
518  return 0;
519  }
520 
521  size = (int) strlen(in) + 1;
522  out_size = size * 2 - 1;
523  out = (unsigned char *) xmlMalloc((size_t) out_size);
524 
525  if (out != 0) {
526  temp = size - 1;
527  ret = handler->input(out, &out_size, (const xmlChar *) in, &temp);
528  if ((ret < 0) || (temp - size + 1)) {
529  if (ret < 0) {
530  m_logger << kWARNING << "ConvertInput: conversion wasn't successful." << GEndl;
531  } else {
532  m_logger << kWARNING << "ConvertInput: conversion wasn't successful. Converted: " << temp << " octets." << GEndl;
533  }
534 
535  xmlFree(out);
536  out = 0;
537  } else {
538  out = (unsigned char *) xmlRealloc(out, out_size + 1);
539  out[out_size] = 0; /*null terminating out */
540  }
541  } else {
542  m_logger << kWARNING << "ConvertInput: no mem" << GEndl;
543  }
544 
545 #else
546 
547  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
548  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
549 
550 
551 #endif
552 
553  return out;
554 }

◆ GetFilename()

const TString& Root::TGoodRunsListWriter::GetFilename ( ) const
inline

Definition at line 52 of file TGoodRunsListWriter.h.

52 { return m_dataCardName; }

◆ GetGRLCollection()

const TGRLCollection& Root::TGoodRunsListWriter::GetGRLCollection ( ) const
inline

Definition at line 55 of file TGoodRunsListWriter.h.

55 { return m_grlvec; }

◆ GetMergedGoodRunsList()

const TGoodRunsList Root::TGoodRunsListWriter::GetMergedGoodRunsList ( const Root::BoolOperation operation = OR) const
inline

Definition at line 53 of file TGoodRunsListWriter.h.

54  { return m_grlvec.GetMergedGoodRunsList(operation); }

◆ GetXMLString()

const TString & Root::TGoodRunsListWriter::GetXMLString ( )

Definition at line 194 of file TGoodRunsListWriter.cxx.

195 {
196  m_xmlstring="";
197 
198  if (m_grlvec.IsEmpty()) {
199  m_logger << kWARNING << "GoodRunsList is empty - nothing to write. Return false." << GEndl;
200  return m_xmlstring;
201  }
202 
203 #ifndef __NOLIBXML__
204 
205  int rc;
207  xmlBufferPtr buf;
208 
209  /* Create a new XML buffer, to which the XML document will be
210  * written */
211  buf = xmlBufferCreate();
212  if (buf == NULL) {
213  m_logger << kWARNING << "testXmlwriterMemory: Error creating the xml buffer" << GEndl;
214  return m_xmlstring;
215  }
216 
217  /* Create a new XmlWriter for memory, with no compression.
218  * Remark: there is no compression for this kind of xmlTextWriter */
219  writer = xmlNewTextWriterMemory(buf, 0);
220  if (writer == NULL) {
221  m_logger << kWARNING << "testXmlwriterMemory: Error creating the xml writer" << GEndl;
222  return m_xmlstring;
223  }
224 
225  /* Write out goodrunslist here */
226  this->WriteLumiRangeCollection(writer);
227 
228  /* Here we could close the elements ORDER and EXAMPLE using the
229  * function xmlTextWriterEndElement, but since we do not want to
230  * write any other elements, we simply call xmlTextWriterEndDocument,
231  * which will do all the work. */
232  rc = xmlTextWriterEndDocument(writer);
233  if (rc < 0) {
234  m_logger << kWARNING << "testXmlwriterMemory: Error at xmlTextWriterEndDocument" << GEndl;
235  return m_xmlstring;
236  }
237 
238  xmlFreeTextWriter(writer);
239  m_xmlstring = (const char *) buf->content;
240  xmlBufferFree(buf);
241 
242 #else
243 
244  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
245  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
246 
247 #endif
248 
249  return m_xmlstring;
250 }

◆ GetXMLStrings()

const std::vector< TString > & Root::TGoodRunsListWriter::GetXMLStrings ( )

loop over goodrunslists

set grl to store

Definition at line 165 of file TGoodRunsListWriter.cxx.

166 {
167  m_xmlstringVec.clear();
168 
169  if (m_grlvec.IsEmpty()) {
170  m_logger << kWARNING << "GoodRunsList is empty - nothing to write. Return false." << GEndl;
171  return m_xmlstringVec;
172  }
173 
174  // individual strings
175  m_individuals=true;
176 
178  std::vector< Root::TGoodRunsList >::const_iterator litr = m_grlvec.begin();
179  for (int i=0; litr!=m_grlvec.end(); ++litr, ++i) {
181  m_grl = (*litr);
182  // get xml string for this goodrunslist
183  m_xmlstringVec.push_back( this->GetXMLString() );
184  }
185 
186  // reset back to original values
187  m_individuals=false;
188 
189  return m_xmlstringVec;
190 }

◆ reset()

void Root::TGoodRunsListWriter::reset ( )
private

Definition at line 68 of file TGoodRunsListWriter.cxx.

69 {
70  m_grlvec.Reset();
71  m_grl.clear();
72  m_mergegrls = false;
73  m_individuals = false;
74  m_prefix="";
75  m_xmlstring="";
76  m_xmlstringVec.clear();
77 }

◆ SetCheckGRLInfo()

void Root::TGoodRunsListWriter::SetCheckGRLInfo ( bool  check = true)
inline

Definition at line 58 of file TGoodRunsListWriter.h.

◆ SetFilename()

void Root::TGoodRunsListWriter::SetFilename ( const TString &  dataCardName)
inline

Definition at line 63 of file TGoodRunsListWriter.h.

63 { m_dataCardName=dataCardName; }

◆ SetGoodRunsList()

void Root::TGoodRunsListWriter::SetGoodRunsList ( const TGoodRunsList goodrunslist)
inline

Definition at line 62 of file TGoodRunsListWriter.h.

62 { reset(); m_grlvec.push_back(goodrunslist); }

◆ SetGRLCollection()

void Root::TGoodRunsListWriter::SetGRLCollection ( const TGRLCollection grlvec)
inline

Definition at line 61 of file TGoodRunsListWriter.h.

61 { reset(); m_grlvec=grlvec; }

◆ SetIndividuals()

void Root::TGoodRunsListWriter::SetIndividuals ( bool  indf = true)
inline

Definition at line 59 of file TGoodRunsListWriter.h.

59 { m_individuals=indf; }

◆ SetMergeGoodRunsLists()

void Root::TGoodRunsListWriter::SetMergeGoodRunsLists ( bool  merge = true)
inline

Definition at line 57 of file TGoodRunsListWriter.h.

57 { m_mergegrls=merge; }

◆ SetPrefix()

void Root::TGoodRunsListWriter::SetPrefix ( const TString &  prefix)
inline

Definition at line 64 of file TGoodRunsListWriter.h.

64 { m_prefix=prefix; }

◆ WriteElement()

Bool_t Root::TGoodRunsListWriter::WriteElement ( xmlTextWriterPtr  writer,
const char *  name,
const char *  value = 0,
const char *  atr1 = 0,
const char *  val1 = 0,
const char *  atr2 = 0,
const char *  val2 = 0 
)
private

Definition at line 433 of file TGoodRunsListWriter.cxx.

436 {
437 #ifndef __NOLIBXML__
438 
439  int rc;
440  /* Start an element named 'name' as child of previous element. */
441  rc = xmlTextWriterStartElement(writer, BAD_CAST (name));
442  if (rc < 0) {
443  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterStartElement" << GEndl;
444  return kFALSE;
445  }
446  /* Add an attribute 'atr1' and value 'val1' to element. */
447  if ((atr1!=0) && (val1!=0)) {
448  rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (atr1), BAD_CAST (val1));
449  if (rc < 0) {
450  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterWriteAttribute" << GEndl;
451  return kFALSE;
452  }
453  }
454  /* Add an attribute 'atr2' and value 'val2' to element. */
455  if ((atr2!=0) && (val2!=0)) {
456  rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (atr2), BAD_CAST (val2));
457  if (rc < 0) {
458  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterWriteAttribute" << GEndl;
459  return kFALSE;
460  }
461  }
462  /* Add value 'value' to the element */
463  if ((value!=0)) {
464  rc = xmlTextWriterWriteString(writer, BAD_CAST (value));
465  if(rc < 0) {
466  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterWriteString" << GEndl;
467  return kFALSE;
468  }
469  }
470  /* Close the element */
471  rc = xmlTextWriterEndElement(writer);
472  if (rc < 0) {
473  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterEndElement" << GEndl;
474  return kFALSE;
475  }
476 
477 #else
478 
479  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
480  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
481 
482 
483 #endif
484 
485  return kTRUE;
486 }

◆ WriteLumiBlockCollection()

Bool_t Root::TGoodRunsListWriter::WriteLumiBlockCollection ( xmlTextWriterPtr  writer,
const TGoodRun goodrun 
)
private

Definition at line 388 of file TGoodRunsListWriter.cxx.

389 {
390 #ifndef __NOLIBXML__
391  int rc;
392 
393  /* Start an element named "NamedLumiRange" as child of LumiRangeCollection. */
394  rc = xmlTextWriterStartElement(writer, BAD_CAST "LumiBlockCollection");
395  if (rc < 0) {
396  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterStartElement" << GEndl;
397  return kFALSE;
398  }
399 
400  if (!goodrun.IsEmpty()) {
401  /* Runnumber */
402  this->WriteElement(writer,"Run",Form("%d",goodrun.GetRunNumber()));
403  /* Start an element named "LBRange" */
404  std::vector<TLumiBlockRange>::const_iterator litr = goodrun.begin();
405  for (; litr!=goodrun.end(); ++litr)
406  if (!litr->IsEmpty()) {
407  if (litr->End()!=2147483647)
408  this->WriteElement(writer,"LBRange",0,"Start",Form("%d",litr->Begin()),"End",Form("%d",litr->End()));
409  else
410  this->WriteElement(writer,"LBRange",0,"Start",Form("%d",litr->Begin()));
411  }
412  }
413 
414  /* Close the element named Metadata. */
415  rc = xmlTextWriterEndElement(writer);
416  if (rc < 0) {
417  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterEndElement" << GEndl;
418  return kFALSE;
419  }
420 
421 #else
422 
423  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
424  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
425 
426 #endif
427 
428  return kTRUE;
429 }

◆ WriteLumiRangeCollection()

Bool_t Root::TGoodRunsListWriter::WriteLumiRangeCollection ( xmlTextWriterPtr  writer)
private

Definition at line 254 of file TGoodRunsListWriter.cxx.

255 {
256 #ifndef __NOLIBXML__
257 
258  int rc;
259  xmlChar *tmp;
260 
261  /* Start the document with the xml default for the version,
262  * default encoding, and the default for the standalone declaration. */
263  rc = xmlTextWriterStartDocument(writer, NULL, NULL/*MY_ENCODING*/, NULL);
264  if (rc < 0) {
265  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterStartDocument" << GEndl;
266  return kFALSE;
267  }
268 
269  /* Write DTD section */
270  xmlTextWriterWriteDTD(writer, (xmlChar *)"LumiRangeCollection", NULL,
271  (xmlChar *)"http://atlas-runquery.cern.ch/LumiRangeCollection.dtd", NULL);
272 
273  /* Write a comment as child of LumiRangeCollection.
274  * Please observe, that the input to the xmlTextWriter functions
275  * HAS to be in UTF-8, even if the output XML is encoded
276  * in iso-8859-1 */
277  tmp = ConvertInput("This document is created by GoodRunsListWriter.", MY_ENCODING);
278  rc = xmlTextWriterWriteComment(writer, tmp);
279  if (rc < 0) {
280  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterWriteComment" << GEndl;
281  return kFALSE;
282  }
283  if (tmp != NULL) xmlFree(tmp);
284 
285  /* Start an element named "LumiRangeCollection". Since thist is the first
286  * element, this will be the root element of the document. */
287  rc = xmlTextWriterStartElement(writer, BAD_CAST "LumiRangeCollection");
288  if (rc < 0) {
289  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterStartElement" << GEndl;
290  return kFALSE;
291  }
292 
293  /* Write the actual goodrunslist here.
294  * Use m_grl as global grl currently processed
295  */
296  if (m_individuals) {
297  // m_grl has already been set.
299  } else {
300  // m_grl is set here below
301  if (!m_mergegrls) {
302  std::vector< Root::TGoodRunsList >::const_iterator litr = m_grlvec.begin();
303  for (; litr!=m_grlvec.end(); ++litr) {
304  m_grl = (*litr);
306  }
307  } else {
308  m_grl = this->GetMergedGoodRunsList(); // OR merging
310  }
311  }
312 
313  /* Close the element */
314  rc = xmlTextWriterEndElement(writer);
315  if (rc < 0) {
316  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterEndElement" << GEndl;
317  return kFALSE;
318  }
319 
320 #else
321 
322  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
323  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
324 
325 
326 #endif
327 
328  return kTRUE;
329 }

◆ WriteMetadata()

Bool_t Root::TGoodRunsListWriter::WriteMetadata ( xmlTextWriterPtr  writer)
private

◆ WriteNamedLumiRange()

Bool_t Root::TGoodRunsListWriter::WriteNamedLumiRange ( xmlTextWriterPtr  writer)
private

Definition at line 333 of file TGoodRunsListWriter.cxx.

334 {
335  if (m_dataCardName.IsNull()) {
336  m_dataCardName = m_prefix + "merged_" + m_grl.GetSuggestedName() + ".xml" ;
337  }
338 
339 #ifndef __NOLIBXML__
340 
341  int rc;
342  /* Start an element named "NamedLumiRange" as child of LumiRangeCollection. */
343  rc = xmlTextWriterStartElement(writer, BAD_CAST "NamedLumiRange");
344  if (rc < 0) {
345  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterStartElement" << GEndl;
346  return kFALSE;
347  }
348 
349  /* Compress grl before writing to file */
350  m_grl.Compress(); // safe space, remove duplicates.
351  /* Write an element named "NAME" as child of NamedLumiRange. */
352  this->WriteElement(writer,"Name",m_grl.GetName());
353  /* Write an element named "VERSION" as child of NamedLumiRange. */
354  if (m_grl.GetVersion().Length()>0) {
355  this->WriteElement(writer,"Version",m_grl.GetVersion().Data());
356  } else { m_logger << kINFO << "<Version> written to xml file <" << m_dataCardName << "> is empty." << GEndl; }
357  /* Write Metadata */
358  if (!m_grl.GetMetaData().empty()) {
359  std::map<TString,TString>::const_iterator mitr = m_grl.GetMetaData().begin();
360  for (; mitr!=m_grl.GetMetaData().end(); ++mitr)
361  this->WriteElement(writer,"Metadata",mitr->second.Data(),"Name",mitr->first.Data());
362  } else { m_logger << kINFO << "<Metadata> written to xml file <" << m_dataCardName << "> is empty." << GEndl; }
363  /* loop over goodruns */
364  std::map<Int_t,Root::TGoodRun>::const_iterator gitr = m_grl.begin();
365  for (; gitr!=m_grl.end(); ++gitr)
366  this->WriteLumiBlockCollection(writer,gitr->second);
367 
368  /* Close the element named NamedLumiRange. */
369  rc = xmlTextWriterEndElement(writer);
370  if (rc < 0) {
371  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterEndElement" << GEndl;
372  return kFALSE;
373  }
374 
375 #else
376 
377  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
378  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
379 
380 
381 #endif
382 
383  return kTRUE;
384 }

◆ WriteXMLFile()

Bool_t Root::TGoodRunsListWriter::WriteXMLFile ( )

Definition at line 110 of file TGoodRunsListWriter.cxx.

111 {
112  if (m_grlvec.IsEmpty()) {
113  m_logger << kWARNING << "GoodRunsList is empty - nothing to write to <" << m_dataCardName << ">. Return false." << GEndl;
114  return kFALSE;
115  }
116  if (m_dataCardName.IsNull()) {
117  m_logger << kINFO << "Output filename not set. Will be generated automatically." << GEndl;
118  }
119 
120 #ifndef __NOLIBXML__
121 
122  int rc;
124  xmlDocPtr doc;
125 
126  /* Create a new XmlWriter for DOM, with no compression. */
127  writer = xmlNewTextWriterDoc(&doc, 0);
128  if (writer == NULL) {
129  m_logger << kWARNING << "testXmlwriterDoc: Error creating the xml writer" << GEndl;
130  return kFALSE;
131  }
132 
133  /* Write out goodrunslist here */
134  this->WriteLumiRangeCollection(writer);
135 
136  /* Here we could close the elements NamedLumiRange and LumiRangeCollection using the
137  * function xmlTextWriterEndElement, but since we do not want to
138  * write any other elements, we simply call xmlTextWriterEndDocument,
139  * which will do all the work. */
140  rc = xmlTextWriterEndDocument(writer);
141  if (rc < 0) {
142  m_logger << kWARNING << "testXmlwriterDoc: Error at xmlTextWriterEndDocument" << GEndl;
143  return kFALSE;
144  }
145 
146  xmlFreeTextWriter(writer);
147  //xmlSaveFileEnc(m_dataCardName.Data(), doc, MY_ENCODING);
148  xmlSaveFormatFile(m_dataCardName.Data(), doc, 1);
149  xmlFreeDoc(doc);
150 
151  m_logger << kINFO << "GoodRunsList stored as : " << m_dataCardName << GEndl;
152 
153 #else
154 
155  m_logger << kWARNING << "GoodRunsLists package compiled without libxml2" << GEndl;
156  m_logger << kWARNING << "can not write out GoodRunsList" << GEndl;
157 
158 #endif
159 
160  return kTRUE;
161 }

◆ WriteXMLFiles()

Bool_t Root::TGoodRunsListWriter::WriteXMLFiles ( )

loop over goodrunslists

set grl to store

Definition at line 81 of file TGoodRunsListWriter.cxx.

82 {
83  if (m_grlvec.IsEmpty()) {
84  m_logger << kWARNING << "GoodRunsList is empty - nothing to write. Return false." << GEndl;
85  return kFALSE;
86  }
87 
88  m_individuals=true;
89  TString olddatacardname=m_dataCardName;
90 
92  std::vector< Root::TGoodRunsList >::const_iterator litr = m_grlvec.begin();
93  for (int i=0; litr!=m_grlvec.end(); ++litr, ++i) {
95  m_grl = (*litr);
96  // write xml for this goodrunslist
97  m_dataCardName = m_prefix + Form("merged_%d_",i) + litr->GetSuggestedName() + ".xml" ;
98  (void) this->WriteXMLFile();
99  }
100 
101  // reset back to original values
102  m_individuals=false;
103  m_dataCardName=olddatacardname;
104 
105  return kTRUE;
106 }

Member Data Documentation

◆ m_dataCardName

TString Root::TGoodRunsListWriter::m_dataCardName
private

Definition at line 86 of file TGoodRunsListWriter.h.

◆ m_grl

TGoodRunsList Root::TGoodRunsListWriter::m_grl
private

Definition at line 82 of file TGoodRunsListWriter.h.

◆ m_grlvec

TGRLCollection Root::TGoodRunsListWriter::m_grlvec
private

Definition at line 81 of file TGoodRunsListWriter.h.

◆ m_individuals

Bool_t Root::TGoodRunsListWriter::m_individuals
private

Definition at line 92 of file TGoodRunsListWriter.h.

◆ m_logger

TMsgLogger Root::TGoodRunsListWriter::m_logger
private

Definition at line 89 of file TGoodRunsListWriter.h.

◆ m_mergegrls

Bool_t Root::TGoodRunsListWriter::m_mergegrls
private

Definition at line 91 of file TGoodRunsListWriter.h.

◆ m_prefix

TString Root::TGoodRunsListWriter::m_prefix
private

Definition at line 87 of file TGoodRunsListWriter.h.

◆ m_xmlstring

TString Root::TGoodRunsListWriter::m_xmlstring
private

Definition at line 85 of file TGoodRunsListWriter.h.

◆ m_xmlstringVec

std::vector<TString> Root::TGoodRunsListWriter::m_xmlstringVec
private

Definition at line 84 of file TGoodRunsListWriter.h.


The documentation for this class was generated from the following files:
xmlChar
unsigned char xmlChar
Definition: TGoodRunsListWriter.h:28
temp
Definition: JetEventDict.h:21
Root::kWARNING
@ kWARNING
Definition: TMsgLogger.h:51
Root::TGRLCollection::SetCheckGRLInfo
void SetCheckGRLInfo(Bool_t check=kTRUE)
Definition: TGRLCollection.h:41
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Root::TGoodRunsListWriter::m_logger
TMsgLogger m_logger
Definition: TGoodRunsListWriter.h:89
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Root::TGoodRunsListWriter::m_individuals
Bool_t m_individuals
Definition: TGoodRunsListWriter.h:92
athena.value
value
Definition: athena.py:122
Root::TGoodRunsListWriter::reset
void reset()
Definition: TGoodRunsListWriter.cxx:68
Root::TGoodRunsListWriter::m_xmlstringVec
std::vector< TString > m_xmlstringVec
Definition: TGoodRunsListWriter.h:84
Root::TGoodRunsListWriter::WriteElement
Bool_t WriteElement(xmlTextWriterPtr writer, const char *name, const char *value=0, const char *atr1=0, const char *val1=0, const char *atr2=0, const char *val2=0)
Definition: TGoodRunsListWriter.cxx:433
Root::TGoodRunsListWriter::m_grlvec
TGRLCollection m_grlvec
Definition: TGoodRunsListWriter.h:81
GEndl
#define GEndl
Definition: TMsgLogger.h:151
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
handler
void handler(int sig)
signal handler
Definition: rmain.cxx:98
Root::TGoodRunsList::GetMetaData
const std::map< TString, TString > & GetMetaData() const
Definition: TGoodRunsList.h:64
Root::TGoodRunsListWriter::WriteLumiBlockCollection
Bool_t WriteLumiBlockCollection(xmlTextWriterPtr writer, const TGoodRun &goodrun)
Definition: TGoodRunsListWriter.cxx:388
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Root::TGoodRunsListWriter::m_dataCardName
TString m_dataCardName
Definition: TGoodRunsListWriter.h:86
Root::TGoodRunsListWriter::m_mergegrls
Bool_t m_mergegrls
Definition: TGoodRunsListWriter.h:91
Root::TGoodRunsListWriter::WriteXMLFile
Bool_t WriteXMLFile()
Definition: TGoodRunsListWriter.cxx:110
Root::TGoodRunsListWriter::GetXMLString
const TString & GetXMLString()
Definition: TGoodRunsListWriter.cxx:194
lumiFormat.i
int i
Definition: lumiFormat.py:92
Root::TGoodRunsList::GetVersion
const TString & GetVersion() const
Definition: TGoodRunsList.h:63
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
ret
T ret(T t)
Definition: rootspy.cxx:260
Root::kINFO
@ kINFO
Definition: TMsgLogger.h:50
xmlTextWriterPtr
xmlTextWriter * xmlTextWriterPtr
Definition: TGoodRunsListWriter.h:30
generateReferenceFile.encoding
encoding
Definition: generateReferenceFile.py:15
Root::TGoodRunsListWriter::WriteLumiRangeCollection
Bool_t WriteLumiRangeCollection(xmlTextWriterPtr writer)
Definition: TGoodRunsListWriter.cxx:254
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
MY_ENCODING
#define MY_ENCODING
Definition: TGoodRunsListWriter.cxx:34
Root::TGoodRunsList::Compress
void Compress()
Definition: TGoodRunsList.cxx:429
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Root::TGoodRunsListWriter::m_xmlstring
TString m_xmlstring
Definition: TGoodRunsListWriter.h:85
Root::TGoodRunsListWriter::ConvertInput
xmlChar * ConvertInput(const char *in, const char *encoding)
ConvertInput: @in: string in a given encoding @encoding: the encoding used.
Definition: TGoodRunsListWriter.cxx:499
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Root::TGoodRunsListWriter::GetMergedGoodRunsList
const TGoodRunsList GetMergedGoodRunsList(const Root::BoolOperation &operation=OR) const
Definition: TGoodRunsListWriter.h:53
example.goodrunslist
goodrunslist
Definition: example.py:26
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:208
Root::TGRLCollection::GetMergedGoodRunsList
const TGoodRunsList GetMergedGoodRunsList(const Root::BoolOperation &operation=OR) const
Definition: TGRLCollection.cxx:128
Root::TGRLCollection::IsEmpty
Bool_t IsEmpty() const
Definition: TGRLCollection.cxx:114
Root::TGoodRunsListWriter::WriteNamedLumiRange
Bool_t WriteNamedLumiRange(xmlTextWriterPtr writer)
Definition: TGoodRunsListWriter.cxx:333
Root::TGoodRunsListWriter::m_prefix
TString m_prefix
Definition: TGoodRunsListWriter.h:87
Root::TGRLCollection::Reset
void Reset()
Definition: TGRLCollection.cxx:50
python.utility.LHE.merge
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Definition: LHE.py:17
Root::TGoodRunsListWriter::m_grl
TGoodRunsList m_grl
Definition: TGoodRunsListWriter.h:82
example.writer
writer
show summary of content
Definition: example.py:36
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:350
Root::TGoodRunsList::GetSuggestedName
TString GetSuggestedName() const
Definition: TGoodRunsList.cxx:390