KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVDataTransferXRD.cpp
1//Created by KVClassFactory on Wed Apr 28 12:29:38 2010
2//Author: John Frankland,,,
3
4#include "KVDataTransferXRD.h"
5#include "KVDataRepository.h"
6#include "KVDataSet.h"
7#include "KVDataSetManager.h"
8
9using namespace std;
10
12
13
14
15
17
19{
20 // Default constructor
21}
22
23
24
27
29{
30 // Destructor
31}
32
33
34
38
40{
41 // Transfer all requested runs using TFile::Cp
42
43 //check connection to remote repository : i.e. open ssh tunnel if needed
45
46 // loop over runs
47 GetRunList().Begin();
48 while (!GetRunList().End()) {
49
50 Int_t irun = GetRunList().Next();
51
52 // source file full path
54
55 //target repository dataset pointer
57 TString targ_fn = targ_ds->GetRunfileName(GetDataType(), irun);
58 //we have to replace illegal characters like ":" in the target file name
59 //to avoid problems due to the meaning of the ":" character for some
60 //systems (MacOsX, Windows, some Linux distributions)
61 targ_fn.ReplaceAll(":", "_");
62 TString dest_full = fTargetRep->GetFullPathToTransferFile(targ_ds, GetDataType(), targ_fn.Data());
63
64 cout << "TFile::Cp(\"" << src_full.Data() << "\", \"" << dest_full.Data() << "\")" << endl;
65
66 // copy file
67 TFile::Cp(src_full.Data(), dest_full.Data());
68 }
69}
70
71
int Int_t
const KVString & GetDataType() const
virtual KVDataSetManager * GetDataSetManager() const
Return pointer to data set manager for this repository.
virtual const Char_t * GetFullPathToTransferFile(const KVDataSet *dataset, const Char_t *datatype, const Char_t *runfile)
virtual Bool_t IsConnected()
Always returns kTRUE for local repositories.
const KVNumberList & GetRunList() const
const KVDataSet * GetDataSet() const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Manage an experimental dataset corresponding to a given experiment or campaign.
Definition KVDataSet.h:35
const Char_t * GetRunfileName(const Char_t *type, Int_t run) const
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
Transfer data from remote repository using xrootd.
virtual void ExecuteCommand()
virtual ~KVDataTransferXRD()
Destructor.
KVDataRepository * fTargetRep
repository where files will be copied
KVDataRepository * fSourceRep
repository containing source files
void Begin(void) const
Int_t Next(void) const
virtual const char * GetName() const
const char * Data() const
TString & ReplaceAll(const char *s1, const char *s2)
void End()
ClassImp(TPyArg)