Using VZERO v6
[u/mrichter/AliRoot.git] / macros / AliMergeSteer.C
CommitLineData
c9f21053 1////////////////////////////////////////////////////////////////////////
2//
3// Class to steer several steps in merging:
4// - extraction of vertex from bgr event
5// - event simulation
6// - creation of sdigits
7// - creation of digits
8// - analysis
9//
10// Author: Jiri Chudoba (CERN), 2002
11//
12////////////////////////////////////////////////////////////////////////
13
0740b02d 14#if !defined(__CINT__) || defined(__MAKECINT__)
15#include <Riostream.h>
c9f21053 16
17// --- ROOT system ---
18
19#include "TTask.h"
20#include "TString.h"
21#include "TROOT.h"
22#include "TFile.h"
23#include "TTree.h"
24#include "TStopwatch.h"
25#include "TArrayF.h"
26#include "TSystem.h"
27#include "TGeometry.h"
28#include "TInterpreter.h"
29
30// --- AliRoot header files ---
31
0740b02d 32#include "STEER/AliRun.h"
33#include "STEER/AliHeader.h"
34#include "STEER/AliGenEventHeader.h"
35#endif
c9f21053 36
37class AliTRDdigitizer;
38class AliPHOSSDigitizer;
39class AliTOFSDigitizer;
40
41class AliMergeSteer: public TTask {
42
43public:
44 AliMergeSteer(const Text_t* name="AliMergeSteer",
45 const Text_t* title="AliMergeSteer");
46// AliMergeSteer(Option_t *option);
47 virtual ~AliMergeSteer();
48 Bool_t SetDetectorFlag(Option_t* option, Int_t flag);
49 Int_t GetDetectorFlag(Option_t* option);
50// void Print();
51 virtual void Exec(const Option_t *option);
52 Bool_t ImportgAlice(TFile *file);
53
54 Bool_t ExtractVertex(TString fn, Int_t eventNr);
55 void PrintVertex(TArrayF &vertex);
56 void ExportVertex(TArrayF &vertex);
57
58 Bool_t Simulate();
59 Bool_t CreateSDigits();
60 Bool_t Merge();
61 Bool_t NoMerge();
62 Bool_t ITSFastPoints(const char *outputFile, const char *inputFile);
63 Bool_t RecoMerged();
64 Bool_t RecoSignalOnly();
65 Bool_t CmpMerged();
66 Bool_t CmpSignalOnly();
67
68 Bool_t AliCopy(TFile *inputFile, TFile *outputFile);
69 Bool_t AliCopy(TString inputFileName, TString outputFileName);
70
71
72
73// file names setter/getters
74 void SetFileNameHits(TString fileName) {fFileNameHits = fileName;}
75 void SetFileNameSDigits(TString fileName) {fFileNameSDigits = fileName;}
76 void SetFileNameBgrHits(TString fileName) {fFileNameBgrHits = fileName;}
77 void SetFileNameBgrSDigits(TString fileName) {fFileNameBgrSDigits = fileName;}
78 void SetFileNameDigitsMerged(TString fileName) {fFileNameDigitsMerged = fileName;}
79 void SetFileNameDigitsSignalOnly(TString fileName) {fFileNameDigitsSignalOnly = fileName;}
80 TString FileNameHits() {return fFileNameHits;}
81 TString FileNameSDigits() {return fFileNameSDigits;}
82 TString FileNameBgr() {return fFileNameBgrSDigits;}
83 TString FileNameDigitsMerged() {return fFileNameDigitsMerged;}
84 TString FileNameDigitsSignalOnly() {return fFileNameDigitsSignalOnly;}
85
86// flags
87 void SetFlagSim(Bool_t flag) {fFlagSim = flag;}
88 void SetFlagSDigits(Bool_t flag) {fFlagSDigits = flag;}
89 void SetFlagMerge(Bool_t flag) {fFlagMerge = flag;}
90 void SetFlagDigitsSignalOnly(Bool_t flag) {fFlagDigitsSignalOnly = flag;}
91 void SetFlagRecoMerged(Bool_t flag) {fFlagRecoMerged = flag;}
92 void SetFlagRecoSignalOnly(Bool_t flag) {fFlagRecoSignalOnly = flag;}
93 void SetFlagCmpMerged(Bool_t flag) {fFlagCmpMerged = flag;}
94 void SetFlagCmpSignalOnly(Bool_t flag) {fFlagCmpSignalOnly = flag;}
95
96// event numbers
97 void SetNEvents(Int_t nEvents) {fNEvents = nEvents;}
98 void SetBgrEventNr(Int_t i) {fBgrEventNr = i;}
99
100private:
101
102 TString fFileNameHits;
103 TString fFileNameSDigits;
104 TString fFileNameBgrHits;
105 TString fFileNameBgrSDigits;
106 TString fFileNameDigitsMerged;
107 TString fFileNameDigitsSignalOnly;
108 TString fFileNameCmpMerged;
109 TString fFileNameCmpSignalOnly;
110
111 Bool_t fFlagSim;
112 Bool_t fFlagSDigits;
113 Bool_t fFlagMerge;
114 Bool_t fFlagDigitsSignalOnly;
115 Bool_t fFlagRecoMerged;
116 Bool_t fFlagRecoSignalOnly;
117 Bool_t fFlagCmpMerged;
118 Bool_t fFlagCmpSignalOnly;
119 Bool_t fCopy2S;
120 Bool_t fCopy2D;
121
122 Int_t fNEvents;
123 Int_t fFirstEvent;
124 Int_t fBgrEventNr;
125
126 Int_t fDEBUG;
127
128// flags for detectors - determine which detector will be used
129// during merging.
130// 0 - do not use
131// 1 - process the whole detector
132// 2 - process only active region (region of interest on)
133
134 Int_t fFMD;
135 Int_t fITS;
136 Int_t fMUON;
137 Int_t fPHOS;
138 Int_t fPMD;
139 Int_t fRICH;
140 Int_t fSTART;
141 Int_t fTOF;
142 Int_t fTPC;
143 Int_t fTRD;
144 Int_t fZDC;
145 Int_t fEMCAL;
146
147};
148
149
150////////////////////////////////////////////////////////////////////////
151//
152// AliMergeSteer.cxx
153//
154//
155////////////////////////////////////////////////////////////////////////
156
157AliMergeSteer::AliMergeSteer(const Text_t *name, const Text_t* title) : TTask(name,title)
158{
159//
160// default ctor
161//
162 fFileNameHits="galice.root";
163 fFileNameSDigits = "sdigits.root";
164 fFileNameBgrSDigits = "bgr.sdigits.root";
165 fFileNameBgrHits = "bgr.hits.root";
166 fFileNameDigitsMerged = "digits.root";
167 fFileNameDigitsSignalOnly = "digits.signal.root";
168 fFileNameCmpMerged = "CmpGaRS_merged.root";
169 fFileNameCmpSignalOnly = "CmpGaRS_signal.root";
170
171 fFlagSim = kFALSE;
172 fFlagSDigits = kFALSE;
173 fFlagMerge = kFALSE;
174 fFlagDigitsSignalOnly = kFALSE;
175 fFlagRecoMerged = kFALSE;
176 fFlagRecoSignalOnly = kFALSE;
177 fFlagCmpMerged = kFALSE;
178 fFlagCmpSignalOnly = kFALSE;
179 fCopy2S = kTRUE;
180 fCopy2D = kTRUE;
181
182 fNEvents = 1;
183 fFirstEvent = 0;
184 fBgrEventNr = 0;
185
186 fDEBUG = 1;
187
188 fFMD = 0;
189 fITS = 0;
190 fMUON = 0;
191 fPHOS = 0;
192 fPMD = 0;
193 fRICH = 0;
194 fSTART = 0;
195 fTOF = 0;
196 fTPC = 0;
197 fTRD = 0;
198 fZDC = 0;
199 fEMCAL = 0;
200}
201
202////////////////////////////////////////////////////////////////////////
203AliMergeSteer::~AliMergeSteer()
204{
205// default dtor
206
207}
208////////////////////////////////////////////////////////////////////////
209void AliMergeSteer::Exec(Option_t* option)
210{
211 Bool_t rc = kTRUE;
212 if (gAlice) delete gAlice;
213 gAlice = 0;
214
215 if (fFlagSim) rc = Simulate();
216 if (!rc) {Error("Exec","Simulate wrong"); return;}
217
218 if (fFlagSDigits) rc = CreateSDigits();
219 if (!rc) {Error("Exec","CreateSDigits wrong"); return;}
220
221 if (fFlagSDigits && fCopy2S) rc = AliCopy(fFileNameHits,fFileNameSDigits);
222 if (!rc) {Error("Exec","AliCopy to SD wrong"); return;}
223
224 if (fFlagMerge && fCopy2D) rc = AliCopy(fFileNameHits,fFileNameDigitsMerged);
225 if (!rc) {Error("Exec","AliCopy to DigitsMerged wrong"); return;}
226
227 if (fFlagMerge) rc = Merge();
228 if (!rc) {Error("Exec","Merge wrong"); return;}
229
230 if (fFlagDigitsSignalOnly) rc = NoMerge();
231 if (!rc) {Error("Exec","NoMerge wrong"); return;}
232
233 if (fFlagRecoMerged) rc = RecoMerged();
234 if (!rc) {Error("Exec","RecoMerged wrong"); return;}
235
236 if (fFlagRecoSignalOnly) rc = RecoSignalOnly();
237 if (!rc) {Error("Exec","RecoSignalOnly wrong"); return;}
238
239 if (fFlagCmpMerged) rc = CmpMerged();
240 if (!rc) {Error("Exec","CmpMerged wrong"); return;}
241
242 if (fFlagCmpSignalOnly) rc = CmpSignalOnly();
243 if (!rc) {Error("Exec","CmpSignalOnly wrong"); return;}
244
245
246
247
248}
249////////////////////////////////////////////////////////////////////////
250Int_t AliMergeSteer::GetDetectorFlag(Option_t* option)
251{
252//
253// return current flag value for a given detector
254//
255 if (strstr(option,"FMD")) {
256 return fFMD;
257 } else if (strstr(option,"ITS")) {
258 return fITS;
259 } else if (strstr(option,"MUON")) {
260 return fMUON;
261 } else if (strstr(option,"PHOS")) {
262 return fPHOS;
263 } else if (strstr(option,"PMD")) {
264 return fPMD;
265 } else if (strstr(option,"RICH")) {
266 return fRICH;
267 } else if (strstr(option,"START")) {
268 return fSTART;
269 } else if (strstr(option,"TOF")) {
270 return fTOF;
271 } else if (strstr(option,"TPC")) {
272 return fTPC;
273 } else if (strstr(option,"TRD")) {
274 return fTRD;
275 } else if (strstr(option,"ZDC")) {
276 return fZDC;
277 } else if (strstr(option,"EMCAL")) {
278 return fEMCAL;
279 } else {
280 cerr<<"Unknown detector required."<<endl;
281 return -1;
282 }
283}
284////////////////////////////////////////////////////////////////////////
285Bool_t AliMergeSteer::SetDetectorFlag(Option_t* option, Int_t flag)
286{
287//
288// return current flag value for a given detector
289//
290 if (strstr(option,"FMD")) {
291 fFMD = flag;
292 } else if (strstr(option,"ITS")) {
293 fITS = flag;
294 } else if (strstr(option,"MUON")) {
295 fMUON = flag;
296 } else if (strstr(option,"PHOS")) {
297 fPHOS = flag;
298 } else if (strstr(option,"PMD")) {
299 fPMD = flag;
300 } else if (strstr(option,"RICH")) {
301 fRICH = flag;
302 } else if (strstr(option,"START")) {
303 fSTART = flag;
304 } else if (strstr(option,"TOF")) {
305 fTOF = flag;
306 } else if (strstr(option,"TPC")) {
307 fTPC = flag;
308 } else if (strstr(option,"TRD")) {
309 fTRD = flag;
310 } else if (strstr(option,"ZDC")) {
311 fZDC = flag;
312 } else if (strstr(option,"EMCAL")) {
313 fEMCAL = flag;
314 } else {
315 cerr<<"Unknown detector required."<<endl;
316 return kFALSE;
317 }
318 return kTRUE;
319}
320////////////////////////////////////////////////////////////////////////
321Bool_t AliMergeSteer::ImportgAlice(TFile *file) {
322// read in gAlice object from the file
323 gAlice = (AliRun*)file->Get("gAlice");
324 if (!gAlice) return kFALSE;
325 return kTRUE;
326}
327////////////////////////////////////////////////////////////////////////
328Bool_t AliMergeSteer::ExtractVertex(TString fn, Int_t eventNr)
329{
330// Open file with TPC geom and digits
331 TFile *file=TFile::Open(fn);
332 if (!file->IsOpen()) {cerr<<"Cannnot open "<<fn.Data()<<" !\n"; return kFALSE;}
333 if (!(gAlice=(AliRun*)file->Get("gAlice"))) {
334 cerr<<"gAlice was not found in "<<fn.Data()<<" !\n";
335 return kFALSE;
336 }
337
338 AliHeader *header = gAlice->GetHeader();
339 if (!header) {
340 cerr<<"header was not found in "<<fn.Data()<<" !\n";
341 return kFALSE;
342 }
343 AliGenEventHeader* genEventHeader = header->GenEventHeader();
344 if (!genEventHeader) {
345 cerr<<"GenEventHeader was not found in "<<fn.Data()<<" !\n";
346 return kFALSE;
347 }
348
349 TArrayF primaryVertex(3);
350 genEventHeader->PrimaryVertex(primaryVertex);
351 PrintVertex(primaryVertex);
352 ExportVertex(primaryVertex);
353// delete header;
354
355// Following two lines should be there, but ....
356// delete genEventHeader;
357// delete gAlice;
358 gAlice = 0;
359 file->Close();
360
361 return kTRUE;
362
363}
364////////////////////////////////////////////////////////////////////////
365void AliMergeSteer::PrintVertex(TArrayF &primaryVertex)
366{
367 cout <<"CONFIG_VERTEX: "
368 <<primaryVertex[0]<<" "
369 <<primaryVertex[1]<<" "
370 <<primaryVertex[2]<<" "<<endl;
371 return;
372}
373
374////////////////////////////////////////////////////////////////////////
375void AliMergeSteer::ExportVertex(TArrayF &primaryVertex)
376{
377 char vertexAsString[30];
378 sprintf(vertexAsString,"%f",primaryVertex[0]);
379 gSystem->Setenv("CONFIG_VERTEX_X",vertexAsString);
380 sprintf(vertexAsString,"%f",primaryVertex[1]);
381 gSystem->Setenv("CONFIG_VERTEX_Y",vertexAsString);
382 sprintf(vertexAsString,"%f",primaryVertex[2]);
383 gSystem->Setenv("CONFIG_VERTEX_Z",vertexAsString);
384 return;
385}
386////////////////////////////////////////////////////////////////////////
387Bool_t AliMergeSteer::Simulate()
388{
389 char cmd[100];
390 TFile *f;
391
392 TDirectory *saveDir = gDirectory;
393 cout<< "The original directory is: ";
394 saveDir->pwd();
395 if (!ExtractVertex(fFileNameBgrHits,fBgrEventNr)) {
396 cerr<<" ExtractVertexAndSimulateSignal: Error in ExtractVertex"<<endl;
397 return kFALSE;
398 }
399 saveDir->cd();
400 new AliRun("gAlice","Signal for Merging");
401 gAlice->Init("Config.C");
402// gSystem->Setenv("CONFIG_FILE",fileNameSigHits);
403 TStopwatch timer;
404 timer.Start();
405 gAlice->Run(fNEvents);
406 timer.Stop();
407 cout<<"Simulation of "<<fNEvents<<" of signal took: "<<endl;
408 timer.Print();
409 delete gAlice;
410 gAlice = 0;
411 f = static_cast<TFile *>(gROOT->FindObject("galice.root"));
412 if (f) f->Close();
413 f = 0;
414 sprintf(cmd,"mv galice.root %s",fFileNameHits.Data());
415 gSystem->Exec(cmd);
416 return kTRUE;
417
418}
419
420////////////////////////////////////////////////////////////////////////
421Bool_t AliMergeSteer::CreateSDigits()
422{
423 char macroName[200];
424 char funcName[200];
425 sprintf(macroName,"AliHits2SDigits.C");
426 sprintf(funcName,
427 "AliHits2SDigits(\"%s\",\"%s\",%d,%d,%d,%d,%d,%d,%d,%d);",
428 fFileNameSDigits.Data(),fFileNameHits.Data(),
429 fNEvents,0,fITS,fTPC,fTRD,fPHOS,fTOF,0);
430 cerr<<"I'll do: "<<funcName<<endl;
431 gROOT->LoadMacro(macroName);
432 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
433 gInterpreter->ProcessLine(funcName);
434 if (fDEBUG) cerr<<"SDigits created"<<endl;
435 return kTRUE;
436}
437
438
439////////////////////////////////////////////////////////////////////////
440Bool_t AliMergeSteer::Merge()
441{
442 char macroName[200];
443 char funcName[200];
444 cerr<<"Start merging"<<endl;
445 sprintf(macroName,"MergeV1.C");
446 sprintf(funcName,
447 "Merge(\"%s\",\"%s\",\"%s\",%d,%d,%d,%d,%d,%d,%d,%d);",
448 fFileNameDigitsMerged.Data(),fFileNameSDigits.Data(),
449 fFileNameBgrSDigits.Data(),
450 fNEvents,fITS,fTPC,fTRD,fPHOS,fMUON,fRICH,0);
451 cerr<<"I'll do: "<<funcName<<endl;
452 gROOT->LoadMacro(macroName);
453 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
454 gInterpreter->ProcessLine(funcName);
455 if (fDEBUG) cerr<<"Merging done"<<endl;
456
457// return kTRUE;
458// add ITS fast points, no merging yet
459// return ITSFastPoints(fFileNameDigitsMerged.Data(),
460// fFileNameHits.Data());
461
462}
463////////////////////////////////////////////////////////////////////////
464Bool_t AliMergeSteer::NoMerge()
465{
466 char macroName[200];
467 char funcName[200];
468 cerr<<"Start NoMerging"<<endl;
469 sprintf(macroName,"AliSDigits2Digits.C");
470 sprintf(funcName,
471 "AliSDigits2Digits(\"%s\",\"%s\",%d,%d,%d,%d,%d,%d,%d,%d);",
472 fFileNameDigitsSignalOnly.Data(),fFileNameSDigits.Data(),
473 fNEvents,fITS,fTPC,fTRD,fPHOS,fMUON,fRICH,0);
474 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
475 gROOT->LoadMacro(macroName);
476 gInterpreter->ProcessLine(funcName);
477 if (fDEBUG) cerr<<"NoMerging done"<<endl;
478// return kTRUE;
479// add ITS fast points, no merging
480// return ITSFastPoints(fFileNameDigitsSignalOnly.Data(),
481// fFileNameHits.Data());
482
483}
484////////////////////////////////////////////////////////////////////////
485Bool_t AliMergeSteer::ITSFastPoints(const char *outputFile, const char *inputFile) {
486
487 char macroName[200];
488 char funcName[200];
489 sprintf(macroName,"AliITSHits2SDR.C");
490 sprintf(funcName,"AliITSH2FR2files(\"%s\",\"%s\");",
491 inputFile, outputFile);
492 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
493 gROOT->LoadMacro(macroName);
494 gInterpreter->ProcessLine(funcName);
495 if (fDEBUG) cerr<<"ITSFastPoints done"<<endl;
496
497 return kTRUE;
498}
499
500////////////////////////////////////////////////////////////////////////
501Bool_t AliMergeSteer::RecoMerged()
502{
503//
504//
505//
506 char macroName[200];
507 char funcName[200];
508 cerr<<"Start RecoMerged"<<endl;
509 sprintf(macroName,"AliBarrelRecoV3.C");
510 sprintf(funcName,"AliBarrelRecoMerged(%d);",fNEvents);
511 gROOT->LoadMacro(macroName);
512 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
513 gInterpreter->ProcessLine(funcName);
514 if (fDEBUG) cerr<<"RecoMerged done"<<endl;
515 return kTRUE;
516}
517
518////////////////////////////////////////////////////////////////////////
519Bool_t AliMergeSteer::RecoSignalOnly()
520{
521//
522//
523//
524 char macroName[200];
525 char funcName[200];
526 cerr<<"Start RecoSignalOnly"<<endl;
527 sprintf(macroName,"AliBarrelRecoNoITSClass.C");
528 sprintf(funcName,"AliBarrelReco(%d);",fNEvents);
529 gROOT->LoadMacro(macroName);
530 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
531 gInterpreter->ProcessLine(funcName);
532 if (fDEBUG) cerr<<"RecoSignalOnly done"<<endl;
533 return kTRUE;
534}
535
536////////////////////////////////////////////////////////////////////////
537Bool_t AliMergeSteer::CmpMerged()
538{
539//
540//
541//
542 char macroName[200];
543 char funcName[200];
544 cerr<<"Start CmpMerged"<<endl;
545 sprintf(macroName,"CmpGaRS.C");
546 sprintf(funcName,
547 "CmpGaRS(%d,%d,\"%s\",\"AliTPCtracks_merged.root\",\"%s\");",
548 fNEvents, fFirstEvent, fFileNameHits.Data(),
549 fFileNameCmpMerged.Data());
550 gROOT->LoadMacro(macroName);
551 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
552 gInterpreter->ProcessLine(funcName);
553 if (fDEBUG) cerr<<"CmpMerged done"<<endl;
554 return kTRUE;
555}
556////////////////////////////////////////////////////////////////////////
557Bool_t AliMergeSteer::CmpSignalOnly()
558{
559//
560//
561//
562 char macroName[200];
563 char funcName[200];
564 cerr<<"Start CmpSignalOnly"<<endl;
565 sprintf(macroName,"CmpGaRS.C");
566 sprintf(funcName,
567 "CmpGaRS(%d,%d,\"%s\",\"AliTPCtracks.root\",\"%s\");",
568 fNEvents, fFirstEvent, fFileNameHits.Data(),
569 fFileNameCmpSignalOnly.Data());
570 gROOT->LoadMacro(macroName);
571 if (fDEBUG) cerr<<"I'll do: "<<funcName<<endl;
572 gInterpreter->ProcessLine(funcName);
573 if (fDEBUG) cerr<<"CmpSignalOnly done"<<endl;
574 return kTRUE;
575}
576////////////////////////////////////////////////////////////////////////
577Bool_t AliMergeSteer::AliCopy(TFile *inputFile, TFile *outputFile)
578{
579//
580// copy gAlice object, AliceGeom and TreeE
581//
582
583// copy gAlice
584 if (fDEBUG) cout<<"Copy gAlice: ";
585 outputFile->cd();
586 if (gAlice) {
587 Error("AliCopy",
588 "gAlice must be deleted before AliCopy is called.");
589 return kFALSE;
590 }
591 if (!ImportgAlice(inputFile)) return kFALSE;
592 gAlice->Write();
593 if (fDEBUG) cout<<"done"<<endl;
594
595
596// copy TreeE
597 TTree *treeE = gAlice->TreeE();
598 if (!treeE) {
599 cerr<<"No TreeE found "<<endl;
600 return kFALSE;
601 }
602 if (fDEBUG) cout<<"Copy TreeE: ";
603 AliHeader *header = new AliHeader();
604 treeE->SetBranchAddress("Header", &header);
605 treeE->SetBranchStatus("*",1);
606 TTree *treeENew = treeE->CloneTree();
607 treeENew->Write();
608 if (fDEBUG) cout<<"done"<<endl;
609
610// copy AliceGeom
611 if (fDEBUG) cout<<"Copy AliceGeom: ";
612 TGeometry *AliceGeom = static_cast<TGeometry*>(inputFile->Get("AliceGeom"));
613 if (!AliceGeom) {
614 cerr<<"AliceGeom was not found in the input file "<<endl;
615 return kFALSE;
616 }
617 AliceGeom->Write();
618 if (fDEBUG) cout<<"done"<<endl;
619
620 delete gAlice;
621 gAlice = 0;
622
623 return kTRUE;
624
625}
626
627////////////////////////////////////////////////////////////////////////
628Bool_t AliMergeSteer::AliCopy(TString inputFileName, TString outputFileName)
629{
630//
631// open iput and output files,
632// ask to copy gAlice object, AliceGeom and TreeE
633// close input and ouput files
634//
635 if (fDEBUG) {
636 cout<<"AliCopy: will copy gAlice from "<<inputFileName.Data()<<" to "
637 <<outputFileName.Data()<<endl;
638 }
639
640 TFile *inputFile = TFile::Open(inputFileName.Data());
641 if (!inputFile->IsOpen()) {
642 cerr<<"Can't open "<<inputFileName.Data()<<" !\n";
643 return kFALSE;
644 }
645
646 TFile *outputFile = TFile::Open(outputFileName.Data(),"UPDATE");
647 if (!outputFile->IsOpen()) {
648 cerr<<"Can't open "<<outputFileName.Data()<<" !\n";
649 return kFALSE;
650 }
651
652 AliCopy(inputFile, outputFile);
653
654 inputFile->Close();
655 outputFile->Close();
656
657 if (fDEBUG) {
658 cout<<"AliCopy copied gAlice from "<<inputFileName.Data()<<" to "
659 <<outputFileName.Data()<<endl;
660 }
661
662 return kTRUE;
663}
664////////////////////////////////////////////////////////////////////////