36 metadata =
grl.GetMetaData();
37 version =
grl.GetVersion();
48 piovComplete->setStore( piovCompleteAux );
51 std::map<Int_t, Root::TGoodRun>::const_iterator it;
52 std::vector< Root::TLumiBlockRange >::const_iterator itlbr;
53 int RunNumber(-1), LumiBlockStart(-1), LumiBlockEnd(-1);
55 for(it =
grl.begin(); it !=
grl.end(); ++it) {
56 RunNumber = it->first;
58 for(itlbr = goodrun.begin(); itlbr != goodrun.end(); ++itlbr) {
59 LumiBlockStart = itlbr->Begin();
60 LumiBlockEnd = itlbr->End();
100 m_writer->SetGRLCollection( grlcollection ) ;
101 m_writer->SetFilename( xmlfilename ) ;
110 TString
xmlfile = ( xmlfilename.IsNull() ? prefix +
grl.GetSuggestedName() +
".xml" : xmlfilename );
118 const TString& xmlfilename,
const TString& prefix )
121 m_writer->SetGoodRunsList( *pgrl ) ;
132 m_writer->SetGRLCollection( grlcollection ) ;
149 m_writer->SetGRLCollection( grlcollection ) ;
154const std::vector<TString>
157 m_writer->SetGRLCollection( grlcollection ) ;
166 m_writer->SetGoodRunsList( *pgrl ) ;
167 TString xmlstring =
m_writer->GetXMLString() ;
177 grl->SetVersion(version);
178 grl->SetMetaData(metadata);
182 int prev_runnbr(-1), cur_runnbr(-1), cur_lbstart(-1), cur_lbstop(-1);
187 cur_runnbr = lbr->startRunNumber();
188 cur_lbstart = lbr->startLumiBlockNumber();
189 cur_lbstop = lbr->stopLumiBlockNumber();
191 if (prev_runnbr!=cur_runnbr) {
192 if (prev_runnbr>=0) { (*grl)[prev_runnbr]=goodrun; }
198 prev_runnbr = cur_runnbr;
200 (*grl)[prev_runnbr]=goodrun;
221 m_reader->SetXMLString( xmlstring );
239 m_reader->SetXMLString( xmlstring );
248 if (lbc.
empty())
return "grl_empty";
250 Int_t beginrun(-1), endrun(-1), beginlb(-1), endlb(-1);
259 beginrun = (*itb)->startRunNumber();
260 beginlb = (*itb)->startLumiBlockNumber();
261 endrun = (*ite)->stopRunNumber();
262 endlb = (*ite)->stopLumiBlockNumber();
264 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_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.
virtual ~LumiBlockRangeContainerConverter()
Root::TGoodRunsListWriter * m_writer
void CreateXMLFiles(const Root::TGRLCollection &grlcollection, const char *prefix)
const TString GetSuggestedName(const xAOD::LumiBlockRangeContainer &lbc) const
Root::TGoodRunsList * GetGRLObject(const xAOD::LumiBlockRangeContainer &lbc, const grlmetadatamap &metadata=grlmetadatamap(), const char *version="") const
LumiBlockRangeContainerConverter()
Root::TGoodRunsList * GetGRLObjectFromString(const TString &xmlstring)
xAOD::LumiBlockRangeContainer * GetLumiBlockRangeContainerFromString(const TString &xmlstring)
Root::TGRLCollection * GetGRLCollection(const char *xmlfile)
const std::vector< TString > GetXMLStrings(const Root::TGRLCollection &grlcollection)
const TString GetXMLString(const Root::TGoodRunsList &grl)
xAOD::LumiBlockRangeContainer * GetLumiBlockRangeContainer(const Root::TGoodRunsList &grl, std::map< TString, TString > &metadata, TString &version)
Root::TGoodRunsListReader * m_reader
void CreateXMLFile(const Root::TGoodRunsList &grl, const TString &xmlfilename="", const TString &prefix="")
Root::TGRLCollection * GetGRLCollectionFromString(const TString &xmlstring)
void SetRunNumber(const Int_t &runnr)
TString GetSuggestedName() const
void setStopRunNumber(uint32_t value)
Set the run number of the stop time of the range.
void setEventsSeen(uint32_t value)
Set the number of seen/processed events in this luminosity block range.
void setStartRunNumber(uint32_t value)
Set the run number of the start time of the range.
void setEventsExpected(uint32_t value)
Set the number of expected events in this luminosity block range.
void setStartLumiBlockNumber(uint32_t value)
Set the luminosity block of the start time of the range.
void setStopLumiBlockNumber(uint32_t value)
Set the luminosity block of the stop time of the range.
Helper functor used to sort xAOD::LumiBlockRangeContainer-s.
static std::vector< std::string > xmlfile
LumiBlockRange_v1 LumiBlockRange
Declare the latest version of the class.
LumiBlockRangeContainer_v1 LumiBlockRangeContainer
Declare the latest version of the container.
LumiBlockRangeAuxContainer_v1 LumiBlockRangeAuxContainer
Declare the latest version of the auxiliary container.