37 metadata =
grl.GetMetaData();
38 version =
grl.GetVersion();
49 std::map<Int_t, Root::TGoodRun>::const_iterator it;
50 std::vector< Root::TLumiBlockRange >::const_iterator itlbr;
51 int RunNumber(-1), LumiBlockStart(-1), LumiBlockEnd(-1);
53 for(it =
grl.begin(); it !=
grl.end(); ++it) {
54 RunNumber = it->first;
56 for(itlbr = goodrun.begin(); itlbr != goodrun.end(); ++itlbr) {
57 LumiBlockStart = itlbr->Begin();
58 LumiBlockEnd = itlbr->End();
90 m_writer->SetGRLCollection( grlcollection ) ;
91 m_writer->SetFilename( xmlfilename ) ;
100 TString
xmlfile = ( xmlfilename.IsNull() ? prefix +
grl.GetSuggestedName() +
".xml" : xmlfilename );
108 const TString& xmlfilename,
const TString& prefix )
111 m_writer->SetGoodRunsList( *pgrl ) ;
122 m_writer->SetGRLCollection( grlcollection ) ;
139 m_writer->SetGRLCollection( grlcollection ) ;
144const std::vector<TString>
147 m_writer->SetGRLCollection( grlcollection ) ;
156 m_writer->SetGoodRunsList( *pgrl ) ;
157 TString xmlstring =
m_writer->GetXMLString() ;
167 grl->SetVersion(version);
168 grl->SetMetaData(metadata);
172 int prev_runnbr(-1), cur_runnbr(-1), cur_lbstart(-1), cur_lbstop(-1);
180 if (prev_runnbr!=cur_runnbr) {
181 if (prev_runnbr>=0) { (*grl)[prev_runnbr]=goodrun; }
187 prev_runnbr = cur_runnbr;
189 (*grl)[prev_runnbr]=goodrun;
210 m_reader->SetXMLString( xmlstring );
228 m_reader->SetXMLString( xmlstring );
237 if (lbc.
empty())
return "grl_empty";
239 Int_t beginrun(-1), endrun(-1), beginlb(-1), endlb(-1);
244 beginrun = (*itb)->start().run();
245 beginlb = (*itb)->start().event();
246 endrun = (*ite)->stop().run();
247 endlb = (*ite)->stop().event();
249 return Form(
"grl_%d.%d-%d.%d",beginrun,beginlb,endrun,endlb);
std::map< TString, TString > grlmetadatamap
DataModel_detail::const_iterator< DataVector > const_iterator
void sort()
Sort the container.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::reverse_iterator< const_iterator > const_reverse_iterator
bool empty() const noexcept
Returns true if the collection is empty.
const IOVTime & stop() const
const IOVTime & start() const
Basic time unit for IOVSvc.
uint32_t event() const noexcept
uint32_t run() const noexcept
LumiBlockCollectionConverter()
Root::TGoodRunsList * GetGRLObject(const LumiBlockCollection &lbc, const grlmetadatamap &metadata=grlmetadatamap(), const char *version="") const
LumiBlockCollection * GetLumiBlockCollectionFromString(const TString &xmlstring)
LumiBlockCollection * GetLumiBlockCollection(const Root::TGoodRunsList &grl, std::map< TString, TString > &metadata, TString &version)
Root::TGoodRunsList * GetGRLObjectFromString(const TString &xmlstring)
virtual ~LumiBlockCollectionConverter()
Root::TGRLCollection * GetGRLCollection(const char *xmlfile)
const std::vector< TString > GetXMLStrings(const Root::TGRLCollection &grlcollection)
void CreateXMLFile(const Root::TGoodRunsList &grl, const TString &xmlfilename="", const TString &prefix="")
Root::TGoodRunsListWriter * m_writer
Root::TGoodRunsListReader * m_reader
const TString GetXMLString(const Root::TGoodRunsList &grl)
const TString GetSuggestedName(const LumiBlockCollection &lbc) const
Root::TGRLCollection * GetGRLCollectionFromString(const TString &xmlstring)
void CreateXMLFiles(const Root::TGRLCollection &grlcollection, const char *prefix)
void SetRunNumber(const Int_t &runnr)
TString GetSuggestedName() const
static std::vector< std::string > xmlfile