Skip to content
Snippets Groups Projects
  • Fons Rademakers's avatar
    6ca0e02c
    From Andreas: · 6ca0e02c
    Fons Rademakers authored
    here are my modifications to interface the Grid file catalog
    (AliEn in this case) with TChain data sets. Some changes are just
    one-liner changes to make some base class things virtual or to set
    some members. With these changes one can do:
    
    // connect
    TGrid::Connect("alien://");
    
    // query
    TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","");
    
    or
    
    TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","-l 50");  // to query maximum 50 files
    
    result->Print(""); // or result->Print("l") or result->Print("all"); => Tells you also the complete size of the TDSet (the ALICE one is 68 GB)
    
    // build chain for ALICE files
    TChain* mychain = new TChain("esdTree","AliceSession");
    
    // Get a list of FileInfo Objects
    // -> I cannot use directly a list of FileInfo objects in TGridResult,
    //    because TGridResult can be also a list of jobs etc ....
    
    TList* list = result->GetFileInfoList()
    
    // add them to a chain
    mychain->AddFileInfoList(list);    // adds all
    mychain->AddFileInfoList(list,10); // adds only the first 10
    
    // to use PROOF then, you need to do
    mychain->Lookup();                 // open's all files via TAlienFile over
                                          the redirector and replaces the
                                          alien URL with the physical location
                                          of the file on the cluster
                                          (including the access token)
    
    mychain->SetProof();
    mychain->Draw("ESD.fTrigger");
    
    
    git-svn-id: http://root.cern.ch/svn/root/trunk@12825 27541ba8-7e3a-0410-8455-c3a389f83636
    6ca0e02c
    History
    From Andreas:
    Fons Rademakers authored
    here are my modifications to interface the Grid file catalog
    (AliEn in this case) with TChain data sets. Some changes are just
    one-liner changes to make some base class things virtual or to set
    some members. With these changes one can do:
    
    // connect
    TGrid::Connect("alien://");
    
    // query
    TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","");
    
    or
    
    TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","-l 50");  // to query maximum 50 files
    
    result->Print(""); // or result->Print("l") or result->Print("all"); => Tells you also the complete size of the TDSet (the ALICE one is 68 GB)
    
    // build chain for ALICE files
    TChain* mychain = new TChain("esdTree","AliceSession");
    
    // Get a list of FileInfo Objects
    // -> I cannot use directly a list of FileInfo objects in TGridResult,
    //    because TGridResult can be also a list of jobs etc ....
    
    TList* list = result->GetFileInfoList()
    
    // add them to a chain
    mychain->AddFileInfoList(list);    // adds all
    mychain->AddFileInfoList(list,10); // adds only the first 10
    
    // to use PROOF then, you need to do
    mychain->Lookup();                 // open's all files via TAlienFile over
                                          the redirector and replaces the
                                          alien URL with the physical location
                                          of the file on the cluster
                                          (including the access token)
    
    mychain->SetProof();
    mychain->Draw("ESD.fTrigger");
    
    
    git-svn-id: http://root.cern.ch/svn/root/trunk@12825 27541ba8-7e3a-0410-8455-c3a389f83636