]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changed arrays
authormhorner <mhorner@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jul 2003 19:33:08 +0000 (19:33 +0000)
committermhorner <mhorner@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jul 2003 19:33:08 +0000 (19:33 +0000)
EMCAL/AliEMCALJetFinderOutput.cxx
EMCAL/AliEMCALJetFinderOutput.h

index 04bb5891cac56e2a278c38323f438aaa2860dd3a..44587418c752b186e1bd9656dba8ff4523e0256a 100755 (executable)
@@ -13,6 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+
 /* $Id$ */
 
 //_________________________________________________________________________
@@ -23,9 +24,7 @@
 //
 
 
-
 #include <stdio.h>
-#include <TClonesArray.h>
 #include <TParticle.h>
 #include <TTree.h>
 
 ClassImp(AliEMCALJetFinderOutput)
 
 //________________________________________________________________________
-AliEMCALJetFinderOutput::AliEMCALJetFinderOutput()
-{
+AliEMCALJetFinderOutput::AliEMCALJetFinderOutput(){ 
+       fNMaxJets=10;
+       fNMaxParticles=2000;
+       fNMaxPartons=4;
+       fInitialised=kFALSE;
+       fNPartons=0;
+       fNJets=0;    
+       fNParticles=0;
+                                                               
+
 if (fDebug>0) Info("AliEMCALJetFinderOutput","Beginning Constructor");
 
-        fNMaxJets=10;
-        fNMaxParticles=2000;
-        fNMaxPartons=4;
-       fInitialised = kFALSE;
-       InitArrays();
-} 
+} //________________________________________________________________________
 void AliEMCALJetFinderOutput::InitArrays()
 {
        
 if (fDebug>1) Info("AliEMCALJetFinderOutput","Beginning InitArrays");
 
-       fJetsArray      = new TClonesArray("AliEMCALJet",fNMaxJets);
-       fNJets = 0;
-       fPartonsArray   = new TClonesArray("AliEMCALParton",fNMaxPartons);
-       fNPartons = 0;
-       fParticlesArray = new TClonesArray("TParticle",fNMaxParticles); 
-       fNParticles =0;
-       fInitialised = kTRUE;
-
 }
 
 //_______________________________________________________________________
 AliEMCALJetFinderOutput::~AliEMCALJetFinderOutput()
 {
 if (fDebug>0) Info("~AliEMCALJetFinderOutput","Beginning Destructor");
-if (fInitialised)
-{
- fJetsArray->Delete();
- fPartonsArray->Delete();
- fParticlesArray->Delete();
-
- delete fJetsArray;
- delete fPartonsArray;
- delete fParticlesArray;
-}
 }
 
 //_______________________________________________________________________
@@ -87,19 +71,16 @@ if (!fInitialised) InitArrays();
  if (  resettype == kResetAll ||
        resettype == kResetJets||
        resettype == kResetData ){
-        fJetsArray->Delete();
         fNJets = 0;
  }
  if (   resettype == kResetAll ||
         resettype == kResetPartons||              
         resettype == kResetData ){
-        fPartonsArray->Delete();
         fNPartons = 0;
  }
  if (   resettype == kResetAll ||    
         resettype == kResetParticles||              
         resettype == kResetData ){
-        fParticlesArray->Delete();
         fNParticles = 0;
  }
 }
@@ -109,13 +90,15 @@ void AliEMCALJetFinderOutput::AddJet(AliEMCALJet* jet)
 if (fDebug>1) Info("AddJet","Beginning AddJet");
 if (!fInitialised) InitArrays();
 
-       if (fNJets < fNMaxJets){
-               new( (*fJetsArray)[fNJets] )  AliEMCALJet( *jet );
+
+       if (fNJets < fNMaxJets){
+               new( &fJetsArray[fNJets])   AliEMCALJet( *jet );
                fNJets++;
        }else
        {
                Error("AddJet","Cannot AddJet - maximum exceeded");
-       }
+                }
+   
 }
 
 
@@ -126,13 +109,13 @@ if (fDebug>1) Info("AddParton","Beginning AddParton");
 if (!fInitialised) InitArrays();
 
        if (fNPartons < fNMaxPartons){
-               new( (*fPartonsArray)[fNPartons] )  AliEMCALParton( *parton );
+               new( &fPartonsArray[fNPartons] )  AliEMCALParton( *parton );
                fNPartons++;
        }else
        {
                 Error("AddParton","Cannot AddParton - maximum exceeded");
        }
