ATLAS Offline Software
TGoodRunsListWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 /**********************************************************************************
7  * Class : TGoodRunsListWriter *
8  * *
9  * Authors (alphabetical): *
10  * Max Baak <mbaak@cern.ch> - CERN, Switzerland *
11  **********************************************************************************/
12 
13 #ifndef _TGoodRunsListWriter
14 #define _TGoodRunsListWriter
15 
16 #include <vector>
17 
18 #include "TROOT.h"
19 #include "TList.h"
20 #include "TObject.h"
21 #include "TString.h"
22 
27 
28 typedef unsigned char xmlChar;
29 typedef struct _xmlTextWriter xmlTextWriter;
31 
32 namespace Root {
33 
34  class TLumiBlockRange;
35  class TGoodRun;
36  class TGoodRunsList;
37 
38  class ATLAS_NOT_THREAD_SAFE TGoodRunsListWriter : public TObject {
39 
40  public:
41 
43  TGoodRunsListWriter( const TGoodRunsList& goodrunslist, const TString& dataCardName );
45 
46  Bool_t WriteXMLFile();
47  Bool_t WriteXMLFiles();
48  const TString& GetXMLString();
49  const std::vector<TString>& GetXMLStrings();
50 
51  // accessors
52  inline const TString& GetFilename() const { return m_dataCardName; }
53  inline const TGoodRunsList GetMergedGoodRunsList( const Root::BoolOperation& operation = OR ) const
54  { return m_grlvec.GetMergedGoodRunsList(operation); }
55  inline const TGRLCollection& GetGRLCollection() const { return m_grlvec; }
56 
57  inline void SetMergeGoodRunsLists( bool merge=true ) { m_mergegrls=merge; }
58  inline void SetCheckGRLInfo( bool check=true ) { m_grlvec.SetCheckGRLInfo( check ); }
59  inline void SetIndividuals( bool indf=true ) { m_individuals=indf; }
60 
61  void SetGRLCollection( const TGRLCollection& grlvec ) { reset(); m_grlvec=grlvec; }
62  void SetGoodRunsList( const TGoodRunsList& goodrunslist ) { reset(); m_grlvec.push_back(goodrunslist); }
63  void SetFilename( const TString& dataCardName ) { m_dataCardName=dataCardName; }
64  void SetPrefix( const TString& prefix ) { m_prefix=prefix; }
65  void AddGoodRunsList( const TGoodRunsList& goodrunslist ) { m_grlvec.push_back(goodrunslist); }
66 
67  private:
68 
69  // aux method
70  void reset();
71 
72  Bool_t WriteLumiRangeCollection(xmlTextWriterPtr writer);
73  Bool_t WriteNamedLumiRange(xmlTextWriterPtr writer);
75  Bool_t WriteLumiBlockCollection(xmlTextWriterPtr writer, const TGoodRun& goodrun);
76  Bool_t WriteElement(xmlTextWriterPtr writer, const char* name, const char* value=0,
77  const char* atr1=0, const char* val1=0, const char* atr2=0, const char* val2=0);
78 
79  xmlChar* ConvertInput(const char *in, const char *encoding);
80 
83 
84  std::vector<TString> m_xmlstringVec;
85  TString m_xmlstring;
86  TString m_dataCardName;
87  TString m_prefix;
88 
90 
91  Bool_t m_mergegrls;
92  Bool_t m_individuals;
93 
94  ClassDef(TGoodRunsListWriter,0)
95  };
96 }
97 
98 #endif
99 
xmlChar
unsigned char xmlChar
Definition: TGoodRunsListWriter.h:28
TGoodRunsList.h
Root::TGoodRun
Definition: TGoodRun.h:27
Root
Definition: GoodRunsListSelectorTool.h:30
TGRLCollection.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
Root::TGoodRunsListWriter::m_logger
TMsgLogger m_logger
Definition: TGoodRunsListWriter.h:89
Root::TGoodRunsListWriter::SetIndividuals
void SetIndividuals(bool indf=true)
Definition: TGoodRunsListWriter.h:59
Root::TGoodRunsListWriter::m_individuals
Bool_t m_individuals
Definition: TGoodRunsListWriter.h:92
athena.value
value
Definition: athena.py:124
Root::TGoodRunsListWriter::m_xmlstringVec
std::vector< TString > m_xmlstringVec
Definition: TGoodRunsListWriter.h:84
Root::TGoodRunsListWriter::SetCheckGRLInfo
void SetCheckGRLInfo(bool check=true)
Definition: TGoodRunsListWriter.h:58
Root::TGoodRunsListWriter::m_grlvec
TGRLCollection m_grlvec
Definition: TGoodRunsListWriter.h:81
Root::TGoodRunsListWriter::WriteMetadata
Bool_t WriteMetadata(xmlTextWriterPtr writer)
Root::TGoodRunsListWriter::GetGRLCollection
const TGRLCollection & GetGRLCollection() const
Definition: TGoodRunsListWriter.h:55
Root::TGoodRunsListWriter::m_dataCardName
TString m_dataCardName
Definition: TGoodRunsListWriter.h:86
Root::TGoodRunsListWriter::m_mergegrls
Bool_t m_mergegrls
Definition: TGoodRunsListWriter.h:91
xmlTextWriterPtr
xmlTextWriter * xmlTextWriterPtr
Definition: TGoodRunsListWriter.h:30
generateReferenceFile.encoding
encoding
Definition: generateReferenceFile.py:15
Root::TGoodRunsListWriter
Definition: TGoodRunsListWriter.h:38
Root::TGoodRunsListWriter::SetFilename
void SetFilename(const TString &dataCardName)
Definition: TGoodRunsListWriter.h:63
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xmlTextWriter
struct _xmlTextWriter xmlTextWriter
Definition: TGoodRunsListWriter.h:29
Root::TGoodRunsListWriter::SetGRLCollection
void SetGRLCollection(const TGRLCollection &grlvec)
Definition: TGoodRunsListWriter.h:61
Root::TGoodRunsListWriter::m_xmlstring
TString m_xmlstring
Definition: TGoodRunsListWriter.h:85
Root::TGRLCollection
Definition: TGRLCollection.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Root::TGoodRunsListWriter::SetPrefix
void SetPrefix(const TString &prefix)
Definition: TGoodRunsListWriter.h:64
Root::TGoodRunsListWriter::GetMergedGoodRunsList
const TGoodRunsList GetMergedGoodRunsList(const Root::BoolOperation &operation=OR) const
Definition: TGoodRunsListWriter.h:53
Root::TGoodRunsListWriter::SetMergeGoodRunsLists
void SetMergeGoodRunsLists(bool merge=true)
Definition: TGoodRunsListWriter.h:57
Root::TGoodRunsList
Definition: TGoodRunsList.h:31
example.goodrunslist
goodrunslist
Definition: example.py:26
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:258
Root::TGoodRunsListWriter::SetGoodRunsList
void SetGoodRunsList(const TGoodRunsList &goodrunslist)
Definition: TGoodRunsListWriter.h:62
Root::TGoodRunsListWriter::m_prefix
TString m_prefix
Definition: TGoodRunsListWriter.h:87
CxxUtils::reset
constexpr std::enable_if_t< is_bitmask_v< E >, E & > reset(E &lhs, E rhs)
Convenience function to clear bits in a class enum bitmask.
Definition: bitmask.h:251
python.utility.LHE.merge
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
Definition: LHE.py:29
Root::OR
@ OR
Definition: TGRLCollection.h:32
TMsgLogger.h
Root::TMsgLogger
Definition: TMsgLogger.h:52
Root::TGoodRunsListWriter::m_grl
TGoodRunsList m_grl
Definition: TGoodRunsListWriter.h:82
Root::BoolOperation
BoolOperation
Definition: TGRLCollection.h:27
checker_macros.h
Define macros for attributes used to control the static checker.
example.writer
writer
show summary of content
Definition: example.py:36
Root::TGoodRunsListWriter::GetFilename
const TString & GetFilename() const
Definition: TGoodRunsListWriter.h:52
Root::TGoodRunsListWriter::AddGoodRunsList
void AddGoodRunsList(const TGoodRunsList &goodrunslist)
Definition: TGoodRunsListWriter.h:65
merge
Definition: merge.py:1