Re: How to get files from castor

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 14 Apr 2011 10:19:36 -0500


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:19:42 CEST

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