change library dependencies and paths to the new places of the analysis under PWGGA...
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / anaEMCALCalib.C
CommitLineData
6eb2a715 1/* $Id: $ */
2//--------------------------------------------------
5fdef45d 3// Example macro to do EMCAL calibration analysis
6eb2a715 4// Can be executed with Root and AliRoot
5//
6// Pay attention to the options and definitions
7// set in the lines below
8//
9// Author : Gustavo Conesa Balbastre (INFN-LNF)
10//
11//-------------------------------------------------
12enum anaModes {mLocal, mLocalCAF,mPROOF,mGRID};
13//mLocal: Analyze locally files in your computer
14//mLocalCAF: Analyze locally CAF files
15//mPROOF: Analyze CAF files with PROOF
16
17//---------------------------------------------------------------------------
18//Settings to read locally several files, only for "mLocal" mode
19//The different values are default, they can be set with environmental
20//variables: INDIR, PATTERN, NFILES, respectivelly
21char * kInDir = "/user/data/files/";
22char * kPattern = ""; // Data are in files kInDir/kPattern+i
23Int_t kFile = 1; // Number of files
24//---------------------------------------------------------------------------
25//Collection file for grid analysis
26char * kXML = "collection.xml";
27//---------------------------------------------------------------------------
28
247abff4 29const TString kInputData = "ESD"; //ESD, AOD, MC
9584c261 30TString kTreeName = "esdTree";
247abff4 31
6eb2a715 32void anaEMCALCalib(Int_t mode=mLocal)
33{
34 // Main
9584c261 35 char cmd[200] ;
36 sprintf(cmd, ".! rm -rf aod.root pi0calib.root") ;
37 gROOT->ProcessLine(cmd) ;
6eb2a715 38 //--------------------------------------------------------------------
39 // Load analysis libraries
40 // Look at the method below,
41 // change whatever you need for your analysis case
42 // ------------------------------------------------------------------
43 LoadLibraries(mode) ;
5fdef45d 44 //gSystem->Unload("libPWGGAEMCALTasks.so");
6eb2a715 45 //Try to set the new library
5fdef45d 46 //gSystem->Load("./PWGGAEMCALTasks/libPWGGAEMCALTasks.so");
247abff4 47 //gSystem->ListLibraries();
5fdef45d 48
6eb2a715 49 //-------------------------------------------------------------------------------------------------
50 //Create chain from ESD and from cross sections files, look below for options.
51 //-------------------------------------------------------------------------------------------------
52 if(kInputData == "ESD") kTreeName = "esdTree" ;
53 else if(kInputData == "AOD") kTreeName = "aodTree" ;
54 else {
55 cout<<"Wrong data type "<<kInputData<<endl;
56 break;
57 }
5fdef45d 58
6eb2a715 59 TChain *chain = new TChain(kTreeName) ;
60 CreateChain(mode, chain);
5fdef45d 61
6eb2a715 62 if(chain){
63 AliLog::SetGlobalLogLevel(AliLog::kError);//Minimum prints on screen
64
65 //--------------------------------------
66 // Make the analysis manager
67 //-------------------------------------
68 AliAnalysisManager *mgr = new AliAnalysisManager("Manager", "Manager");
5fdef45d 69
6eb2a715 70 //input
71 if(kInputData == "ESD")
5fdef45d 72 {
73 // ESD handler
74 AliESDInputHandler *esdHandler = new AliESDInputHandler();
75 mgr->SetInputEventHandler(esdHandler);
76 esdHandler->SetReadFriends(kFALSE);
77 cout<<"ESD handler "<<mgr->GetInputEventHandler()<<endl;
78 }
6eb2a715 79 if(kInputData == "AOD")
5fdef45d 80 {
81 // AOD handler
82 AliAODInputHandler *aodHandler = new AliAODInputHandler();
83 mgr->SetInputEventHandler(aodHandler);
84 cout<<"AOD handler "<<mgr->GetInputEventHandler()<<endl;
85
86 }
6eb2a715 87
19db8f8c 88 // mgr->SetDebugLevel(1);
6eb2a715 89
90 //-------------------------------------------------------------------------
91 //Define task, put here any other task that you want to use.
92 //-------------------------------------------------------------------------
6eb2a715 93
5fdef45d 94/*
9584c261 95 if(kInputData == "ESD"){
5fdef45d 96
97 gROOT->LoadMacro("AddTaskPhysicsSelection.C");
98 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
99
6eb2a715 100 }
5fdef45d 101*/
6eb2a715 102
247abff4 103 // Create containers for input/output
104 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
5fdef45d 105
e2fe2603 106 AliAnalysisTaskEMCALPi0CalibSelection * pi0calib = new AliAnalysisTaskEMCALPi0CalibSelection ("EMCALPi0Calibration");
5fdef45d 107 if(kInputData == "ESD") pi0calib->SelectCollisionCandidates();
e2fe2603 108 //pi0calib->SetDebugLevel(10);
109 //pi0calib->UseFilteredEventAsInput();
110 pi0calib->SetClusterMinEnergy(0.5);
111 pi0calib->SetClusterMaxEnergy(10.);
112 pi0calib->SetAsymmetryCut(0.5);
113 pi0calib->SetClusterMinNCells(0);
114 pi0calib->SetNCellsGroup(0);
115 pi0calib->SwitchOnSameSM();
116 //pi0calib->SwitchOnOldAODs();
5fdef45d 117
118/*
4f7f37d3 119 TGeoHMatrix *matrix[4];
120
121 double rotationMatrix[4][9] = {-0.014585, -0.999892, -0.002031, 0.999892, -0.014589, 0.001950, -0.001979, -0.002003, 0.999996,
5fdef45d 122 -0.014585, 0.999892, 0.002031, 0.999892, 0.014589, -0.001950, -0.001979, 0.002003, -0.999996,
123 -0.345861, -0.938280, -0.003412, 0.938281, -0.345869, 0.001950, -0.003010, -0.002527, 0.999992,
124 -0.345861, 0.938280, 0.003412, 0.938281, 0.345869, -0.001950, -0.003010, 0.002527, -0.999992};
4f7f37d3 125
126 double translationMatrix[4][3] = {0.367264, 446.508738, 175.97185+0.3,
5fdef45d 127 1.078181, 445.826258, -174.026758+0.3,
128 -153.843916, 418.304256, 175.956905+0.8,
129 -152.649580, 417.621779, -174.040392+0.8};
4f7f37d3 130 for(int j=0; j<4; j++)
5fdef45d 131 {
132 matrix[j] = new TGeoHMatrix();
133 matrix[j]->SetRotation(rotationMatrix[j]);
134 matrix[j]->SetTranslation(translationMatrix[j]);
135 matrix[j]->Print();
136 pi0calib->SetGeometryMatrixInSM(matrix[j],j);
137 }
138
4f7f37d3 139
4f7f37d3 140 pi0calib->SwitchOnLoadOwnGeometryMatrices();
5fdef45d 141*/
142
e2fe2603 143 pi0calib->SwitchOnClusterCorrection();
144 AliEMCALRecoUtils * reco = pi0calib->GetEMCALRecoUtils();
5fdef45d 145 reco->SetParticleType(AliEMCALRecoUtils::kPhoton);
4f7f37d3 146 reco->SetW0(4.5);
5fdef45d 147
148 //---------------------
149 // Geometry alignment
150 //---------------------
4f7f37d3 151
152 //reco->SetPositionAlgorithm(AliEMCALRecoUtils::kUnchanged);
4f7f37d3 153 reco->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal);
5fdef45d 154
4f7f37d3 155 //reco->SetMisalTransShift(0,1.134); reco->SetMisalTransShift(1,8.2); reco->SetMisalTransShift(2,1.197);
156 //reco->SetMisalTransShift(3,-3.093); reco->SetMisalTransShift(4,6.82);reco->SetMisalTransShift(5,1.635);
5fdef45d 157
4f7f37d3 158 //reco->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerIndex);
159 //reco->SetMisalTransShift(0,1.08); reco->SetMisalTransShift(1,8.35); reco->SetMisalTransShift(2,1.12);
160 //reco->SetMisalRotShift(3,-8.05); reco->SetMisalRotShift(4,8.05);
161 //reco->SetMisalTransShift(3,-0.42); reco->SetMisalTransShift(5,1.55);
5fdef45d 162
163 //---------------------
164 // Non linearity
165 //---------------------
166
4f7f37d3 167 reco->SetNonLinearityFunction(AliEMCALRecoUtils::kNoCorrection);
168 //reco->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0GammaGamma);
169 //reco->SetNonLinearityParam(0,1.04); reco->SetNonLinearityParam(1,-0.1445);
170 //reco->SetNonLinearityParam(2,1.046);
5fdef45d 171
172 // reco->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0GammaConversion);
173 // reco->SetNonLinearityParam(0,1.033); reco->SetNonLinearityParam(1,0.0566186);
174 // reco->SetNonLinearityParam(2,0.982133);
175
176
177 // reco->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0MC);
178 // reco->SetNonLinearityParam(0,1.001); reco->SetNonLinearityParam(1,-0.01264);
179 // reco->SetNonLinearityParam(2,-0.03632);
180 // reco->SetNonLinearityParam(3,0.1798); reco->SetNonLinearityParam(4,-0.522);
181
182
183 //---------------------
184 // Recalibration
185 //---------------------
186
187 //
188 // reco->SwitchOnRecalibration();
189 // TFile * f = new TFile("RecalibrationFactors.root","read");
190 // TH2F * h0 = (TH2F*)f->Get("EMCALRecalFactors_SM0")->Clone();
191 // TH2F * h1 = (TH2F*)f->Get("EMCALRecalFactors_SM1")->Clone();
192 // TH2F * h2 = (TH2F*)f->Get("EMCALRecalFactors_SM2")->Clone();
193 // TH2F * h3 = (TH2F*)f->Get("EMCALRecalFactors_SM3")->Clone();
194
195 // reco->SetEMCALChannelRecalibrationFactors(0,h0);
196 // reco->SetEMCALChannelRecalibrationFactors(1,h1);
197 // reco->SetEMCALChannelRecalibrationFactors(2,h2);
198 // reco->SetEMCALChannelRecalibrationFactors(3,h3);
199
200 //---------------------
201 // Bad channels removal
202 //---------------------
4f7f37d3 203
5fdef45d 204/*
4f7f37d3 205 reco->SwitchOnBadChannelsRemoval();
5fdef45d 206
4f7f37d3 207 // SM0
208 reco->SetEMCALChannelStatus(0,3,13); reco->SetEMCALChannelStatus(0,44,1); reco->SetEMCALChannelStatus(0,3,13);
209 reco->SetEMCALChannelStatus(0,20,7); reco->SetEMCALChannelStatus(0,38,2);
210 // SM1
211 reco->SetEMCALChannelStatus(1,4,7); reco->SetEMCALChannelStatus(1,4,13); reco->SetEMCALChannelStatus(1,9,20);
212 reco->SetEMCALChannelStatus(1,14,15); reco->SetEMCALChannelStatus(1,23,16); reco->SetEMCALChannelStatus(1,32,23);
213 reco->SetEMCALChannelStatus(1,37,5); reco->SetEMCALChannelStatus(1,40,1); reco->SetEMCALChannelStatus(1,40,2);
214 reco->SetEMCALChannelStatus(1,40,5); reco->SetEMCALChannelStatus(1,41,0); reco->SetEMCALChannelStatus(1,41,1);
215 reco->SetEMCALChannelStatus(1,41,2); reco->SetEMCALChannelStatus(1,41,4);
216 // SM2
217 reco->SetEMCALChannelStatus(2,14,15); reco->SetEMCALChannelStatus(2,18,16); reco->SetEMCALChannelStatus(2,18,17);
218 reco->SetEMCALChannelStatus(2,18,18); reco->SetEMCALChannelStatus(2,18,20); reco->SetEMCALChannelStatus(2,18,21);
219 reco->SetEMCALChannelStatus(2,18,23); reco->SetEMCALChannelStatus(2,19,16); reco->SetEMCALChannelStatus(2,19,17);
220 reco->SetEMCALChannelStatus(2,19,19); reco->SetEMCALChannelStatus(2,19,20); reco->SetEMCALChannelStatus(2,19,21);
221 reco->SetEMCALChannelStatus(2,19,22);
222 //SM3
223 reco->SetEMCALChannelStatus(3,4,7);
5fdef45d 224*/
225
4f7f37d3 226 reco->SetNumberOfCellsFromEMCALBorder(1);
5fdef45d 227
e2fe2603 228 //reco->Print("");
5fdef45d 229
e2fe2603 230 pi0calib->PrintInfo();
231 mgr->AddTask(pi0calib);
5fdef45d 232
6eb2a715 233 AliAnalysisDataContainer *coutput2 =
247abff4 234 mgr->CreateContainer("pi0calib", TList::Class(), AliAnalysisManager::kOutputContainer, "pi0calib.root");
6eb2a715 235
236 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer("Cuts", TList::Class(),
5fdef45d 237 AliAnalysisManager::kOutputContainer, "pi0calib.root");
6eb2a715 238
239 mgr->ConnectInput (pi0calib, 0, cinput1);
6eb2a715 240 mgr->ConnectOutput (pi0calib, 1, coutput2 );
241 mgr->ConnectOutput (pi0calib, 2, cout_cuts);
5fdef45d 242
6eb2a715 243 //-----------------------
244 // Run the analysis
245 //-----------------------
246 TString smode = "";
247 if (mode==mLocal || mode == mLocalCAF)
248 smode = "local";
249 else if (mode==mPROOF)
250 smode = "proof";
251 else if (mode==mGRID)
252 smode = "local";
253
254 mgr->InitAnalysis();
255 mgr->PrintStatus();
256 mgr->StartAnalysis(smode.Data(),chain);
5fdef45d 257
258 cout <<" Analysis ended sucessfully "<< endl ;
259
6eb2a715 260 }
261 else cout << "Chain was not produced ! "<<endl;
262
263}
264
265void LoadLibraries(const anaModes mode) {
266
267 //--------------------------------------
268 // Load the needed libraries most of them already loaded by aliroot
269 //--------------------------------------
270 gSystem->Load("libTree.so");
271 gSystem->Load("libGeom.so");
272 gSystem->Load("libVMC.so");
273 gSystem->Load("libXMLIO.so");
274
275 //----------------------------------------------------------
276 // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
277 //----------------------------------------------------------
278 if (mode==mLocal || mode == mLocalCAF || mode == mGRID) {
279 //--------------------------------------------------------
280 // If you want to use already compiled libraries
281 // in the aliroot distribution
282 //--------------------------------------------------------
5fdef45d 283
6eb2a715 284 gSystem->Load("libSTEERBase.so");
285 gSystem->Load("libESD.so");
286 gSystem->Load("libAOD.so");
287 gSystem->Load("libANALYSIS.so");
288 gSystem->Load("libANALYSISalice.so");
289 gSystem->Load("libANALYSISalice.so");
4f7f37d3 290 //TGeoManager::Import("geometry.root") ; //need file "geometry.root" in local dir!!!!
5fdef45d 291 gSystem->Load("libPWGGAEMCALTasks.so");
292 //SetupPar("PWGGAEMCALTasks");
293
6eb2a715 294 //--------------------------------------------------------
295 //If you want to use root and par files from aliroot
296 //--------------------------------------------------------
297 /*
298 SetupPar("STEERBase");
299 SetupPar("ESD");
300 SetupPar("AOD");
301 SetupPar("ANALYSIS");
302 SetupPar("ANALYSISalice");
303 SetupPar("PHOSUtils");
304 SetupPar("EMCALUtils");
305 //Create Geometry
306 TGeoManager::Import("geometry.root") ; //need file "geometry.root" in local dir!!!!
5fdef45d 307 SetupPar("PWGGAEMCALTasks");
308 */
6eb2a715 309 }
5fdef45d 310
6eb2a715 311 //---------------------------------------------------------
312 // <<<<<<<<<< PROOF mode >>>>>>>>>>>>
313 //---------------------------------------------------------
314 else if (mode==mPROOF) {
315 //
316 // Connect to proof
317 // Put appropriate username here
318 // TProof::Reset("proof://mgheata@lxb6046.cern.ch");
319 TProof::Open("proof://mgheata@lxb6046.cern.ch");
320
321 // gProof->ClearPackages();
322 // gProof->ClearPackage("ESD");
323 // gProof->ClearPackage("AOD");
324 // gProof->ClearPackage("ANALYSIS");
6eb2a715 325
326 // Enable the STEERBase Package
327 gProof->UploadPackage("STEERBase.par");
328 gProof->EnablePackage("STEERBase");
329 // Enable the ESD Package
330 gProof->UploadPackage("ESD.par");
331 gProof->EnablePackage("ESD");
332 // Enable the AOD Package
333 gProof->UploadPackage("AOD.par");
334 gProof->EnablePackage("AOD");
335 // Enable the Analysis Package
336 gProof->UploadPackage("ANALYSIS.par");
337 gProof->EnablePackage("ANALYSIS");
338 // Enable the PHOS geometry Package
339 //gProof->UploadPackage("PHOSUtils.par");
340 //gProof->EnablePackage("PHOSUtils");
6eb2a715 341 gProof->ShowEnabledPackages();
342 }
343
344}
345
346void SetupPar(char* pararchivename)
347{
348 //Load par files, create analysis libraries
349 //For testing, if par file already decompressed and modified
350 //classes then do not decompress.
5fdef45d 351
6eb2a715 352 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
353 TString parpar(Form("%s.par", pararchivename)) ;
354 if ( gSystem->AccessPathName(parpar.Data()) ) {
355 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
356 TString processline(Form(".! make %s", parpar.Data())) ;
357 gROOT->ProcessLine(processline.Data()) ;
358 gSystem->ChangeDirectory(cdir) ;
359 processline = Form(".! mv $ALICE_ROOT/%s .", parpar.Data()) ;
360 gROOT->ProcessLine(processline.Data()) ;
361 }
362 if ( gSystem->AccessPathName(pararchivename) ) {
363 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
364 gROOT->ProcessLine(processline.Data());
365 }
366
367 TString ocwd = gSystem->WorkingDirectory();
368 gSystem->ChangeDirectory(pararchivename);
369
370 // check for BUILD.sh and execute
371 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
372 printf("*******************************\n");
373 printf("*** Building PAR archive ***\n");
374 cout<<pararchivename<<endl;
375 printf("*******************************\n");
376
377 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
378 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
379 return -1;
380 }
381 }
382 // check for SETUP.C and execute
383 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
384 printf("*******************************\n");
385 printf("*** Setup PAR archive ***\n");
386 cout<<pararchivename<<endl;
387 printf("*******************************\n");
388 gROOT->Macro("PROOF-INF/SETUP.C");
389 }
390
391 gSystem->ChangeDirectory(ocwd.Data());
392 printf("Current dir: %s\n", ocwd.Data());
393}
394
395
396
397void CreateChain(const anaModes mode, TChain * chain){
398 //Fills chain with data
399 TString ocwd = gSystem->WorkingDirectory();
400
401 //-----------------------------------------------------------
402 //Analysis of CAF data locally and with PROOF
403 //-----------------------------------------------------------
404 if(mode ==mPROOF || mode ==mLocalCAF){
405 // Chain from CAF
406 gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
407 // The second parameter is the number of input files in the chain
408 chain = CreateESDChain("ESD12001.txt", 5);
409 }
410
411 //---------------------------------------
412 //Local files analysis
413 //---------------------------------------
414 else if(mode == mLocal){
415 //If you want to add several ESD files sitting in a common directory INDIR
416 //Specify as environmental variables the directory (INDIR), the number of files
417 //to analyze (NFILES) and the pattern name of the directories with files (PATTERN)
5fdef45d 418
6eb2a715 419 if(gSystem->Getenv("INDIR"))
420 kInDir = gSystem->Getenv("INDIR") ;
421 else cout<<"INDIR not set, use default: "<<kInDir<<endl;
422
423 if(gSystem->Getenv("PATTERN"))
424 kPattern = gSystem->Getenv("PATTERN") ;
425 else cout<<"PATTERN not set, use default: "<<kPattern<<endl;
426
427 if(gSystem->Getenv("NFILES"))
428 kFile = atoi(gSystem->Getenv("NFILES")) ;
429 else cout<<"NFILES not set, use default: "<<kFile<<endl;
430
431 //Check if env variables are set and are correct
432 if ( kInDir && kFile) {
433 printf("Get %d files from directory %s\n",kFile,kInDir);
434 if ( ! gSystem->cd(kInDir) ) {//check if ESDs directory exist
5fdef45d 435 printf("%s does not exist\n", kInDir) ;
436 return ;
6eb2a715 437 }
5fdef45d 438
439
6eb2a715 440 cout<<"INDIR : "<<kInDir<<endl;
441 cout<<"NFILES : "<<kFile<<endl;
442 cout<<"PATTERN : " <<kPattern<<endl;
5fdef45d 443
6eb2a715 444 TString datafile="";
445 if(kInputData == "ESD") datafile = "AliESDs.root" ;
446 else if(kInputData == "AOD") datafile = "aod.root" ;
447 else if(kInputData == "MC") datafile = "galice.root" ;
448
449 //Loop on ESD files, add them to chain
450 Int_t event =0;
451 Int_t skipped=0 ;
452 char file[120] ;
453
454 for (event = 0 ; event < kFile ; event++) {
5fdef45d 455 sprintf(file, "%s/%s%d/%s", kInDir,kPattern,event,datafile.Data()) ;
456 TFile * fESD = 0 ;
457 //Check if file exists and add it, if not skip it
458 if ( fESD = TFile::Open(file)) {
459 if ( fESD->Get(kTreeName) ) {
460 printf("++++ Adding %s\n", file) ;
461 chain->AddFile(file);
462 }
463 }
464 else {
465 printf("---- Skipping %s\n", file) ;
466 skipped++ ;
467 }
6eb2a715 468 }
469 printf("number of entries # %lld, skipped %d\n", chain->GetEntries(), skipped*100) ;
470 }
471 else {
472 TString input = "AliESDs.root" ;
473 cout<<">>>>>> No list added, take a single file <<<<<<<<< "<<input<<endl;
474 chain->AddFile(input);
475 }
476
477 }// local files analysis
478
479 //------------------------------
480 //GRID xml files
481 //-----------------------------
482 else if(mode == mGRID){
483 //Get colection file. It is specified by the environmental
484 //variable XML
5fdef45d 485
6eb2a715 486 if(gSystem->Getenv("XML") )
487 kXML = gSystem->Getenv("XML");
488 else
489 sprintf(kXML, "collection.xml") ;
490
491 if (!TFile::Open(kXML)) {
492 printf("No collection file with name -- %s -- was found\n",kXML);
493 return ;
494 }
495 else cout<<"XML file "<<kXML<<endl;
5fdef45d 496
6eb2a715 497 //Load necessary libraries and connect to the GRID
498 gSystem->Load("libNetx.so") ;
499 gSystem->Load("libRAliEn.so");
500 TGrid::Connect("alien://") ;
5fdef45d 501
6eb2a715 502 //Feed Grid with collection file
503 //TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\", 0)", kXML));
504 TGridCollection * collection = (TGridCollection*) TAlienCollection::Open(kXML);
505 if (! collection) {
506 AliError(Form("%s not found", kXML)) ;
507 return kFALSE ;
508 }
509 TGridResult* result = collection->GetGridResult("",0 ,0);
5fdef45d 510
6eb2a715 511 // Makes the ESD chain
512 printf("*** Getting the Chain ***\n");
513 for (Int_t index = 0; index < result->GetEntries(); index++) {
514 TString alienURL = result->GetKey(index, "turl") ;
515 cout << "================== " << alienURL << endl ;
516 chain->Add(alienURL) ;
517 }
518 }// xml analysis
519
520 gSystem->ChangeDirectory(ocwd.Data());
521}
522