- if (branch) branch->SetAddress(&fHits);
- }
- //
- // Branch address for digit tree
- TTree *treeD = gAlice->TreeD();
-
- if(fDigits)
- fDigits->Clear();
- else{
- cout << "AliPHOS:SetTree() fDigits " << fDigits << endl ;
- cout << "AliPHOS:SetTree() creating new fDigits "<< endl ;
- fDigits = new TClonesArray("AliPHOSDigit",1000);
- }
-
- if (treeD && fDigits) {
- branch = treeD->GetBranch(branchname);
- if (branch) branch->SetAddress(&fDigits);
- }
-
-
- if(fSDigits)
- fSDigits->Clear();
- else{
- cout << "AliPHOS:SetTree() fSDigits " << fSDigits << endl ;
- cout << "AliPHOS:SetTree() creating new fSDigits "<< endl ;
- fSDigits = new TClonesArray("AliPHOSDigit",1000);
- }
-
- if (gAlice->TreeS() && fSDigits ) {
- branch = gAlice->TreeS()->GetBranch("PHOS");
- if (branch) branch->SetAddress(&fSDigits) ;
- }
-
-
- TTree *treeR = gAlice->TreeR();
-
- //Branch address for TreeR: EmcRecPoint
-
- if(fEmcRecPoints)
- fEmcRecPoints->Delete();
- else{
- cout << "AliPHOS:SetTree() fEmcRecPoints " << fEmcRecPoints << endl ;
- cout << "AliPHOS:SetTree() creating new fEmcRecPoints "<< endl ;
- fEmcRecPoints = new TObjArray(100);
- }
-
-
- if ( treeR && fEmcRecPoints ) {
- branch = treeR->GetBranch("PHOSEmcRP");
- if (branch) branch->SetAddress(&fEmcRecPoints) ;
+ if (branch)
+ {
+ if (fHits == 0x0) fHits= new TClonesArray("AliPHOSHit",1000);
+ //Info("SetTreeAddress","<%s> Setting Hits Address",GetName());
+ branch->SetAddress(&fHits);
+ }