KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDataTransferXRD.cpp
Go to the documentation of this file.
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 
9 using namespace std;
10 
12 
13 
14 
15 
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
44  fSourceRep->IsConnected();
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
53  TString src_full = GetDataSet()->GetFullPathToRunfile(GetDataType(), irun);
54 
55  //target repository dataset pointer
56  KVDataSet* targ_ds = fTargetRep->GetDataSetManager()->GetDataSet(GetDataSet()->GetName());
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
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
Manage an experimental dataset corresponding to a given experiment or campaign.
Definition: KVDataSet.h:207
const Char_t * GetRunfileName(const Char_t *type, Int_t run) const
Definition: KVDataSet.cpp:914
Transfer data from remote repository using xrootd.
virtual void ExecuteCommand()
virtual ~KVDataTransferXRD()
Destructor.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
const char * Data() const
TString & ReplaceAll(const char *s1, const char *s2)
BinData::ErrorType GetDataType(const TGraph *gr, DataOptions &fitOpt)
void End()