ATLAS Offline Software
Loading...
Searching...
No Matches
AtlCoolCopy Class Reference

Public Member Functions

 AtlCoolCopy (const std::string &sourcedb, const std::string &destdb, bool allowcreate=false)
bool isOpen () const
bool addFolder (const std::string &folder, const bool onlyTags)
bool addExclude (const std::string &folder)
int copyFolder ATLAS_NOT_THREAD_SAFE (const std::string &folder, const std::vector< std::string > &taglist)
int doCopy ATLAS_NOT_THREAD_SAFE ()
int setOpts (int argc, const char *argv[])

Private Types

typedef std::map< std::string, PoolMapElementPoolMap
using HiTagMap = std::map<std::string, std::string>
using CoolTagMap = std::map<std::string, CoolTagInfo>

Private Member Functions

bool openConnections (const std::string &sourcedb, const std::string &destdb, bool allowcreate)
bool openCoraCool ()
bool getLockedTags ()
bool procOptVector (const int argc, const char *argv[], std::vector< std::string > &folders)
void setChannelRange (const cool::IFolderPtr &sourcefl)
int copyIOVs ATLAS_NOT_THREAD_SAFE (const std::string &folder, const std::string &destfolder, const cool::IFolderPtr &sourcefl, const CoraCoolFolderPtr &sourceflc, const cool::IFolderPtr &destfl, const CoraCoolFolderPtr &destflc, const std::string &sourcetag, const std::string &desttag, const cool::ValidityKey since, const cool::ValidityKey until, bool timestamp, bool checkrefs, bool iscora, const cool::PayloadMode::Mode paymode, bool created)
void adjustIOVs (const cool::ValidityKey &since, const cool::ValidityKey &until, const cool::ValidityKey &qsince, const cool::ValidityKey &quntil, cool::ValidityKey &newsince, cool::ValidityKey &newuntil, const bool timestamp) const
int nocopyIOVs (const std::string &folder, const cool::IFolderPtr &sourcefl, const std::string &sourcetag, const cool::ValidityKey since, const cool::ValidityKey until, bool checkrefs)
int verifyIOVs (const std::string &folder, const cool::IFolderPtr &sourcefl, const CoraCoolFolderPtr &sourceflc, const cool::IFolderPtr &destfl, const CoraCoolFolderPtr &destflc, const std::string &sourcetag, const cool::ValidityKey since, const cool::ValidityKey until, const bool checkrefs, const bool iscora, const cool::PayloadMode::Mode paymode)
int rootIOVs (const std::string &folder, const cool::IFolderPtr &sourcefl, const std::string &sourcetag, const cool::ValidityKey since, const cool::ValidityKey until, const bool timestamp)
std::string rootDirs (const std::string &folder, const std::string &toproot)
bool rootAllocate (const cool::IFieldSpecification &spec, void *&sptr, char &rootID) const
void rootWrite (void *sptr, const cool::IField &field) const
int analyseIOVs (const std::string &folder, const cool::IFolderPtr &sourcefl, const std::string &sourcetag, const cool::ValidityKey since, const cool::ValidityKey until, const bool timestamp)
bool getTimeFromRun ()
bool getOnlineRun ()
bool getBulkRun ()
bool getRunList ()
bool checkChannels (const std::string &folder, const cool::IFolderPtr &sourcefl, const cool::IFolderPtr &destfl, bool newfolder)
void checkRef (const cool::IRecord &payload, const std::string &folder, const std::string &tag)
int tagParents ()
int writeTagInfo ()
int listPoolRefs ()
int resolvePoolRefs ATLAS_NOT_THREAD_SAFE ()
void filePoolRefs ()
void setupCatalog (const std::vector< std::string > &catvec)

Static Private Member Functions

static std::string transConn (const std::string &inconn)
static cool::ChannelId channelID (const cool::IFolderPtr &folder, const std::string &chanstring)
static bool isNumeric (const char *input)
static bool equalRecord (const cool::IRecord &lhs, const cool::IRecord &rhs)
static TH1F * bookOrFindTH1F (const std::string &hID, const std::string &htitle, const int chan, const float xlow, const float xhigh)
static cool::ValidityKey timeVal (const char *input)
static std::string timeString (const cool::ValidityKey iovtime)
static cool::ValidityKey runLBVal (const char *input1, const char *input2)
static int getUpdateMode (std::string_view desc, std::string_view tag)
static std::string getCoolHistGUID (const std::string &file)

Private Attributes

SmartIF< Gaudi::IFileCatalog > m_catalog
std::string m_sourcedb
std::string m_destdb
bool m_allowcreate
bool m_recreate
bool m_includehead
bool m_excludehead
bool m_usertags
bool m_userupdatehead
bool m_debug
bool m_alliov
bool m_verify
bool m_root
bool m_zeronull
bool m_analyse
bool m_checkrefs
bool m_listpfn
bool m_poolopen
bool m_poolall
bool m_nocopy
bool m_nodata
bool m_nochannel
bool m_chdesc
bool m_hitag
bool m_nohitag
bool m_forcesingle
bool m_forcemulti
bool m_forcerune
bool m_forcetime
bool m_forcepay
bool m_forcenopay
bool m_sourceread
bool m_truncate
bool m_skipout
bool m_skiprep
bool m_applock
bool m_applocksv
bool m_readoracle
bool m_gettime
bool m_getonline
bool m_onlinerun
bool m_getbulk
bool m_prunetags
bool m_lockedonly
bool m_copytaginfo
bool m_copytaglock
bool m_coracool
bool m_ignoremode
bool m_ignorespec
bool m_checkdesttag
bool m_noclobroot
cool::ValidityKey m_runemin
cool::ValidityKey m_runemax
cool::ValidityKey m_timemin
cool::ValidityKey m_timemax
cool::ValidityKey m_newrunemin
cool::ValidityKey m_newrunemax
cool::ValidityKey m_newtimemin
cool::ValidityKey m_newtimemax
cool::ValidityKey m_srunemin
cool::ValidityKey m_srunemax
std::vector< std::string > m_channelRange
std::string m_channel1
std::string m_channel2
int m_bufsize
int m_sealmsg
long long m_anadelt
std::string m_outfolder
std::string m_outtag
std::string m_newdataset
std::string m_checkoutputfile
std::string m_timedb
std::string m_taglabel
std::string m_runinfohost
std::vector< std::string > m_addguid
std::vector< std::string > m_addlfn
std::vector< std::string > m_parfile
std::vector< cool::ChannelId > m_excludechans
std::vector< std::string > m_runfile
std::vector< unsigned int > m_runlist
coral::ConnectionService m_coralsvc
cool::Application m_coolapp
cool::IDatabaseSvc * m_dbSvc
ReplicaSorterm_repsort
cool::IDatabasePtr m_sourceDbPtr
cool::IDatabasePtr m_destDbPtr
CoraCoolDatabasePtr m_sourceCoraPtr
CoraCoolDatabasePtr m_destCoraPtr
std::vector< std::string > m_folderlist
std::vector< std::string > m_folderexcl
std::vector< std::string > m_tags
std::vector< std::string > m_magic
std::vector< std::string > m_poolcat
std::vector< std::string > m_mergecat
bool m_open
cool::ChannelSelection m_chansel
PoolMap::iterator m_poollast
PoolMap m_poolrefs
HiTagMap m_hitagmap
std::vector< std::string > m_hiparent
CoolTagMap m_cooltagmap
TFile * p_rootfile
ULong64_t m_nt_since = 0
ULong64_t m_nt_until = 0
UInt_t m_nt_runsince = 0
UInt_t m_nt_rununtil = 0
UInt_t m_nt_lbsince = 0
UInt_t m_nt_lbuntil = 0
UInt_t m_nt_channel = 0
char m_nt_tagid [256] = {0}
std::string m_nt_treename
std::vector< void * > m_nt_bufferptr

Detailed Description

Definition at line 81 of file AtlCoolCopy.cxx.

Member Typedef Documentation

◆ CoolTagMap

using AtlCoolCopy::CoolTagMap = std::map<std::string, CoolTagInfo>
private

Definition at line 280 of file AtlCoolCopy.cxx.

◆ HiTagMap

using AtlCoolCopy::HiTagMap = std::map<std::string, std::string>
private

Definition at line 274 of file AtlCoolCopy.cxx.

◆ PoolMap

typedef std::map<std::string,PoolMapElement> AtlCoolCopy::PoolMap
private

Definition at line 270 of file AtlCoolCopy.cxx.

Constructor & Destructor Documentation

◆ AtlCoolCopy()

AtlCoolCopy::AtlCoolCopy ( const std::string & sourcedb,
const std::string & destdb,
bool allowcreate = false )

Definition at line 302 of file AtlCoolCopy.cxx.

303 :
304 m_sourcedb(sourcedb),m_destdb(destdb),m_allowcreate(allowcreate),
305 m_recreate(false),
306 m_includehead(false),m_excludehead(false),
307 m_usertags(true),m_userupdatehead(false),m_debug(false),m_alliov(false),
308 m_verify(false),m_root(false),m_zeronull(false),m_analyse(false),
309 m_checkrefs(false),m_listpfn(false),m_poolopen(false),m_poolall(false),
310 m_nocopy(false),m_nodata(false),m_nochannel(false),m_chdesc(false),
311 m_hitag(false),m_nohitag(false),m_forcesingle(false),m_forcemulti(false),
312 m_forcerune(false),m_forcetime(false),m_forcepay(false),m_forcenopay(false),
313 m_sourceread(true),m_truncate(false),m_skipout(false),m_skiprep(false),
314 m_applock(false),m_applocksv(false),
315 m_readoracle(false),m_gettime(false),m_getonline(false),m_onlinerun(false),
316 m_getbulk(false),
317 m_prunetags(false),m_lockedonly(false),m_copytaginfo(false),
318 m_copytaglock(false),m_coracool(true),m_ignoremode(false),
319 m_ignorespec(false),m_checkdesttag(false),m_noclobroot(false),
320 m_runemin(cool::ValidityKeyMin),m_runemax(cool::ValidityKeyMax),
321 m_timemin(cool::ValidityKeyMin),m_timemax(cool::ValidityKeyMax),
322 m_newrunemin(cool::ValidityKeyMin),m_newrunemax(cool::ValidityKeyMax),
323 m_newtimemin(cool::ValidityKeyMin),m_newtimemax(cool::ValidityKeyMax),
324 m_srunemin(cool::ValidityKeyMin),m_srunemax(cool::ValidityKeyMax),
325 m_channel1(""),m_channel2(""),m_bufsize(1000),m_sealmsg(5),
328 m_runinfohost("http://atlas-run-info-api.web.cern.ch/api"),
330 m_dbSvc(&(m_coolapp.databaseService())),m_repsort(nullptr),
331 m_open(false),m_chansel(cool::ChannelSelection::all()),p_rootfile(nullptr)
332{
333 m_poolrefs.clear();
335 // configure CORAL components
336 coral::IConnectionServiceConfiguration& csconfig=m_coralsvc.configuration();
337 csconfig.disablePoolAutomaticCleanUp();
338 csconfig.setConnectionTimeOut(0);
339}
cool::ValidityKey m_newrunemin
cool::ValidityKey m_timemax
cool::ValidityKey m_newrunemax
cool::Application m_coolapp
std::string m_timedb
std::string m_outfolder
cool::ValidityKey m_runemax
cool::ValidityKey m_srunemax
long long m_anadelt
TFile * p_rootfile
std::string m_newdataset
cool::ValidityKey m_timemin
std::string m_outtag
PoolMap m_poolrefs
PoolMap::iterator m_poollast
std::string m_sourcedb
std::string m_channel2
cool::ChannelSelection m_chansel
cool::IDatabaseSvc * m_dbSvc
coral::ConnectionService m_coralsvc
cool::ValidityKey m_newtimemax
std::string m_channel1
cool::ValidityKey m_runemin
std::string m_destdb
std::string m_checkoutputfile
std::string m_taglabel
std::string m_runinfohost
bool m_userupdatehead
cool::ValidityKey m_srunemin
ReplicaSorter * m_repsort
cool::ValidityKey m_newtimemin

Member Function Documentation

◆ addExclude()

bool AtlCoolCopy::addExclude ( const std::string & folder)

Definition at line 530 of file AtlCoolCopy.cxx.

530 {
531 std::cout << "Adding folder to exclude list: " << folder << std::endl;
532 m_folderexcl.push_back(folder);
533 return true;
534}
std::vector< std::string > m_folderexcl

◆ addFolder()

bool AtlCoolCopy::addFolder ( const std::string & folder,
const bool onlyTags )

Definition at line 462 of file AtlCoolCopy.cxx.

462 {
463 std::cout << "Add folders in path:" << folder << " [ ";
464 const std::vector<std::string> nodelist=m_sourceDbPtr->listAllNodes();
465 // find all matching leaf folders
466 for (std::vector<std::string>::const_iterator nodeitr=nodelist.begin();
467 nodeitr!=nodelist.end();++nodeitr) {
468 // match exact folder name or leading part of path
469 // for leading part matches, next char in folder name must be '/'
470 // so /CALO/SetA matches /CALO/SetA/X but not /CALO/SetAB
471 if (*nodeitr==folder || folder=="/" ||
472 (nodeitr->compare(0,folder.size(),folder)==0 &&
473 nodeitr->size()>folder.size() && nodeitr->compare(folder.size(),1,"/")==0)) {
474 // check if folder on exclude list
475 bool exclude=false;
476 for (std::vector<std::string>::const_iterator iexcl=m_folderexcl.begin();
477 iexcl!=m_folderexcl.end();++iexcl) {
478 if (iexcl->compare(0,1,"/")==0) {
479 // exclude pattern starting / matches folder path (/SCT or /SCT/DCS)
480 exclude=(exclude || nodeitr->compare(0,iexcl->size(),*iexcl)==0);
481 } else {
482 // exclude pattern without leading / matches anywhere in folder
483 exclude=(exclude || (nodeitr->find(*iexcl)!=std::string::npos));
484 }
485 }
486 // check folder exists (is a leaf folder), and not excluded
487 if (m_sourceDbPtr->existsFolder(*nodeitr) && !exclude && !onlyTags) {
488 // only add if folder not already on list
489 if (find(m_folderlist.begin(),m_folderlist.end(),*nodeitr)==
490 m_folderlist.end()) {
491 std::cout << *nodeitr << " ";
492 m_folderlist.push_back(*nodeitr);
493 }
494 }
495 // if its a folderset, check for any hierarchical tags
496 if (!m_nohitag && m_sourceDbPtr->existsFolderSet(*nodeitr) && !exclude) {
497 if (!m_prunetags) {
498 const std::vector<std::string> foldersettags=
499 m_sourceDbPtr->getFolderSet(*nodeitr)->listTags();
500 if (!foldersettags.empty()) {
501 for (std::vector<std::string>::const_iterator
502 itr=foldersettags.begin();itr!=foldersettags.end();++itr) {
503 m_hitagmap[*itr]=*nodeitr;
504 }
505 }
506 } else {
507 // only take tags in this folder which are referenced from one of
508 // the input tags (assumed to be top-level tags)
509 cool::IFolderSetPtr sfolder=m_sourceDbPtr->getFolderSet(*nodeitr);
510 for (std::vector<std::string>::const_iterator toptag=m_tags.begin();
511 toptag!=m_tags.end();++toptag) {
512 try {
513 std::string rtag=sfolder->resolveTag(*toptag);
514 m_hitagmap[rtag]=*nodeitr;
515 }
516 // catch exceptions indicating tag defines nothing here
517 // note std::exception rather than COOL exception to cover case
518 // when trying to resolve a leaf tag in the '/' folder, which
519 // throws a coral AttributeException
520 catch (std::exception& e) {}
521 }
522 }
523 }
524 }
525 }
526 std::cout << "]" << std::endl;
527 return true;
528}
HiTagMap m_hitagmap
std::vector< std::string > m_tags
std::vector< std::string > m_folderlist
cool::IDatabasePtr m_sourceDbPtr
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140
std::set< std::string > exclude
list of directories to be excluded
Definition hcg.cxx:100

◆ adjustIOVs()

void AtlCoolCopy::adjustIOVs ( const cool::ValidityKey & since,
const cool::ValidityKey & until,
const cool::ValidityKey & qsince,
const cool::ValidityKey & quntil,
cool::ValidityKey & newsince,
cool::ValidityKey & newuntil,
const bool timestamp ) const
private

Definition at line 1297 of file AtlCoolCopy.cxx.

