From 3247125a1fce8004da4c105096fac15dd3e610eb Mon Sep 17 00:00:00 2001 From: schutz Date: Wed, 21 Feb 2001 10:23:58 +0000 Subject: [PATCH] all datamembers like fDigits etc are created now on simulation stage --- PHOS/AliPHOS.cxx | 53 +++++++++------------------------------------- PHOS/AliPHOSv1.cxx | 26 ++++++----------------- 2 files changed, 16 insertions(+), 63 deletions(-) diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index 66eeb8d081e..feedfa65b4e 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -60,12 +60,12 @@ AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name,title) { // 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); } //____________________________________________________________________________ @@ -360,38 +360,27 @@ void AliPHOS::SetTreeAddress() 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"); @@ -405,11 +394,6 @@ void AliPHOS::SetTreeAddress() 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 ) { @@ -421,11 +405,6 @@ void AliPHOS::SetTreeAddress() 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"); @@ -435,13 +414,7 @@ void AliPHOS::SetTreeAddress() //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"); @@ -452,13 +425,7 @@ void AliPHOS::SetTreeAddress() 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) ; diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index eb7a06e581a..5e0df8e2454 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -358,7 +358,6 @@ void AliPHOSv1::SDigits2Digits(){ 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) ; @@ -371,8 +370,6 @@ void AliPHOSv1::MakeBranch(Option_t* opt, char *file) sprintf(branchname,"%s",GetName()); if(fSDigits) fSDigits->Clear(); - else - fSDigits = new TClonesArray("AliPHOSDigit",1000); fnSdigits = 0 ; gAlice->MakeBranchInTree(gAlice->TreeS(),branchname,&fSDigits,fBufferSize,file); @@ -386,9 +383,6 @@ void AliPHOSv1::MakeBranch(Option_t* opt, char *file) if(fDigits) fDigits->Clear(); - else - fDigits = new TClonesArray("AliPHOSDigit",1000); - fNdigits = 0 ; gAlice->MakeBranchInTree(gAlice->TreeD(),branchname,&fDigits,fBufferSize,file); } @@ -402,42 +396,34 @@ void AliPHOSv1::MakeBranch(Option_t* opt, char *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); } } -- 2.43.0