]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fEmcRecPoints etc are created now in SetTreeAdress - to be removed when STEER will...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2001 14:09:41 +0000 (14:09 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Feb 2001 14:09:41 +0000 (14:09 +0000)
PHOS/AliPHOS.cxx
PHOS/AliPHOSv1.cxx

index 2bd10d1f7c3d5999d2982d227c52f422f5f31792..66eeb8d081efcb08005b8b8e2f7b6138c9729062 100644 (file)
@@ -47,6 +47,7 @@ AliPHOS::AliPHOS():AliDetector()
 {
   // ctor 
   //We do not create objects, because these pointers will be overwritten durin reading from file.
+  fSDigits       = 0 ;
   fDigits        = 0 ;
   fEmcRecPoints  = 0 ; 
   fPpsdRecPoints = 0 ;
@@ -59,6 +60,7 @@ AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name,title)
 {
   // ctor
 
+  fSDigits       = 0 ; 
   fDigits        = 0 ; 
   fEmcRecPoints  = 0 ; 
   fPpsdRecPoints = 0 ;
@@ -84,6 +86,7 @@ AliPHOS::~AliPHOS()
   delete fRecParticles ;
   delete fHits ;
   delete fDigits ;
+  delete fSDigits ;
 }
 
 //____________________________________________________________________________
@@ -369,9 +372,12 @@ void AliPHOS::SetTreeAddress()
   TTree *treeD = gAlice->TreeD();
 
   if(fDigits)
-    fDigits->Clear();
-  else
-    fDigits = new TClonesArray("AliPHOSDigit",1000);
+      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);
@@ -381,8 +387,11 @@ void AliPHOS::SetTreeAddress()
 
   if(fSDigits)
     fSDigits->Clear();
-  else
-    fSDigits = new TClonesArray("AliPHOSDigit",1000);
+  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");
@@ -393,7 +402,16 @@ void AliPHOS::SetTreeAddress()
   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) ;
@@ -401,12 +419,29 @@ void AliPHOS::SetTreeAddress()
 
   //Branch address for TreeR: PPSDRecPoint
 
+  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");
     if (branch) branch->SetAddress(&fPpsdRecPoints) ;
   }
 
   //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);
+   }
   
   if ( treeR && fTrackSegments ) {
     branch = treeR->GetBranch("PHOSTS");
@@ -415,6 +450,15 @@ void AliPHOS::SetTreeAddress()
   
   //Branch address for TreeR: RecParticles
 
+  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) ;
index f4e066f5acd98ceb61622f4961dfcc934683e740..eb7a06e581a030dc05b0665b5c53f6391ea237ea 100644 (file)
@@ -58,7 +58,8 @@
 ClassImp(AliPHOSv1)
 
 //____________________________________________________________________________
-AliPHOSv1::AliPHOSv1()
+AliPHOSv1::AliPHOSv1():
+AliPHOSv0()
 {
   // ctor