1303 {
1304 // set newsince/until to since/until
1305 // but doing any required truncation/adjustment
1306 newsince=since;
1307 newuntil=until;
1308 if (m_alliov) {
1309 // make IOV cover specified range
1310 if (timestamp) {
1311 newsince=m_newtimemin;
1312 newuntil=m_newtimemax;
1313 } else {
1314 newsince=m_newrunemin;
1315 newuntil=m_newrunemax;
1316 }
1317 }
1318 // check for IOV truncation to range of query
1319 if (m_truncate) {
1320 if (newsince<qsince) newsince=qsince;
1321 if (newuntil>quntil) newuntil=quntil;
1322 }
1323 // check not requesting an IOV with negative length
1324 if (newuntil<newsince) throw cool::Exception(
1325 "Attempt to insert IOV with -ve length","AtlCoolCopy::adjustIOVs");
1326}

◆ analyseIOVs()

int AtlCoolCopy::analyseIOVs ( const std::string & folder,
const cool::IFolderPtr & sourcefl,
const std::string & sourcetag,
const cool::ValidityKey since,
const cool::ValidityKey until,
const bool timestamp )
private

Definition at line 1864 of file AtlCoolCopy.cxx.

1867 {
1868 // analyse the IOV and channel structure of this folder/tag, make ROOT histos
1869 std::cout << "Analyse tag " << sourcetag << " of folder " << folder <<
1870 std::endl;
1871 bool anatime=(m_anadelt>=0);
1872 if (anatime) {
1873 std::cout << "Analyse time structures with tolerance of " <<
1874 m_anadelt/1.E9 << " seconds " << std::endl;
1875 }
1876 // create COOLANA/folder structure and create leaf directory for histograms
1877 std::string dirname=rootDirs(folder,"COOLANA");
1878 if (gDirectory->FindObject(dirname.c_str())==nullptr) {
1879 std::cout << "Make directory " << dirname << std::endl;
1880 gDirectory->mkdir(dirname.c_str());
1881 }
1882 gDirectory->cd(dirname.c_str());
1883 // get channels
1884 std::vector<cool::ChannelId> channels=sourcefl->listChannels();
1885 unsigned int nchan=channels.size();
1886 // end of last IOV seen on this channel
1887 long long* lastiov=new long long[nchan];
1888 long long* iovtotlen=new long long[nchan];
1889 long long* iovtotgap=new long long[nchan];
1890 int* iovn=new int[nchan];
1891 for (unsigned int i=0;i<nchan;++i) {
1892 lastiov[i]=-1; // no IOV seen on this channel yet
1893 iovtotlen[i]=0;
1894 iovtotgap[i]=0;
1895 iovn[i]=0;
1896 }
1897 cool::ValidityKey globsince=cool::ValidityKeyMax;
1898 cool::ValidityKey globuntil=cool::ValidityKeyMin;
1899
1900 // book histograms - only if the objects do not already exist (previous tag)
1901 TH1F* h_iovchan=bookOrFindTH1F("IOVSperChannel","IOVs per channel",
1902 nchan,-0.5,nchan-0.5);
1903 TH1F* h_iovname=bookOrFindTH1F("IOVSperChannelName",
1904 "IOVs per channel-name (copy of IOVSperChannel)",
1905 nchan,-0.5,nchan-0.5);
1906 TH1F* h_iovlength=bookOrFindTH1F("IOVLogLength","IOV log10 length",
1907 100,0.,20.);
1908 TH1F* h_iovgap=bookOrFindTH1F("IOVLogGapLength","IOV log10 gap length",
1909 100,0.,20.);
1910 // histograms for time analysis if needed
1911 TH1F* h_anadelt=nullptr;
1912 TH1F* h_chandelt=nullptr;
1913 if (anatime) {
1914 h_anadelt=bookOrFindTH1F("IOVAlignLogDelT","IOV alignment log deltaT",
1915 100,0.,20.);
1916 // add factor 2 in number of channels, to catch those where a channel
1917 // changes many times within the m_anadelt window (i.e. noise/jitter)
1918 h_chandelt=bookOrFindTH1F("AlignedChanPerIOV","Aligned channels per IOV",
1919 nchan*2,0.5,nchan*2-0.5);
1920 }
1921 std::cout << "Booked histograms for folder with " << nchan << " channels"
1922 << std::endl;
1923 // setup storage for IOV time analysis
1924 using IOVTimeMap = std::map<cool::ValidityKey, int>;
1925 IOVTimeMap iov_time_map;
1926
1927 // setup iterator to loop over objects
1928 int nobj=0;
1929 cool::FolderVersioning::Mode vermode=sourcefl->versioningMode();
1930 cool::IObjectIteratorPtr sourceitr;
1931 try {
1932 if (vermode==cool::FolderVersioning::SINGLE_VERSION) {
1933 sourceitr=sourcefl->browseObjects(since,until,m_chansel);
1934 } else {
1935 sourceitr=sourcefl->browseObjects(since,until,m_chansel,sourcetag);
1936 }
1937 }
1938 catch (cool::Exception& e) {
1939 std::cout << "Exception thrown from analysis copy iterator setup: " <<
1940 e.what() << std::endl;
1941 return 135;
1942 }
1943 // look up names of all the channels in one go
1944 std::map<cool::ChannelId,std::string>
1945 chanmap=sourcefl->listChannelsWithNames();
1946 // now loop over all IOVs and write them
1947 try {
1948 while (sourceitr->goToNext()) {
1949 const cool::IObject& sobj=sourceitr->currentRef();
1950 // get channel and find its index
1951 cool::ChannelId ichanid=sobj.channelId();
1952 const std::string& cname=chanmap[ichanid];
1953 std::pair<std::vector<cool::ChannelId>::iterator,
1954 std::vector<cool::ChannelId>::iterator > chanitr=
1955 std::equal_range(channels.begin(),channels.end(),ichanid);
1956 if (chanitr.first!=chanitr.second) {
1957 cool::ChannelId ichan=std::distance(channels.begin(),chanitr.first);
1958 Int_t bin=h_iovchan->Fill(ichan);
1959 if (ichan && !h_iovname->GetBinContent(bin)) {
1960 h_iovname->GetXaxis()->SetBinLabel(bin,cname.c_str());
1961 }
1962 h_iovname->Fill(ichan);
1963 // analyse IOV start/stop
1964 cool::ValidityKey since2=sobj.since();
1965 cool::ValidityKey until2=sobj.until();
1966 if (since2<globsince) globsince=since2;
1967 // dont count IOV is open-ended, so length statistics will make sense
1968 if (until2!=cool::ValidityKeyMax) {
1969 if (until2>globuntil) globuntil=until2;
1970 long long len=until2-since2;
1971 h_iovlength->Fill(log10(len));
1972 iovn[ichan]+=1;
1973 iovtotlen[ichan]+=len;
1974 }
1975 if (lastiov[ichan]<static_cast<long long>(since2) &&
1976 lastiov[ichan]>=0) {
1977 // have a gap in the IOV structure for this channel
1978 long long gap=since2-lastiov[ichan];
1979 iovtotgap[ichan]+=gap;
1980 h_iovgap->Fill(log10(gap));
1981 std::cout << "Gap of " << gap << std::endl;
1982 }
1983 if (until2!=cool::ValidityKeyMax) {
1984 lastiov[ichan]=until2;
1985 } else {
1986 lastiov[ichan]=since2;
1987 }
1988 // analyse IOV alignment
1989 if (anatime) {
1990 long long del1=-1;
1991 long long del2=-1;
1992 // find the nearest time to this one
1993 // this gives the first value exceeding since2
1994 IOVTimeMap::iterator hiitr=iov_time_map.lower_bound(since2);
1995 IOVTimeMap::iterator lowitr=hiitr;
1996 if (hiitr!=iov_time_map.end()) {
1997 // del1 is +ve time interval to next one
1998 del1=hiitr->first-since2;
1999 }
2000 if (lowitr!=iov_time_map.begin()) {
2001 // del2 is +ve time interval to previous one
2002 --lowitr;
2003 del2=since2-lowitr->first;
2004 }
2005 long long del=-1;
2006 IOVTimeMap::iterator moditr;
2007 bool domod=false;
2008 if (del1<=m_anadelt && del1>-1) {
2009 moditr=hiitr;
2010 del=del1;
2011 domod=true;
2012 }
2013 if (del2<=m_anadelt && del2>-1 && (del2<del || del==-1)) {
2014 moditr=lowitr;
2015 del=del2;
2016 domod=true;
2017 }
2018 if (domod) {
2019 ++(moditr->second);
2020 if (del>0) {
2021 h_anadelt->Fill(log10(del));
2022 } else {
2023 h_anadelt->Fill(0.);
2024 }
2025 } else {
2026 iov_time_map[since2]=0;
2027 }
2028 }
2029 } else {
2030 // channel ID not found
2031 std::cout << "ERROR :Channel " << ichanid <<
2032 " not found in channel list - ignored" << std::endl;
2033 }
2034 ++nobj;
2035 }
2036 std::cout << "Finished analysis with " << nobj << " objects" << std::endl;
2037 if (timestamp) {
2038 std::cout << "IOV timestamp range: " << globsince << " " <<
2039 timeString(globsince) << "to " << globuntil << " " <<
2040 timeString(globuntil) << std::endl;
2041 } else {
2042 std::cout << "IOV run/LB range [" << (globsince >> 32) << "," <<
2043 (globsince & 0xFFFFFFFF) << "] to [" << (globuntil >> 32) << "," <<
2044 (globuntil & 0xFFFFFFFF) << "]" << std::endl;
2045 }
2046 // calculate statistics for each channel
2047 TH1F* h_iovoccchan=bookOrFindTH1F("ChannelOcc","Channel Occupancy",
2048 nchan,-0.5,nchan-0.5);
2049 TH1F* h_iovlenchan=bookOrFindTH1F("IOVLenChan",
2050 "Mean IOV length per channel",nchan,-0.5,nchan-0.5);
2051 for (unsigned int i=0;i<nchan;++i) {
2052 float occ=0.;
2053 float avlen=0.;
2054 if (iovn[i]>0) {
2055 occ=1.-float(iovtotgap[i])/float(iovtotlen[i]+iovtotgap[i]);
2056 avlen=float(iovtotlen[i])/iovn[i];
2057 }
2058 h_iovoccchan->Fill(i,occ);
2059 h_iovlenchan->Fill(i,avlen);
2060 }
2061 if (anatime) {
2062 std::cout << "Alignment analysis: " << iov_time_map.size()
2063 << " seperate IOV starts (tolerance " << m_anadelt/1.E9 <<
2064 " seconds)" << std::endl;
2065 // fill histogram of number of channels incremented per IOV
2066 for (IOVTimeMap::const_iterator itr=iov_time_map.begin();
2067 itr!=iov_time_map.end();++itr) {
2068 h_chandelt->Fill(itr->second);
2069 }
2070 }
2071 }
2072 catch (cool::Exception& e) {
2073 std::cout << "Exception thrown from folder analysis reading loop: " <<
2074 e.what() << std::endl;
2075 return 134;
2076 }
2077 sourceitr->close();
2078 delete [] lastiov;
2079 delete [] iovtotlen;
2080 delete [] iovtotgap;
2081 delete[] iovn; iovn=nullptr;
2082 return 0;
2083}
static std::string timeString(const cool::ValidityKey iovtime)
std::string rootDirs(const std::string &folder, const std::string &toproot)
static TH1F * bookOrFindTH1F(const std::string &hID, const std::string &htitle, const int chan, const float xlow, const float xhigh)
gap(flags, cells_name, *args, **kw)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::string dirname(std::string name)
Definition utils.cxx:200

◆ ATLAS_NOT_THREAD_SAFE() [1/4]

int resolvePoolRefs AtlCoolCopy::ATLAS_NOT_THREAD_SAFE ( )
private

◆ ATLAS_NOT_THREAD_SAFE() [2/4]

int doCopy AtlCoolCopy::ATLAS_NOT_THREAD_SAFE ( )

◆ ATLAS_NOT_THREAD_SAFE() [3/4]

int copyIOVs AtlCoolCopy::ATLAS_NOT_THREAD_SAFE ( const std::string & folder,
const std::string & destfolder,
const cool::IFolderPtr & sourcefl,
const CoraCoolFolderPtr & sourceflc,
const cool::IFolderPtr & destfl,
const CoraCoolFolderPtr & destflc,
const std::string & sourcetag,
const std::string & desttag,
const cool::ValidityKey since,
const cool::ValidityKey until,
bool timestamp,
bool checkrefs,
bool iscora,
const cool::PayloadMode::Mode paymode,
bool created )
private

◆ ATLAS_NOT_THREAD_SAFE() [4/4]

int copyFolder AtlCoolCopy::ATLAS_NOT_THREAD_SAFE ( const std::string & folder,
const std::vector< std::string > & taglist )

◆ bookOrFindTH1F()

TH1F * AtlCoolCopy::bookOrFindTH1F ( const std::string & hID,
const std::string & htitle,
const int chan,
const float xlow,
const float xhigh )
staticprivate

Definition at line 2085 of file AtlCoolCopy.cxx.

2087 {
2088 // check histogram does not exist in current directory
2089 // if yes, return pointer to it, else book and return pointer
2090 TObject* obj=gDirectory->FindObject(hID.c_str());
2091 if (obj==nullptr) {
2092 return new TH1F(hID.c_str(),htitle.c_str(),nchan,xlow,xhigh);
2093 } else {
2094 return static_cast<TH1F*>(obj);
2095 }
2096}

◆ channelID()

cool::ChannelId AtlCoolCopy::channelID ( const cool::IFolderPtr & folder,
const std::string & chanstring )
staticprivate

Definition at line 862 of file AtlCoolCopy.cxx.

863 {
864 const char* cstr=chanstring.c_str();
865 if (isNumeric(cstr)) {
866 // channel is a number
867 return cool::ChannelId(strtoul(cstr,nullptr,10));
868 } else {
869 cool::ChannelId chan=0;
870 try {
871 chan=folder->channelId(chanstring);
872 std::cout << "Channel name " << chanstring << " maps to channelID "
873 << chan << std::endl;
874 }
875 catch (cool::Exception& e) {
876 std::cout << "ERROR: Channel name " << chanstring <<
877 " not defined in folder " << std::endl;
878 }
879 return chan;
880 }
881}
static bool isNumeric(const char *input)

◆ checkChannels()

bool AtlCoolCopy::checkChannels ( const std::string & folder,
const cool::IFolderPtr & sourcefl,
const cool::IFolderPtr & destfl,
bool newfolder )
private

Definition at line 2938 of file AtlCoolCopy.cxx.

2940 {
2941 // Channel manipulation is slow due to lack of bulk API for creating them
2942 // this routine therefore does the minimum work, not checking destination
2943 // if folder is newly created, and not copying description unless requested
2944 // get map of all channels
2945 const std::map<cool::ChannelId,std::string> chanmap=
2946 sourcefl->listChannelsWithNames();
2947 if (m_debug) std::cout << "Checking channels table for folder " << folder
2948 << " with " << chanmap.size() << " channels" << std::endl;
2949 int ncreate=0;
2950 int nmodify=0;
2951 // iterate over all channels
2952 for (std::map<cool::ChannelId,std::string>::const_iterator
2953 itr=chanmap.begin();itr!=chanmap.end();++itr) {
2954 // assume now ALL channels are in channels table (COOL 2.4 and above)
2955 const cool::ChannelId chan=itr->first;
2956 // check if channel should be skipped
2957 if (!m_excludechans.empty()) {
2958 if (find(m_excludechans.begin(),m_excludechans.end(),
2959 chan)!=m_excludechans.end()) continue;
2960 }
2961 if (!m_chansel.inSelection(chan)) continue;
2962
2963 const std::string& sourcename=itr->second;
2964 // only look up channel description if we are copying it
2965 std::string sourcedesc="";
2966 if (m_chdesc) sourcedesc=sourcefl->channelDescription(chan);
2967 // only check destination if folder alreay existed
2968 if (!newfolder && destfl->existsChannel(chan)) {
2969 const std::string & destname=destfl->channelName(chan);
2970 std::string destdesc="";
2971 if (m_chdesc) destdesc=destfl->channelDescription(chan);
2972 // if sourcename is not set, and destination is, dont worry
2973 if (sourcename!=destname && !sourcename.empty()) {
2974 // channel names differ - error if verifying, set if copying
2975 if (m_verify) {
2976 std::cout << "ERROR: Channel " << chan << " names differ: " <<
2977 sourcename << " " << destname << std::endl;
2978 return false;
2979 }
2980 destfl->setChannelName(chan,sourcename);
2981 std::cout << "Modify channel " << chan << " name from "
2982 << destname << " to " << sourcename << std::endl;
2983 ++nmodify;
2984 }
2985 if (sourcedesc!=destdesc && !sourcedesc.empty()) {
2986 // channel descriptions differ - error if verifying, set if copying
2987 if (m_verify) {
2988 std::cout << "ERROR: Channel " << chan << " descriptions differ: "
2989 << sourcedesc << " " << destdesc << std::endl;
2990 return false;
2991 }
2992 std::cout << "Modify channel " << chan << " description from "
2993 << sourcedesc << " to " << destdesc << std::endl;
2994 destfl->setChannelDescription(chan,sourcedesc);
2995 ++nmodify;
2996 }
2997 } else {
2998 // channel does not exist on destination - if verifying, this is error
2999 if (m_verify) return false;
3000 // otherwise create it
3001 if (m_debug) std::cout << "Create new channel " << chan << " name "
3002 << sourcename << " description" << sourcedesc << std::endl;
3003 destfl->createChannel(chan,sourcename,sourcedesc);
3004 ++ncreate;
3005 }
3006 }
3007 if (ncreate>0) std::cout << "Created " << ncreate << " new channels for "
3008 << folder << std::endl;
3009 if (nmodify>0) std::cout << "Modified " << nmodify << " channel info for "
3010 << folder << std::endl;
3011 return true;
3012}
std::vector< cool::ChannelId > m_excludechans

◆ checkRef()

void AtlCoolCopy::checkRef ( const cool::IRecord & payload,
const std::string & folder,
const std::string & tag )
private

Definition at line 3015 of file AtlCoolCopy.cxx.

3016 {
3017 const std::string name=payload[0].name();
3018 if (name=="PoolRef" || name=="fileGUID") {
3019 std::string poolref;
3020 std::string addr=payload[0].data<std::string>();
3021 if (name=="PoolRef") {
3022 std::string::size_type iofs1=addr.find("[DB=");
3023 std::string::size_type iofs2=addr.find(']',iofs1);
3024 if (iofs1!=std::string::npos && iofs2!=std::string::npos && iofs2>iofs1) {
3025 poolref=addr.substr(iofs1+4,iofs2-iofs1-4);
3026 } else {
3027 std::cout << "ERROR: Badly formed POOL object reference " <<
3028 addr << std::endl;
3029 }
3030 } else {
3031 // for fileGUID, POOL GUID is just the string
3032 poolref=std::move(addr);
3033 }
3034 std::string foldertag=folder+":"+tag;
3035 // insert into list, first check if same as before
3036 if (m_poollast!=m_poolrefs.end() && m_poollast->first==poolref) {
3037 m_poollast->second.inccount();
3038 m_poollast->second.addfoldertag(foldertag);
3039 } else {
3040 m_poollast=m_poolrefs.find(poolref);
3041 if (m_poollast!=m_poolrefs.end()) {
3042 m_poollast->second.inccount();
3043 m_poollast->second.addfoldertag(foldertag);
3044 } else {
3045 m_poolrefs[poolref]=PoolMapElement(1,foldertag);
3046 m_poollast=m_poolrefs.find(poolref);
3047 }
3048 }
3049 }
3050}

◆ equalRecord()

bool AtlCoolCopy::equalRecord ( const cool::IRecord & lhs,
const cool::IRecord & rhs )
staticprivate

Definition at line 2515 of file AtlCoolCopy.cxx.

2516 {
2517 // equality test for COOL IRecords, handling NULL string attributes correctly
2518 // tests values and types of Attributes, not names
2519 if (lhs.size()!=rhs.size()) return false;
2520 for (size_t i=0;i<lhs.size();++i) {
2521 // types must match - have to test explicitly first
2522 if (lhs[i].specification().storageType()!=
2523 rhs[i].specification().storageType())
2524 return false;
2525 // now use IField equality to for final test (spec again and data)
2526 if (lhs[i]!=rhs[i]) {
2527 // if not equal, check for special case of strings and compare directly
2528 // types are known to be equal so only test LHS
2529 const cool::StorageType& stype=lhs[i].specification().storageType();
2530 if (stype==cool::StorageType::String255 ||
2531 stype==cool::StorageType::String4k ||
2532 stype==cool::StorageType::String64k ||
2533 stype==cool::StorageType::String16M) {
2534 // check if string data payloads are really equal or not
2535 if (lhs[i].data<std::string>()!=rhs[i].data<std::string>())
2536 return false;
2537 } else {
2538 // if not string, trust the result of IField !=operator
2539 return false;
2540 }
2541 }
2542 }
2543 return true;
2544}

◆ filePoolRefs()

void AtlCoolCopy::filePoolRefs ( )
private

Definition at line 3290 of file AtlCoolCopy.cxx.

3290 {
3291 // list POOL refs and error codes, optionally to file
3292 if (!m_checkoutputfile.empty()) {
3293 std::cout << "Write POOL file checkoutput on " << m_checkoutputfile <<
3294 std::endl;
3295 } else {
3296 m_checkoutputfile="/dev/null";
3297 }
3298 std::ofstream chkostream(m_checkoutputfile.c_str());
3299 std::cout << "ErrCode GUID Count LFN PFN Folders ..." << std::endl;
3300 for (PoolMap::const_iterator ipool=m_poolrefs.begin();
3301 ipool!=m_poolrefs.end();++ipool) {
3302 if (m_poolall || ipool->second.errcode()>0) {
3303 std::ostringstream line;
3304 // write error code, GUID, usage count
3305 line << ipool->second.errcode() << " " << ipool->first << " " <<
3306 ipool->second.count() << " ";
3307 if (!ipool->second.lfn().empty()) {
3308 line << ipool->second.lfn() << " ";
3309 } else {
3310 line << "noLFN ";
3311 }
3312 if (!ipool->second.pfn().empty()) {
3313 line << ipool->second.pfn() << " ";
3314 } else {
3315 line << "noPFN ";
3316 }
3317 for (std::vector<std::string>::const_iterator
3318 itr=ipool->second.foldertag().begin();
3319 itr!=ipool->second.foldertag().end();++itr)
3320 line << *itr << " ";
3321 std::cout << line.str() << std::endl;
3322 chkostream << line.str() << std::endl;
3323 }
3324 }
3325}

◆ getBulkRun()

bool AtlCoolCopy::getBulkRun ( )
private

Definition at line 2799 of file AtlCoolCopy.cxx.

2799 {
2800 // get minimum run-number/timestamp for bulk reco update
2801 if (m_getonline) {
2802 std::cout << "ERROR: -getonline and -getbulk cannot be used simultaneously"
2803 << std::endl;
2804 return false;
2805 }
2806 std::cout << "Call getbulk using URL" << std::endl;
2807 // Initialize libcurl
2808 curl_global_init(CURL_GLOBAL_ALL);
2809 using uniqueCurl_t = std::unique_ptr<CURL,decltype(&curl_easy_cleanup)>;
2810 uniqueCurl_t curl(curl_easy_init(), curl_easy_cleanup);
2811 //CURL *curl = curl_easy_init();
2812 CURLcode res = CURLE_OK;
2813
2814 if (curl) {
2815 std::string url = m_runinfohost + "/runs/nemop/sync";
2816 // Set the URL
2817 res = curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
2818 if (res != CURLE_OK) {
2819 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2820 return false;
2821 }
2822 // Follow HTTP redirections
2823 res = curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1L);
2824 if (res != CURLE_OK) {
2825 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2826 return false;
2827 }
2828 // Response data buffer
2829 std::string response;
2830
2831 // Set the callback function to receive response data
2832 res = curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, WriteCallback);
2833 if (res != CURLE_OK) {
2834 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2835 return false;
2836 }
2837 res = curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &response);
2838 if (res != CURLE_OK) {
2839 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2840 return false;
2841 }
2842 // Perform the request
2843 res = curl_easy_perform(curl.get());
2844 if (res != CURLE_OK) {
2845 std::cerr << "Failed to perform request: " << curl_easy_strerror(res) << ":" << url << std::endl;
2846 return false;
2847 } else {
2848 // Print the received response
2849 std::cout << "Response: " << std::endl;
2850 std::cout << response << std::endl;
2851 try {
2852 // Split the response into two fields
2853 nlohmann::json jsonData = nlohmann::json::parse(response);
2854 // Extract the run and timestamp fields
2855 int nextrun = jsonData["run"];
2856 long long rtime = jsonData["timestamp"];
2857 std::cout << "Next run started will be " << nextrun << std::endl;
2858 std::cout << "Epoch time extracted " << rtime << std::endl;
2859 if (m_alliov) {
2860 // if overwriting IOVs, set the new IOV lower limit
2861 m_newrunemin=(static_cast<long long>(nextrun)) << 32;
2862 m_newtimemin=rtime*static_cast<long long>(1E9);
2863 } else {
2864 // set the query lower limit - for use with truncate option
2865 m_runemin=(static_cast<long long>(nextrun)) << 32;
2866 m_timemin=rtime*static_cast<long long>(1E9);
2867 m_truncate=true;
2868 }
2869 } catch (nlohmann::json::parse_error& e) {
2870 std::cerr << "Failed to parse JSON response: " << e.what() << std::endl;
2871 return false;
2872 } catch (nlohmann::json::type_error& e) {
2873 std::cerr << "Failed to extract data from JSON response: " << e.what() << std::endl;
2874 return false;
2875 } catch (std::exception& e) {
2876 std::cerr << "Failed to extract run and timestamp from JSON response: " << e.what() << std::endl;
2877 return false;
2878 }
2879 }
2880 // Clean up done by unique_ptr
2881 } else {
2882 std::cerr << "Failed to initialize libcurl." << std::endl;
2883 return false;
2884 }
2885 // Cleanup libcurl
2886 curl_global_cleanup();
2887
2888 return true;
2889}
size_t WriteCallback(void *contents, size_t size, size_t nmemb, std::string *s)
std::pair< std::vector< unsigned int >, bool > res
MDT_Response response
rtime(fn, *args, **kw)
Definition rtime.py:14

◆ getCoolHistGUID()

std::string AtlCoolCopy::getCoolHistGUID ( const std::string & file)
staticprivate

Definition at line 3274 of file AtlCoolCopy.cxx.

3274 {
3275 // attempt to extract COOL Hist GUID from file
3276 std::string hguid="";
3277 TFile* myfile=TFile::Open(file.c_str(),"READ");
3278 if (myfile!=nullptr) {
3279 TObjString* oguid;
3280 myfile->GetObject("fileGUID",oguid);
3281 if (oguid!=nullptr) {
3282 hguid=oguid->GetString();
3283 std::cout << "CoolHist GUID found to be " << hguid << std::endl;
3284 }
3285 myfile->Close();
3286 }
3287 return hguid;
3288}
TFile * file

◆ getLockedTags()

bool AtlCoolCopy::getLockedTags ( )
private

Definition at line 431 of file AtlCoolCopy.cxx.

431 {
432 // set m_tags to list of top level tags which are locked
433 m_tags.clear();
434 cool::IFolderSetPtr topfolder=m_sourceDbPtr->getFolderSet("/");
435 const std::vector<std::string>& toptaglist=topfolder->listTags();
436 for (std::vector<std::string>::const_iterator toptag=toptaglist.begin();
437 toptag!=toptaglist.end();++toptag) {
438 cool::HvsTagLock::Status tstat=topfolder->tagLockStatus(*toptag);
439 if (tstat==cool::HvsTagLock::LOCKED ||
440 tstat==cool::HvsTagLock::PARTIALLYLOCKED) {
441 std::cout << "Top-level tag " << *toptag << " will be copied" <<
442 std::endl;
443 m_tags.push_back(*toptag);
444 }
445 }
446 std::cout << "Total of " << m_tags.size() << " top-level tags to be copied"
447 << std::endl;
448 return (!m_tags.empty());
449}

◆ getOnlineRun()

bool AtlCoolCopy::getOnlineRun ( )
private

Definition at line 2711 of file AtlCoolCopy.cxx.

2711 {
2712 // open using the ATLAS_COOLONL_GLOBAL schema, since we have authentication
2713 // information for this one by default
2714 // get minimum run-number/timestamp for bulk reco update
2715 std::cout << "Extracting current run-number from ATLAS_RUN_NUMBER @ ATONR_ADG ... " <<
2716 // Initialize libcurl
2717 curl_global_init(CURL_GLOBAL_ALL);
2718 using uniqueCurl_t = std::unique_ptr<CURL,decltype(&curl_easy_cleanup)>;
2719 uniqueCurl_t curl(curl_easy_init(), curl_easy_cleanup);
2720 CURLcode res = CURLE_OK;
2721 if (curl) {
2722 std::string url = m_runinfohost + "/runs?sort=runnumber:DESC&size=1";
2723 // Set the URL
2724 res = curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
2725 if (res != CURLE_OK) {
2726 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2727 return false;
2728 }
2729 // Follow HTTP redirections
2730 res = curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1L);
2731 if (res != CURLE_OK) {
2732 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2733 return false;
2734 }
2735 // Response data buffer
2736 std::string response;
2737
2738 // Set the callback function to receive response data
2739 res = curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, WriteCallback);
2740 if (res != CURLE_OK) {
2741 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2742 return false;
2743 }
2744 res = curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &response);
2745 if (res != CURLE_OK) {
2746 std::cerr << "Failed to perform request: curl_easy_setopt, line "<<__LINE__<<std::endl;
2747 return false;
2748 }
2749
2750 // Perform the request
2751 res = curl_easy_perform(curl.get());
2752 if (res != CURLE_OK) {
2753 std::cerr << "Failed to perform request: " << curl_easy_strerror(res) << ":" << url << std::endl;
2754 return false;
2755 } else {
2756 // Print the received response
2757 std::cout << "Response: " << std::endl;
2758 std::cout << response << std::endl;
2759 // Parse the JSON string
2760 try {
2761 nlohmann::json jsonData = nlohmann::json::parse(response);
2762
2763 // Extract the runnumber field
2764 int runNumber = jsonData["resources"][0]["runnumber"];
2765 int nextrun=runNumber+1;
2766 std::cout << "Next run started will be " << nextrun << std::endl;
2767 const long long rtime=time(nullptr);
2768 std::cout << "Epoch time extracted " << rtime << std::endl;
2769 if (m_alliov) {
2770 // if overwriting IOVs, set the new IOV lower limit
2771 m_newrunemin=(static_cast<long long>(nextrun)) << 32;
2772 m_newtimemin=rtime*static_cast<long long>(1E9);
2773 } else {
2774 // set the query lower limit - for use with truncate option
2775 m_runemin=(static_cast<long long>(nextrun)) << 32;
2776 m_timemin=rtime*static_cast<long long>(1E9);
2777 m_truncate=true;
2778 }
2779 } catch (nlohmann::json::parse_error& e) {
2780 std::cerr << "Failed to parse JSON response: " << e.what() << std::endl;
2781 return false;
2782 } catch (nlohmann::json::type_error& e) {
2783 std::cerr << "Failed to extract data from JSON response: " << e.what() << std::endl;
2784 return false;
2785 } catch (std::exception& e) {
2786 std::cerr << "Failed to extract run and timestamp from JSON response: " << e.what() << std::endl;
2787 return false;
2788 }
2789 }
2790 // Clean up done by unique_ptr d'tor
2791 } else {
2792 std::cerr << "Failed to initialize libcurl." << std::endl;
2793 return false;
2794 }
2795 // Cleanup libcurl
2796 curl_global_cleanup();
2797 return true;
2798}
time(flags, cells_name, *args, **kw)

◆ getRunList()

bool AtlCoolCopy::getRunList ( )
private

Definition at line 2891 of file AtlCoolCopy.cxx.

2891 {
2892 // loop over all given filenames
2893 for (std::vector<std::string>::const_iterator itr=m_runfile.begin();
2894 itr!=m_runfile.end();++itr) {
2895 std::cout << "Reading allowed run numbers from file " << *itr << std::endl;
2896 FILE* p_inp=fopen(itr->c_str(),"r");
2897 if (p_inp==nullptr) {
2898 std::cout << "File not found" << std::endl;
2899 return false;
2900 }
2901 std::vector<char> p_buf (999);
2902 while (!feof(p_inp)) {
2903 char* p_line=fgets(p_buf.data(),p_buf.size(),p_inp);
2904 if (p_line!=nullptr) {
2905 unsigned int run=atoi(p_line);
2906 m_runlist.push_back(run);
2907 }
2908 }
2909 fclose(p_inp);
2910 }
2911 std::sort(m_runlist.begin(),m_runlist.end());
2912 std::cout << "Read list of " << m_runlist.size() << " runs from " <<
2913 m_runfile.size() << " input runlist files" << std::endl;
2914 for (std::vector<unsigned int>::const_iterator itr=m_runlist.begin();
2915 itr!=m_runlist.end();++itr) std::cout <<
2916 "Update allowed for run " << *itr << std::endl;
2917 return true;
2918}
std::vector< unsigned int > m_runlist
std::vector< std::string > m_runfile
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
int run(int argc, char *argv[])

◆ getTimeFromRun()

bool AtlCoolCopy::getTimeFromRun ( )
private

Definition at line 2622 of file AtlCoolCopy.cxx.

2622 {
2623 // extract time limits for a run range using the expected information
2624 // in the /TDAQ/RunCtrl/SOR_Params and EOR_Params on the given DB connection
2625
2626 // choose database instance based on run number switchover if none is given
2627 if (m_timedb.empty()) {
2628 if ((m_runemin >> 32)>=236107) {
2629 m_timedb="COOLONL_TDAQ/CONDBR2";
2630 } else {
2631 m_timedb="COOLONL_TDAQ/COMP200";
2632 }
2633 }
2634 // select foldername based on database instance
2635 std::string sorfolder="/TDAQ/RunCtrl/SOR_Params";
2636 std::string eorfolder="/TDAQ/RunCtrl/EOR_Params";
2637 if (m_timedb.find ("CONDBR2")!=std::string::npos) {
2638 sorfolder="/TDAQ/RunCtrl/SOR";
2639 eorfolder="/TDAQ/RunCtrl/EOR";
2640 }
2641 std::cout << "Extracting times for run range [" << (m_runemin >> 32) <<
2642 "," << (m_runemax >> 32) << "] from database " << m_timedb <<
2643 " folder " << sorfolder << std::endl;
2644 if (m_runemin==cool::ValidityKeyMin || m_runemax==cool::ValidityKeyMax) {
2645 std::cout << "ERROR: Run range not correctly specified" << std::endl;
2646 return false;
2647 }
2648 // open database connection
2649 cool::IDatabasePtr tdaqdb;
2650 try {
2651 tdaqdb=m_dbSvc->openDatabase(transConn(m_timedb),m_sourceread);
2652 std::cout << "Opened database connection" << std::endl;
2653 }
2654 catch (std::exception& e) {
2655 std::cout << "COOL exception caught: " << e.what() << std::endl;
2656 return false;
2657 }
2658 // start of run information
2659 try {
2660 cool::IFolderPtr folder=tdaqdb->getFolder(sorfolder);
2661 // channel number is arbitrary - have to loop
2662 cool::IObjectIteratorPtr itr=folder->browseObjects(m_runemin,m_runemin,
2663 cool::ChannelSelection::all());
2664 int nobj=0;
2665 while (itr->goToNext()) {
2666 const cool::IRecord& payload=itr->currentRef().payload();
2667 m_timemin=payload["SORTime"].data<unsigned long long>();
2668 ++nobj;
2669 }
2670 itr->close();
2671 if (nobj!=1) {
2672 std::cout << "ERROR: Found " << nobj << " SOR records" << std::endl;
2673 return false;
2674 }
2675 }
2676 catch (std::exception& e) {
2677 std::cout << "Exception accessing SOR information: " << e.what() <<
2678 std::endl;
2679 return false;
2680 }
2681 // end of run information
2682 try {
2683 cool::IFolderPtr folder=tdaqdb->getFolder(eorfolder);
2684 // channel number is arbitrary - have to loop
2685 cool::IObjectIteratorPtr itr=folder->browseObjects(((m_runemax >> 32) << 32),((m_runemax >> 32) << 32),
2686 cool::ChannelSelection::all());
2687 int nobj=0;
2688 while (itr->goToNext()) {
2689 const cool::IRecord& payload=itr->currentRef().payload();
2690 m_timemax=payload["EORTime"].data<unsigned long long>();
2691 ++nobj;
2692 }
2693 itr->close();
2694 if (nobj!=1) {
2695 std::cout << "ERROR: Found " << nobj << " EOR records" << std::endl;
2696 return false;
2697 }
2698 }
2699 catch (std::exception& e) {
2700 std::cout << "Exception accessing SOR information: " << e.what() <<
2701 std::endl;
2702 return false;
2703 }
2704 tdaqdb->closeDatabase();
2705 std::cout << "Timestamp range set to " << m_timemin << " " <<
2706 timeString(m_timemin) << "to " << m_timemax << " " <<
2707 timeString(m_timemax) << std::endl;
2708 return true;
2709}
static std::string transConn(const std::string &inconn)

◆ getUpdateMode()

int AtlCoolCopy::getUpdateMode ( std::string_view desc,
std::string_view tag )
staticprivate

Definition at line 2920 of file AtlCoolCopy.cxx.

2921 {
2922 // analyse the folder description and tag name for updateMode flags
2923 // return 1 for online mode, 0 otherwise
2924 std::string_view modestr="";
2925 int mode=0;
2926 std::string::size_type iofs1=desc.find("<updateMode>");
2927 std::string::size_type iofs2=desc.find("</updateMode>");
2928 if (iofs1!=std::string::npos && iofs2!=std::string::npos && iofs2>iofs1)
2929 modestr=desc.substr(iofs1+12,iofs2-iofs1-12);
2930 if (modestr=="UPD1" || tag.find("UPD1")!=std::string::npos) mode=1;
2931 if (modestr=="UPD2" || tag.find("UPD2")!=std::string::npos) mode=2;
2932 if (modestr=="UPD3" || tag.find("UPD3")!=std::string::npos) mode=3;
2933 if (modestr=="UPD4" || tag.find("UPD4")!=std::string::npos) mode=4;
2934 return mode;
2935}

◆ isNumeric()

bool AtlCoolCopy::isNumeric ( const char * input)
staticprivate

Definition at line 2504 of file AtlCoolCopy.cxx.

2504 {
2505 // determine if input string is numeric or string
2506 bool isnum=true;
2507 const char* cptr=input;
2508 while (*cptr!='\0') {
2509 if (!isdigit(*cptr)) { isnum=false; break;}
2510 ++cptr;
2511 }
2512 return isnum;
2513}

◆ isOpen()

bool AtlCoolCopy::isOpen ( ) const
inline

Definition at line 298 of file AtlCoolCopy.cxx.

298{ return m_open; }

◆ listPoolRefs()

int AtlCoolCopy::listPoolRefs ( )
private

Definition at line 3125 of file AtlCoolCopy.cxx.

3125 {
3126 std::cout << "Total of " << m_poolrefs.size() << " POOL files referenced"
3127 << std::endl;
3128 for (PoolMap::const_iterator ipool=m_poolrefs.begin();
3129 ipool!=m_poolrefs.end();++ipool) {
3130 std::cout << "Ref " << ipool->first << " (" << ipool->second.count()
3131 << ")" << std::endl;
3132 }
3133 return 0;
3134}

◆ nocopyIOVs()

int AtlCoolCopy::nocopyIOVs ( const std::string & folder,
const cool::IFolderPtr & sourcefl,
const std::string & sourcetag,
const cool::ValidityKey since,
const cool::ValidityKey until,
bool checkrefs )
private

Definition at line 1328 of file AtlCoolCopy.cxx.

1331 {
1332
1333 std::cout << "Reading tag " << sourcetag << " of folder " << folder <<
1334 " (no copy)" << std::endl;
1335 cool::FolderVersioning::Mode vermode=sourcefl->versioningMode();
1336 int nobj=0;
1337 cool::IObjectIteratorPtr sourceitr;
1338 if (vermode==cool::FolderVersioning::SINGLE_VERSION) {
1339 sourceitr=sourcefl->browseObjects(since,until,m_chansel);
1340 } else {
1341 sourceitr=sourcefl->browseObjects(since,until,m_chansel,sourcetag);
1342 }
1343 try {
1344 while (sourceitr->goToNext()) {
1345 const cool::IObject& obj=sourceitr->currentRef();
1346 if (checkrefs) checkRef(obj.payload(),folder,sourcetag);
1347 ++nobj;
1348 }
1349 std::cout << "Folder scanned with " << nobj << " objects" << std::endl;
1350 }
1351 // exceptions thrown from read loop
1352 catch (cool::Exception& e) {
1353 std::cout << "Exception thrown from read loop: " << e.what() <<
1354 std::endl;
1355 return 33;
1356 }
1357 // finished with the iterator
1358 sourceitr->close();
1359 return 0;
1360}
void checkRef(const cool::IRecord &payload, const std::string &folder, const std::string &tag)

◆ openConnections()

bool AtlCoolCopy::openConnections ( const std::string & sourcedb,
const std::string & destdb,
bool allowcreate )
private

Definition at line 341 of file AtlCoolCopy.cxx.

342 {
343 // check connections not already open
344 if (m_open) return true;
345 // initialise replica sorter if it was requested
346 if (m_readoracle) {
347 m_repsort=new ReplicaSorter();
348 coral::IConnectionServiceConfiguration& csconfig=m_coralsvc.configuration();
349 csconfig.setReplicaSortingAlgorithm(*m_repsort);
350 }
351 // cool::IDatabaseSvc& dbSvc=cool::DatabaseSvcFactory::databaseService();
352 // open source database
353 std::cout << "Open source database: " << sourcedb << std::endl;
354 if (!m_sourceread) std::cout << "... in UPDATE mode" << std::endl;
355 try {
356 m_sourceDbPtr=m_dbSvc->openDatabase(transConn(sourcedb),m_sourceread);
357 }
358 catch (std::exception& e) {
359 std::cout << "Cool exception caught: " << e.what() << std::endl;
360 return false;
361 }
362 // open destination database
363 if (m_nocopy) {
364 m_open=true;
365 return true;
366 } else if (m_root || m_analyse) {
367 std::cout << "Open destination ROOT file: " << destdb << std::endl;
368 p_rootfile=new TFile(destdb.c_str(),"RECREATE");
369 if (p_rootfile==nullptr) std::cout << "ERROR: Could not open ROOT file" <<
370 std::endl;
371 m_open=(p_rootfile!=nullptr);
372 return m_open;
373 }
374 std::string tdestdb=transConn(destdb);
375 std::cout << "Open destination database: " << tdestdb << std::endl;
376 try {
377 m_destDbPtr=m_dbSvc->openDatabase(tdestdb,m_verify);
378 // if the open succeeds and we are using recreate mode, drop/delete
379 // the existing database first
380 if (m_recreate) {
381 std::cout <<
382 "Forcing recreation of destination database - deleting existing data!"
383 << std::endl;
384 m_destDbPtr.reset();
385 m_dbSvc->dropDatabase(tdestdb);
386 // go into catch to recrete database
387 throw cool::DatabaseDoesNotExist("old database deleted");
388 }
389 }
390 catch (std::exception& e) {
391 std::cout << "COOL exception caught: " << e.what() << std::endl;
392 // try to recover by creating new DB if possible and requested
393 if (allowcreate || m_recreate) {
394 std::cout << "Try to create new conditions DB" << std::endl;
395 try {
396 m_destDbPtr=m_dbSvc->createDatabase(tdestdb);
397 std::cout << "Creation succeeded" << std::endl;
398 }
399 catch (cool::Exception& e) {
400 std::cout << "Creation failed" << std::endl;
401 return false;
402 }
403 } else {
404 return false;
405 }
406 }
407 m_open=true;
408 return true;
409}
cool::IDatabasePtr m_destDbPtr

◆ openCoraCool()

bool AtlCoolCopy::openCoraCool ( )
private

Definition at line 411 of file AtlCoolCopy.cxx.

411 {
412 if (m_sourceCoraPtr.get()==nullptr) {
413 std::cout << "Attempt to open source CoraCool DB " << m_sourcedb <<
414 std::endl;
417 std::cout << "Opened CoraCool source DB" << std::endl;
418 }
419 // skip destination DB if not copying
420 if (m_nocopy) return true;
421 if (m_destCoraPtr.get()==nullptr) {
422 std::cout << "Attempt to open destination CoraCool DB " << m_destdb <<
423 std::endl;
424 m_destCoraPtr=CoraCoolDatabasePtr(new CoraCoolDatabase(m_destdb,
426 std::cout << "Opened CoraCool dest DB" << std::endl;
427 }
428 return true;
429}
boost::shared_ptr< CoraCoolDatabase > CoraCoolDatabasePtr
CoraCoolDatabasePtr m_destCoraPtr
CoraCoolDatabasePtr m_sourceCoraPtr

◆ procOptVector()

bool AtlCoolCopy::procOptVector ( const int argc,
const char * argv[],
std::vector< std::string > & folders )
private

Definition at line 2138 of file AtlCoolCopy.cxx.

2139 {
2140 // process an array of options, return True if OK, False if not
2141 int ic=0;
2142 bool error=false;
2143 while (ic<argc) {
2144 int ir=argc-ic;
2145 std::string_view par0=argv[ic];
2146 // strip double "--" to achieve compatability with python-style options
2147 if (par0.compare(0,2,"--")==0) par0=par0.substr(1);
2148 if ((par0=="-f" || par0=="-folder") && ir>1) {
2149 folders.emplace_back(argv[ic+1]);
2150 ++ic;
2151 } else if ((par0=="-e" || par0=="-exclude") && ir>1) {
2152 addExclude(argv[ic+1]);
2153 ++ic;
2154 } else if ((par0=="-t" || par0=="-tag") && ir>1) {
2155 m_tags.emplace_back(argv[ic+1]);
2156 ++ic;
2157 } else if ((par0=="-mt" || par0=="-magic") && ir>1) {
2158 m_magic.push_back("_"+std::string(argv[ic+1]));
2159 ++ic;
2160 } else if ((par0=="-of" || par0=="-outfolder") && ir>1) {
2161 m_outfolder=argv[ic+1];
2162 ++ic;
2163 } else if ((par0=="-ot" || par0=="-outtag") && ir>1) {
2164 m_outtag=argv[ic+1];
2165 ++ic;
2166 } else if ((par0=="-bs" || par0=="-buffersize") && ir>1) {
2167 m_bufsize=atoi(argv[ic+1]);
2168 ++ic;
2169 } else if ((par0=="-sl" || par0=="-seal") && ir>1) {
2170 m_sealmsg=atoi(argv[ic+1]);
2171 ++ic;
2172 } else if ((par0=="-rls" || par0=="-runlumisince") && ir>2) {
2173 m_runemin=runLBVal(argv[ic+1],argv[ic+2]);
2174 ic+=2;
2175 } else if ((par0=="-rlu" || par0=="-runlumiuntil") && ir>2) {
2176 m_runemax=runLBVal(argv[ic+1],argv[ic+2]);
2177 ic+=2;
2178 } else if ((par0=="-nrls" || par0=="-newrunlumisince") && ir>2) {
2179 m_newrunemin=runLBVal(argv[ic+1],argv[ic+2]);
2180 ic+=2;
2181 } else if ((par0=="-nrlu" || par0=="-newrunlumiuntil") && ir>2) {
2182 m_newrunemax=runLBVal(argv[ic+1],argv[ic+2]);
2183 ic+=2;
2184 } else if ((par0=="-srls" || par0=="-skiprunlumisince") && ir>2) {
2185 m_srunemin=runLBVal(argv[ic+1],argv[ic+2]);
2186 m_skipout=true;
2187 ic+=2;
2188 } else if ((par0=="-srlu" || par0=="-skiprunlumiuntil") && ir>2) {
2189 m_srunemax=runLBVal(argv[ic+1],argv[ic+2]);
2190 m_skipout=true;
2191 ic+=2;
2192 } else if (par0=="-ro" || par0=="-root") {
2193 m_root=true;
2194 } else if (par0=="-zn" || par0=="-zeronull") {
2195 m_zeronull=true;
2196 } else if (par0=="-ana" || par0=="-analyse") {
2197 m_analyse=true;
2198 float ttime=atof(argv[ic+1])*1.E9;
2199 m_anadelt=static_cast<long long>(ttime);
2200 ++ic;
2201 } else if ((par0=="-rs" || par0=="-runsince") && ir>1) {
2202 m_runemin=(static_cast<long long>(atol(argv[ic+1])) << 32);
2203 ++ic;
2204 } else if ((par0=="-ru" || par0=="-rununtil") && ir>1) {
2205 m_runemax=(static_cast<long long>(1+atol(argv[ic+1])) << 32)-1;
2206 ++ic;
2207 } else if ((par0=="-r" || par0=="-run") && ir>1) {
2208 m_runemin=(static_cast<long long>(atol(argv[ic+1])) << 32);
2209 m_runemax=(static_cast<long long>(1+atol(argv[ic+1])) << 32)-1;
2210 ++ic;
2211 } else if ((par0=="-ts" || par0=="-timesince") && ir>1) {
2212 m_timemin=timeVal(argv[ic+1]);
2213 ++ic;
2214 } else if ((par0=="-tu" || par0=="-timeuntil") && ir>1) {
2215 m_timemax=timeVal(argv[ic+1]);
2216 ++ic;
2217 } else if ((par0=="-nts" || par0=="-newtimesince") && ir>1) {
2218 m_newtimemin=timeVal(argv[ic+1]);
2219 ++ic;
2220 } else if ((par0=="-ntu" || par0=="-newtimeuntil") && ir>1) {
2221 m_newtimemax=timeVal(argv[ic+1]);
2222 ++ic;
2223 } else if (par0=="-c" || par0=="-create") {
2224 m_allowcreate=true;
2225 } else if ((par0=="-ch" || par0=="-channel") && ir>1) {
2226 m_channelRange.emplace_back(argv[ic+1]);
2227 ++ic;
2228 } else if ((par0=="-ch1" || par0=="-channel1") && ir>1) {
2229 m_channel1=argv[ic+1];
2230 ++ic;
2231 } else if ((par0=="-ch2" || par0=="-channel2") && ir>1) {
2232 m_channel2=argv[ic+1];
2233 ++ic;
2234 } else if (par0=="-chd" || par0=="-channeldesc") {
2235 m_chdesc=true;
2236 // no abbreviaton for this one - dangerous option
2237 } else if (par0=="-forcerecreate") {
2238 m_recreate=true;
2239 } else if (par0=="-d" || par0=="-debug") {
2240 m_debug=true;
2241 } else if (par0=="-a" || par0=="-alliov") {
2242 m_alliov=true;
2243 } else if (par0=="-ih" || par0=="-includehead") {
2244 m_includehead=true;
2245 } else if (par0=="-eh" || par0=="-excludehead") {
2246 m_excludehead=true;
2247 } else if (par0=="-ht" || par0=="-headtag") {
2248 m_usertags=false;
2249 } else if (par0=="-uht" || par0=="-userheadtag") {
2250 m_userupdatehead=true;
2251 } else if (par0=="-v" || par0=="-verify") {
2252 m_verify=true;
2253 } else if (par0=="-nc" || par0=="-nocopy") {
2254 m_nocopy=true;
2255 } else if (par0=="-noc" || par0=="-nocoracool") {
2256 m_coracool=false;
2257 } else if (par0=="-nch" || par0=="-nochannel") {
2258 m_nochannel=true;
2259 } else if (par0=="-ncr" || par0=="-noclobroot") {
2260 m_noclobroot=true;
2261 } else if (par0=="-nd" || par0=="-nodata") {
2262 m_nodata=true;
2263 } else if (par0=="-nh" || par0=="-nohitag") {
2264 m_nohitag=true;
2265 } else if (par0=="-hi" || par0=="-hitag") {
2266 m_hitag=true;
2267 } else if ((par0=="-ec" || par0=="-excludechannel") && ir>1) {
2268 m_excludechans.push_back(strtoul(argv[ic+1],nullptr,10));
2269 ++ic;
2270 } else if (par0=="-fs" || par0=="-forcesingle") {
2271 m_forcesingle=true;
2272 } else if (par0=="-fm" || par0=="-forcemulti") {
2273 m_forcemulti=true;
2274 } else if (par0=="-frl" || par0=="-forcerunlumi") {
2275 m_forcerune=true;
2276 } else if (par0=="-ftm" || par0=="-forcetime") {
2277 m_forcetime=true;
2278 } else if (par0=="-fp" || par0=="-forcepayload") {
2279 m_forcepay=true;
2280 } else if (par0=="-fnp" || par0=="-forcenopayload") {
2281 m_forcenopay=true;
2282 } else if (par0=="-cr" || par0=="-checkrefs") {
2283 m_checkrefs=true;
2284 } else if (par0=="-lp" || par0=="-listpfn") {
2285 m_listpfn=true;
2286 m_checkrefs=true;
2287 } else if (par0=="-cf" || par0=="-checkfiles") {
2288 m_poolopen=true;
2289 m_checkrefs=true;
2290 } else if (par0=="-pa" || par0=="-poolall") {
2291 m_poolall=true;
2292 } else if ((par0=="-co" || par0=="-checkoutput") && ir>1) {
2294 ++ic;
2295 } else if ((par0=="-pc" || par0=="-poolcat") && ir>1) {
2296 m_poolcat.emplace_back(argv[ic+1]);
2297 ++ic;
2298 } else if ((par0=="-mc" || par0=="-mergecat") && ir>1) {
2299 m_mergecat.emplace_back(argv[ic+1]);
2300 ++ic;
2301 } else if ((par0=="-ds" || par0=="-dataset") && ir>1) {
2302 m_newdataset=argv[ic+1];
2303 ++ic;
2304 } else if (par0=="-us" || par0=="-updatesource") {
2305 m_sourceread=false;
2306 } else if (par0=="-cd" || par0=="-checkdest") {
2307 m_checkdesttag=true;
2308 } else if (par0=="-tr" || par0=="-truncate") {
2309 m_truncate=true;
2310 } else if (par0=="-al" || par0=="-appendlocked") {
2311 m_applock=true;
2312 } else if (par0=="-alsv" || par0=="-appendlockedsv") {
2313 m_applock=true;
2314 m_applocksv=true;
2315 } else if (par0=="-rdo" || par0=="-readoracle") {
2316 m_readoracle=true;
2317 } else if (par0=="-skiprep" || par0=="-sr") {
2318 m_skiprep=true;
2319 } else if (par0=="-go" || par0=="-getonline") {
2320 m_getonline=true;
2321 } else if (par0=="-onr" || par0=="-onlinerun") {
2322 m_onlinerun=true;
2323 } else if (par0=="-gb" || par0=="-getbulk") {
2324 m_getbulk=true;
2325 } else if (par0=="-gt" || par0=="-gettime") {
2326 m_gettime=true;
2327 } else if ((par0=="-tdb" || par0=="-timedb") && ir>1) {
2328 m_timedb=argv[ic+1];
2329 ++ic;
2330 } else if (par0=="-ignoremode" && ir>1) {
2331 std::cout << "Ignoremode password is " << argv[ic+1] << ":end" << std::endl;
2332 if (strcmp(argv[ic+1],"BackDoor")==0) {
2333 m_ignoremode=true;
2334 } else {
2335 std::cout << "ERROR: Incorrect password for -ignoremode" << std::endl;
2336 error=true;
2337 }
2338 ++ic;
2339 } else if (par0=="-is" || par0=="-ignorespec") {
2340 m_ignorespec=true;
2341 } else if (par0=="-pt" || par0=="-prunetags") {
2342 m_prunetags=true;
2343 m_excludehead=true;
2344 } else if (par0=="-lo" || par0=="-lockedonly") {
2345 m_lockedonly=true;
2346 m_prunetags=true;
2347 m_excludehead=true;
2348 } else if (par0=="-cti" || par0=="-copytaginfo") {
2349 m_copytaginfo=true;
2350 } else if (par0=="-ctl" || par0=="-copytaglock") {
2351 m_copytaginfo=true;
2352 m_copytaglock=true;
2353 } else if ((par0=="-tl" || par0=="-taglabel") && ir>1) {
2354 m_taglabel=argv[ic+1];
2355 ++ic;
2356 m_copytaginfo=true;
2357 } else if ((par0=="-ag" || par0=="-addguid") && ir>1) {
2358 m_addguid.emplace_back(argv[ic+1]);
2359 ++ic;
2360 } else if ((par0=="-alf" || par0=="-addlfn") && ir>1) {
2361 m_addlfn.emplace_back(argv[ic+1]);
2362 ++ic;
2363 } else if ((par0=="-pf" || par0=="-parfile") && ir>1) {
2364 m_parfile.emplace_back(argv[ic+1]);
2365 ++ic;
2366 } else if ((par0=="-rf" || par0=="-runfile") && ir>1) {
2367 m_runfile.emplace_back(argv[ic+1]);
2368 ++ic;
2369 } else if ((par0=="-ws" || par0=="-runinfohost") && ir>1) {
2371 ++ic;
2372 } else if (par0=="-h" || par0=="-help") {
2373 // help printout triggered by -999 return code
2374 return 999;
2375 } else {
2376 std::cout << "Parameter error for argument: " << par0 << std::endl;
2377 error=true;
2378 }
2379 ++ic;
2380 }
2381 return !error;
2382}
std::vector< std::string > m_channelRange
std::vector< std::string > m_parfile
bool addExclude(const std::string &folder)
std::vector< std::string > m_poolcat
std::vector< std::string > m_mergecat
std::vector< std::string > m_addguid
std::vector< std::string > m_magic
static cool::ValidityKey runLBVal(const char *input1, const char *input2)
static cool::ValidityKey timeVal(const char *input)
std::vector< std::string > m_addlfn
int ir
counter of the current depth
Definition fastadd.cxx:49
double atof(std::string_view str)
Converts a string into a double / float.
int ic
Definition grepfile.py:33

◆ rootAllocate()

bool AtlCoolCopy::rootAllocate ( const cool::IFieldSpecification & spec,
void *& sptr,
char & rootID ) const
private

Definition at line 1722 of file AtlCoolCopy.cxx.

1723 {
1724 const cool::StorageType& stype=spec.storageType();
1725 rootID=' ';
1726 sptr=nullptr;
1727 if (stype==cool::StorageType::Bool) {
1728 // map bool to uint32 for now
1729 sptr=static_cast<void*>(new unsigned int(0));
1730 rootID='i';
1731 } else if (stype==cool::StorageType::UChar) {
1732 sptr=static_cast<void*>(new unsigned char(' '));
1733 rootID='C';
1734 } else if (stype==cool::StorageType::Int16) {
1735 sptr=static_cast<void*>(new short(0));
1736 rootID='S';
1737 } else if (stype==cool::StorageType::UInt16) {
1738 sptr=static_cast<void*>(new unsigned short(0));
1739 rootID='s';
1740 } else if (stype==cool::StorageType::Int32) {
1741 sptr=static_cast<void*>(new int(0));
1742 rootID='I';
1743 } else if (stype==cool::StorageType::UInt32) {
1744 sptr=static_cast<void*>(new unsigned int(0));
1745 rootID='i';
1746 } else if (stype==cool::StorageType::Int64) {
1747 sptr=static_cast<void*>(new long long int(0));
1748 rootID='L';
1749 } else if (stype==cool::StorageType::UInt63) {
1750 sptr=static_cast<void*>(new unsigned long long int(0));
1751 rootID='l';
1752 } else if (stype==cool::StorageType::Float) {
1753 sptr=static_cast<void*>(new float(0.));
1754 rootID='F';
1755 } else if (stype==cool::StorageType::Double) {
1756 sptr=static_cast<void*>(new double(0.));
1757 rootID='D';
1758 } else if (stype==cool::StorageType::String4k ||
1759 stype==cool::StorageType::String255) {
1760 sptr=static_cast<void*>(new char[4100]);
1761 rootID='C';
1762 } else if (stype==cool::StorageType::String64k && !m_noclobroot) {
1763 sptr=static_cast<void*>(new char[65536]);
1764 rootID='C';
1765 } else if (stype==cool::StorageType::String16M && !m_noclobroot) {
1766 sptr=static_cast<void*>(new char[67108864]);
1767 rootID='C';
1768 } else if (stype==cool::StorageType::Blob64k && !m_noclobroot) {
1769 sptr=static_cast<void*>(new char[65536]);
1770 rootID='C';
1771 } else {
1772 std::cout << "rootAllocate: Unsupported storage type for attribute: " <<
1773 spec.name() << std::endl;
1774 }
1775 return (sptr!=nullptr);
1776}

◆ rootDirs()

std::string AtlCoolCopy::rootDirs ( const std::string & folder,
const std::string & toproot )
private

Definition at line 1688 of file AtlCoolCopy.cxx.

1689 {
1690 // create a ROOT directory structure start with toproot (=COOL or COOLANA)
1691 // and cd to the directory where a tree should be created
1692 // return the tree name (=leaf of the COOL foldername)
1693 p_rootfile->cd();
1694 if (p_rootfile->FindObject(toproot.c_str())==nullptr) {
1695 p_rootfile->mkdir(toproot.c_str());
1696 std::cout << "Made top directory " << toproot << std::endl;
1697 }
1698 gDirectory->cd(toproot.c_str());
1699 // now parse the COOL folder name to create intermediate directories
1700 // assume folder names begin with '/', to be skipped
1701 std::string::size_type iofs1=1;
1702 std::string::size_type iofs2=1;
1703 std::string treename;
1704 while (iofs2!=std::string::npos) {
1705 iofs2=folder.find('/',iofs1);
1706 if (iofs2==std::string::npos) {
1707 // no more /, so current part of string is leaf tree name
1708 treename=folder.substr(iofs1);
1709 } else {
1710 std::string dirname=folder.substr(iofs1,iofs2-iofs1);
1711 iofs1=iofs2+1;
1712 if (gDirectory->FindObject(dirname.c_str())==nullptr) {
1713 std::cout << "Make directory " << dirname << std::endl;
1714 gDirectory->mkdir(dirname.c_str());
1715 }
1716 gDirectory->cd(dirname.c_str());
1717 }
1718 }
1719 return treename;
1720}
static std::string treename
Definition iLumiCalc.h:31

◆ rootIOVs()

int AtlCoolCopy::rootIOVs ( const std::string & folder,
const cool::IFolderPtr & sourcefl,
const std::string & sourcetag,
const cool::ValidityKey since,
const cool::ValidityKey until,
const bool timestamp )
private

Definition at line 1557 of file AtlCoolCopy.cxx.

1560 {
1561 // copy this selection to ROOT
1562 std::cout << "Write tag " << sourcetag << " of folder " << folder <<
1563 " to ROOT file" << std::endl;
1564 // create the directory structure - top directory COOL
1565 std::string treename=rootDirs(folder,"COOL");
1566 bool timestamp2=timestamp;
1567 if (m_forcetime) timestamp2=true;
1568 if (m_forcerune) timestamp2=false;
1569 cool::FolderVersioning::Mode vermode=sourcefl->versioningMode();
1570 // create TTree with appropriate structure - only if it does not exist
1571 // could have been created from a previous tag in the same folder
1572 TTree* tree=static_cast<TTree*>(gDirectory->FindObject(treename.c_str()));
1573 if (tree==nullptr) {
1574 std::cout << "Book TTree " << treename << std::endl;
1575 tree=new TTree(treename.c_str(),"COOL datadump");
1576 if (timestamp2) {
1577 tree->Branch("IOVSince",&m_nt_since,"IOVSince/l");
1578 tree->Branch("IOVUntil",&m_nt_until,"IOVUntil/l");
1579 } else {
1580 tree->Branch("RunSince",&m_nt_runsince,"RunSince/i");
1581 tree->Branch("RunUntil",&m_nt_rununtil,"RunUntil/i");
1582 tree->Branch("LBSince",&m_nt_lbsince,"LBSince/i");
1583 tree->Branch("LBUntil",&m_nt_lbuntil,"LBUntil/i");
1584 }
1585 tree->Branch("ChannelID",&m_nt_channel,"ChannelID/i");
1586 if (vermode==cool::FolderVersioning::MULTI_VERSION)
1587 tree->Branch("TagID",m_nt_tagid,"TagID/C");
1588 // now loop through specification, creating payload buffer and tree
1589 const cool::IRecordSpecification& spec=
1590 (sourcefl->folderSpecification()).payloadSpecification();
1591 unsigned int ncolumns=spec.size();
1592 // clear the buffer of pointers - note this leaks the memory of the
1593 // previous buffers, but to do this properly would have to remember
1594 // the type of each object and delete appropriately
1595 m_nt_treename=std::move(treename);
1596 m_nt_bufferptr.clear();
1597 for (unsigned int icol=0;icol<ncolumns;++icol) {
1598 const cool::IFieldSpecification& fieldspec=spec[icol];
1599 void* ptr=nullptr;
1600 char rootID;
1601 if (rootAllocate(fieldspec,ptr,rootID)) {
1602 tree->Branch(fieldspec.name().c_str(),ptr,
1603 (fieldspec.name()+"/"+rootID).c_str());
1604 if (m_debug) std::cout << "Defining column for " << spec[icol].name()
1605 << " of type " << spec[icol].storageType().name() << std::endl;
1606 } else {
1607 std::cout << "Attribute " << spec[icol].name() << " of type " <<
1608 spec[icol].storageType().name() << " will be skipped" << std::endl;
1609 }
1610 m_nt_bufferptr.push_back(ptr);
1611 }
1612 } else {
1613 std::cout << "TTree " << treename << " already exists" << std::endl;
1614 // check we have seen and defined this tree
1615 unsigned int size=
1616 (sourcefl->folderSpecification()).payloadSpecification().size();
1617 if (treename!=m_nt_treename || size!=m_nt_bufferptr.size()) {
1618 std::cout << "ERROR in tree buffer definition: expect " << treename <<
1619 " size " << size << " but buffer has " << m_nt_treename << " size "
1620 << m_nt_bufferptr.size() << std::endl;
1621 return 123;
1622 }
1623 }
1624
1625 int nobj=0;
1626 int nex=0;
1627 cool::IObjectIteratorPtr sourceitr;
1628 try {
1629 if (vermode==cool::FolderVersioning::SINGLE_VERSION) {
1630 sourceitr=sourcefl->browseObjects(since,until,m_chansel);
1631 } else {
1632 sourceitr=sourcefl->browseObjects(since,until,m_chansel,sourcetag);
1633 }
1634 }
1635 catch (cool::Exception& e) {
1636 std::cout << "Exception thrown from ROOT copy iterator setup: " <<
1637 e.what() << std::endl;
1638 return 125;
1639 }
1640 // now loop over all IOVs to copy them
1641 try {
1642 while (sourceitr->goToNext()) {
1643 const cool::IObject& sobj=sourceitr->currentRef();
1644 if (timestamp2) {
1645 m_nt_since=sobj.since();
1646 m_nt_until=sobj.until();
1647 } else {
1648 m_nt_runsince=(sobj.since() >> 32);
1649 m_nt_rununtil=(sobj.until() >> 32);
1650 m_nt_lbsince=(sobj.since() & 0xFFFFFFFF);
1651 m_nt_lbuntil=(sobj.until() & 0xFFFFFFFF);
1652 }
1653 m_nt_channel=sobj.channelId();
1654 if (vermode==cool::FolderVersioning::MULTI_VERSION) {
1655 // truncate the string first to avoid coverity complaining about
1656 // potential buffer overruns
1657 std::string sourcetag2=sourcetag.substr(0,255);
1658 strncpy(m_nt_tagid,sourcetag2.c_str(),sizeof(m_nt_tagid)-1);
1659 }
1660 // loop over the payload elements and fill the ones for which buffers
1661 // are defined
1662 try {
1663 const cool::IRecord& record=sobj.payload();
1664 for (unsigned int icol=0;icol<record.size();++icol) {
1665 if (m_nt_bufferptr[icol]!=nullptr) rootWrite(m_nt_bufferptr[icol],record[icol]);
1666 }
1667 tree->Fill();
1668 ++nobj;
1669 }
1670 catch (cool::Exception& e) {
1671 // can get exceptions due to NULL values
1672 // catch them and continue...
1673 ++nex;
1674 }
1675 }
1676 sourceitr->close();
1677 std::cout << "Written " << nobj << " objects to ROOT TTree with " << nex
1678 << " nulls/exceptions" << std::endl;
1679 }
1680 catch (cool::Exception& e) {
1681 std::cout << "Exception thrown from ROOT file writing loop: " <<
1682 e.what() << std::endl;
1683 return 124;
1684 }
1685 return 0;
1686}
size_t size() const
Number of registered mappings.
UInt_t m_nt_runsince
UInt_t m_nt_rununtil
void rootWrite(void *sptr, const cool::IField &field) const
std::string m_nt_treename
UInt_t m_nt_lbuntil
std::vector< void * > m_nt_bufferptr
UInt_t m_nt_lbsince
bool rootAllocate(const cool::IFieldSpecification &spec, void *&sptr, char &rootID) const
ULong64_t m_nt_since
char m_nt_tagid[256]
ULong64_t m_nt_until
UInt_t m_nt_channel
void * ptr(T *p)
Definition SGImplSvc.cxx:74
TChain * tree

◆ rootWrite()

void AtlCoolCopy::rootWrite ( void * sptr,
const cool::IField & field ) const
private

Definition at line 1778 of file AtlCoolCopy.cxx.

1778 {
1779 // check for NULL value
1780 bool recnull=(field.isNull() && m_zeronull);
1781 const cool::StorageType& stype=field.storageType();
1782 if (stype==cool::StorageType::Bool) {
1783 if (recnull) {
1784 *(static_cast<int*>(sptr))=0;
1785 } else {
1786 *(static_cast<int*>(sptr))=(field.data<bool>() ? 1 : 0);
1787 }
1788 } else if (stype==cool::StorageType::UChar) {
1789 if (recnull) {
1790 *(static_cast<unsigned char*>(sptr))=0;
1791 } else {
1792 *(static_cast<unsigned char*>(sptr))=field.data<unsigned char>();
1793 }
1794 } else if (stype==cool::StorageType::Int16) {
1795 if (recnull) {
1796 *(static_cast<short*>(sptr))=0;
1797 } else {
1798 *(static_cast<short*>(sptr))=field.data<short>();
1799 }
1800 } else if (stype==cool::StorageType::UInt16) {
1801 if (recnull) {
1802 *(static_cast<unsigned short*>(sptr))=0;
1803 } else {
1804 *(static_cast<unsigned short*>(sptr))=field.data<unsigned short>();
1805 }
1806 } else if (stype==cool::StorageType::Int32) {
1807 if (recnull) {
1808 *(static_cast<int*>(sptr))=0;
1809 } else {
1810 *(static_cast<int*>(sptr))=field.data<int>();
1811 }
1812 } else if (stype==cool::StorageType::UInt32) {
1813 if (recnull) {
1814 *(static_cast<unsigned int*>(sptr))=0;
1815 } else {
1816 *(static_cast<unsigned int*>(sptr))=field.data<unsigned int>();
1817 }
1818 } else if (stype==cool::StorageType::Int64) {
1819 if (recnull) {
1820 *(static_cast<long long*>(sptr))=0;
1821 } else {
1822 *(static_cast<long long*>(sptr))=field.data<long long>();
1823 }
1824 } else if (stype==cool::StorageType::UInt63) {
1825 if (recnull) {
1826 *(static_cast<unsigned long long*>(sptr))=0;
1827 } else {
1828 *(static_cast<unsigned long long*>(sptr))=field.data<unsigned long long>();
1829 }
1830 } else if (stype==cool::StorageType::Float) {
1831 if (recnull) {
1832 *(static_cast<float*>(sptr))=0.;
1833 } else {
1834 *(static_cast<float*>(sptr))=field.data<float>();
1835 }
1836 } else if (stype==cool::StorageType::Double) {
1837 if (recnull) {
1838 *(static_cast<double*>(sptr))=0.;
1839 } else {
1840 *(static_cast<double*>(sptr))=field.data<double>();
1841 }
1842 } else if (stype==cool::StorageType::String255 ||
1843 stype==cool::StorageType::String4k ||
1844 stype==cool::StorageType::String64k ||
1845 stype==cool::StorageType::String16M) {
1846 if (recnull) {
1847 strcpy(static_cast<char*>(sptr),"NULL");
1848 } else {
1849 strcpy(static_cast<char*>(sptr),field.data<std::string>().c_str());
1850 }
1851 } else if (stype==cool::StorageType::Blob64k && !m_noclobroot) {
1852 if (recnull) {
1853 strcpy(static_cast<char*>(sptr),"NULL");
1854 } else {
1855 auto blob = field.data<coral::Blob>();
1856 std::string blobStr((char*)blob.startingAddress(), blob.size());
1857 strcpy(static_cast<char*>(sptr), blobStr.c_str());
1858 }
1859 } else {
1860 std::cout << "ERROR: Unknown storage type in rootWrite!" << std::endl;
1861 }
1862}

◆ runLBVal()

cool::ValidityKey AtlCoolCopy::runLBVal ( const char * input1,
const char * input2 )
staticprivate

Definition at line 2603 of file AtlCoolCopy.cxx.

2603 {
2604 // parse the inputs as run/LB numbers to generate a validitykey
2605 // used in processing -rls-type options
2606 cool::ValidityKey val;
2607 if (input1[0]=='M' || input1[0]=='m') {
2608 val=((1LL << 31)-1) << 32;
2609 } else {
2610 val=static_cast<long long>(atol(input1)) << 32;
2611 }
2612 if (input2[0]=='M' || input2[0]=='m') {
2613 val+=(1LL << 32);
2614 } else {
2615 val+=atoll(input2);
2616 }
2617 if (val>cool::ValidityKeyMax) val=cool::ValidityKeyMax;
2618 return val;
2619}

◆ setChannelRange()

void AtlCoolCopy::setChannelRange ( const cool::IFolderPtr & sourcefl)
private

Definition at line 827 of file AtlCoolCopy.cxx.

827 {
828 // add range specified via -ch1 -ch2 if given
829 if (!m_channel1.empty() && !m_channel2.empty()) {
830 m_channelRange.clear();
831 m_channelRange.push_back(m_channel1+":"+m_channel2);
832 }
833 m_chansel=cool::ChannelSelection::all();
834 const size_t nChanRange=m_channelRange.size();
835 for (size_t i=0;i<nChanRange;i++) {
836 size_t cpos=m_channelRange[i].find(':');
837 if (cpos==std::string::npos || cpos > m_channelRange[i].size()-1) {
838 // single channel
839 std::cout << "Adding channel " << m_channelRange[i] <<
840 " to channel selection" << std::endl;
841 if (m_chansel.allChannels())
842 m_chansel=cool::ChannelSelection(channelID(sourcefl,
843 m_channelRange[i]));
844 else
845 m_chansel.addChannel(channelID(sourcefl,m_channelRange[i]));
846 }
847 else {
848 // Channel Range
849 std::string c1=m_channelRange[i].substr(0,cpos);
850 std::string c2=m_channelRange[i].substr(1+cpos);
851 std::cout << "Adding channel range " << c1 << " to " << c2 <<
852 " to channel selection" << std::endl;
853 if (m_chansel.allChannels())
854 m_chansel=cool::ChannelSelection(channelID(sourcefl,c1),
855 channelID(sourcefl,c2));
856 else
857 m_chansel.addRange(channelID(sourcefl,c1),channelID(sourcefl,c2));
858 }
859 }//end loop over channel ranges
860}
static cool::ChannelId channelID(const cool::IFolderPtr &folder, const std::string &chanstring)

◆ setOpts()

int AtlCoolCopy::setOpts ( int argc,
const char * argv[] )

Definition at line 2385 of file AtlCoolCopy.cxx.

2385 {
2386 // accumulate raw folder list
2387 std::vector<std::string> folders;
2388 // process options given on command-line
2389 if (!procOptVector(argc,argv,folders)) return 2;
2390
2391 // parse any parameters in files via parfile option
2392 for (std::vector<std::string>::const_iterator ifile=m_parfile.begin();
2393 ifile!=m_parfile.end();++ifile) {
2394 std::cout << "Reading parameters from file " << *ifile << std::endl;
2395 FILE* p_inp=fopen(ifile->c_str(),"r");
2396 if (p_inp==nullptr) {
2397 std::cout << "File not found" << std::endl;
2398 return 3;
2399 }
2400 std::vector<char> p_buf (999);
2401 while (!feof(p_inp)) {
2402 char* p_line=fgets(p_buf.data(),p_buf.size(),p_inp);
2403 if (p_line!=nullptr) {
2404 int fargc=0;
2405 const char* fargv[99];
2406 // split this line into tokens
2407 char* p_start=nullptr;
2408 while (*p_line!='\0') {
2409 if (*p_line==' ' || *p_line=='\n') {
2410 // pointing at a space/newline, marking the end of a parameter
2411 if (p_start!=nullptr) {
2412 // if we have a parameter, mark the end and store it
2413 *p_line='\0';
2414 fargv[fargc]=p_start;
2415 fargc++;
2416 p_start=nullptr;
2417 }
2418 } else {
2419 // mark the start of a parameter
2420 if (p_start==nullptr) p_start=p_line;
2421 }
2422 ++p_line;
2423 }
2424 if (fargc>0) {
2425 if (!procOptVector(fargc,&fargv[0],folders)) {
2426 fclose(p_inp);
2427 return 3;
2428 }
2429 }
2430 }
2431 }
2432 std::cout << "Close file" << std::endl;
2433 fclose(p_inp);
2434 }
2435
2436 // now open the database so folder lookup will work
2438 std::cout << "Problem opening connections" << std::endl;
2439 return 10;
2440 } else {
2441 // having assembled the raw list of folders and exclude list, construct
2442 // real list of folders (allows exclude to be specified after folders on
2443 // command line), if none given, add '/'
2444 if (m_lockedonly) {
2445 if (getLockedTags()==0) return 11;
2446 }
2447 if (folders.empty()) {
2448 // no folders specified, take all with tags
2449 addFolder("/",false);
2450 } else {
2451 // explicit list of folders
2452 for (std::vector<std::string>::const_iterator ifold=folders.begin();
2453 ifold!=folders.end();++ifold) addFolder(*ifold,false);
2454 // need to process only tags in root folder, if inclusive hiearchicals
2455 if (m_hitag) addFolder("/",true);
2456 }
2457 }
2458 if (m_getonline) {
2459 if (!getOnlineRun()) return 6;
2460 }
2461 if (m_getbulk) {
2462 if (!getBulkRun()) return 6;
2463 }
2464 if (m_gettime) {
2465 if (!getTimeFromRun()) return 5;
2466 }
2467 if (!m_runfile.empty()) {
2468 if (!getRunList()) return 7;
2469 }
2470 // list out parameter changes
2471 if (m_runemin!=cool::ValidityKeyMin || m_runemax!=cool::ValidityKeyMax)
2472 std::cout << "Source run/LB range [" << (m_runemin >> 32) << "," <<
2473 (m_runemin & 0xFFFFFFFF) << "] to [" << (m_runemax >> 32) << "," <<
2474 (m_runemax & 0xFFFFFFFF) << "]" << std::endl;
2475 if (m_timemin!=cool::ValidityKeyMin || m_timemax!=cool::ValidityKeyMax)
2476 std::cout << "Source timestamp range " << m_timemin << " " <<
2477 timeString(m_timemin) << "to " << m_timemax << " " <<
2478 timeString(m_timemax) << std::endl;
2479 if (m_alliov)
2480 std::cout << "Change o/p run/LB range [" << (m_newrunemin >> 32) << "," <<
2481 (m_newrunemin & 0xFFFFFFFF) << "] to [" << (m_newrunemax >> 32) << "," <<
2482 (m_newrunemax & 0xFFFFFFFF) << "]" << std::endl;
2483 if (m_alliov)
2484 std::cout << "Change o/p timestamp range " << m_newtimemin << " " <<
2485 timeString(m_newtimemin) << "to " << m_newtimemax << " " <<
2486 timeString(m_newtimemax) << std::endl;
2487 if (m_skipout) {
2488 std::cout << "Skip IOVs extending outside run/LB range [" <<
2489 (m_srunemin >> 32) << "," << (m_srunemin & 0xFFFFFFFF) << "] to [" <<
2490 (m_srunemax >> 32) << "," << (m_srunemax & 0xFFFFFFFF) << "]" <<
2491 std::endl;
2492 }
2493 if (!m_excludechans.empty()) {
2494 for (std::vector<cool::ChannelId>::const_iterator itr=
2495 m_excludechans.begin();itr!=m_excludechans.end();++itr)
2496 std::cout << "Channel " << *itr << " will be excluded" << std::endl;
2497 }
2498 if (m_hitag) std::cout << "All hierarchical tags connecting to referenced tags will be copied" << std::endl;
2499 if (m_nohitag) std::cout << "Hierarchical tag relations will not be copied"
2500 << std::endl;
2501 return 0;
2502}
bool openConnections(const std::string &sourcedb, const std::string &destdb, bool allowcreate)
bool addFolder(const std::string &folder, const bool onlyTags)
bool getTimeFromRun()
bool getLockedTags()
bool procOptVector(const int argc, const char *argv[], std::vector< std::string > &folders)
bool getOnlineRun()

◆ setupCatalog()

void AtlCoolCopy::setupCatalog ( const std::vector< std::string > & catvec)
private

Definition at line 3327 of file AtlCoolCopy.cxx.

3328{
3329 try {
3330 SmartIF<Gaudi::IFileCatalogMgr> catMgr( Gaudi::svcLocator()->service<Gaudi::IFileCatalogMgr>( "Gaudi::MultiFileCatalog" ) );
3331 std::string writeCatName("file:PoolFileCatalog.xml");
3332 catMgr->addCatalog( "xmlcatalog_"+writeCatName );
3333 catMgr->setWriteCatalog( catMgr->findCatalog( writeCatName, true ) );
3334
3335 for( const auto& icat : catvec ) {
3336 std::cout << "Add catalogue: " << icat << std::endl;
3337 // if catalogue contains ":", assume it already has the full format specifier
3338 if( icat.contains(':') ) {
3339 catMgr->addCatalog(icat);
3340 } else {
3341 catMgr->addCatalog("xmlcatalog_file:" + icat);
3342 }
3343 }
3344 m_catalog = catMgr;
3345 m_catalog->init();
3346 }
3347 catch (std::exception& e) {
3348 std::cout << "Could not setup POOL catalogues, exception:" << e.what() << std::endl;
3349 }
3350}
SmartIF< Gaudi::IFileCatalog > m_catalog

◆ tagParents()

int AtlCoolCopy::tagParents ( )
private

Definition at line 3052 of file AtlCoolCopy.cxx.

3052 {
3053 std::cout << "Copying additional hierarchical tags of parent folders"
3054 << std::endl;
3055 while (!m_hiparent.empty()) {
3056 // take first element and erase it
3057 std::string folderset=*m_hiparent.begin();
3058 m_hiparent.erase(m_hiparent.begin());
3059 // process any tags defined for this folderset
3060 if (m_sourceDbPtr->existsFolderSet(folderset)) {
3061 cool::IFolderSetPtr sourcefl=m_sourceDbPtr->getFolderSet(folderset);
3062 cool::IFolderSetPtr destfl=m_destDbPtr->getFolderSet(folderset);
3063 std::cout << "Processing folderset " << folderset << std::endl;
3064 for (HiTagMap::const_iterator imap=m_hitagmap.begin();
3065 imap!=m_hitagmap.end();++imap) {
3066 try {
3067 // will throw exception if this tag is not pointing to the folder
3068 std::string sourcetag=sourcefl->findTagRelation(imap->first);
3069 std::cout << "Create hierarchical tag between " << sourcetag <<
3070 " and " << imap->first << " in folder " << imap->second <<
3071 std::endl;
3072 try {
3073 // first check this relation has not already been created
3074 std::string etag=destfl->resolveTag(imap->first);
3075 if (etag==sourcetag) {
3076 std::cout << "This relation has already been created" << std::endl;
3077 } else {
3078 std::cout << "ERROR: Tag in parent already related to " <<
3079 etag << std::endl;
3080 return 34;
3081 }
3082 }
3083 catch (cool::Exception& e ) {
3084 // only do creation if does not already exist - via exception
3085 try {
3086 destfl->createTagRelation(imap->first,sourcetag);
3087 // check if this implicates yet another parent folder to be checked
3088 if (find(m_hiparent.begin(),m_hiparent.end(),imap->second)==
3089 m_hiparent.end()) m_hiparent.push_back(imap->second);
3090 if (m_copytaginfo &&
3091 m_cooltagmap.find(imap->first)==m_cooltagmap.end())
3092 m_cooltagmap.insert(CoolTagMap::value_type(imap->first,
3093 CoolTagInfo(m_sourceDbPtr,imap->second,imap->second,
3094 imap->first,imap->first)));
3095 }
3096 catch (cool::Exception& e) {
3097 std::cout << "Cool exception " << e.what() <<
3098 "thrown in hierarchical tag creation" << std::endl;
3099 return 34;
3100 }
3101 }
3102 }
3103 // exceptions from findTag - do nothing
3104 catch (cool::Exception& e) { }
3105 }
3106 } else {
3107 std::cout << "ERROR Folderset " << folderset << " not found" <<
3108 std::endl;
3109 }
3110 }
3111 return 0;
3112}
std::vector< std::string > m_hiparent
CoolTagMap m_cooltagmap

◆ timeString()

std::string AtlCoolCopy::timeString ( const cool::ValidityKey iovtime)
staticprivate

Definition at line 2590 of file AtlCoolCopy.cxx.

2590 {
2591 if (iovtime==cool::ValidityKeyMin) {
2592 return "ValidityKeyMin ";
2593 } else if (iovtime==cool::ValidityKeyMax) {
2594 return "ValidityKeyMax ";
2595 } else {
2596 time_t time=static_cast<time_t>(iovtime/1E9);
2597 struct tm result;
2598 char buf[32];
2599 return "UTC "+std::string(asctime_r(gmtime_r(&time, &result), buf));
2600 }
2601}

◆ timeVal()

cool::ValidityKey AtlCoolCopy::timeVal ( const char * input)
staticprivate

Definition at line 2547 of file AtlCoolCopy.cxx.

2547 {
2548 // convert input char* string to 64bit COOL validityKey
2549 // input either represents a string in seconds, or a date in the form
2550 // yyyy/mm/dd:hh:mm:ss
2551 // first determine if input is a number
2552 if (isNumeric(input)) {
2553 return static_cast<long long>(atol(input))*
2554 static_cast<long long>(1.E9);
2555 } else {
2556 struct tm mytm{},mytm2{};
2557 char* result=strptime(input,"%Y-%m-%d:%T",&mytm);
2558 if (result!=nullptr) {
2559 // make the DST field zero, so the time is interpreted without daylight
2560 // savings time
2561 mytm.tm_isdst=0;
2562 // now have to correct for the local time zone - do this by also
2563 // calculating the time since epoch for 2/1/1970 midnight (no DST)
2564 time_t tm = mktime(&mytm);
2565 if (tm == static_cast<time_t>(-1)) {
2566 std::cout <<
2567 "ERROR in mktime" << std::endl;
2568 return 0;
2569 }
2570 cool::ValidityKey itime=static_cast<cool::ValidityKey>(tm);
2571 strptime("1970-01-02:00:00:00","%Y-%m-%d:%T",&mytm2);
2572 time_t tm2 = mktime(&mytm2);
2573 if (tm2 == static_cast<time_t>(-1)) {
2574 std::cout <<
2575 "ERROR in mktime" << std::endl;
2576 return 0;
2577 }
2578 cool::ValidityKey caltime=static_cast<cool::ValidityKey>(tm2);
2579 itime+=24*60*60-caltime;
2580 return itime*static_cast<cool::ValidityKey>(1.E9);
2581 } else {
2582 std::cout <<
2583 "ERROR in format of time value, use e.g. 2007-05-25:14:01:00" <<
2584 std::endl;
2585 return 0;
2586 }
2587 }
2588}

◆ transConn()

std::string AtlCoolCopy::transConn ( const std::string & inconn)
staticprivate

Definition at line 451 of file AtlCoolCopy.cxx.

451 {
452 // translate simple connection string (no slash) to mycool.db with given
453 // instance name, all others are left alone
454 if (inconn.find('/')==std::string::npos) {
455 return "sqlite://X;schema=mycool.db;dbname="+inconn;
456 } else {
457 return inconn;
458 }
459}

◆ verifyIOVs()

int AtlCoolCopy::verifyIOVs ( const std::string & folder,
const cool::IFolderPtr & sourcefl,
const CoraCoolFolderPtr & sourceflc,
const cool::IFolderPtr & destfl,
const CoraCoolFolderPtr & destflc,
const std::string & sourcetag,
const cool::ValidityKey since,
const cool::ValidityKey until,
const bool checkrefs,
const bool iscora,
const cool::PayloadMode::Mode paymode )
private

Definition at line 1362 of file AtlCoolCopy.cxx.

1368 {
1369
1370 std::cout << "Verifying tag " << sourcetag << " of folder " << folder <<
1371 std::endl;
1372 destfl->setPrefetchAll(false);
1373 cool::FolderVersioning::Mode vermode=sourcefl->versioningMode();
1374 int nobj=0;
1375 cool::IObjectIteratorPtr sourceitr,destitr;
1376 CoraCoolObjectIterPtr csourceitr,cdestitr;
1377 std::string tag=sourcetag;
1378 if (vermode==cool::FolderVersioning::SINGLE_VERSION || sourcetag=="HEAD")
1379 tag="";
1380 try {
1381 if (iscora) {
1382 sourceflc->setPrefetchAll(false);
1383 csourceitr=sourceflc->browseObjects(since,until,m_chansel,tag);
1384 cdestitr=destflc->browseObjects(since,until,m_chansel,tag);
1385 } else {
1386 sourceitr=sourcefl->browseObjects(since,until,m_chansel,tag);
1387 destitr=destfl->browseObjects(since,until,m_chansel,tag);
1388 }
1389 }
1390 catch (std::exception& e) {
1391 std::cout << "Exception thrown from verify iterator setup: " << e.what() <<
1392 std::endl;
1393 return 105;
1394 }
1395 try {
1396 // the check algorithm assumes the two databases will give back the
1397 // results of the query in the same order, which is currently the
1398 // case in COOL 1.3. If this changes, the verification will be more complex
1399 if (iscora) {
1400 const std::string& cfkey=sourceflc->coralFKey();
1401 const std::string& cpkey=sourceflc->coralPKey();
1402 while (csourceitr->hasNext()) {
1403 CoraCoolObjectPtr sobj=csourceitr->next();
1404 // check object should not be skipped as excluded channel
1405 if (!m_excludechans.empty()) {
1406 if (find(m_excludechans.begin(),m_excludechans.end(),
1407 sobj->channelId())!=m_excludechans.end()) {
1408 continue;
1409 }
1410 }
1411 if (cdestitr->hasNext()) {
1412 CoraCoolObjectPtr dobj=cdestitr->next();
1413 // check objects are the same
1414 int iret=0;
1415 // check IOV equality
1416 if (sobj->since()!=dobj->since() || sobj->until()!=dobj->until())
1417 iret=100;
1418 // check channel equality
1419 if (sobj->channelId()!=dobj->channelId())
1420 iret=101;
1421 // check size of payloads
1422 if (sobj->size()!=dobj->size()) {
1423 std::cout << "ERROR CoraCool object " << nobj <<
1424 " sizes do not match: " << sobj->size() << " " << dobj->size()
1425 << std::endl;
1426 iret=102;
1427 }
1428 // check payload equality (does not check attribute names)
1429 CoraCoolObject::const_iterator ditr=dobj->begin();
1430 for (CoraCoolObject::const_iterator sitr=sobj->begin();
1431 sitr!=sobj->end();++sitr,++ditr) {
1432 // loop over all the attributes, in order to skip PK and FK
1433 for (coral::AttributeList::const_iterator aitr=sitr->begin();
1434 aitr!=sitr->end();++aitr) {
1435 const std::string& aname=aitr->specification().name();
1436 if (aname!=cfkey && aname!=cpkey) {
1437 try {
1438 if (*aitr!=(*ditr)[aname]) {
1439 std::cout << "ERROR Values of attriute " << aname <<
1440 " differ" << std::endl;
1441 iret=102;
1442 }
1443 }
1444 catch (coral::AttributeListException& e) {
1445 std::cout << "ERROR: CoraCool attribute " << aname <<
1446 " not found in destination!" << std::endl;
1447 iret=102;
1448 }
1449 }
1450 }
1451 }
1452 if (iret!=0) {
1453 std::cout << "ERROR database entries do not match: since: " <<
1454 sobj->since() << "," << dobj->since() << " until: " <<
1455 sobj->until() << "," << dobj->until() << " channel: " <<
1456 sobj->channelId() << "," << dobj->channelId() << std::endl;
1457 return iret;
1458 }
1459 } else {
1460 std::cout <<
1461 "ERROR destination folder no matching CoraCool iterator for object "
1462 << nobj << std::endl;
1463 return 103;
1464 }
1465 ++ nobj;
1466 }
1467 } else {
1468 while (sourceitr->goToNext()) {
1469 const cool::IObject& sobj=sourceitr->currentRef();
1470 // check object should not be skipped as excluded channel
1471 if (!m_excludechans.empty()) {
1472 if (find(m_excludechans.begin(),m_excludechans.end(),
1473 sobj.channelId())!=m_excludechans.end()) {
1474 continue;
1475 }
1476 }
1477 if (checkrefs) checkRef(sobj.payload(),folder,sourcetag);
1478 if (destitr->goToNext()) {
1479 const cool::IObject& dobj=destitr->currentRef();
1480 // check objects are the same
1481 int iret=0;
1482 // check IOV equality
1483 if (sobj.since()!=dobj.since() || sobj.until()!=dobj.until())
1484 iret=100;
1485 // check channel equality
1486 if (sobj.channelId()!=dobj.channelId())
1487 iret=101;
1488 // check payload equality (does not check attribute names)
1489 // do not use cool::IRecord equality operator as does not correctly
1490 // handle null values
1491 if (paymode==cool::PayloadMode::VECTORPAYLOAD) {
1492 cool::IRecordIterator& spitr=sobj.payloadIterator();
1493 const cool::IRecordVectorPtr svptr=spitr.fetchAllAsVector();
1494 cool::IRecordIterator& dpitr=dobj.payloadIterator();
1495 const cool::IRecordVectorPtr dvptr=dpitr.fetchAllAsVector();
1496 if (svptr->size()!=dvptr->size()) {
1497 iret=102;
1498 } else {
1499 // loop through the payloads, checking equality - assumes
1500 // order is significant and same in source and destination DBs
1501 cool::IRecordVector::const_iterator svitr=svptr->begin();
1502 cool::IRecordVector::const_iterator svend=svptr->end();
1503 cool::IRecordVector::const_iterator dvitr=dvptr->begin();
1504 for (;svitr!=svend;++svitr,++dvitr) {
1505 if (!equalRecord(**svitr,**dvitr)) iret=102;
1506 }
1507 }
1508 if (iret!=0) {
1509 std::cout << "ERROR vector payloads do not match (size " << svptr->size() << "," << dvptr->size() << ")" << std::endl;
1510 }
1511
1512 } else {
1513 // standard COOL folder - simple check of payloads
1514 if (!equalRecord(sobj.payload(),dobj.payload())) iret=102;
1515 }
1516
1517 if (iret!=0) {
1518 std::cout << "ERROR database entries do not match: since: " <<
1519 sobj.since() << "," << dobj.since() << " until: " <<
1520 sobj.until() << "," << dobj.until() << " channel: " <<
1521 sobj.channelId() << "," << dobj.channelId() << std::endl;
1522 std::cout << "Source payload:" << std::endl;
1523 sobj.payload().attributeList().toOutputStream(std::cout);
1524 std::cout << std::endl << "Destination payload:" << std::endl;
1525 dobj.payload().attributeList().toOutputStream(std::cout);
1526 std::cout << std::endl;
1527 return iret;
1528 }
1529 } else {
1530 std::cout <<
1531 "ERROR destination folder no matching iterator for object "
1532 << nobj << std::endl;
1533 return 103;
1534 }
1535 ++nobj;
1536 }
1537 }
1538 }
1539 catch (cool::Exception& e) {
1540 std::cout << "Exception thrown from verify loop: " << e.what() <<
1541 std::endl;
1542 return 104;
1543 }
1544 // finished with the iterators
1545 if (iscora) {
1546 } else {
1547 sourceitr->close();
1548 destitr->close();
1549 }
1550 std::cout << "Verification of folder " << folder << " tag " <<
1551 sourcetag << " OK (" << nobj << " objects)" << std::endl;
1552 return 0;
1553}
boost::shared_ptr< CoraCoolObject > CoraCoolObjectPtr
boost::shared_ptr< CoraCoolObjectIter > CoraCoolObjectIterPtr
static bool equalRecord(const cool::IRecord &lhs, const cool::IRecord &rhs)
AttrListVec::const_iterator const_iterator

◆ writeTagInfo()

int AtlCoolCopy::writeTagInfo ( )
private

Definition at line 3114 of file AtlCoolCopy.cxx.

3114 {
3115 std::cout << "Write tag description ";
3116 if (m_copytaglock) std::cout << "and lock info ";
3117 std::cout << "for " << m_cooltagmap.size() << " tags" << std::endl;
3118 for (CoolTagMap::const_iterator itr=m_cooltagmap.begin();
3119 itr!=m_cooltagmap.end();++itr) {
3120 itr->second.write(m_destDbPtr,m_copytaglock);
3121 }
3122 return 0;
3123}

Member Data Documentation

◆ m_addguid

std::vector<std::string> AtlCoolCopy::m_addguid
private

Definition at line 246 of file AtlCoolCopy.cxx.

◆ m_addlfn

std::vector<std::string> AtlCoolCopy::m_addlfn
private

Definition at line 247 of file AtlCoolCopy.cxx.

◆ m_alliov

bool AtlCoolCopy::m_alliov
private

Definition at line 182 of file AtlCoolCopy.cxx.

◆ m_allowcreate

bool AtlCoolCopy::m_allowcreate
private

Definition at line 175 of file AtlCoolCopy.cxx.

◆ m_anadelt

long long AtlCoolCopy::m_anadelt
private

Definition at line 238 of file AtlCoolCopy.cxx.

◆ m_analyse

bool AtlCoolCopy::m_analyse
private

Definition at line 186 of file AtlCoolCopy.cxx.

◆ m_applock

bool AtlCoolCopy::m_applock
private

Definition at line 207 of file AtlCoolCopy.cxx.

◆ m_applocksv

bool AtlCoolCopy::m_applocksv
private

Definition at line 208 of file AtlCoolCopy.cxx.

◆ m_bufsize

int AtlCoolCopy::m_bufsize
private

Definition at line 236 of file AtlCoolCopy.cxx.

◆ m_catalog

SmartIF<Gaudi::IFileCatalog> AtlCoolCopy::m_catalog
private

Definition at line 170 of file AtlCoolCopy.cxx.

◆ m_channel1

std::string AtlCoolCopy::m_channel1
private

Definition at line 234 of file AtlCoolCopy.cxx.

◆ m_channel2

std::string AtlCoolCopy::m_channel2
private

Definition at line 235 of file AtlCoolCopy.cxx.

◆ m_channelRange

std::vector<std::string> AtlCoolCopy::m_channelRange
private

Definition at line 233 of file AtlCoolCopy.cxx.

◆ m_chansel

cool::ChannelSelection AtlCoolCopy::m_chansel
private

Definition at line 269 of file AtlCoolCopy.cxx.

◆ m_chdesc

bool AtlCoolCopy::m_chdesc
private

Definition at line 194 of file AtlCoolCopy.cxx.

◆ m_checkdesttag

bool AtlCoolCopy::m_checkdesttag
private

Definition at line 221 of file AtlCoolCopy.cxx.

◆ m_checkoutputfile

std::string AtlCoolCopy::m_checkoutputfile
private

Definition at line 242 of file AtlCoolCopy.cxx.

◆ m_checkrefs

bool AtlCoolCopy::m_checkrefs
private

Definition at line 187 of file AtlCoolCopy.cxx.

◆ m_coolapp

cool::Application AtlCoolCopy::m_coolapp
private

Definition at line 255 of file AtlCoolCopy.cxx.

◆ m_cooltagmap

CoolTagMap AtlCoolCopy::m_cooltagmap
private

Definition at line 281 of file AtlCoolCopy.cxx.

◆ m_copytaginfo

bool AtlCoolCopy::m_copytaginfo
private

Definition at line 216 of file AtlCoolCopy.cxx.

◆ m_copytaglock

bool AtlCoolCopy::m_copytaglock
private

Definition at line 217 of file AtlCoolCopy.cxx.

◆ m_coracool

bool AtlCoolCopy::m_coracool
private

Definition at line 218 of file AtlCoolCopy.cxx.

◆ m_coralsvc

coral::ConnectionService AtlCoolCopy::m_coralsvc
private

Definition at line 254 of file AtlCoolCopy.cxx.

◆ m_dbSvc

cool::IDatabaseSvc* AtlCoolCopy::m_dbSvc
private

Definition at line 256 of file AtlCoolCopy.cxx.

◆ m_debug

bool AtlCoolCopy::m_debug
private

Definition at line 181 of file AtlCoolCopy.cxx.

◆ m_destCoraPtr

CoraCoolDatabasePtr AtlCoolCopy::m_destCoraPtr
private

Definition at line 261 of file AtlCoolCopy.cxx.

◆ m_destdb

std::string AtlCoolCopy::m_destdb
private

Definition at line 174 of file AtlCoolCopy.cxx.

◆ m_destDbPtr

cool::IDatabasePtr AtlCoolCopy::m_destDbPtr
private

Definition at line 259 of file AtlCoolCopy.cxx.

◆ m_excludechans

std::vector<cool::ChannelId> AtlCoolCopy::m_excludechans
private

Definition at line 249 of file AtlCoolCopy.cxx.

◆ m_excludehead

bool AtlCoolCopy::m_excludehead
private

Definition at line 178 of file AtlCoolCopy.cxx.

◆ m_folderexcl

std::vector<std::string> AtlCoolCopy::m_folderexcl
private

Definition at line 263 of file AtlCoolCopy.cxx.

◆ m_folderlist

std::vector<std::string> AtlCoolCopy::m_folderlist
private

Definition at line 262 of file AtlCoolCopy.cxx.

◆ m_forcemulti

bool AtlCoolCopy::m_forcemulti
private

Definition at line 198 of file AtlCoolCopy.cxx.

◆ m_forcenopay

bool AtlCoolCopy::m_forcenopay
private

Definition at line 202 of file AtlCoolCopy.cxx.

◆ m_forcepay

bool AtlCoolCopy::m_forcepay
private

Definition at line 201 of file AtlCoolCopy.cxx.

◆ m_forcerune

bool AtlCoolCopy::m_forcerune
private

Definition at line 199 of file AtlCoolCopy.cxx.

◆ m_forcesingle

bool AtlCoolCopy::m_forcesingle
private

Definition at line 197 of file AtlCoolCopy.cxx.

◆ m_forcetime

bool AtlCoolCopy::m_forcetime
private

Definition at line 200 of file AtlCoolCopy.cxx.

◆ m_getbulk

bool AtlCoolCopy::m_getbulk
private

Definition at line 213 of file AtlCoolCopy.cxx.

◆ m_getonline

bool AtlCoolCopy::m_getonline
private

Definition at line 211 of file AtlCoolCopy.cxx.

◆ m_gettime

bool AtlCoolCopy::m_gettime
private

Definition at line 210 of file AtlCoolCopy.cxx.

◆ m_hiparent

std::vector<std::string> AtlCoolCopy::m_hiparent
private

Definition at line 277 of file AtlCoolCopy.cxx.

◆ m_hitag

bool AtlCoolCopy::m_hitag
private

Definition at line 195 of file AtlCoolCopy.cxx.

◆ m_hitagmap

HiTagMap AtlCoolCopy::m_hitagmap
private

Definition at line 275 of file AtlCoolCopy.cxx.

◆ m_ignoremode

bool AtlCoolCopy::m_ignoremode
private

Definition at line 219 of file AtlCoolCopy.cxx.

◆ m_ignorespec

bool AtlCoolCopy::m_ignorespec
private

Definition at line 220 of file AtlCoolCopy.cxx.

◆ m_includehead

bool AtlCoolCopy::m_includehead
private

Definition at line 177 of file AtlCoolCopy.cxx.

◆ m_listpfn

bool AtlCoolCopy::m_listpfn
private

Definition at line 188 of file AtlCoolCopy.cxx.

◆ m_lockedonly

bool AtlCoolCopy::m_lockedonly
private

Definition at line 215 of file AtlCoolCopy.cxx.

◆ m_magic

std::vector<std::string> AtlCoolCopy::m_magic
private

Definition at line 265 of file AtlCoolCopy.cxx.

◆ m_mergecat

std::vector<std::string> AtlCoolCopy::m_mergecat
private

Definition at line 267 of file AtlCoolCopy.cxx.

◆ m_newdataset

std::string AtlCoolCopy::m_newdataset
private

Definition at line 241 of file AtlCoolCopy.cxx.

◆ m_newrunemax

cool::ValidityKey AtlCoolCopy::m_newrunemax
private

Definition at line 228 of file AtlCoolCopy.cxx.

◆ m_newrunemin

cool::ValidityKey AtlCoolCopy::m_newrunemin
private

Definition at line 227 of file AtlCoolCopy.cxx.

◆ m_newtimemax

cool::ValidityKey AtlCoolCopy::m_newtimemax
private

Definition at line 230 of file AtlCoolCopy.cxx.

◆ m_newtimemin

cool::ValidityKey AtlCoolCopy::m_newtimemin
private

Definition at line 229 of file AtlCoolCopy.cxx.

◆ m_nochannel

bool AtlCoolCopy::m_nochannel
private

Definition at line 193 of file AtlCoolCopy.cxx.

◆ m_noclobroot

bool AtlCoolCopy::m_noclobroot
private

Definition at line 222 of file AtlCoolCopy.cxx.

◆ m_nocopy

bool AtlCoolCopy::m_nocopy
private

Definition at line 191 of file AtlCoolCopy.cxx.

◆ m_nodata

bool AtlCoolCopy::m_nodata
private

Definition at line 192 of file AtlCoolCopy.cxx.

◆ m_nohitag

bool AtlCoolCopy::m_nohitag
private

Definition at line 196 of file AtlCoolCopy.cxx.

◆ m_nt_bufferptr

std::vector<void*> AtlCoolCopy::m_nt_bufferptr
private

Definition at line 295 of file AtlCoolCopy.cxx.

◆ m_nt_channel

UInt_t AtlCoolCopy::m_nt_channel = 0
private

Definition at line 292 of file AtlCoolCopy.cxx.

◆ m_nt_lbsince

UInt_t AtlCoolCopy::m_nt_lbsince = 0
private

Definition at line 290 of file AtlCoolCopy.cxx.

◆ m_nt_lbuntil

UInt_t AtlCoolCopy::m_nt_lbuntil = 0
private

Definition at line 291 of file AtlCoolCopy.cxx.

◆ m_nt_runsince

UInt_t AtlCoolCopy::m_nt_runsince = 0
private

Definition at line 288 of file AtlCoolCopy.cxx.

◆ m_nt_rununtil

UInt_t AtlCoolCopy::m_nt_rununtil = 0
private

Definition at line 289 of file AtlCoolCopy.cxx.

◆ m_nt_since

ULong64_t AtlCoolCopy::m_nt_since = 0
private

Definition at line 286 of file AtlCoolCopy.cxx.

◆ m_nt_tagid

char AtlCoolCopy::m_nt_tagid[256] = {0}
private

Definition at line 293 of file AtlCoolCopy.cxx.

293{0};

◆ m_nt_treename

std::string AtlCoolCopy::m_nt_treename
private

Definition at line 294 of file AtlCoolCopy.cxx.

◆ m_nt_until

ULong64_t AtlCoolCopy::m_nt_until = 0
private

Definition at line 287 of file AtlCoolCopy.cxx.

◆ m_onlinerun

bool AtlCoolCopy::m_onlinerun
private

Definition at line 212 of file AtlCoolCopy.cxx.

◆ m_open

bool AtlCoolCopy::m_open
private

Definition at line 268 of file AtlCoolCopy.cxx.

◆ m_outfolder

std::string AtlCoolCopy::m_outfolder
private

Definition at line 239 of file AtlCoolCopy.cxx.

◆ m_outtag

std::string AtlCoolCopy::m_outtag
private

Definition at line 240 of file AtlCoolCopy.cxx.

◆ m_parfile

std::vector<std::string> AtlCoolCopy::m_parfile
private

Definition at line 248 of file AtlCoolCopy.cxx.

◆ m_poolall

bool AtlCoolCopy::m_poolall
private

Definition at line 190 of file AtlCoolCopy.cxx.

◆ m_poolcat

std::vector<std::string> AtlCoolCopy::m_poolcat
private

Definition at line 266 of file AtlCoolCopy.cxx.

◆ m_poollast

PoolMap::iterator AtlCoolCopy::m_poollast
private

Definition at line 271 of file AtlCoolCopy.cxx.

◆ m_poolopen

bool AtlCoolCopy::m_poolopen
private

Definition at line 189 of file AtlCoolCopy.cxx.

◆ m_poolrefs

PoolMap AtlCoolCopy::m_poolrefs
private

Definition at line 272 of file AtlCoolCopy.cxx.

◆ m_prunetags

bool AtlCoolCopy::m_prunetags
private

Definition at line 214 of file AtlCoolCopy.cxx.

◆ m_readoracle

bool AtlCoolCopy::m_readoracle
private

Definition at line 209 of file AtlCoolCopy.cxx.

◆ m_recreate

bool AtlCoolCopy::m_recreate
private

Definition at line 176 of file AtlCoolCopy.cxx.

◆ m_repsort

ReplicaSorter* AtlCoolCopy::m_repsort
private

Definition at line 257 of file AtlCoolCopy.cxx.

◆ m_root

bool AtlCoolCopy::m_root
private

Definition at line 184 of file AtlCoolCopy.cxx.

◆ m_runemax

cool::ValidityKey AtlCoolCopy::m_runemax
private

Definition at line 224 of file AtlCoolCopy.cxx.

◆ m_runemin

cool::ValidityKey AtlCoolCopy::m_runemin
private

Definition at line 223 of file AtlCoolCopy.cxx.

◆ m_runfile

std::vector<std::string> AtlCoolCopy::m_runfile
private

Definition at line 250 of file AtlCoolCopy.cxx.

◆ m_runinfohost

std::string AtlCoolCopy::m_runinfohost
private

Definition at line 245 of file AtlCoolCopy.cxx.

◆ m_runlist

std::vector<unsigned int> AtlCoolCopy::m_runlist
private

Definition at line 251 of file AtlCoolCopy.cxx.

◆ m_sealmsg

int AtlCoolCopy::m_sealmsg
private

Definition at line 237 of file AtlCoolCopy.cxx.

◆ m_skipout

bool AtlCoolCopy::m_skipout
private

Definition at line 205 of file AtlCoolCopy.cxx.

◆ m_skiprep

bool AtlCoolCopy::m_skiprep
private

Definition at line 206 of file AtlCoolCopy.cxx.

◆ m_sourceCoraPtr

CoraCoolDatabasePtr AtlCoolCopy::m_sourceCoraPtr
private

Definition at line 260 of file AtlCoolCopy.cxx.

◆ m_sourcedb

std::string AtlCoolCopy::m_sourcedb
private

Definition at line 173 of file AtlCoolCopy.cxx.

◆ m_sourceDbPtr

cool::IDatabasePtr AtlCoolCopy::m_sourceDbPtr
private

Definition at line 258 of file AtlCoolCopy.cxx.

◆ m_sourceread

bool AtlCoolCopy::m_sourceread
private

Definition at line 203 of file AtlCoolCopy.cxx.

◆ m_srunemax

cool::ValidityKey AtlCoolCopy::m_srunemax
private

Definition at line 232 of file AtlCoolCopy.cxx.

◆ m_srunemin

cool::ValidityKey AtlCoolCopy::m_srunemin
private

Definition at line 231 of file AtlCoolCopy.cxx.

◆ m_taglabel

std::string AtlCoolCopy::m_taglabel
private

Definition at line 244 of file AtlCoolCopy.cxx.

◆ m_tags

std::vector<std::string> AtlCoolCopy::m_tags
private

Definition at line 264 of file AtlCoolCopy.cxx.

◆ m_timedb

std::string AtlCoolCopy::m_timedb
private

Definition at line 243 of file AtlCoolCopy.cxx.

◆ m_timemax

cool::ValidityKey AtlCoolCopy::m_timemax
private

Definition at line 226 of file AtlCoolCopy.cxx.

◆ m_timemin

cool::ValidityKey AtlCoolCopy::m_timemin
private

Definition at line 225 of file AtlCoolCopy.cxx.

◆ m_truncate

bool AtlCoolCopy::m_truncate
private

Definition at line 204 of file AtlCoolCopy.cxx.

◆ m_usertags

bool AtlCoolCopy::m_usertags
private

Definition at line 179 of file AtlCoolCopy.cxx.

◆ m_userupdatehead

bool AtlCoolCopy::m_userupdatehead
private

Definition at line 180 of file AtlCoolCopy.cxx.

◆ m_verify

bool AtlCoolCopy::m_verify
private

Definition at line 183 of file AtlCoolCopy.cxx.

◆ m_zeronull

bool AtlCoolCopy::m_zeronull
private

Definition at line 185 of file AtlCoolCopy.cxx.

◆ p_rootfile

TFile* AtlCoolCopy::p_rootfile
private

Definition at line 283 of file AtlCoolCopy.cxx.


The documentation for this class was generated from the following file: