{
// ctor
- fSDigits = 0 ;
- fDigits = 0 ;
- fEmcRecPoints = 0 ;
- fPpsdRecPoints = 0 ;
- fTrackSegments = 0 ;
- fRecParticles = 0 ;
+ fSDigits = new TClonesArray("AliPHOSDigit",1000) ;
+ fDigits = new TClonesArray("AliPHOSDigit",1000) ;
+ fEmcRecPoints = new TObjArray(100) ;
+ fPpsdRecPoints = new TObjArray(100) ;
+ fTrackSegments = new TClonesArray("AliPHOSTrackSegment",100);
+ fRecParticles = new TClonesArray("AliPHOSRecParticle",100);
}
//____________________________________________________________________________
TBranch *branch;
char branchname[20];
sprintf(branchname,"%s",GetName());
- //
+
// Branch address for hit tree
TTree *treeH = gAlice->TreeH();
if (treeH && fHits) {
branch = treeH->GetBranch(branchname);
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(fEmcRecPoints)
fEmcRecPoints->Delete();
- else{
- cout << "AliPHOS:SetTree() fEmcRecPoints " << fEmcRecPoints << endl ;
- cout << "AliPHOS:SetTree() creating new fEmcRecPoints "<< endl ;
- fEmcRecPoints = new TObjArray(100);
- }
if ( treeR && fEmcRecPoints ) {
if(fPpsdRecPoints)
fPpsdRecPoints->Delete();
- else{
- cout << "AliPHOS:SetTree() fPpsdRecPoints " << fPpsdRecPoints << endl ;
- cout << "AliPHOS:SetTree() creating new fPpsdRecPoints "<< endl ;
- fPpsdRecPoints = new TObjArray(100);
- }
if ( treeR && fPpsdRecPoints ) {
branch = treeR->GetBranch("PHOSPpsdRP");
//Branch address for TreeR: TrackSegments
if(fTrackSegments)
- fTrackSegments->Clear() ;
- else{
- cout << "AliPHOS:SetTree() fTrackSegments " << fTrackSegments << endl ;
- cout << "AliPHOS:SetTree() creating new fTrackSegments "<< endl ;
- fTrackSegments = new TClonesArray("AliPHOSTrackSegment",100);
- }
-
+ fTrackSegments->Clear() ;
if ( treeR && fTrackSegments ) {
branch = treeR->GetBranch("PHOSTS");
if(fRecParticles)
fRecParticles->Clear() ;
- else{
- cout << "AliPHOS:SetTree() fRecParticles " << fRecParticles << endl ;
- cout << "AliPHOS:SetTree() creating new fRecParticles "<< endl ;
- fRecParticles = new TClonesArray("AliPHOSRecParticle",100);
- }
-
-
+
if ( treeR && fRecParticles ) {
branch = treeR->GetBranch("PHOSRP");
if (branch) branch->SetAddress(&fRecParticles) ;
void AliPHOSv1::MakeBranch(Option_t* opt, char *file)
{
-
char *cH ;
// Create new branche in the current Root Tree in the digit Tree
AliDetector::MakeBranch(opt) ;
sprintf(branchname,"%s",GetName());
if(fSDigits)
fSDigits->Clear();
- else
- fSDigits = new TClonesArray("AliPHOSDigit",1000);
fnSdigits = 0 ;
gAlice->MakeBranchInTree(gAlice->TreeS(),branchname,&fSDigits,fBufferSize,file);
if(fDigits)
fDigits->Clear();
- else
- fDigits = new TClonesArray("AliPHOSDigit",1000);
- fNdigits = 0 ;
gAlice->MakeBranchInTree(gAlice->TreeD(),branchname,&fDigits,fBufferSize,file);
}
if(fEmcRecPoints)
fEmcRecPoints->Delete() ;
- else
- fEmcRecPoints = new TObjArray(100) ;
if ( fEmcRecPoints && gAlice->TreeR() ) {
sprintf(branchname,"%sEmcRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, "TObjArray", &fEmcRecPoints, fBufferSize, splitlevel) ;
+ gAlice->MakeBranchInTree(gAlice->TreeR(),branchname,"TObjArray",&fEmcRecPoints, fBufferSize, splitlevel,file);
}
if(fPpsdRecPoints)
fPpsdRecPoints->Delete() ;
- else
- fPpsdRecPoints = new TObjArray(100) ;
if ( fPpsdRecPoints && gAlice->TreeR() ) {
sprintf(branchname,"%sPpsdRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, "TObjArray", &fPpsdRecPoints, fBufferSize, splitlevel) ;
+ gAlice->MakeBranchInTree(gAlice->TreeR(),branchname,"TObjArray",&fPpsdRecPoints, fBufferSize, splitlevel,file);
}
if(fTrackSegments)
- fTrackSegments->Delete() ;
- else
- fTrackSegments = new TClonesArray("AliPHOSTrackSegment",100) ;
+ fTrackSegments->Clear() ;
if ( fTrackSegments && gAlice->TreeR() ) {
sprintf(branchname,"%sTS",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fTrackSegments, fBufferSize) ;
+ gAlice->MakeBranchInTree(gAlice->TreeR(),branchname,&fTrackSegments,fBufferSize,file);
}
if(fRecParticles)
- fRecParticles->Delete() ;
- else
- fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
+ fRecParticles->Clear() ;
if ( fRecParticles && gAlice->TreeR() ) {
sprintf(branchname,"%sRP",GetName()) ;
- gAlice->TreeR()->Branch(branchname, &fRecParticles, fBufferSize) ;
+ gAlice->MakeBranchInTree(gAlice->TreeR(),branchname,&fRecParticles,fBufferSize,file);
}
}