#include <TGoodRunsListWriter.h>
Definition at line 38 of file TGoodRunsListWriter.h.
◆ TGoodRunsListWriter() [1/2]
| Root::TGoodRunsListWriter::TGoodRunsListWriter |
( |
| ) |
|
◆ TGoodRunsListWriter() [2/2]
| Root::TGoodRunsListWriter::TGoodRunsListWriter |
( |
const TGoodRunsList & | goodrunslist, |
|
|
const TString & | dataCardName ) |
◆ ~TGoodRunsListWriter()
| Root::TGoodRunsListWriter::~TGoodRunsListWriter |
( |
| ) |
|
◆ AddGoodRunsList()
| void Root::TGoodRunsListWriter::AddGoodRunsList |
( |
const TGoodRunsList & | goodrunslist | ) |
|
|
inline |
◆ 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 503 of file TGoodRunsListWriter.cxx.
504{
506
507#ifndef __NOLIBXML__
508
509 int ret;
510 int size;
511 int out_size;
512 int temp;
513 xmlCharEncodingHandlerPtr
handler;
514
515 if (in == 0)
516 return 0;
517
518 handler = xmlFindCharEncodingHandler(encoding);
519
522 return 0;
523 }
524
525 size = (
int) strlen(in) + 1;
526 out_size = size * 2 - 1;
527 out = (
unsigned char *) xmlMalloc((
size_t) out_size);
528
529 if (out != 0) {
530 temp = size - 1;
531 ret =
handler->input(out, &out_size, (
const xmlChar *) in, &temp);
532 if ((ret < 0) || (temp - size + 1)) {
533 if (ret < 0) {
535 } else {
536 m_logger <<
kWARNING <<
"ConvertInput: conversion wasn't successful. Converted: " << temp <<
" octets." <<
GEndl;
537 }
538
539 xmlFree(out);
541 } else {
542 out = (
unsigned char *) xmlRealloc(out, out_size + 1);
544 }
545 } else {
547 }
548
549#else
550
553
554
555#endif
556
558}
void handler(int sig)
signal handler
◆ GetFilename()
| const TString & Root::TGoodRunsListWriter::GetFilename |
( |
| ) |
const |
|
inline |
◆ GetGRLCollection()
| const TGRLCollection & Root::TGoodRunsListWriter::GetGRLCollection |
( |
| ) |
const |
|
inline |
◆ GetMergedGoodRunsList()
◆ GetXMLString()
| const TString & Root::TGoodRunsListWriter::GetXMLString |
( |
| ) |
|
Definition at line 194 of file TGoodRunsListWriter.cxx.
195{
197
201 }
202
203#ifndef __NOLIBXML__
204
208
209
210
211 buf = xmlBufferCreate();
212 if (buf == NULL) {
215 }
216
217
218
219 writer = xmlNewTextWriterMemory(buf, 0);
220 if (writer == NULL) {
223 }
224
225
227
228
229
230
231
232 rc = xmlTextWriterEndDocument(writer);
236 }
237
238 xmlFreeTextWriter(writer);
240 xmlBufferFree(buf);
241
242#else
243
246
247#endif
248
250}
xmlTextWriter * xmlTextWriterPtr
Bool_t WriteLumiRangeCollection(xmlTextWriterPtr writer)
writer
show summary of content
◆ GetXMLStrings()
| const std::vector< TString > & Root::TGoodRunsListWriter::GetXMLStrings |
( |
| ) |
|
loop over goodrunslists
set grl to store
Definition at line 165 of file TGoodRunsListWriter.cxx.
166{
168
172 }
173
174
176
178 std::vector< Root::TGoodRunsList >::const_iterator litr =
m_grlvec.begin();
179 for (
int i=0; litr!=
m_grlvec.end(); ++litr, ++
i) {
182
184 }
185
186
188
190}
const TString & GetXMLString()
std::vector< TString > m_xmlstringVec
◆ reset()
| void Root::TGoodRunsListWriter::reset |
( |
| ) |
|
|
private |
◆ SetCheckGRLInfo()
| void Root::TGoodRunsListWriter::SetCheckGRLInfo |
( |
bool | check = true | ) |
|
|
inline |
◆ SetFilename()
| void Root::TGoodRunsListWriter::SetFilename |
( |
const TString & | dataCardName | ) |
|
|
inline |
◆ SetGoodRunsList()
| void Root::TGoodRunsListWriter::SetGoodRunsList |
( |
const TGoodRunsList & | goodrunslist | ) |
|
|
inline |
◆ SetGRLCollection()
| void Root::TGoodRunsListWriter::SetGRLCollection |
( |
const TGRLCollection & | grlvec | ) |
|
|
inline |
◆ SetIndividuals()
| void Root::TGoodRunsListWriter::SetIndividuals |
( |
bool | indf = true | ) |
|
|
inline |
◆ SetMergeGoodRunsLists()
| void Root::TGoodRunsListWriter::SetMergeGoodRunsLists |
( |
bool | merge = true | ) |
|
|
inline |
Definition at line 57 of file TGoodRunsListWriter.h.
merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
◆ SetPrefix()
| void Root::TGoodRunsListWriter::SetPrefix |
( |
const TString & | prefix | ) |
|
|
inline |
◆ 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 437 of file TGoodRunsListWriter.cxx.
440{
441#ifndef __NOLIBXML__
442
444
445 rc = xmlTextWriterStartElement(writer, BAD_CAST (name));
448 return kFALSE;
449 }
450
451 if ((atr1!=0) && (val1!=0)) {
452 rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (atr1), BAD_CAST (val1));
455 return kFALSE;
456 }
457 }
458
459 if ((atr2!=0) && (val2!=0)) {
460 rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (atr2), BAD_CAST (val2));
463 return kFALSE;
464 }
465 }
466
467 if ((value!=0)) {
468 rc = xmlTextWriterWriteString(writer, BAD_CAST (value));
471 return kFALSE;
472 }
473 }
474
475 rc = xmlTextWriterEndElement(writer);
478 return kFALSE;
479 }
480
481#else
482
485
486
487#endif
488
489 return kTRUE;
490}
◆ WriteLumiBlockCollection()
Definition at line 392 of file TGoodRunsListWriter.cxx.
393{
394#ifndef __NOLIBXML__
396
397
398 rc = xmlTextWriterStartElement(writer, BAD_CAST
"LumiBlockCollection");
401 return kFALSE;
402 }
403
404 if (!goodrun.IsEmpty()) {
405
406 this->
WriteElement(writer,
"Run",Form(
"%d",goodrun.GetRunNumber()));
407
408 std::vector<TLumiBlockRange>::const_iterator litr = goodrun.begin();
409 for (; litr!=goodrun.end(); ++litr)
410 if (!litr->IsEmpty()) {
411 if (litr->End()!=2147483647)
412 this->
WriteElement(writer,
"LBRange",0,
"Start",Form(
"%d",litr->Begin()),
"End",Form(
"%d",litr->End()));
413 else
414 this->
WriteElement(writer,
"LBRange",0,
"Start",Form(
"%d",litr->Begin()));
415 }
416 }
417
418
419 rc = xmlTextWriterEndElement(writer);
422 return kFALSE;
423 }
424
425#else
426
429
430#endif
431
432 return kTRUE;
433}
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)
◆ WriteLumiRangeCollection()
| Bool_t Root::TGoodRunsListWriter::WriteLumiRangeCollection |
( |
xmlTextWriterPtr | writer | ) |
|
|
private |
Definition at line 254 of file TGoodRunsListWriter.cxx.
255{
256#ifndef __NOLIBXML__
257
260
261
262
263 rc = xmlTextWriterStartDocument(writer, NULL, NULL, NULL);
266 return kFALSE;
267 }
268
269
270 rc = xmlTextWriterWriteDTD(writer, (
xmlChar *)
"LumiRangeCollection", NULL,
271 (
xmlChar *)
"http://atlas-runquery.cern.ch/LumiRangeCollection.dtd", NULL);
274 return kFALSE;
275 }
276
277
278
279
280
282 rc = xmlTextWriterWriteComment(writer, tmp);
285 return kFALSE;
286 }
287 if (tmp != NULL) xmlFree(tmp);
288
289
290
291 rc = xmlTextWriterStartElement(writer, BAD_CAST
"LumiRangeCollection");
294 return kFALSE;
295 }
296
297
298
299
301
303 } else {
304
306 std::vector< Root::TGoodRunsList >::const_iterator litr =
m_grlvec.begin();
307 for (; litr!=
m_grlvec.end(); ++litr) {
310 }
311 } else {
314 }
315 }
316
317
318 rc = xmlTextWriterEndElement(writer);
321 return kFALSE;
322 }
323
324#else
325
328
329
330#endif
331
332 return kTRUE;
333}
xmlChar * ConvertInput(const char *in, const char *encoding)
ConvertInput: @in: string in a given encoding @encoding: the encoding used.
const TGoodRunsList GetMergedGoodRunsList(const Root::BoolOperation &operation=OR) const
Bool_t WriteNamedLumiRange(xmlTextWriterPtr writer)
◆ WriteMetadata()
◆ WriteNamedLumiRange()
| Bool_t Root::TGoodRunsListWriter::WriteNamedLumiRange |
( |
xmlTextWriterPtr | writer | ) |
|
|
private |
Definition at line 337 of file TGoodRunsListWriter.cxx.
338{
341 }
342
343#ifndef __NOLIBXML__
344
346
347 rc = xmlTextWriterStartElement(writer, BAD_CAST
"NamedLumiRange");
350 return kFALSE;
351 }
352
353
355
357
358 if (
m_grl.GetVersion().Length()>0) {
361
362 if (!
m_grl.GetMetaData().empty()) {
363 std::map<TString,TString>::const_iterator mitr =
m_grl.GetMetaData().begin();
364 for (; mitr!=
m_grl.GetMetaData().
end(); ++mitr)
365 this->
WriteElement(writer,
"Metadata",mitr->second.Data(),
"Name",mitr->first.Data());
367
368 std::map<Int_t,Root::TGoodRun>::const_iterator gitr =
m_grl.begin();
369 for (; gitr!=
m_grl.end(); ++gitr)
371
372
373 rc = xmlTextWriterEndElement(writer);
376 return kFALSE;
377 }
378
379#else
380
383
384
385#endif
386
387 return kTRUE;
388}
Bool_t WriteLumiBlockCollection(xmlTextWriterPtr writer, const TGoodRun &goodrun)
◆ WriteXMLFile()
| Bool_t Root::TGoodRunsListWriter::WriteXMLFile |
( |
| ) |
|
Definition at line 110 of file TGoodRunsListWriter.cxx.
111{
114 return kFALSE;
115 }
117 m_logger <<
kINFO <<
"Output filename not set. Will be generated automatically." <<
GEndl;
118 }
119
120#ifndef __NOLIBXML__
121
125
126
127 writer = xmlNewTextWriterDoc(&doc, 0);
128 if (writer == NULL) {
130 return kFALSE;
131 }
132
133
135
136
137
138
139
140 rc = xmlTextWriterEndDocument(writer);
143 return kFALSE;
144 }
145
146 xmlFreeTextWriter(writer);
147
149 xmlFreeDoc(doc);
150
152
153#else
154
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{
85 return kFALSE;
86 }
87
90
92 std::vector< Root::TGoodRunsList >::const_iterator litr =
m_grlvec.begin();
93 for (
int i=0; litr!=
m_grlvec.end(); ++litr, ++
i) {
96
99 }
100
101
104
105 return kTRUE;
106}
◆ m_dataCardName
| TString Root::TGoodRunsListWriter::m_dataCardName |
|
private |
◆ m_grl
◆ m_grlvec
◆ m_individuals
| Bool_t Root::TGoodRunsListWriter::m_individuals |
|
private |
◆ m_logger
◆ m_mergegrls
| Bool_t Root::TGoodRunsListWriter::m_mergegrls |
|
private |
◆ m_prefix
| TString Root::TGoodRunsListWriter::m_prefix |
|
private |
◆ m_xmlstring
| TString Root::TGoodRunsListWriter::m_xmlstring |
|
private |
◆ m_xmlstringVec
| std::vector<TString> Root::TGoodRunsListWriter::m_xmlstringVec |
|
private |
The documentation for this class was generated from the following files: