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 ()

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)
static pool::IFileCatalogsetupCatalog (const std::vector< std::string > &catvec)

Private Attributes

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 80 of file AtlCoolCopy.cxx.

Member Typedef Documentation

◆ CoolTagMap

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

Definition at line 278 of file AtlCoolCopy.cxx.

◆ HiTagMap

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

Definition at line 272 of file AtlCoolCopy.cxx.

◆ PoolMap

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

Definition at line 268 of file AtlCoolCopy.cxx.

Constructor & Destructor Documentation

◆ AtlCoolCopy()

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

Definition at line 300 of file AtlCoolCopy.cxx.

301 :
302 m_sourcedb(sourcedb),m_destdb(destdb),m_allowcreate(allowcreate),
303 m_recreate(false),
304 m_includehead(false),m_excludehead(false),
305 m_usertags(true),m_userupdatehead(false),m_debug(false),m_alliov(false),
306 m_verify(false),m_root(false),m_zeronull(false),m_analyse(false),
307 m_checkrefs(false),m_listpfn(false),m_poolopen(false),m_poolall(false),
308 m_nocopy(false),m_nodata(false),m_nochannel(false),m_chdesc(false),
309 m_hitag(false),m_nohitag(false),m_forcesingle(false),m_forcemulti(false),
310 m_forcerune(false),m_forcetime(false),m_forcepay(false),m_forcenopay(false),
311 m_sourceread(true),m_truncate(false),m_skipout(false),m_skiprep(false),
312 m_applock(false),m_applocksv(false),
313 m_readoracle(false),m_gettime(false),m_getonline(false),m_onlinerun(false),
314 m_getbulk(false),
315 m_prunetags(false),m_lockedonly(false),m_copytaginfo(false),
316 m_copytaglock(false),m_coracool(true),m_ignoremode(false),
317 m_ignorespec(false),m_checkdesttag(false),m_noclobroot(false),
318 m_runemin(cool::ValidityKeyMin),m_runemax(cool::ValidityKeyMax),
319 m_timemin(cool::ValidityKeyMin),m_timemax(cool::ValidityKeyMax),
320 m_newrunemin(cool::ValidityKeyMin),m_newrunemax(cool::ValidityKeyMax),
321 m_newtimemin(cool::ValidityKeyMin),m_newtimemax(cool::ValidityKeyMax),
322 m_srunemin(cool::ValidityKeyMin),m_srunemax(cool::ValidityKeyMax),
323 m_channel1(""),m_channel2(""),m_bufsize(1000),m_sealmsg(5),
326 m_runinfohost("http://atlas-run-info-api.web.cern.ch/api"),
328 m_dbSvc(&(m_coolapp.databaseService())),m_repsort(nullptr),
329 m_open(false),m_chansel(cool::ChannelSelection::all()),p_rootfile(nullptr)
330{
331 m_poolrefs.clear();
333 // configure CORAL components
334 coral::IConnectionServiceConfiguration& csconfig=m_coralsvc.configuration();
335 csconfig.disablePoolAutomaticCleanUp();
336 csconfig.setConnectionTimeOut(0);
337}
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 528 of file AtlCoolCopy.cxx.

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

◆ addFolder()

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

Definition at line 460 of file AtlCoolCopy.cxx.

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

◆ 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 1295 of file AtlCoolCopy.cxx.

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

◆ 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 1862 of file AtlCoolCopy.cxx.

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

◆ ATLAS_NOT_THREAD_SAFE() [2/4]

int resolvePoolRefs AtlCoolCopy::ATLAS_NOT_THREAD_SAFE ( )
private

◆ 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 2083 of file AtlCoolCopy.cxx.

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

◆ channelID()

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

Definition at line 860 of file AtlCoolCopy.cxx.

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

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

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

◆ equalRecord()

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

Definition at line 2513 of file AtlCoolCopy.cxx.

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

◆ filePoolRefs()

void AtlCoolCopy::filePoolRefs ( )
private

Definition at line 3291 of file AtlCoolCopy.cxx.

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

◆ getBulkRun()

bool AtlCoolCopy::getBulkRun ( )
private

Definition at line 2791 of file AtlCoolCopy.cxx.

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

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

◆ getLockedTags()

bool AtlCoolCopy::getLockedTags ( )
private

Definition at line 429 of file AtlCoolCopy.cxx.

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

◆ getOnlineRun()

bool AtlCoolCopy::getOnlineRun ( )
private

Definition at line 2703 of file AtlCoolCopy.cxx.

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

◆ getRunList()

bool AtlCoolCopy::getRunList ( )
private

Definition at line 2883 of file AtlCoolCopy.cxx.

2883 {
2884 // loop over all given filenames
2885 for (std::vector<std::string>::const_iterator itr=m_runfile.begin();
2886 itr!=m_runfile.end();++itr) {
2887 std::cout << "Reading allowed run numbers from file " << *itr << std::endl;
2888 FILE* p_inp=fopen(itr->c_str(),"r");
2889 if (p_inp==nullptr) {
2890 std::cout << "File not found" << std::endl;
2891 return false;
2892 }
2893 std::vector<char> p_buf (999);
2894 while (!feof(p_inp)) {
2895 char* p_line=fgets(p_buf.data(),p_buf.size(),p_inp);
2896 if (p_line!=nullptr) {
2897 unsigned int run=atoi(p_line);
2898 m_runlist.push_back(run);
2899 }
2900 }
2901 fclose(p_inp);
2902 }
2903 std::sort(m_runlist.begin(),m_runlist.end());
2904 std::cout << "Read list of " << m_runlist.size() << " runs from " <<
2905 m_runfile.size() << " input runlist files" << std::endl;
2906 for (std::vector<unsigned int>::const_iterator itr=m_runlist.begin();
2907 itr!=m_runlist.end();++itr) std::cout <<
2908 "Update allowed for run " << *itr << std::endl;
2909 return true;
2910}
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.

◆ getTimeFromRun()

bool AtlCoolCopy::getTimeFromRun ( )
private

Definition at line 2614 of file AtlCoolCopy.cxx.

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

◆ getUpdateMode()

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

Definition at line 2912 of file AtlCoolCopy.cxx.

2913 {
2914 // analyse the folder description and tag name for updateMode flags
2915 // return 1 for online mode, 0 otherwise
2916 std::string_view modestr="";
2917 int mode=0;
2918 std::string::size_type iofs1=desc.find("<updateMode>");
2919 std::string::size_type iofs2=desc.find("</updateMode>");
2920 if (iofs1!=std::string::npos && iofs2!=std::string::npos && iofs2>iofs1)
2921 modestr=desc.substr(iofs1+12,iofs2-iofs1-12);
2922 if (modestr=="UPD1" || tag.find("UPD1")!=std::string::npos) mode=1;
2923 if (modestr=="UPD2" || tag.find("UPD2")!=std::string::npos) mode=2;
2924 if (modestr=="UPD3" || tag.find("UPD3")!=std::string::npos) mode=3;
2925 if (modestr=="UPD4" || tag.find("UPD4")!=std::string::npos) mode=4;
2926 return mode;
2927}

◆ isNumeric()

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

Definition at line 2502 of file AtlCoolCopy.cxx.

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

◆ isOpen()

bool AtlCoolCopy::isOpen ( ) const
inline

Definition at line 296 of file AtlCoolCopy.cxx.

296{ return m_open; }

◆ listPoolRefs()

int AtlCoolCopy::listPoolRefs ( )
private

Definition at line 3117 of file AtlCoolCopy.cxx.

3117 {
3118 std::cout << "Total of " << m_poolrefs.size() << " POOL files referenced"
3119 << std::endl;
3120 for (PoolMap::const_iterator ipool=m_poolrefs.begin();
3121 ipool!=m_poolrefs.end();++ipool) {
3122 std::cout << "Ref " << ipool->first << " (" << ipool->second.count()
3123 << ")" << std::endl;
3124 }
3125 return 0;
3126}

◆ 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 1326 of file AtlCoolCopy.cxx.

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

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

◆ openCoraCool()

bool AtlCoolCopy::openCoraCool ( )
private

Definition at line 409 of file AtlCoolCopy.cxx.

409 {
410 if (m_sourceCoraPtr.get()==nullptr) {
411 std::cout << "Attempt to open source CoraCool DB " << m_sourcedb <<
412 std::endl;
415 std::cout << "Opened CoraCool source DB" << std::endl;
416 }
417 // skip destination DB if not copying
418 if (m_nocopy) return true;
419 if (m_destCoraPtr.get()==nullptr) {
420 std::cout << "Attempt to open destination CoraCool DB " << m_destdb <<
421 std::endl;
422 m_destCoraPtr=CoraCoolDatabasePtr(new CoraCoolDatabase(m_destdb,
424 std::cout << "Opened CoraCool dest DB" << std::endl;
425 }
426 return true;
427}
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 2136 of file AtlCoolCopy.cxx.

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

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

◆ rootDirs()

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

Definition at line 1686 of file AtlCoolCopy.cxx.

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

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

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

◆ runLBVal()

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

Definition at line 2595 of file AtlCoolCopy.cxx.

2595 {
2596 // parse the inputs as run/LB numbers to generate a validitykey
2597 // used in processing -rls-type options
2598 cool::ValidityKey val;
2599 if (input1[0]=='M' || input1[0]=='m') {
2600 val=((1LL << 31)-1) << 32;
2601 } else {
2602 val=static_cast<long long>(atol(input1)) << 32;
2603 }
2604 if (input2[0]=='M' || input2[0]=='m') {
2605 val+=(1LL << 32);
2606 } else {
2607 val+=atoll(input2);
2608 }
2609 if (val>cool::ValidityKeyMax) val=cool::ValidityKeyMax;
2610 return val;
2611}

◆ setChannelRange()

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

Definition at line 825 of file AtlCoolCopy.cxx.

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

◆ setOpts()

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

Definition at line 2383 of file AtlCoolCopy.cxx.

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

pool::IFileCatalog * AtlCoolCopy::setupCatalog ( const std::vector< std::string > & catvec)
staticprivate

Definition at line 3328 of file AtlCoolCopy.cxx.

3329 {
3330 pool::IFileCatalog* catalog=new pool::IFileCatalog;
3331 try {
3332 catalog->setWriteCatalog("file:PoolFileCatalog.xml");
3333 for (std::vector<std::string>::const_iterator icat=catvec.begin();
3334 icat!=catvec.end();++icat) {
3335 std::cout << "Add catalogue: " << *icat << std::endl;
3336 // if catalogue contains no ":" specifier, assume plain file
3337 if (icat->find(':')==std::string::npos) {
3338 catalog->addReadCatalog("file:"+(*icat));
3339 } else {
3340 catalog->addReadCatalog(*icat);
3341 }
3342 }
3343 catalog->connect();
3344 catalog->start();
3345 return catalog;
3346 }
3347 catch (std::exception& e) {
3348 std::cout << "Could not setup POOL catalogues, exception:" << e.what()
3349 << std::endl;
3350 return nullptr;
3351 }
3352}
void start()
redirect to init() for Gaudi FC
void addReadCatalog(const std::string &connect)
Add new catalog identified by name to the existing ones.
void setWriteCatalog(const std::string &connect)
Access to the (first) writable file catalog.

◆ tagParents()

int AtlCoolCopy::tagParents ( )
private

Definition at line 3044 of file AtlCoolCopy.cxx.

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

◆ timeString()

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

Definition at line 2582 of file AtlCoolCopy.cxx.

2582 {
2583 if (iovtime==cool::ValidityKeyMin) {
2584 return "ValidityKeyMin ";
2585 } else if (iovtime==cool::ValidityKeyMax) {
2586 return "ValidityKeyMax ";
2587 } else {
2588 time_t time=static_cast<time_t>(iovtime/1E9);
2589 struct tm result;
2590 char buf[32];
2591 return "UTC "+std::string(asctime_r(gmtime_r(&time, &result), buf));
2592 }
2593}

◆ timeVal()

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

Definition at line 2545 of file AtlCoolCopy.cxx.

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

◆ transConn()

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

Definition at line 449 of file AtlCoolCopy.cxx.

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

◆ 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 1360 of file AtlCoolCopy.cxx.

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

3106 {
3107 std::cout << "Write tag description ";
3108 if (m_copytaglock) std::cout << "and lock info ";
3109 std::cout << "for " << m_cooltagmap.size() << " tags" << std::endl;
3110 for (CoolTagMap::const_iterator itr=m_cooltagmap.begin();
3111 itr!=m_cooltagmap.end();++itr) {
3112 itr->second.write(m_destDbPtr,m_copytaglock);
3113 }
3114 return 0;
3115}

Member Data Documentation

◆ m_addguid

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

Definition at line 244 of file AtlCoolCopy.cxx.

◆ m_addlfn

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

Definition at line 245 of file AtlCoolCopy.cxx.

◆ m_alliov

bool AtlCoolCopy::m_alliov
private

Definition at line 180 of file AtlCoolCopy.cxx.

◆ m_allowcreate

bool AtlCoolCopy::m_allowcreate
private

Definition at line 173 of file AtlCoolCopy.cxx.

◆ m_anadelt

long long AtlCoolCopy::m_anadelt
private

Definition at line 236 of file AtlCoolCopy.cxx.

◆ m_analyse

bool AtlCoolCopy::m_analyse
private

Definition at line 184 of file AtlCoolCopy.cxx.

◆ m_applock

bool AtlCoolCopy::m_applock
private

Definition at line 205 of file AtlCoolCopy.cxx.

◆ m_applocksv

bool AtlCoolCopy::m_applocksv
private

Definition at line 206 of file AtlCoolCopy.cxx.

◆ m_bufsize

int AtlCoolCopy::m_bufsize
private

Definition at line 234 of file AtlCoolCopy.cxx.

◆ m_channel1

std::string AtlCoolCopy::m_channel1
private

Definition at line 232 of file AtlCoolCopy.cxx.

◆ m_channel2

std::string AtlCoolCopy::m_channel2
private

Definition at line 233 of file AtlCoolCopy.cxx.

◆ m_channelRange

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

Definition at line 231 of file AtlCoolCopy.cxx.

◆ m_chansel

cool::ChannelSelection AtlCoolCopy::m_chansel
private

Definition at line 267 of file AtlCoolCopy.cxx.

◆ m_chdesc

bool AtlCoolCopy::m_chdesc
private

Definition at line 192 of file AtlCoolCopy.cxx.

◆ m_checkdesttag

bool AtlCoolCopy::m_checkdesttag
private

Definition at line 219 of file AtlCoolCopy.cxx.

◆ m_checkoutputfile

std::string AtlCoolCopy::m_checkoutputfile
private

Definition at line 240 of file AtlCoolCopy.cxx.

◆ m_checkrefs

bool AtlCoolCopy::m_checkrefs
private

Definition at line 185 of file AtlCoolCopy.cxx.

◆ m_coolapp

cool::Application AtlCoolCopy::m_coolapp
private

Definition at line 253 of file AtlCoolCopy.cxx.

◆ m_cooltagmap

CoolTagMap AtlCoolCopy::m_cooltagmap
private

Definition at line 279 of file AtlCoolCopy.cxx.

◆ m_copytaginfo

bool AtlCoolCopy::m_copytaginfo
private

Definition at line 214 of file AtlCoolCopy.cxx.

◆ m_copytaglock

bool AtlCoolCopy::m_copytaglock
private

Definition at line 215 of file AtlCoolCopy.cxx.

◆ m_coracool

bool AtlCoolCopy::m_coracool
private

Definition at line 216 of file AtlCoolCopy.cxx.

◆ m_coralsvc

coral::ConnectionService AtlCoolCopy::m_coralsvc
private

Definition at line 252 of file AtlCoolCopy.cxx.

◆ m_dbSvc

cool::IDatabaseSvc* AtlCoolCopy::m_dbSvc
private

Definition at line 254 of file AtlCoolCopy.cxx.

◆ m_debug

bool AtlCoolCopy::m_debug
private

Definition at line 179 of file AtlCoolCopy.cxx.

◆ m_destCoraPtr

CoraCoolDatabasePtr AtlCoolCopy::m_destCoraPtr
private

Definition at line 259 of file AtlCoolCopy.cxx.

◆ m_destdb

std::string AtlCoolCopy::m_destdb
private

Definition at line 172 of file AtlCoolCopy.cxx.

◆ m_destDbPtr

cool::IDatabasePtr AtlCoolCopy::m_destDbPtr
private

Definition at line 257 of file AtlCoolCopy.cxx.

◆ m_excludechans

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

Definition at line 247 of file AtlCoolCopy.cxx.

◆ m_excludehead

bool AtlCoolCopy::m_excludehead
private

Definition at line 176 of file AtlCoolCopy.cxx.

◆ m_folderexcl

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

Definition at line 261 of file AtlCoolCopy.cxx.

◆ m_folderlist

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

Definition at line 260 of file AtlCoolCopy.cxx.

◆ m_forcemulti

bool AtlCoolCopy::m_forcemulti
private

Definition at line 196 of file AtlCoolCopy.cxx.

◆ m_forcenopay

bool AtlCoolCopy::m_forcenopay
private

Definition at line 200 of file AtlCoolCopy.cxx.

◆ m_forcepay

bool AtlCoolCopy::m_forcepay
private

Definition at line 199 of file AtlCoolCopy.cxx.

◆ m_forcerune

bool AtlCoolCopy::m_forcerune
private

Definition at line 197 of file AtlCoolCopy.cxx.

◆ m_forcesingle

bool AtlCoolCopy::m_forcesingle
private

Definition at line 195 of file AtlCoolCopy.cxx.

◆ m_forcetime

bool AtlCoolCopy::m_forcetime
private

Definition at line 198 of file AtlCoolCopy.cxx.

◆ m_getbulk

bool AtlCoolCopy::m_getbulk
private

Definition at line 211 of file AtlCoolCopy.cxx.

◆ m_getonline

bool AtlCoolCopy::m_getonline
private

Definition at line 209 of file AtlCoolCopy.cxx.

◆ m_gettime

bool AtlCoolCopy::m_gettime
private

Definition at line 208 of file AtlCoolCopy.cxx.

◆ m_hiparent

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

Definition at line 275 of file AtlCoolCopy.cxx.

◆ m_hitag

bool AtlCoolCopy::m_hitag
private

Definition at line 193 of file AtlCoolCopy.cxx.

◆ m_hitagmap

HiTagMap AtlCoolCopy::m_hitagmap
private

Definition at line 273 of file AtlCoolCopy.cxx.

◆ m_ignoremode

bool AtlCoolCopy::m_ignoremode
private

Definition at line 217 of file AtlCoolCopy.cxx.

◆ m_ignorespec

bool AtlCoolCopy::m_ignorespec
private

Definition at line 218 of file AtlCoolCopy.cxx.

◆ m_includehead

bool AtlCoolCopy::m_includehead
private

Definition at line 175 of file AtlCoolCopy.cxx.

◆ m_listpfn

bool AtlCoolCopy::m_listpfn
private

Definition at line 186 of file AtlCoolCopy.cxx.

◆ m_lockedonly

bool AtlCoolCopy::m_lockedonly
private

Definition at line 213 of file AtlCoolCopy.cxx.

◆ m_magic

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

Definition at line 263 of file AtlCoolCopy.cxx.

◆ m_mergecat

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

Definition at line 265 of file AtlCoolCopy.cxx.

◆ m_newdataset

std::string AtlCoolCopy::m_newdataset
private

Definition at line 239 of file AtlCoolCopy.cxx.

◆ m_newrunemax

cool::ValidityKey AtlCoolCopy::m_newrunemax
private

Definition at line 226 of file AtlCoolCopy.cxx.

◆ m_newrunemin

cool::ValidityKey AtlCoolCopy::m_newrunemin
private

Definition at line 225 of file AtlCoolCopy.cxx.

◆ m_newtimemax

cool::ValidityKey AtlCoolCopy::m_newtimemax
private

Definition at line 228 of file AtlCoolCopy.cxx.

◆ m_newtimemin

cool::ValidityKey AtlCoolCopy::m_newtimemin
private

Definition at line 227 of file AtlCoolCopy.cxx.

◆ m_nochannel

bool AtlCoolCopy::m_nochannel
private

Definition at line 191 of file AtlCoolCopy.cxx.

◆ m_noclobroot

bool AtlCoolCopy::m_noclobroot
private

Definition at line 220 of file AtlCoolCopy.cxx.

◆ m_nocopy

bool AtlCoolCopy::m_nocopy
private

Definition at line 189 of file AtlCoolCopy.cxx.

◆ m_nodata

bool AtlCoolCopy::m_nodata
private

Definition at line 190 of file AtlCoolCopy.cxx.

◆ m_nohitag

bool AtlCoolCopy::m_nohitag
private

Definition at line 194 of file AtlCoolCopy.cxx.

◆ m_nt_bufferptr

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

Definition at line 293 of file AtlCoolCopy.cxx.

◆ m_nt_channel

UInt_t AtlCoolCopy::m_nt_channel = 0
private

Definition at line 290 of file AtlCoolCopy.cxx.

◆ m_nt_lbsince

UInt_t AtlCoolCopy::m_nt_lbsince = 0
private

Definition at line 288 of file AtlCoolCopy.cxx.

◆ m_nt_lbuntil

UInt_t AtlCoolCopy::m_nt_lbuntil = 0
private

Definition at line 289 of file AtlCoolCopy.cxx.

◆ m_nt_runsince

UInt_t AtlCoolCopy::m_nt_runsince = 0
private

Definition at line 286 of file AtlCoolCopy.cxx.

◆ m_nt_rununtil

UInt_t AtlCoolCopy::m_nt_rununtil = 0
private

Definition at line 287 of file AtlCoolCopy.cxx.

◆ m_nt_since

ULong64_t AtlCoolCopy::m_nt_since = 0
private

Definition at line 284 of file AtlCoolCopy.cxx.

◆ m_nt_tagid

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

Definition at line 291 of file AtlCoolCopy.cxx.

291{0};

◆ m_nt_treename

std::string AtlCoolCopy::m_nt_treename
private

Definition at line 292 of file AtlCoolCopy.cxx.

◆ m_nt_until

ULong64_t AtlCoolCopy::m_nt_until = 0
private

Definition at line 285 of file AtlCoolCopy.cxx.

◆ m_onlinerun

bool AtlCoolCopy::m_onlinerun
private

Definition at line 210 of file AtlCoolCopy.cxx.

◆ m_open

bool AtlCoolCopy::m_open
private

Definition at line 266 of file AtlCoolCopy.cxx.

◆ m_outfolder

std::string AtlCoolCopy::m_outfolder
private

Definition at line 237 of file AtlCoolCopy.cxx.

◆ m_outtag

std::string AtlCoolCopy::m_outtag
private

Definition at line 238 of file AtlCoolCopy.cxx.

◆ m_parfile

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

Definition at line 246 of file AtlCoolCopy.cxx.

◆ m_poolall

bool AtlCoolCopy::m_poolall
private

Definition at line 188 of file AtlCoolCopy.cxx.

◆ m_poolcat

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

Definition at line 264 of file AtlCoolCopy.cxx.

◆ m_poollast

PoolMap::iterator AtlCoolCopy::m_poollast
private

Definition at line 269 of file AtlCoolCopy.cxx.

◆ m_poolopen

bool AtlCoolCopy::m_poolopen
private

Definition at line 187 of file AtlCoolCopy.cxx.

◆ m_poolrefs

PoolMap AtlCoolCopy::m_poolrefs
private

Definition at line 270 of file AtlCoolCopy.cxx.

◆ m_prunetags

bool AtlCoolCopy::m_prunetags
private

Definition at line 212 of file AtlCoolCopy.cxx.

◆ m_readoracle

bool AtlCoolCopy::m_readoracle
private

Definition at line 207 of file AtlCoolCopy.cxx.

◆ m_recreate

bool AtlCoolCopy::m_recreate
private

Definition at line 174 of file AtlCoolCopy.cxx.

◆ m_repsort

ReplicaSorter* AtlCoolCopy::m_repsort
private

Definition at line 255 of file AtlCoolCopy.cxx.

◆ m_root

bool AtlCoolCopy::m_root
private

Definition at line 182 of file AtlCoolCopy.cxx.

◆ m_runemax

cool::ValidityKey AtlCoolCopy::m_runemax
private

Definition at line 222 of file AtlCoolCopy.cxx.

◆ m_runemin

cool::ValidityKey AtlCoolCopy::m_runemin
private

Definition at line 221 of file AtlCoolCopy.cxx.

◆ m_runfile

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

Definition at line 248 of file AtlCoolCopy.cxx.

◆ m_runinfohost

std::string AtlCoolCopy::m_runinfohost
private

Definition at line 243 of file AtlCoolCopy.cxx.

◆ m_runlist

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

Definition at line 249 of file AtlCoolCopy.cxx.

◆ m_sealmsg

int AtlCoolCopy::m_sealmsg
private

Definition at line 235 of file AtlCoolCopy.cxx.

◆ m_skipout

bool AtlCoolCopy::m_skipout
private

Definition at line 203 of file AtlCoolCopy.cxx.

◆ m_skiprep

bool AtlCoolCopy::m_skiprep
private

Definition at line 204 of file AtlCoolCopy.cxx.

◆ m_sourceCoraPtr

CoraCoolDatabasePtr AtlCoolCopy::m_sourceCoraPtr
private

Definition at line 258 of file AtlCoolCopy.cxx.

◆ m_sourcedb

std::string AtlCoolCopy::m_sourcedb
private

Definition at line 171 of file AtlCoolCopy.cxx.

◆ m_sourceDbPtr

cool::IDatabasePtr AtlCoolCopy::m_sourceDbPtr
private

Definition at line 256 of file AtlCoolCopy.cxx.

◆ m_sourceread

bool AtlCoolCopy::m_sourceread
private

Definition at line 201 of file AtlCoolCopy.cxx.

◆ m_srunemax

cool::ValidityKey AtlCoolCopy::m_srunemax
private

Definition at line 230 of file AtlCoolCopy.cxx.

◆ m_srunemin

cool::ValidityKey AtlCoolCopy::m_srunemin
private

Definition at line 229 of file AtlCoolCopy.cxx.

◆ m_taglabel

std::string AtlCoolCopy::m_taglabel
private

Definition at line 242 of file AtlCoolCopy.cxx.

◆ m_tags

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

Definition at line 262 of file AtlCoolCopy.cxx.

◆ m_timedb

std::string AtlCoolCopy::m_timedb
private

Definition at line 241 of file AtlCoolCopy.cxx.

◆ m_timemax

cool::ValidityKey AtlCoolCopy::m_timemax
private

Definition at line 224 of file AtlCoolCopy.cxx.

◆ m_timemin

cool::ValidityKey AtlCoolCopy::m_timemin
private

Definition at line 223 of file AtlCoolCopy.cxx.

◆ m_truncate

bool AtlCoolCopy::m_truncate
private

Definition at line 202 of file AtlCoolCopy.cxx.

◆ m_usertags

bool AtlCoolCopy::m_usertags
private

Definition at line 177 of file AtlCoolCopy.cxx.

◆ m_userupdatehead

bool AtlCoolCopy::m_userupdatehead
private

Definition at line 178 of file AtlCoolCopy.cxx.

◆ m_verify

bool AtlCoolCopy::m_verify
private

Definition at line 181 of file AtlCoolCopy.cxx.

◆ m_zeronull

bool AtlCoolCopy::m_zeronull
private

Definition at line 183 of file AtlCoolCopy.cxx.

◆ p_rootfile

TFile* AtlCoolCopy::p_rootfile
private

Definition at line 281 of file AtlCoolCopy.cxx.


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