- // Read the reconstrunction tree gAlice->TreeR()
-
- if(gAlice->TreeR()== 0){
- cerr << "WARNING: AliPHOSGetter::ReadTreeR: can not read TreeR " << endl ;
- return 1;
- }
-
- // RecPoints
- TObjArray * lob = static_cast<TObjArray*>(gAlice->TreeR()->GetListOfBranches()) ;
- TIter next(lob) ;
- TBranch * branch = 0 ;
- TBranch * emcbranch = 0 ;
- TBranch * cpvbranch = 0 ;
- TBranch * clusterizerbranch = 0 ;
- Bool_t phosemcrpfound = kFALSE, phoscpvrpfound = kFALSE, clusterizerfound = kFALSE ;
-
- while ( (branch = static_cast<TBranch*>(next())) && (!phosemcrpfound || !phoscpvrpfound || !clusterizerfound) )
- if(strcmp(branch->GetTitle(), fRecPointsTitle)==0) {
- if ( strcmp(branch->GetName(), "PHOSEmcRP")==0) {
- emcbranch = branch ;
- phosemcrpfound = kTRUE ;
- }
- else if ( strcmp(branch->GetName(), "PHOSCpvRP")==0) {
- cpvbranch = branch ;
- phoscpvrpfound = kTRUE ;
- }
- else if(strcmp(branch->GetName(), "AliPHOSClusterizer")==0){
- clusterizerbranch = branch ;
- clusterizerfound = kTRUE ;
- }
- }
-
- if ( !phosemcrpfound ) {
- if (fDebug)
- cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find EmcRecPoints with title "
- << fRecPointsTitle << endl ;
- return 2 ;
- }
- if ( !phoscpvrpfound ) {
- if (fDebug)
- cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find CpvRecPoints with title "
- << fRecPointsTitle << endl ;
- return 3;
- }
- if ( !clusterizerfound ) {
- if (fDebug)
- cout << "WARNING: AliPHOSGetter::ReadTreeR -> Can not find Clusterizer with title "
- << fRecPointsTitle << endl ;
- return 4;
- }
-
- // Read and Post the RecPoints
- if(!EmcRecPoints(fRecPointsTitle) )
- PostRecPoints(fRecPointsTitle) ;
-
- emcbranch->SetAddress(EmcRecPointsRef(fRecPointsTitle)) ;
- emcbranch->GetEntry(0) ;
-
- cpvbranch->SetAddress(CpvRecPointsRef(fRecPointsTitle)) ;
- cpvbranch->GetEntry(0) ;
-
- if(!Clusterizer(fRecPointsTitle) )
- PostClusterizer(fRecPointsTitle) ;
-
- clusterizerbranch->SetAddress(ClusterizerRef(fRecPointsTitle)) ;
- clusterizerbranch->GetEntry(0) ;
-
-
- //------------------- TrackSegments ---------------------
- next.Reset() ;
- TBranch * tsbranch = 0 ;
- TBranch * tsmakerbranch = 0 ;
- Bool_t phostsfound = kFALSE, tsmakerfound = kFALSE ;
-
- while ( (branch = static_cast<TBranch*>(next())) && (!phostsfound || !tsmakerfound) )
- if(strcmp(branch->GetTitle(), fTrackSegmentsTitle)==0) {
- if ( strcmp(branch->GetName(), "PHOSTS")==0){
- tsbranch = branch ;
- phostsfound = kTRUE ;
- }
- else if(strcmp(branch->GetName(), "AliPHOSTrackSegmentMaker")==0) {
- tsmakerbranch = branch ;
- tsmakerfound = kTRUE ;
- }
- }
-
- if ( !phostsfound || !tsmakerfound ) {
- if (fDebug)
- cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find TrackSegments and/or TrackSegmentMaker with name "
- << fTrackSegmentsTitle << endl ;
- return 5;
- }
-
- // Read and Post the TrackSegments
- if(!TrackSegments(fTrackSegmentsTitle))
- PostTrackSegments(fTrackSegmentsTitle) ;
-
- tsbranch->SetAddress(TrackSegmentsRef(fTrackSegmentsTitle)) ;
- tsbranch->GetEntry(0) ;
-
- // Read and Post the TrackSegment Maker
- if(!TrackSegmentMaker(fTrackSegmentsTitle))
- PostTrackSegmentMaker(fTrackSegmentsTitle) ;
-
- tsmakerbranch->SetAddress(TSMakerRef(fTrackSegmentsTitle)) ;
- tsmakerbranch->GetEntry(0) ;
-
-
- //------------ RecParticles ----------------------------
- next.Reset() ;
- TBranch * rpabranch = 0 ;
- TBranch * pidbranch = 0 ;
- Bool_t phosrpafound = kFALSE, pidfound = kFALSE ;
-
- while ( (branch = static_cast<TBranch*>(next())) && (!phosrpafound || !pidfound) )
- if(strcmp(branch->GetTitle(), fRecParticlesTitle)==0) {
- if ( strcmp(branch->GetName(), "PHOSRP")==0) {
- rpabranch = branch ;
- phosrpafound = kTRUE ;
- }
- else if (strcmp(branch->GetName(), "AliPHOSPID")==0) {
- pidbranch = branch ;
- pidfound = kTRUE ;
- }
- }
-
- if ( !phosrpafound || !pidfound ) {
- if (fDebug)
- cout << "WARNING: AliPHOSGetter::ReadTreeR -> Cannot find RecParticles and/or PID with name "
- << fRecParticlesTitle << endl ;
- return 6;