-
 }
 
 //_______________________________________________________________________
@@ -142,13 +125,12 @@ if (fDebug>1) Info("AddParticle","Beginning AddParticle");
 if (!fInitialised) InitArrays();
 
        if (fNParticles < fNMaxParticles){
-               new( (*fParticlesArray)[fNParticles] )  TParticle( *particle );
+               new( &fParticlesArray[fNParticles] )  TParticle( *particle );
                fNParticles++;
        }else
        {
                Error("AddParticle","Cannot AddParticle - maximum exceeded");
-       }
-
+                }
 }
 
 //______________________________________________________________________
@@ -157,9 +139,8 @@ AliEMCALJet* AliEMCALJetFinderOutput::GetJet(Int_t jetID)
 if (fDebug>1) Info("GetJet","Beginning GetJet");
        
   if (jetID >= fNJets) return 0;
-  return (AliEMCALJet*)((*fJetsArray)[jetID]);
+  return &(fJetsArray[jetID]);
   
-
 }
 
 //______________________________________________________________________
@@ -168,9 +149,7 @@ AliEMCALParton* AliEMCALJetFinderOutput::GetParton(Int_t partonID)
 if (fDebug>1) Info("GetParton","Beginning GetParton");
 
   if (partonID >= fNPartons) return 0;
-  return (AliEMCALParton*)((*fPartonsArray)[partonID]);
-
-
+  return &(fPartonsArray[partonID]);
 }
 
 //______________________________________________________________________
@@ -179,8 +158,7 @@ TParticle* AliEMCALJetFinderOutput::GetParticle(Int_t particleID)
 if (fDebug>1) Info("GetParticle","Beginning GetParticle");
 
   if (particleID >= fNParticles) return 0;
-  return (TParticle*)((*fParticlesArray)[particleID]);
-
+return &(fParticlesArray[particleID]);
 
 }
 
index 0b6a0903b1be999aa3eb538cccb54121f17cca8b..d4e774a8d766b550baf8769c6c2bfa37f7d33673 100755 (executable)
@@ -16,7 +16,6 @@
 
 #include "TObject.h"
 #include "TParticle.h"
-#include "TClonesArray.h"
 #include "AliEMCALParton.h"
 #include "AliEMCALJet.h"
 #include "AliEMCALJetFinderTypes.h"
@@ -41,18 +40,18 @@ class AliEMCALJetFinderOutput : public TObject
 
        private:
                void InitArrays();
-               TClonesArray*   fJetsArray;     //-> 
-               Int_t           fNJets;         // Number of jets actually stored
-               TClonesArray*   fPartonsArray;  //-> 
-               Int_t           fNPartons;      // Number of Partons actually stored
-               TClonesArray*  fParticlesArray; //-> 
-               Int_t           fNParticles;    // Number of particles actually stored
-                Int_t           fNMaxJets;      // Maximum number of jets 
-                Int_t           fNMaxParticles; // Maximum number of primary particles
-                Int_t           fNMaxPartons;   // Maximum number of primary particles
-                Int_t           fDebug;                // Debug level
-               Bool_t          fInitialised;   // stores whether or not the arrays have been initialised
+               AliEMCALJet     fJetsArray[10];         // 
+               AliEMCALParton  fPartonsArray[4];       // 
+               Int_t           fNPartons;              // Number of Partons actually stored
+               Int_t           fNJets;                 // Number of jets actually stored
+               TParticle   fParticlesArray[2000];      //
+               Int_t           fNParticles;            // Number of particles actually stored
+                Int_t           fNMaxJets;             // Maximum number of jets 
+                Int_t           fNMaxParticles;        // Maximum number of primary particles
+                Int_t           fNMaxPartons;          // Maximum number of primary particles
+                Int_t           fDebug;                        // Debug level
+               Bool_t          fInitialised;           // stores whether or not the arrays have been initialised
                
-       ClassDef(AliEMCALJetFinderOutput,1)
+       ClassDef(AliEMCALJetFinderOutput,2)
 };
 #endif