]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSGetter.cxx
Add a metho to retrieve the QA tasks
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGetter.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id:  */
17
18 /* $Log:
19    29.05.2001 Yuri Kharlov:
20               Everywhere reading the treese TTree->GetEvent(i)
21               is replaced by reading the branches TBranch->GetEntry(0)
22 */
23
24 //_________________________________________________________________________
25 //  A singleton. This class should be used in the analysis stage to get 
26 //  reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
27 //  instead of directly reading them from galice.root file. This container 
28 //  ensures, that one reads Digits, made of these particular digits, RecPoints, 
29 //  made of these particular RecPoints, TrackSegments and RecParticles. 
30 //  This becomes non trivial if there are several identical branches, produced with
31 //  different set of parameters. 
32 //
33 //  An example of how to use (see also class AliPHOSAnalyser):
34 //  AliPHOSGetter * gime = AliPHOSGetter::GetInstance("galice.root","test") ;
35 //  for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
36 //     AliPHOSRecParticle * part = gime->RecParticle(1) ;
37 //     ................
38 //  please->GetEvent(event) ;    // reads new event from galice.root
39 //                  
40 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
41 //*--         Completely redesigned by Dmitri Peressounko March 2001  
42 //
43 //*-- YS June 2001 : renamed the original AliPHOSIndexToObject and make
44 //*--         systematic usage of TFolders without changing the interface        
45 //////////////////////////////////////////////////////////////////////////////
46
47
48 // --- ROOT system ---
49
50 #include "TFile.h"
51 #include "TTree.h"
52 #include "TROOT.h"
53 #include "TObjString.h"
54 #include "TFolder.h"
55
56 // --- Standard library ---
57 #include <iostream.h>
58
59 // --- AliRoot header files ---
60
61 #include "AliRun.h"
62 #include "AliPHOSGetter.h"
63 #include "AliPHOS.h"
64 #include "AliPHOSDigitizer.h"
65 #include "AliPHOSSDigitizer.h"
66 #include "AliPHOSClusterizer.h"
67 #include "AliPHOSClusterizerv1.h"
68 #include "AliPHOSTrackSegmentMaker.h"
69 #include "AliPHOSTrackSegmentMakerv1.h"
70 #include "AliPHOSTrackSegment.h"
71 #include "AliPHOSPID.h" 
72 #include "AliPHOSPIDv1.h" 
73 #include "AliPHOSGeometry.h"
74
75 ClassImp(AliPHOSGetter)
76   
77   AliPHOSGetter * AliPHOSGetter::fgObjGetter = 0 ; 
78
79 //____________________________________________________________________________ 
80 AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle )
81 {
82   //Initialize  all lists
83
84   fHeaderFile         = headerFile ; 
85   fSDigitsTitle       = branchTitle ; 
86   fDigitsTitle        = branchTitle ; 
87   fRecPointsTitle     = branchTitle ; 
88   fRecParticlesTitle  = branchTitle ; 
89   fTrackSegmentsTitle = branchTitle ; 
90
91   fPrimaries = new TObjArray(1) ;
92
93   if ( fHeaderFile != "aliroot" ) { // to call the getter without a file
94     
95     //open headers file
96     TFile * file = (TFile*) gROOT->GetFile(fHeaderFile.Data() ) ;
97     
98     if(file == 0){    //if file was not opened yet, read gAlice
99       if(fHeaderFile.Contains("rfio")) // if we read file using HPSS
100         file =  TFile::Open(fHeaderFile.Data(),"update") ;
101       else
102         file = new TFile(fHeaderFile.Data(),"update") ;
103       
104       if (!file->IsOpen()) {
105         cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot open " << fHeaderFile.Data() << endl ; 
106         abort() ; 
107       }
108       
109       gAlice = (AliRun *) file->Get("gAlice") ;
110       
111       if (!gAlice) {
112         cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; 
113         abort() ; 
114       }
115     }
116   }
117 }
118 //____________________________________________________________________________ 
119 void AliPHOSGetter::CreateWhiteBoard() const
120 {
121   // Posts a few item to the white board (folders)
122   
123   // -- the geometry
124   Post(fHeaderFile, "G") ; 
125   
126   // -- the hits
127   Post(fHeaderFile, "H") ; 
128     
129 }
130
131 //____________________________________________________________________________ 
132 AliPHOSGetter * AliPHOSGetter::GetInstance()
133 {
134   // Returns the pointer of the unique instance already defined
135   
136   AliPHOSGetter * rv = 0 ;
137   if ( fgObjGetter )
138     rv = fgObjGetter ;
139   else
140     cout << "AliPHOSGetter::GetInstance ERROR: not yet initialized" << endl ;
141
142   return rv ;
143 }
144
145 //____________________________________________________________________________ 
146 AliPHOSGetter * AliPHOSGetter::GetInstance(const char* headerFile,
147                                            const char* branchTitle)
148 {
149   // Creates and returns the pointer of the unique instance
150   // Must be called only when the environment has changed 
151
152
153   if ( fgObjGetter )      // delete it if already exists
154     delete fgObjGetter ; 
155
156   fgObjGetter = new AliPHOSGetter(headerFile,branchTitle) ; 
157   
158   // Posts a few item to the white board (folders)
159   fgObjGetter->CreateWhiteBoard() ;
160
161   // Get the first event into the arrays posted on the white board
162   // branchTitle = 0, means simulation run and no event yet 
163   if (branchTitle) 
164     fgObjGetter->Event(0) ;
165
166   return fgObjGetter ; 
167   
168 }
169
170 //____________________________________________________________________________ 
171  const  AliPHOS * AliPHOSGetter::PHOS() const 
172 {
173   // returns the PHOS object 
174   return ( (AliPHOS*)gAlice->GetDetector("PHOS") ); 
175 }  
176
177 //____________________________________________________________________________ 
178   const AliPHOSGeometry *  AliPHOSGetter::PHOSGeometry() const 
179 {
180   // retrieves the geometr from the folder
181
182   TString path("YSAlice/WhiteBoard/Geometry/PHOS/") ;
183   path += PHOS()->GetTitle() ;
184   return (AliPHOSGeometry*)gROOT->FindObjectAny(path.Data()) ; 
185 }
186
187 //____________________________________________________________________________ 
188 void AliPHOSGetter::Post(const char * headerFile, const char * opt, const char * name, const Int_t event) const 
189 {
190   // Adds a new folder for summable digits 
191  
192   TString foldertitle ; 
193   if ( event >= 0 ) 
194     foldertitle += event ; 
195   else 
196     foldertitle = "" ; 
197
198   TFolder * aliceF  = (TFolder*)gROOT->FindObjectAny("YSAlice") ; 
199  
200   if ( strcmp(opt, "G") == 0 ) { // Geometry
201     // the hierarchy is //YSALICE/WhiteBoard/Geometry/PHOS/
202     AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance(PHOS()->GetTitle(),"") ;  
203     TFolder * geomF  = (TFolder*)aliceF->FindObject("WhiteBoard/Geometry/PHOS") ; 
204     if ( !geomF ) {
205       cerr << "ERROR: AliPHOSGetter::Post G -> Folder WhiteBoard/Geometry/PHOS/" << " not found!" << endl;
206       abort() ; 
207     }    
208     else 
209       geomF->Add((TObject*)geom) ; 
210    
211   } else if ( strcmp(opt, "H") == 0 ) { // Hits
212     // the hierarchy is //YSALICE/WhiteBoard/SDigits/PHOS/Hits
213     TClonesArray * hits = new TClonesArray("AliPHOSHit",1000) ;
214     hits->SetName("Hits") ; 
215     TFolder * hitsF  = (TFolder*)aliceF->FindObject("WhiteBoard/Hits/PHOS") ; 
216     if ( !hitsF ) {
217       cerr << "ERROR: AliPHOSGetter::Post H -> Folder WhiteBoard/Hits/PHOS/" << " not found!" << endl;
218       abort() ; 
219     }    
220     else 
221       hitsF->Add(hits) ; 
222
223   } else if ( strcmp(opt, "S") == 0 ) { // summable digits
224     // the hierarchy is //YSALICE/WhiteBoard/SDigits/PHOS/headerFile/sdigitsname
225     // because you can have sdigits from several hit files for mixing
226     TClonesArray * sdigits = new TClonesArray("AliPHOSDigit",1000) ;
227     TString sdigitsName ; 
228     if (name) 
229       sdigitsName = name ;
230     else 
231       sdigitsName = "SDigits" ; 
232     sdigits->SetName( sdigitsName.Data() ) ; 
233     TFolder * sdigitsF  = (TFolder*)aliceF->FindObject("WhiteBoard/SDigits/PHOS") ;
234     TFolder * sdigitsF2 = 0 ; 
235     TString subdir(headerFile) ;
236     if ( !(sdigitsF2=(TFolder*)sdigitsF->FindObject(subdir)) ) 
237       sdigitsF2 = sdigitsF->AddFolder(subdir, foldertitle); 
238     else {
239       if ( sdigitsF2->FindObject( sdigitsName.Data() ) ) {
240         cerr <<"INFO: AliPHOSGetter::Post S -> Folder " << subdir << ", " << foldertitle
241              << " already exists!" << endl ;  
242         return ; 
243       }
244     }
245     if ( !sdigitsF2 ) {
246       cerr << "ERROR: AliPHOSGetter::Post S -> Folder WhiteBoard/SDigits/PHOS/" << subdir << " not created!" << endl;
247       abort() ; 
248     }
249     else 
250       sdigitsF2->Add(sdigits) ;
251
252   } else if ( strcmp(opt, "Ser") == 0 ) { // sdigizer
253     // the hierarchy is //YSALICE/tasks/Digitizer/PHOS/sdigitsname
254     AliPHOSSDigitizer * sdigitizer = new AliPHOSSDigitizer() ; 
255     TString sdigitsName ; 
256     if (name) 
257       sdigitsName = name ;
258     else 
259       sdigitsName = "SDigitizer" ;
260     sdigitizer->SetName( sdigitsName.Data() ) ; 
261     TTask * sdigitsF  = (TTask*)aliceF->FindObject("tasks/SDigitizer") ; 
262     if ( !sdigitsF ) {
263       cerr << "ERROR: AliPHOSGetter::Post Ser -> Task tasks/SDigitizer" << " not found!" << endl;
264       abort() ; 
265     }        
266     TTask * phos = (TTask*)sdigitsF->GetListOfTasks()->FindObject("PHOS") ; 
267     if ( !phos )  {
268       cerr <<"ERROR: AliPHOSGetter::Post Ser -> tasks/SDigitizer/PHOS" << " not found!" << endl; 
269       abort() ; 
270     } else {
271       AliPHOSSDigitizer * phossd = (AliPHOSSDigitizer*)phos->GetListOfTasks()->FindObject(sdigitsName.Data()) ; 
272       if (phossd) { 
273         cout << "INFO: AliPHOSGetter::Post Ser -> Task " << sdigitsName.Data() << " already exists" << endl ; 
274         return ; 
275       } else 
276         phos->Add(sdigitizer) ;
277     } 
278
279   } else if ( strcmp(opt, "D") == 0 ) { // digits
280     // the hierarchy is //YSALICE/WhiteBoard/Digits/PHOS/digitsname
281     TClonesArray * digits  = new TClonesArray("AliPHOSDigit",20000) ;
282     TString digitsName ; 
283     if (name) 
284       digitsName = name ;
285     else 
286       digitsName = "Digits" ;   
287     digits->SetName( digitsName.Data() ) ; 
288     TFolder * digitsF  = (TFolder*)aliceF->FindObject("WhiteBoard/Digits/PHOS") ;
289     if ( !digitsF ) {
290       cerr << "ERROR: AliPHOSGetter::Post D -> Folder WhiteBoard/Digits/PHOS/" << " not found!" << endl;
291       abort() ; 
292     }    
293     digitsF->SetTitle(foldertitle) ; 
294     if ( digitsF->FindObject( digitsName.Data() ) ) {
295       cerr <<"INFO: AliPHOSGetter::Post D -> Object " << digitsName.Data() 
296            << " already exists!" << endl ;  
297       return ; 
298     } 
299     else 
300       digitsF->Add(digits) ;  
301
302   } else if ( strcmp(opt, "Der") == 0 ) { // sdigizer
303     // the hierarchy is //YSALICE/tasks/Digitizer/PHOS/digitsname
304     AliPHOSDigitizer * digitizer = new AliPHOSDigitizer() ; 
305     TString digitsName ; 
306     if (name) 
307       digitsName = name ;
308     else 
309       digitsName = "Digitizer" ;
310     digitizer->SetName( digitsName.Data() ) ; 
311     TTask * digitsF  = (TTask*)aliceF->FindObject("tasks/Digitizer") ; 
312     if ( !digitsF ) {
313       cerr << "ERROR: AliPHOSGetter::Post Der -> Task tasks/Digitizer" << " not found!" << endl;
314       abort() ; 
315     }        
316     TTask * phos = (TTask*)digitsF->GetListOfTasks()->FindObject("PHOS") ; 
317     if ( !phos )  {
318       cerr <<"ERROR: AliPHOSGetter::Post Der -> tasks/Digitizer/PHOS" << " not found!" << endl; 
319       abort() ; 
320     } else {
321       AliPHOSDigitizer * phosd = (AliPHOSDigitizer*)phos->GetListOfTasks()->FindObject(digitsName.Data()) ; 
322       if (phosd) { 
323         cout << "INFO: AliPHOSGetter::Post Der -> Task " << digitsName.Data() << " already exists" << endl ; 
324         return ; 
325       } else 
326         phos->Add(digitizer) ;
327     }
328  
329   } else if ( strcmp(opt, "R") == 0 ) { // RecPoints
330     // the hierarchy is //YSALICE/WhiteBoard/RecPoints/PHOS/emc/recpointsname
331     //                  //YSALICE/WhiteBoard/RecPoints/PHOS/cpv/recpointsname
332     TObjArray * emcrp  = new TObjArray(100) ;
333     TObjArray * cpvrp  = new TObjArray(100) ;
334     TString recpointsName ; 
335     if (name) 
336       recpointsName = name ;
337     else       
338       recpointsName = "RecPoints" ;     
339     emcrp->SetName( recpointsName.Data() ) ; 
340     cpvrp->SetName( recpointsName.Data() ) ; 
341     TFolder * emcrpF  = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/emc") ; 
342     TFolder * cpvrpF  = (TFolder*)aliceF->FindObject("WhiteBoard/RecPoints/PHOS/cpv") ;
343     emcrpF->SetTitle(foldertitle) ; 
344     cpvrpF->SetTitle(foldertitle) ; 
345     if ( !emcrpF || !cpvrpF ) {
346       cerr << "ERROR: AliPHOSGetter::Post R -> Folder WhiteBoard/RecPoints/PHOS/emc(cpv)" << " not found!" << endl;
347       abort() ; 
348     }    
349     // TString title("PHOS Digits") ; 
350     if ( emcrpF->FindObject( recpointsName.Data() ) ||  cpvrpF->FindObject( recpointsName.Data() ) ) {
351       cerr <<"INFO: AliPHOSGetter::Post R -> Object " << recpointsName.Data() 
352            << " already exists!" << endl ;  
353       return ; 
354     } 
355     else {
356       emcrpF->Add(emcrp) ;  
357       cpvrpF->Add(cpvrp) ;
358     }  
359
360   } else if ( strcmp(opt, "Rer") == 0 ) { // clusterizer
361     // the hierarchy is //YSALICE/tasks/Reconstructionner/PHOS/recpointsname
362     AliPHOSClusterizer * clusterizer; 
363     if ( strstr(name, "clu-v1") != 0 )   
364          clusterizer = new AliPHOSClusterizerv1() ;
365     else {
366       cerr << "ERROR: AliPHOSGetter::Post Rer -> " << name << " unknown clusterizer version" << endl ;  
367       abort() ; 
368     }
369     TString recpointsName ; 
370     if (name) 
371       recpointsName = name ;
372     else 
373       recpointsName = "Clusterizer" ;
374     clusterizer->SetName( recpointsName.Data() ) ; 
375     TTask * reF  = (TTask*)aliceF->FindObject("tasks/Reconstructioner") ; 
376     if ( !reF ) {
377       cerr << "ERROR: AliPHOSGetter::Post Rer -> Task tasks/Reconstructioner" << " not found!" << endl;
378       abort() ; 
379     }        
380     TTask * phos = (TTask*)reF->GetListOfTasks()->FindObject("PHOS") ; 
381     if ( !phos )  {
382       cerr <<"ERROR: AliPHOSGetter::Post Rer -> tasks/Reconstructioner/PHOS" << " not found!" << endl; 
383       abort() ; 
384     } else {
385        AliPHOSClusterizer * phoscl = (AliPHOSClusterizer*)phos->GetListOfTasks()->FindObject(recpointsName.Data()) ; 
386       if (phoscl) { 
387         cout << "INFO: AliPHOSGetter::Post Rer -> Task " << recpointsName.Data() << " already exists" << endl ; 
388         return ; 
389       } else 
390         phos->Add(clusterizer) ;
391     }
392
393   } else if ( strcmp(opt, "T") == 0 ) { //TrackSegments
394     // the hierarchy is //YSALICE/WhiteBoard/TrackSegments/PHOS/tracksegmentsname
395
396     TClonesArray * tracksegments  = new TClonesArray("AliPHOSTrackSegment", 200) ;
397     TString tracksegmentsName ; 
398     if (name) 
399       tracksegmentsName = name ;
400     else       
401       tracksegmentsName = "TrackSegments" ;     
402     tracksegments->SetName( tracksegmentsName.Data() ) ; 
403     TFolder * tracksegmentsF  = (TFolder*)aliceF->FindObject("WhiteBoard/TrackSegments/PHOS") ; 
404     tracksegmentsF->SetTitle(foldertitle) ;  
405     if ( !tracksegmentsF) {
406       cerr << "ERROR: AliPHOSGetter::Post T -> Folder WhiteBoard/TrackSegments/PHOS" << " not found!" << endl;
407       abort() ; 
408     }    
409     if ( tracksegmentsF->FindObject( tracksegmentsName.Data() ) ) {
410       cerr <<"INFO: AliPHOSGetter::Post T -> Object " << tracksegmentsName.Data() 
411            << " already exists!" << endl ;  
412       return ; 
413     } 
414     else 
415       tracksegmentsF->Add(tracksegments) ;  
416
417   } else if ( strcmp(opt, "Ter") == 0 ) { // TrackSegmentsMaker
418     // the hierarchy is //YSALICE/tasks/Reconstructionner/PHOS/tracksegmentsname
419     AliPHOSTrackSegmentMaker * tracksegmentmaker ; 
420     if ( strstr(name, "tsm-v1") != 0 )   
421          tracksegmentmaker = new AliPHOSTrackSegmentMakerv1() ;
422     else {
423       cerr << "ERROR: AliPHOSGetter::Post Ter -> " << name << " unknown track segment maker version" << endl ;  
424       abort() ; 
425     }
426     TString tracksegmentsName ; 
427     if (name) 
428       tracksegmentsName = name ;
429     else 
430       tracksegmentsName = "TrackSegmentMaker" ;
431     tracksegmentmaker->SetName( tracksegmentsName.Data() ) ; 
432     TTask * reF  = (TTask*)aliceF->FindObject("tasks/Reconstructioner") ; 
433     if ( !reF ) {
434       cerr << "ERROR: AliPHOSGetter::Post Ter -> Task tasks/Reconstructioner" << " not found!" << endl;
435       abort() ; 
436     }        
437     TTask * phos = (TTask*)reF->GetListOfTasks()->FindObject("PHOS") ; 
438     if ( !phos )  {
439       cerr <<"ERROR: AliPHOSGetter::Post Ter -> tasks/Reconstructioner/PHOS" << " not found!" << endl; 
440       abort() ; 
441     } else {
442        AliPHOSTrackSegmentMaker * phosts = (AliPHOSTrackSegmentMaker*)phos->GetListOfTasks()->FindObject(tracksegmentsName.Data()) ; 
443       if (phosts) { 
444         cout << "INFO: AliPHOSGetter::Post Ter -> Task " << tracksegmentsName.Data() << " already exists" << endl ; 
445         return ; 
446       } else 
447         phos->Add(tracksegmentmaker) ;
448     }
449   
450   } else if ( strcmp(opt, "P") == 0 ) { // RecParticles
451     // the hierarchy is //YSALICE/WhiteBoard/RecParticles/PHOS/recparticlesname
452
453     TClonesArray * recparticles  = new TClonesArray("AliPHOSRecParticle", 200) ;
454     TString recparticlesName ; 
455     if (name) 
456       recparticlesName = name ;
457     else       
458       recparticlesName = "RecParticles" ;       
459     recparticles->SetName( recparticlesName.Data() ) ; 
460     TFolder * recparticlesF  = (TFolder*)aliceF->FindObject("WhiteBoard/RecParticles/PHOS") ; 
461     recparticlesF->SetTitle(foldertitle) ;  
462     if ( !recparticlesF) {
463       cerr << "ERROR: AliPHOSGetter::Post P -> Folder WhiteBoard/RecParticles/PHOS" << " not found!" << endl;
464       abort() ; 
465     }    
466     if ( recparticlesF->FindObject( recparticlesName.Data() ) ) {
467       cerr <<"INFO: AliPHOSGetter::Post P -> Object " << recparticlesName.Data() 
468            << " already exists!" << endl ;  
469       return ; 
470     } 
471     else 
472       recparticlesF->Add(recparticles) ;  
473
474   } else if ( strcmp(opt, "Per") == 0 ) { // PID Maker
475     // the hierarchy is //YSALICE/tasks/Reconstructionner/PHOS/recparticlesname
476     AliPHOSPID * pid ; 
477     if ( strstr(name, "pid-v1") != 0 )   
478          pid = new AliPHOSPIDv1() ;
479     else {
480       cerr << "ERROR: AliPHOSGetter::Post Per -> " << name << " unknown PID maker version" << endl ;  
481       abort() ; 
482     }
483     TString recparticlesName ; 
484     if (name) 
485       recparticlesName = name ;
486     else 
487       recparticlesName = "PID" ;
488     pid->SetName( recparticlesName.Data() ) ; 
489     TTask * reF  = (TTask*)aliceF->FindObject("tasks/Reconstructioner") ; 
490     if ( !reF ) {
491       cerr << "ERROR: AliPHOSGetter::Post Per -> Task tasks/Reconstructioner" << " not found!" << endl;
492       abort() ; 
493     }        
494     TTask * phos = (TTask*)reF->GetListOfTasks()->FindObject("PHOS") ; 
495     if ( !phos )  {
496       cerr <<"ERROR: AliPHOSGetter::Post Per -> tasks/Reconstructioner/PHOS" << " not found!" << endl; 
497       abort() ; 
498     } else {
499        AliPHOSPID * phospid = (AliPHOSPID*)phos->GetListOfTasks()->FindObject(recparticlesName.Data()) ; 
500       if (phospid) { 
501         cout << "INFO: AliPHOSGetter::Post Per -> Task " << recparticlesName.Data() << " already exists" << endl ; 
502         return ; 
503       } else 
504         phos->Add(pid) ;
505     }
506   } 
507   else if ( strcmp(opt, "QA") == 0 ) { // Alarms
508     // the hierarchy is //YSALICE/WhiteBoard/Alarms/PHOS/
509
510     TFolder * alarmsF  = new TFolder() ;
511     TString alarmsName ; 
512     if (name) 
513       alarmsName = name ;
514     else       
515       alarmsName = "Alarm with no name" ;       
516     alarmsF->SetName( alarmsName.Data() ) ; 
517     alarmsF->SetTitle(foldertitle) ;  
518     TFolder * qaaF  = (TFolder*)aliceF->FindObject("WhiteBoard/QAAlarms") ; 
519     if ( !qaaF) {
520       cerr << "ERROR: AliPHOSGetter::Post QA -> Folder WhiteBoard/QAAlarms/" << " not found!" << endl;
521       return ; 
522     }    
523     if ( qaaF->FindObject( alarmsName.Data() ) ) 
524       qaaF->RecursiveRemove(  qaaF->FindObject( alarmsName.Data() ) ) ; 
525     
526     qaaF->Add(alarmsF) ;  
527
528   }
529 }
530
531 //____________________________________________________________________________ 
532 const TParticle * AliPHOSGetter::Primary(Int_t index) const
533 {
534   // Return primary particle numbered by <index>
535
536   if(index < 0) 
537     return 0 ;
538   
539   Int_t primaryIndex = index % 10000000 ; 
540   Int_t primaryList = (Int_t ) ((index-primaryIndex)/10000000.)  ;
541   
542   if ( primaryList > 0  ) {
543     cout << " Getter does not support currently Mixing of primary " << endl ;
544     cout << "   can not return primary: " << index<< " (list "<< primaryList<< " primary # " << primaryIndex << " )"<<endl ;
545     return 0;
546   }
547   
548   return gAlice->Particle(primaryIndex) ;
549   
550 }
551
552 //____________________________________________________________________________ 
553 void AliPHOSGetter::ReadTreeD()
554 {
555   // Read the digit tree gAlice->TreeD()  
556   if(gAlice->TreeD()== 0){
557     cerr <<   "ERROR: AliPHOSGetter::ReadTreeD: can not read TreeD " << endl ;
558   return ;
559   }
560   
561   TObjArray * lob = (TObjArray*)gAlice->TreeD()->GetListOfBranches() ;
562   TIter next(lob) ; 
563   TBranch * branch = 0 ; 
564   TBranch * digitsbranch = 0 ; 
565   TBranch * digitizerbranch = 0 ; 
566   Bool_t phosfound = kFALSE, digitizerfound = kFALSE ; 
567   
568   while ( (branch = (TBranch*)next()) && (!phosfound || !digitizerfound) ) {
569     if ( (strcmp(branch->GetName(), "PHOS")==0) && (strcmp(branch->GetTitle(), fDigitsTitle)==0) ) {
570       digitsbranch = branch ; 
571       phosfound = kTRUE ;
572     }
573     else if ( (strcmp(branch->GetName(), "AliPHOSDigitizer")==0) && (strcmp(branch->GetTitle(), fDigitsTitle)==0) ) {
574       digitizerbranch = branch ; 
575       digitizerfound = kTRUE ; 
576     }
577   }
578
579   if ( !phosfound || !digitizerfound ) {
580     cerr << "WARNING: AliPHOSGetter::ReadTreeD -> Cannot find Digits and/or Digitizer with name " << fDigitsTitle << endl ;
581     return ; 
582   }   
583  
584
585  // Post the Digits
586   Post(fHeaderFile, "D", fDigitsTitle) ; 
587   
588    // Post the Digitizer
589   Post(fHeaderFile, "Der", fDigitsTitle) ; 
590
591   TClonesArray * digits = Digits(fDigitsTitle) ; 
592   digits->Clear() ; 
593   digitsbranch   ->SetAddress(&digits) ;
594
595   AliPHOSDigitizer * digitizer = Digitizer(fDigitsTitle) ;
596   digitizerbranch->SetAddress(&digitizer) ;
597
598   digitsbranch   ->GetEntry(0) ;
599   digitizerbranch->GetEntry(0) ;
600   
601 }
602
603 //____________________________________________________________________________ 
604 void AliPHOSGetter::ReadTreeH()
605 {
606   // Read the first entry of PHOS branch in hit tree gAlice->TreeH()
607
608   if(gAlice->TreeH()== 0){
609     cerr <<   "ERROR: AliPHOSGetter::ReadTreeH: -> Cannot read TreeH " << endl ;
610     return ;
611   }
612   
613   TBranch * hitsbranch = (TBranch*)gAlice->TreeH()->GetListOfBranches()->FindObject("PHOS") ;
614   if ( !hitsbranch ) {
615     cerr << "WARNING:  AliPHOSGetter::ReadTreeH -> Cannot find branch PHOS" << endl ; 
616   } else {
617     TClonesArray * hits = Hits() ; 
618     hits->Clear() ; 
619     hitsbranch->SetAddress(&hits) ;
620     hitsbranch->GetEntry(0) ;
621   }
622 }
623
624 //____________________________________________________________________________ 
625 void AliPHOSGetter::ReadTreeQA()
626 {
627   // Read the digit tree gAlice->TreeQA()
628   // so far only PHOS knows about this Tree  
629
630   if(PHOS()->TreeQA()== 0){
631     cerr <<   "ERROR: AliPHOSGetter::ReadTreeQA: can not read TreeQA " << endl ;
632     return ;
633   }
634   
635   TBranch * qabranch = PHOS()->TreeQA()->GetBranch("PHOS") ; 
636   if (!qabranch) { 
637     cerr << "WARNING: AliPHOSGetter::ReadTreeQA -> Cannot find QA Alarms for PHOS" << endl ;
638     return ; 
639   }   
640
641  // Post the QA Alarms
642   Post(fHeaderFile, "QA", "PHOS") ; 
643   TFolder * alarmsF = Alarms() ; 
644   alarmsF->Clear() ; 
645   qabranch->SetAddress(&alarmsF) ;
646   qabranch->GetEntry(0) ;
647   
648 }
649
650 //____________________________________________________________________________ 
651 void AliPHOSGetter::ReadTreeR()
652 {
653   // Read the reconstrunction tree gAlice->TreeR()
654
655   if(gAlice->TreeR()== 0){
656     cout <<   "ERROR: AliPHOSGetter::ReadTreeR: can not read TreeR " << endl ;
657    return ;
658   }
659   // RecPoints 
660   TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
661   TIter next(lob) ; 
662   TBranch * branch = 0 ; 
663   TBranch * emcbranch = 0 ; 
664   TBranch * cpvbranch = 0 ; 
665   TBranch * clusterizerbranch = 0 ; 
666   Bool_t phosemcrpfound = kFALSE, phoscpvrpfound = kFALSE, clusterizerfound = kFALSE ; 
667   
668   while ( (branch = (TBranch*)next()) && (!phosemcrpfound || !phoscpvrpfound || !clusterizerfound) ) {
669     if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), fRecPointsTitle)==0) ) {
670       emcbranch = branch ; 
671       phosemcrpfound = kTRUE ;
672     }
673     else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), fRecPointsTitle)==0) ) {
674       cpvbranch = branch ; 
675       phoscpvrpfound = kTRUE ;
676     }
677     else if ( (strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), fRecPointsTitle)==0) ) {
678       clusterizerbranch = branch ; 
679       clusterizerfound = kTRUE ; 
680     }
681   }
682
683   if ( !phosemcrpfound || !phoscpvrpfound || !clusterizerfound ) {
684     cerr << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find RecPoints and/or Clusterizer with name " << fRecPointsTitle << endl ;
685     return ; 
686   }   
687  
688  // Post the RecPoints
689   Post(fHeaderFile, "R", fRecPointsTitle) ; 
690
691   // Post the Clusterizer
692   //  Need the version first
693   AliPHOSClusterizer * clusterizer = 0 ; 
694   clusterizerbranch->SetAddress(&clusterizer) ;
695   clusterizerbranch->GetEntry(0) ;
696   TString clusterizerName(fRecPointsTitle) ; 
697   clusterizerName.Append(clusterizer->Version()) ; 
698   delete clusterizer ;
699   Post(fHeaderFile, "Rer", clusterizerName) ; 
700
701   TObjArray * emcRecPoints = EmcRecPoints(fRecPointsTitle) ;
702   emcRecPoints->Clear() ; 
703   emcbranch->SetAddress(&emcRecPoints) ;
704
705   TObjArray * cpvRecPoints = CpvRecPoints(fRecPointsTitle) ;
706   cpvRecPoints->Clear() ; 
707   cpvbranch->SetAddress(&cpvRecPoints) ;
708
709   clusterizer = Clusterizer(clusterizerName) ;
710   clusterizerbranch->SetAddress(&clusterizer) ;
711
712   emcbranch        ->GetEntry(0) ;
713   cpvbranch        ->GetEntry(0) ;
714   clusterizerbranch->GetEntry(0) ;
715  
716   // TrackSegments
717   next.Reset() ; 
718   TBranch * tsbranch = 0 ; 
719   TBranch * tsmakerbranch = 0 ; 
720   Bool_t phostsfound = kFALSE, tsmakerfound = kFALSE ; 
721   
722   while ( (branch = (TBranch*)next()) && (!phostsfound || !tsmakerfound) ) {
723     if ( (strcmp(branch->GetName(), "PHOSTS")==0) && (strcmp(branch->GetTitle(), fTrackSegmentsTitle)==0) ) {
724       tsbranch = branch ; 
725       phostsfound = kTRUE ;
726     }
727     else if ( (strcmp(branch->GetName(), "AliPHOSTrackSegmentMaker")==0) && (strcmp(branch->GetTitle(), fTrackSegmentsTitle)==0) ) {
728       tsmakerbranch = branch ; 
729       tsmakerfound  = kTRUE ; 
730     }
731   }
732
733   if ( !phostsfound || !tsmakerfound ) {
734     cerr << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find TrackSegments and/or TrackSegmentMaker with name " << fTrackSegmentsTitle << endl ;
735     return ; 
736   } 
737
738  // Post the TrackSegments
739   Post(fHeaderFile, "T", fTrackSegmentsTitle) ; 
740
741   // Post the TrackSegment Maker
742   //  Need the version first
743   AliPHOSTrackSegmentMaker * tsmaker = 0 ; 
744   tsmakerbranch->SetAddress(&tsmaker) ;
745   tsmakerbranch->GetEntry(0) ;
746   TString tsmakerName(fTrackSegmentsTitle) ; 
747   tsmakerName.Append(tsmaker->Version()) ; 
748   delete tsmaker ;
749   Post(fHeaderFile, "Ter", tsmakerName) ; 
750
751   TClonesArray * tracksegments = TrackSegments(fTrackSegmentsTitle) ;
752   tracksegments->Clear() ; 
753   tsbranch->SetAddress(&tracksegments) ;
754  
755   tsmaker = TrackSegmentMaker(tsmakerName) ; 
756   tsmakerbranch->SetAddress(&tsmaker) ;
757
758   tsmakerbranch    ->GetEntry(0) ;
759   tsbranch         ->GetEntry(0) ;
760    
761   // RecParticles
762   next.Reset() ; 
763   TBranch * rpabranch = 0 ; 
764   TBranch * pidbranch = 0 ; 
765   Bool_t phosrpafound = kFALSE, pidfound = kFALSE ; 
766   
767   while ( (branch = (TBranch*)next()) && (!phosrpafound || !pidfound) ) {
768     if ( (strcmp(branch->GetName(), "PHOSRP")==0) && (strcmp(branch->GetTitle(), fRecParticlesTitle)==0) ) {
769       rpabranch = branch ; 
770       phosrpafound = kTRUE ;
771     }
772     else if ( (strcmp(branch->GetName(), "AliPHOSPID")==0) && (strcmp(branch->GetTitle(), fRecParticlesTitle)==0) ) {
773       pidbranch = branch ; 
774       pidfound  = kTRUE ; 
775     }
776   }
777
778   if ( !phosrpafound || !pidfound ) {
779     cerr << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find RecParticles and/or PID with name " << fRecParticlesTitle << endl ;
780     return ; 
781   } 
782
783   // Post the RecParticles
784   Post(fHeaderFile, "P", fRecParticlesTitle) ; 
785
786   // Post the PID
787   //  Need the version first
788   AliPHOSPID * pid = 0 ; 
789   pidbranch->SetAddress(&pid) ;
790   pidbranch->GetEntry(0) ;
791   TString pidName(fRecParticlesTitle) ; 
792   pidName.Append(pid->Version()) ; 
793   delete pid ;
794
795   Post(fHeaderFile, "Per", pidName) ; 
796
797   TClonesArray * recParticles = RecParticles(fRecParticlesTitle) ; 
798   recParticles->Clear() ; 
799   rpabranch->SetAddress(&recParticles) ;
800
801   pid = PID(pidName) ; 
802   pidbranch->SetAddress(&pid) ;
803   
804   pidbranch        ->GetEntry(0) ;
805   rpabranch        ->GetEntry(0) ;
806   
807 }
808
809 //____________________________________________________________________________ 
810 void AliPHOSGetter::ReadTreeS()
811 {
812   // Read the summable digits tree gAlice->TreeS()  
813
814   if(gAlice->TreeS()== 0){
815     cerr <<   "ERROR: AliPHOSGetter::ReadTreeS -> Cannot find TreeS " << endl ;
816     return ;
817   }
818   
819   TObjArray * lob = (TObjArray*)gAlice->TreeS()->GetListOfBranches() ;
820   TIter next(lob) ; 
821   TBranch * branch = 0 ; 
822   TBranch * sdigitsbranch = 0 ; 
823   TBranch * sdigitizerbranch = 0 ; 
824   Bool_t phosfound = kFALSE, sdigitizerfound = kFALSE ; 
825   
826   while ( (branch = (TBranch*)next()) && (!phosfound || !sdigitizerfound) ) {
827     if ( (strcmp(branch->GetName(), "PHOS")==0) && (strcmp(branch->GetTitle(), fSDigitsTitle)==0) ) {
828       sdigitsbranch = branch ; 
829       phosfound = kTRUE ;
830     }
831     else if ( (strcmp(branch->GetName(), "AliPHOSSDigitizer")==0) && (strcmp(branch->GetTitle(), fSDigitsTitle)==0) ) {
832       sdigitizerbranch = branch ; 
833       sdigitizerfound = kTRUE ; 
834     }
835   }
836
837   if ( !phosfound || !sdigitizerfound ) {
838     cerr << "WARNING: AliPHOSGetter::ReadTreeS -> Cannot find SDigits and/or SDigitizer with name " << fSDigitsTitle << endl ;
839     return ; 
840   }   
841
842   // -- the SDigits 
843   Post(fHeaderFile, "S", fSDigitsTitle) ; 
844
845   // Post the SDigitizer
846   Post(fHeaderFile, "Ser", fSDigitsTitle) ; 
847   
848   TClonesArray * sdigits = SDigits(fSDigitsTitle) ; 
849   sdigits->Clear() ; 
850   sdigitsbranch->SetAddress(&sdigits) ;
851
852   AliPHOSSDigitizer * sdigitizer = SDigitizer(fSDigitsTitle) ;
853   sdigitizerbranch->SetAddress(&sdigitizer) ;
854
855   sdigitsbranch->GetEvent(0) ;
856   sdigitizerbranch->GetEvent(0) ;
857     
858 }
859
860 //____________________________________________________________________________ 
861 void AliPHOSGetter::ReadPrimaries()
862 {
863   // Reads specific branches of primaries
864   
865   fNPrimaries = gAlice->GetNtrack();
866   
867   //   //Check, is it necessary to open new files
868   //   TArrayI* events = fDigitizer->GetCurrentEvents() ; 
869   //   TClonesArray * filenames = fDigitizer->GetHeadersFiles() ;
870 //   Int_t input ;
871 //   for(input = 0; input < filenames->GetEntriesFast(); input++){
872
873 //     TObjString * filename = (TObjString *) filenames->At(input) ;
874
875 //     //Test, if this file already open
876 //     TFile *file = (TFile*) gROOT->GetFile( filename->GetString() ) ;
877 //     if(file == 0)
878 //       file = new TFile( filename->GetString()) ;
879 //     file->cd() ;
880     
881 //     // Get Kine Tree from file
882 // //     char treeName[20];
883 // //     sprintf(treeName,"TreeK%d",events->At(input));
884 // //     TTree * treeK = (TTree*)gDirectory->Get(treeName);
885 // //     if (treeK) 
886 // //       treeK->SetBranchAddress("Particles", &fParticleBuffer);
887 // //     else    
888 // //       cout << "AliPHOSGetter: cannot find Kine Tree for event:" << events->At(input) << endl;
889
890 // //     // Create the particle stack
891 // //     if(!fParticles) fParticles = new TClonesArray("TParticle",1000);
892 // //     // Build the pointer list
893 // //     if(fParticleMap) {     <----
894 // //       fParticleMap->Clear();
895 // //       fParticleMap->Expand(treeK->GetEntries());
896 // //     } else
897 // //       fParticleMap = new TObjArray(treeK->GetEntries());
898     
899 //     // From gAlice->Particle(i) 
900
901
902 // //   if(!(*fParticleMap)[i]) {
903 // //     Int_t nentries = fParticles->GetEntries();
904     
905 // //     // algorithmic way of getting entry index
906 // //     // (primary particles are filled after secondaries)
907 // //     Int_t entry;
908 // //     if (i<fHeader.GetNprimary())
909 // //       entry = i+fHeader.GetNsecondary();
910 // //     else 
911 // //       entry = i-fHeader.GetNprimary();
912       
913 // //     // only check the algorithmic way and give
914 // //     // the fatal error if it is wrong
915 // //     if (entry != fParticleFileMap[i]) {
916 // //       Fatal("Particle",
917 // //         "!!!! The algorithmic way is WRONG: !!!\n entry: %d map: %d",
918 // //   entry, fParticleFileMap[i]); 
919 // //     }  
920       
921 // //     fTreeK->GetEntry(fParticleFileMap[i]);
922 // //     new ((*fParticles)[nentries]) TParticle(*fParticleBuffer);
923 // //     fParticleMap->AddAt((*fParticles)[nentries],i);
924 // //   }
925 // //   return (TParticle *) (*fParticleMap)[i];
926
927    
928     
929 //   }
930
931
932 //   //scan over opened files and read corresponding TreeK##
933
934   return ;
935 }
936 //____________________________________________________________________________ 
937 void AliPHOSGetter::Event(Int_t event)
938 {
939   // Reads the content of all Tree's S, D and R
940   
941   if ( event > gAlice->TreeE()->GetEntries() ) {
942     cerr << "ERROR: AliPHOSGetter::Event -> There are only " << gAlice->TreeE()->GetEntries() << " events in this file" << endl ; 
943     return ;
944   }
945   
946   gAlice->GetEvent(event) ;
947   
948   ReadTreeH() ;
949   ReadTreeS() ;
950   ReadTreeD() ;
951   ReadTreeR() ;
952   ReadTreeQA() ;
953   ReadPrimaries() ;
954
955 }
956
957 //____________________________________________________________________________ 
958 const TObject * AliPHOSGetter::ReturnO(TString what, TString name, TString file) const 
959 {
960   // get the object named "what" from the folder
961   // folders are named like //YSAlice/WhiteBoard/what/PHOS/name
962
963   if ( file.IsNull() ) 
964     file = fHeaderFile ; 
965   TString path("WhiteBoard/") ;
966   if ( name.IsNull() ) {
967     if ( what.CompareTo("Hits") == 0 ) {
968       path += what ; 
969       path += "/PHOS/"; 
970       path += what ; 
971     }
972     else if ( what.CompareTo("SDigits") == 0 ) { 
973       path += what ; 
974       path += "/PHOS/"; 
975       path += file ; 
976       path += "/" ; 
977       path += fSDigitsTitle ; 
978     }
979     else if ( what.CompareTo("Digits") == 0 ){
980       path += what ; 
981       path += "/PHOS/"; 
982       path += fDigitsTitle ;
983     } 
984     else if ( what.CompareTo("EmcRecPoints") == 0 ) {
985       path += "RecPoints/PHOS/";  
986       path += "emc/" ; 
987       path += fRecPointsTitle ; 
988     }
989     else if ( what.CompareTo("CpvRecPoints") == 0 ) {
990       path += "RecPoints/PHOS/";  
991       path += "cpv/" ; 
992       path += fRecPointsTitle ; 
993     }
994     else if ( what.CompareTo("TrackSegments") == 0 ) {
995       path += "TrackSegments/PHOS/";  
996       path += fTrackSegmentsTitle ; 
997     }  
998     else if ( what.CompareTo("RecParticles") == 0 ) {
999       path += "RecParticles/PHOS/";  
1000       path += fRecParticlesTitle ; 
1001     }  
1002      else if ( what.CompareTo("Alarms") == 0 ) {
1003       path += "QAAlarms/PHOS";   
1004     }  
1005   } 
1006   else {
1007     if ( what.CompareTo("SDigits") == 0 ) { 
1008       path += what ; 
1009       path += "/PHOS/"; 
1010       path += file ; 
1011       path += "/" ; 
1012       path += name ;
1013     } 
1014     else if ( what.CompareTo("Digits") == 0 ) {
1015       path += what ; 
1016       path += "/PHOS/"; 
1017       path += name ; 
1018     }
1019     else if ( what.CompareTo("EmcRecPoints") == 0 ) {
1020       path += "RecPoints/PHOS/";  
1021       path += "emc/" ; 
1022       path += name ; 
1023     }
1024     else if ( what.CompareTo("CpvRecPoints") == 0 ) {
1025       path += "RecPoints/PHOS/";  
1026       path += "cpv/" ; 
1027       path += name ; 
1028     }  
1029     else if ( what.CompareTo("TrackSegments") == 0 ) {
1030       path += "TrackSegments/PHOS/";  
1031       path += name ; 
1032     } 
1033     else if ( what.CompareTo("RecParticles") == 0 ) {
1034       path += "RecParticles/PHOS/";  
1035       path += name ; 
1036     } 
1037     else if ( what.CompareTo("Alarms") == 0 ) {
1038       path += "QAAlarms/PHOS/";  
1039       path += name ; 
1040     } 
1041   }
1042   path.Prepend("YSAlice/") ;
1043   TObject * phosO  = (TObject*)gROOT->FindObjectAny(path) ; 
1044   if (!phosO) {
1045     cerr << "ERROR : AliPHOSGetter::ReturnO -> Object " << path << " not found!" << endl ; 
1046     abort() ;
1047   }
1048   return phosO ;
1049 }
1050   
1051 //____________________________________________________________________________ 
1052 const TTask * AliPHOSGetter::ReturnT(TString what, TString name) const 
1053 {
1054   // get the TTask named "what" from the folder
1055   // folders are named like //YSAlice/Tasks/what/PHOS/name
1056
1057   TString path("tasks") ;
1058  
1059   if ( what.CompareTo("SDigitizer") == 0 ) 
1060     path += "/SDigitizer" ;
1061   else if ( what.CompareTo("Digitizer") == 0 ) 
1062     path += "/Digitizer" ; 
1063   else if ( what.CompareTo("Clusterizer") == 0 ) 
1064     path += "/Reconstructioner" ; 
1065   else if ( what.CompareTo("TrackSegmentMaker") == 0 ) 
1066     path += "/Reconstructioner" ; 
1067   else if ( what.CompareTo("PID") == 0 ) 
1068     path += "/Reconstructioner" ; 
1069   else if ( what.CompareTo("QATasks") == 0 ) 
1070     path += "/QA" ; 
1071
1072   TFolder * aliceF  = (TFolder*)gROOT->FindObjectAny("YSAlice") ; 
1073   TTask * aliceT  = (TTask*)aliceF->FindObject(path) ; 
1074
1075   if (!aliceT) {
1076     cerr << "ERROR: AliPHOSGetter::ReturnT -> Task " << path << " not found!" << endl ;  
1077     abort() ;
1078   }
1079
1080   TTask * phosT = (TTask*)aliceT->GetListOfTasks()->FindObject("PHOS") ; 
1081   if (!phosT) { 
1082     cerr << "ERROR: AliPHOSGetter::ReturnT -> Task " << path << "/PHOS not found!" << endl ;  
1083     abort() ;
1084   }
1085   TList * l = phosT->GetListOfTasks() ; 
1086  
1087   if (what.CompareTo("SDigitizer") == 0) {  
1088     if ( name.IsNull() )
1089       name =  fSDigitsTitle ; 
1090   } else  if (what.CompareTo("Digitizer") == 0){ 
1091     if ( name.IsNull() )
1092       name =  fDigitsTitle ;
1093   } else  if (what.CompareTo("Clusterizer") == 0){ 
1094     if ( name.IsNull() )
1095       name =  fRecPointsTitle ;
1096   }
1097   else  if (what.CompareTo("TrackSegmentMaker") == 0){ 
1098     if ( name.IsNull() )
1099       name =  fTrackSegmentsTitle ;
1100   }
1101   else  if (what.CompareTo("PID") == 0){ 
1102     if ( name.IsNull() )
1103       name =  fRecParticlesTitle ;
1104   }
1105     else  if (what.CompareTo("QATasks") == 0){ 
1106     if ( name.IsNull() )
1107       return phosT ;
1108   }
1109
1110   TTask * task = (TTask*)l->FindObject(name) ; 
1111
1112   if (!task)
1113     cout << "WARNING: AliPHOSGetter::ReturnT -> Task " << path << "/" << name << " not found!" << endl ; 
1114   
1115   return task ;
1116 }