RE: How to get files from castor

From: Agnieszka Priebe <Agnieszka.Priebe_at_cern.ch>
Date: Thu, 14 Apr 2011 15:28:02 +0000


Yes, I've tried but it doesn't really help since I got an error in next step:

no = 0 | name = C14R2_vert_b2_z0_1.root | path = "rfio://castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" nazwa_pomocnicza = "rfio://castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" Error in <TFile::TFile>: file cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" does not exist



From: Philippe Canal [pcanal_at_fnal.gov]
Sent: 14 April 2011 17:19
To: Agnieszka Priebe
Cc: roottalk_at_root.cern.ch
Subject: Re: [ROOT] How to get files from castor

Hi,

Did you try rfio://castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root

Philippe.

On 4/14/11 9:29 AM, Agnieszka Priebe wrote: Hello,

I'm having a script with a list of files stored on castor (1st element - number, 2nd - name of file, 3rd - complete path to castor file). What I want to do is to go through all lines of text file and derive data from all .root files. Unfortunately I obtain an error:

root [0]
Processing ana.C...
no = 0 | name = C14R2_vert_b2_z0_1.root | path = "rfio:/castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" nazwa_pomocnicza = "rfio:/castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" Error in <TUrl::TUrl>: "rfio:/castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_1.root" malformed, URL must contain "://" Error in <TFile::Open>: no url specified File open
Error: illegal pointer to class object chws 0x0 74 ana_inteligent_script.C:232: *** Interpreter error recovered ***

Could you please advise me what I shall change?

Here is part of my code:



//open file and read it
     ifstream into;
     into.open("../../../../roocik/C14R2_vert_b2_z0.C");

     string line;
     char* cline;
     char name[200], path[200];
     Int_t no, no_last;

     while(into) {
      getline(into,line);
      cline=line.c_str();
      sscanf(cline,"%d %s %s",&no,name,path);
      cout << "no = "<<no<<" | name = "<<name<<" | path = "<<path<<endl;

      TString nazwa_pomocnicza(path);
      cout << "nazwa_pomocnicza = "<<nazwa_pomocnicza<<endl;


// chws.Add(path);
// chws.Add(nazwa_pomocnicza.Data());
TFile *chws = TFile::Open(nazwa_pomocnicza); cout << "File open" << endl; // types of events Event* evQ = new Event(); // event in Q5 TTree *ttree = (TTree*)chws->Get("tree");

//chws.Add("rfio:/castor/cern.ch/user/a/apriebe/C14R2_vert_b2_z0_2.root");

       Particle* evP = new Particle();  // event in Q5
         ttree->SetBranchAddress("Event", &evQ);

// chws.SetBranchAddress("MQI.",&evQ);
cout << " SetBranchAddress " << endl; cout << " Problem za chwile" << endl; TBranch *brQ = chws->GetBranch("MQI."); -----------------------------------------------------------------------------------------------

Best regards,
Agnieszka priebe Received on Thu Apr 14 2011 - 17:28:07 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 14 2011 - 23:50:01 CEST